aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-11-03 11:35:59 -0500
committerWolfgang Denk <wd@denx.de>2010-01-21 22:26:00 +0100
commita16028da63c78001823bfb375b3f6d9d86e5a534 (patch)
treeaea901c9aabc6df0cf0db97e55ec39a55d76b653
parentdac4d7e8849d275023ea2fcae6caf941db91c042 (diff)
lmb: only force on arches that use it
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--common/cmd_bootm.c34
-rw-r--r--include/asm-m68k/config.h2
-rw-r--r--include/asm-ppc/config.h2
-rw-r--r--include/asm-sparc/config.h2
-rw-r--r--include/image.h2
-rw-r--r--include/lmb.h4
-rw-r--r--lib_generic/Makefile2
-rw-r--r--lib_generic/lmb.c12
8 files changed, 40 insertions, 20 deletions
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 05feb3946..f28e88f34 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -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,
diff --git a/include/asm-m68k/config.h b/include/asm-m68k/config.h
index 049c44eaf..36438be11 100644
--- a/include/asm-m68k/config.h
+++ b/include/asm-m68k/config.h
@@ -21,4 +21,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_LMB
+
#endif
diff --git a/include/asm-ppc/config.h b/include/asm-ppc/config.h
index 796707eaf..0d78aa400 100644
--- a/include/asm-ppc/config.h
+++ b/include/asm-ppc/config.h
@@ -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)
diff --git a/include/asm-sparc/config.h b/include/asm-sparc/config.h
index 049c44eaf..36438be11 100644
--- a/include/asm-sparc/config.h
+++ b/include/asm-sparc/config.h
@@ -21,4 +21,6 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_LMB
+
#endif
diff --git a/include/image.h b/include/image.h
index dcf3a7bb1..4ed037910 100644
--- a/include/image.h
+++ b/include/image.h
@@ -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;
diff --git a/include/lmb.h b/include/lmb.h
index 14e8727f0..43082a393 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -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 */
diff --git a/lib_generic/Makefile b/lib_generic/Makefile
index 4b8ed3ad5..4e4496a55 100644
--- a/lib_generic/Makefile
+++ b/lib_generic/Makefile
@@ -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
diff --git a/lib_generic/lmb.c b/lib_generic/lmb.c
index 1c6cf7ce0..c5e75fb3b 100644
--- a/lib_generic/lmb.c
+++ b/lib_generic/lmb.c
@@ -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")));