blob: 3ed43f416cd15e0513fdb6931db9c096fd732477 [file] [log] [blame]
Ralf Baechle07119622005-09-03 15:56:11 -07001#include <linux/init.h>
Ralf Baechlefe3d7282005-11-28 13:15:08 +00002#include <linux/string.h>
3#include <asm/addrspace.h>
Ralf Baechle07119622005-09-03 15:56:11 -07004#include <asm/bootinfo.h>
Ralf Baechlea57c2282007-11-04 04:49:44 +00005#include <asm/io.h>
6
7#define QEMU_PORT_BASE 0xb4000000
Ralf Baechle07119622005-09-03 15:56:11 -07008
9void __init prom_init(void)
10{
Ralf Baechlefe3d7282005-11-28 13:15:08 +000011 int *cmdline;
12
13 cmdline = (int *) (CKSEG0 + (0x10 << 20) - 260);
14 if (*cmdline == 0x12345678) {
15 if (*(char *)(cmdline + 1))
Ralf Baechle49a89ef2007-10-11 23:46:15 +010016 strcpy(arcs_cmdline, (char *)(cmdline + 1));
Ralf Baechlefe3d7282005-11-28 13:15:08 +000017 add_memory_region(0x0<<20, cmdline[-1], BOOT_MEM_RAM);
18 } else {
19 add_memory_region(0x0<<20, 0x10<<20, BOOT_MEM_RAM);
20 }
Ralf Baechlea57c2282007-11-04 04:49:44 +000021
22
23 set_io_port_base(QEMU_PORT_BASE);
Ralf Baechle07119622005-09-03 15:56:11 -070024}