[U-Boot] [PATCH 08/11] MIPS: bootm: automatically initialise kernel cmdline variable 'mem'

Daniel Schwierzeck daniel.schwierzeck at gmail.com
Sun Jun 9 00:42:47 CEST 2013


This replaces the passing of memory size via the traditional Linux
environment. This is required for recent Linux kernels.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
---
 arch/mips/lib/bootm.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 741e088..796d405 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -102,9 +102,15 @@ static void linux_cmdline_dump(void)
 static void boot_cmdline_linux(bootm_headers_t *images)
 {
 	const char *bootargs, *next, *quote;
+	char buf[12];
+	unsigned int mem = gd->ram_size >> 20;
 
 	linux_cmdline_init();
 
+	/* append mem */
+	sprintf(buf, "mem=%uM", mem);
+	linux_cmdline_set(buf, strlen(buf));
+
 	bootargs = getenv("bootargs");
 	if (!bootargs)
 		return;
-- 
1.8.1.2



More information about the U-Boot mailing list