summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-14 21:44:13 +0100
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>2015-01-21 14:02:48 +0100
commit8cec725ad502c955c2e8088ae1afb4e06ef80cef (patch)
tree9851009ae3728c686ae2f01cd7f6706bb187e179
parentca65e5851fb60ae58b46e2ad76a90b39d9c378c3 (diff)
downloadu-boot-imx-8cec725ad502c955c2e8088ae1afb4e06ef80cef.zip
u-boot-imx-8cec725ad502c955c2e8088ae1afb4e06ef80cef.tar.gz
u-boot-imx-8cec725ad502c955c2e8088ae1afb4e06ef80cef.tar.bz2
MIPS: bootm: add mem, rd_start and rd_size to kernel command line
If the user wants to boot a kernel without legacy environment, information like memory size, initrd address and size should be handed over to the kernel in the command line. Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
-rw-r--r--arch/mips/lib/bootm.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index fa579b3..7a98f15 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -144,10 +144,36 @@ static void linux_cmdline_legacy(bootm_headers_t *images)
}
}
+static void linux_cmdline_append(bootm_headers_t *images)
+{
+ char buf[24];
+ ulong mem, rd_start, rd_size;
+
+ /* append mem */
+ mem = gd->ram_size >> 20;
+ sprintf(buf, "mem=%luM", 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));
+ }
+}
+
static void boot_cmdline_linux(bootm_headers_t *images)
{
if (mips_boot_cmdline_legacy) {
linux_cmdline_legacy(images);
+
+ if (!mips_boot_env_legacy)
+ linux_cmdline_append(images);
+
linux_cmdline_dump();
}
}