Skip to contentSkip to conversation

lmb: only force on arches that use it

PATCH New Mike Frysinger 2 participants 5 messages Nov 3, 2009 – Jan 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lmb: only force on arches that use it

---
 common/cmd_bootm.c         |   34 ++++++++++++++++------------------
 include/asm-m68k/config.h  |    2 ++
 include/asm-ppc/config.h   |    2 ++
 include/asm-sparc/config.h |    2 ++
 include/image.h            |    2 +-
 include/lmb.h              |    4 ++++
 lib_generic/Makefile       |    2 +-
 lib_generic/lmb.c          |   12 ++++++++++++
 8 files changed, 40 insertions(+), 20 deletions(-)
common/cmd_bootm.c +16 -18
index 8f83598..22aa7f8 100644
@@ -154,18 +154,6 @@ 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)
 {
@@ -201,15 +189,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);
 
@@ -220,6 +204,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,
include/asm-m68k/config.h +2 -0
index 049c44e..36438be 100644
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
include/asm-ppc/config.h +2 -0
index af0853b..a735e8d 100644
@@ -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)
include/asm-sparc/config.h +2 -0
index 049c44e..36438be 100644
@@ -21,4 +21,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
include/image.h +1 -1
index 5a424e6..b82f4b9 100644
@@ -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;
include/lmb.h +4 -0
index 14e8727..43082a3 100644
@@ -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 */
lib_generic/Makefile +1 -1
index 686601c..8d23c5d 100644
@@ -37,7 +37,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 += sha1.o
lib_generic/lmb.c +12 -0
index 1c6cf7c..c5e75fb 100644
@@ -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")));
Signature · 1 line
1.6.5.2
#2 lore raw

PATCH 1/1 lmb: only force on arches that use it

Dear Mike Frysinger,

Quoted 3 lines · In message <[email protected]> you wrote:

sorry Scott, didnt mean to direct this to you. meant to send the nand one only to you.

So what is supposed to happen with this patch? Do we consider this a fix for the upcoming release? Or is it for "next"? Or none of that?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It would seem that evil retreats when forcibly confronted
	-- Yarnek of Excalbia, "The Savage Curtain", stardate 5906.5
#3 lore raw

PATCH 1/1 lmb: only force on arches that use it

Quoted 6 lines · On Wednesday 02 December 2009 16:49:37 Wolfgang Denk wrote:
Quoted 2 lines · Mike Frysinger

sorry Scott, didnt mean to direct this to you. meant to send the nand one only to you.

So what is supposed to happen with this patch? Do we consider this a fix for the upcoming release? Or is it for "next"? Or none of that?

it's been broken (i.e. adding useless bloat to most people) for so long that one more release (i.e. adding to "next") is fine
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091202/9b4a29f9/attachment.pgp

#4 lore raw

PATCH 1/1 lmb: only force on arches that use it

In reply to Mike Frysinger

Dear Mike Frysinger,

Quoted 11 lines · In message <[email protected]> you wrote:
---
 common/cmd_bootm.c         |   34 ++++++++++++++++------------------
 include/asm-m68k/config.h  |    2 ++
 include/asm-ppc/config.h   |    2 ++
 include/asm-sparc/config.h |    2 ++
 include/image.h            |    2 +-
 include/lmb.h              |    4 ++++
 lib_generic/Makefile       |    2 +-
 lib_generic/lmb.c          |   12 ++++++++++++
 8 files changed, 40 insertions(+), 20 deletions(-)

Applied.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone can count the seeds in an apple.
No one can count the apples in a seed.