2 * Copyright (C) 2000, 2001 Broadcom Corporation
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #include <linux/init.h>
20 #include <linux/kernel.h>
22 #include <linux/blkdev.h>
23 #include <linux/bootmem.h>
24 #include <linux/smp.h>
25 #include <linux/initrd.h>
28 #include <asm/bootinfo.h>
29 #include <asm/reboot.h>
31 #define MAX_RAM_SIZE ((CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - 1)
33 static __init void prom_meminit(void)
35 #ifdef CONFIG_BLK_DEV_INITRD
36 unsigned long initrd_pstart;
37 unsigned long initrd_pend;
39 initrd_pstart = __pa(initrd_start);
40 initrd_pend = __pa(initrd_end);
42 ((initrd_pstart > MAX_RAM_SIZE)
43 || (initrd_pend > MAX_RAM_SIZE))) {
44 panic("initrd out of addressable memory");
47 add_memory_region(0, initrd_pstart,
49 add_memory_region(initrd_pstart, initrd_pend - initrd_pstart,
51 add_memory_region(initrd_pend,
52 (CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024) - initrd_pend,
55 add_memory_region(0, CONFIG_SIBYTE_STANDALONE_RAM_SIZE * 1024 * 1024,
60 void prom_cpu0_exit(void *unused)
65 static void prom_linux_exit(void)
68 if (smp_processor_id()) {
69 smp_call_function(prom_cpu0_exit,NULL,1,1);
76 * prom_init is called just after the cpu type is determined, from setup_arch()
78 void __init prom_init(void)
80 _machine_restart = (void (*)(char *))prom_linux_exit;
81 _machine_halt = prom_linux_exit;
82 pm_power_off = prom_linux_exit;
84 strcpy(arcs_cmdline, "root=/dev/ram0 ");
86 mips_machgroup = MACH_GROUP_SIBYTE;
90 void __init prom_free_prom_memory(void)
92 /* Not sure what I'm supposed to do here. Nothing, I think */
95 void prom_putchar(char c)