]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lmb: only force on arches that use it
authorMike Frysinger <vapier@gentoo.org>
Tue, 3 Nov 2009 16:35:59 +0000 (11:35 -0500)
committerWolfgang Denk <wd@denx.de>
Thu, 21 Jan 2010 21:26:00 +0000 (22:26 +0100)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
common/cmd_bootm.c
include/asm-m68k/config.h
include/asm-ppc/config.h
include/asm-sparc/config.h
include/image.h
include/lmb.h
lib_generic/Makefile
lib_generic/lmb.c

index 05feb39464952f54734211b71bed457882629ad2..f28e88f340f472dc0e96b314cec77572576f04a6 100644 (file)
@@ -153,18 +153,6 @@ static boot_os_fn *boot_os[] = {
 ulong load_addr = CONFIG_SYS_LOAD_ADDR;        /* Default Load Address */
 static bootm_headers_t images;         /* pointers to os/initrd/fdt images */
 
-void __board_lmb_reserve(struct lmb *lmb)
-{
-       /* please define platform specific board_lmb_reserve() */
-}
-void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
-
-void __arch_lmb_reserve(struct lmb *lmb)
-{
-       /* please define platform specific arch_lmb_reserve() */
-}
-void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));
-
 /* Allow for arch specific config before we boot */
 void __arch_preboot_os(void)
 {
@@ -200,15 +188,11 @@ void arch_preboot_os(void) __attribute__((weak, alias("__arch_preboot_os")));
 # error Unknown CPU type
 #endif
 
-static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static void bootm_start_lmb(void)
 {
+#ifdef CONFIG_LMB
        ulong           mem_start;
        phys_size_t     mem_size;
-       void            *os_hdr;
-       int             ret;
-
-       memset ((void *)&images, 0, sizeof (images));
-       images.verify = getenv_yesno ("verify");
 
        lmb_init(&images.lmb);
 
@@ -219,6 +203,20 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        arch_lmb_reserve(&images.lmb);
        board_lmb_reserve(&images.lmb);
+#else
+# define lmb_reserve(lmb, base, size)
+#endif
+}
+
+static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+       void            *os_hdr;
+       int             ret;
+
+       memset ((void *)&images, 0, sizeof (images));
+       images.verify = getenv_yesno ("verify");
+
+       bootm_start_lmb();
 
        /* get kernel image header, start address and length */
        os_hdr = boot_get_kernel (cmdtp, flag, argc, argv,
index 049c44eaf84de0ce67d86afcf0cd016d4bd6c407..36438be112f60a16743a293ae062fec270d67933 100644 (file)
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
index 796707eaf749592618c7d3d4fd344b97d2689274..0d78aa400e547ec683c8c1d704e746bb0917f44e 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #ifndef CONFIG_MAX_MEM_MAPPED
 #if defined(CONFIG_4xx) || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
 #define CONFIG_MAX_MEM_MAPPED  ((phys_size_t)2 << 30)
index 049c44eaf84de0ce67d86afcf0cd016d4bd6c407..36438be112f60a16743a293ae062fec270d67933 100644 (file)
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
index dcf3a7bb18a3ff37a9f3651e04b455d37235166a..4ed03791069b72dcb69a833485861074848c4dab 100644 (file)
@@ -256,7 +256,7 @@ typedef struct bootm_headers {
 #define        BOOTM_STATE_OS_GO       (0x00000080)
        int             state;
 
-#ifndef USE_HOSTCC
+#ifdef CONFIG_LMB
        struct lmb      lmb;            /* for memory mgmt */
 #endif
 } bootm_headers_t;
index 14e8727f0669c5fe98a8e275191fd098986eff34..43082a393fded52ec71f4bca686cffef0e1aedf8 100644 (file)
@@ -52,6 +52,10 @@ lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
 {
        return type->region[region_nr].size;
 }
+
+void board_lmb_reserve(struct lmb *lmb);
+void arch_lmb_reserve(struct lmb *lmb);
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_LMB_H */
index 4b8ed3ad502c95c0cf22d0de3f2077895d052ddf..4e4496a552fd06afa23e9bfd3e7309643efe4e38 100644 (file)
@@ -38,7 +38,7 @@ COBJS-y += ctype.o
 COBJS-y += display_options.o
 COBJS-y += div64.o
 COBJS-y += gunzip.o
-COBJS-y += lmb.o
+COBJS-$(CONFIG_LMB) += lmb.o
 COBJS-y += ldiv.o
 COBJS-$(CONFIG_MD5) += md5.o
 COBJS-y += net_utils.o
index 1c6cf7ce000257b1d91729f95f36b51ccdd5020e..c5e75fb3bbd3cebe83624720e1c8247be273fff8 100644 (file)
@@ -334,3 +334,15 @@ int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr)
        }
        return 0;
 }
+
+void __board_lmb_reserve(struct lmb *lmb)
+{
+       /* please define platform specific board_lmb_reserve() */
+}
+void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
+
+void __arch_lmb_reserve(struct lmb *lmb)
+{
+       /* please define platform specific arch_lmb_reserve() */
+}
+void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));