Commit a16028da63c78001823bfb375b3f6d9d86e5a534

Authored by Mike Frysinger
Committed by Wolfgang Denk
1 parent dac4d7e884

lmb: only force on arches that use it

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Showing 8 changed files with 40 additions and 20 deletions Side-by-side Diff

... ... @@ -153,18 +153,6 @@
153 153 ulong load_addr = CONFIG_SYS_LOAD_ADDR; /* Default Load Address */
154 154 static bootm_headers_t images; /* pointers to os/initrd/fdt images */
155 155  
156   -void __board_lmb_reserve(struct lmb *lmb)
157   -{
158   - /* please define platform specific board_lmb_reserve() */
159   -}
160   -void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
161   -
162   -void __arch_lmb_reserve(struct lmb *lmb)
163   -{
164   - /* please define platform specific arch_lmb_reserve() */
165   -}
166   -void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));
167   -
168 156 /* Allow for arch specific config before we boot */
169 157 void __arch_preboot_os(void)
170 158 {
171 159  
172 160  
173 161  
... ... @@ -200,16 +188,12 @@
200 188 # error Unknown CPU type
201 189 #endif
202 190  
203   -static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  191 +static void bootm_start_lmb(void)
204 192 {
  193 +#ifdef CONFIG_LMB
205 194 ulong mem_start;
206 195 phys_size_t mem_size;
207   - void *os_hdr;
208   - int ret;
209 196  
210   - memset ((void *)&images, 0, sizeof (images));
211   - images.verify = getenv_yesno ("verify");
212   -
213 197 lmb_init(&images.lmb);
214 198  
215 199 mem_start = getenv_bootm_low();
... ... @@ -219,6 +203,20 @@
219 203  
220 204 arch_lmb_reserve(&images.lmb);
221 205 board_lmb_reserve(&images.lmb);
  206 +#else
  207 +# define lmb_reserve(lmb, base, size)
  208 +#endif
  209 +}
  210 +
  211 +static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  212 +{
  213 + void *os_hdr;
  214 + int ret;
  215 +
  216 + memset ((void *)&images, 0, sizeof (images));
  217 + images.verify = getenv_yesno ("verify");
  218 +
  219 + bootm_start_lmb();
222 220  
223 221 /* get kernel image header, start address and length */
224 222 os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
include/asm-m68k/config.h
... ... @@ -21,5 +21,7 @@
21 21 #ifndef _ASM_CONFIG_H_
22 22 #define _ASM_CONFIG_H_
23 23  
  24 +#define CONFIG_LMB
  25 +
24 26 #endif
include/asm-ppc/config.h
... ... @@ -21,6 +21,8 @@
21 21 #ifndef _ASM_CONFIG_H_
22 22 #define _ASM_CONFIG_H_
23 23  
  24 +#define CONFIG_LMB
  25 +
24 26 #ifndef CONFIG_MAX_MEM_MAPPED
25 27 #if defined(CONFIG_4xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
26 28 #define CONFIG_MAX_MEM_MAPPED ((phys_size_t)2 << 30)
include/asm-sparc/config.h
... ... @@ -21,5 +21,7 @@
21 21 #ifndef _ASM_CONFIG_H_
22 22 #define _ASM_CONFIG_H_
23 23  
  24 +#define CONFIG_LMB
  25 +
24 26 #endif
... ... @@ -256,7 +256,7 @@
256 256 #define BOOTM_STATE_OS_GO (0x00000080)
257 257 int state;
258 258  
259   -#ifndef USE_HOSTCC
  259 +#ifdef CONFIG_LMB
260 260 struct lmb lmb; /* for memory mgmt */
261 261 #endif
262 262 } bootm_headers_t;
... ... @@ -52,6 +52,10 @@
52 52 {
53 53 return type->region[region_nr].size;
54 54 }
  55 +
  56 +void board_lmb_reserve(struct lmb *lmb);
  57 +void arch_lmb_reserve(struct lmb *lmb);
  58 +
55 59 #endif /* __KERNEL__ */
56 60  
57 61 #endif /* _LINUX_LMB_H */
lib_generic/Makefile
... ... @@ -38,7 +38,7 @@
38 38 COBJS-y += display_options.o
39 39 COBJS-y += div64.o
40 40 COBJS-y += gunzip.o
41   -COBJS-y += lmb.o
  41 +COBJS-$(CONFIG_LMB) += lmb.o
42 42 COBJS-y += ldiv.o
43 43 COBJS-$(CONFIG_MD5) += md5.o
44 44 COBJS-y += net_utils.o
... ... @@ -334,4 +334,16 @@
334 334 }
335 335 return 0;
336 336 }
  337 +
  338 +void __board_lmb_reserve(struct lmb *lmb)
  339 +{
  340 + /* please define platform specific board_lmb_reserve() */
  341 +}
  342 +void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
  343 +
  344 +void __arch_lmb_reserve(struct lmb *lmb)
  345 +{
  346 + /* please define platform specific arch_lmb_reserve() */
  347 +}
  348 +void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));