summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-11-28 14:15:08 +0100
committerRalf Baechle <ralf@linux-mips.org>2005-12-01 12:05:15 +0100
commitfe3d72858c34a464976c6f8076971e2862d5c3b8 (patch)
tree5903ce0e8eaf69eb71ec29929bd03877e094ecf4
parent[MIPS] Qemu: Qemu is emulating a 1193.182kHz i8254 PIC. (diff)
downloadlinux-fe3d72858c34a464976c6f8076971e2862d5c3b8.tar.xz
linux-fe3d72858c34a464976c6f8076971e2862d5c3b8.zip
[MIPS] Qemu: Accept kernel command line passed by the Emulator.
From Daniel Jacobowitz <dan@debian.org>. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/qemu/q-firmware.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/mips/qemu/q-firmware.c b/arch/mips/qemu/q-firmware.c
index 5980f02b2df9..fb2a8673a6bf 100644
--- a/arch/mips/qemu/q-firmware.c
+++ b/arch/mips/qemu/q-firmware.c
@@ -1,7 +1,18 @@
#include <linux/init.h>
+#include <linux/string.h>
+#include <asm/addrspace.h>
#include <asm/bootinfo.h>
void __init prom_init(void)
{
- add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
+ int *cmdline;
+
+ cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260);
+ if (*cmdline == 0x12345678) {
+ if (*(char *)(cmdline + 1))
+ strcpy (arcs_cmdline, (char *)(cmdline + 1));
+ add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM);
+ } else {
+ add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
+ }
}