[U-Boot] [PATCH 09/11] MIPS: bootm: automatically initialise kernel cmdline variables 'rd_start' and 'rd_size'

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


This replaces the passing of the location and size of an external init ramdisk
via the traditional Linux environment. This is required to supporta again
external init ramdisks with recent Linux kernels.

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

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 796d405..68b57d7 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -104,6 +104,7 @@ static void boot_cmdline_linux(bootm_headers_t *images)
 	const char *bootargs, *next, *quote;
 	char buf[12];
 	unsigned int mem = gd->ram_size >> 20;
+	ulong rd_start, rd_size;
 
 	linux_cmdline_init();
 
@@ -111,6 +112,17 @@ static void boot_cmdline_linux(bootm_headers_t *images)
 	sprintf(buf, "mem=%uM", mem);
 	linux_cmdline_set(buf, strlen(buf));
 
+	/* append rd_start and rd_size */
+	rd_start = images->initrd_start;
+	rd_size = images->initrd_end - images->initrd_start;
+
+	if (rd_size) {
+		sprintf(buf, "rd_start=0x%08lX", rd_start);
+		linux_cmdline_set(buf, strlen(buf));
+		sprintf(buf, "rd_size=0x%lX", rd_size);
+		linux_cmdline_set(buf, strlen(buf));
+	}
+
 	bootargs = getenv("bootargs");
 	if (!bootargs)
 		return;
-- 
1.8.1.2



More information about the U-Boot mailing list