12f56cfddSAurelien Jarno /* 22f56cfddSAurelien Jarno * This file is subject to the terms and conditions of the GNU General Public 32f56cfddSAurelien Jarno * License. See the file "COPYING" in the main directory of this archive 42f56cfddSAurelien Jarno * for more details. 52f56cfddSAurelien Jarno * 62f56cfddSAurelien Jarno * PROM library initialisation code. 72f56cfddSAurelien Jarno * 82f56cfddSAurelien Jarno * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) 92f56cfddSAurelien Jarno */ 102f56cfddSAurelien Jarno #include <linux/init.h> 112f56cfddSAurelien Jarno #include <linux/kernel.h> 122f56cfddSAurelien Jarno 132f56cfddSAurelien Jarno #include <asm/bootinfo.h> 142f56cfddSAurelien Jarno #include <asm/sgialib.h> 15*87353d8aSRalf Baechle #include <asm/smp-ops.h> 162f56cfddSAurelien Jarno 172f56cfddSAurelien Jarno #undef DEBUG_PROM_INIT 182f56cfddSAurelien Jarno 192f56cfddSAurelien Jarno /* Master romvec interface. */ 202f56cfddSAurelien Jarno struct linux_romvec *romvec; 212f56cfddSAurelien Jarno int prom_argc; 222f56cfddSAurelien Jarno LONG *_prom_argv, *_prom_envp; 232f56cfddSAurelien Jarno 242f56cfddSAurelien Jarno void __init prom_init(void) 252f56cfddSAurelien Jarno { 262f56cfddSAurelien Jarno PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; 272f56cfddSAurelien Jarno 282f56cfddSAurelien Jarno romvec = ROMVECTOR; 292f56cfddSAurelien Jarno 302f56cfddSAurelien Jarno prom_argc = fw_arg0; 312f56cfddSAurelien Jarno _prom_argv = (LONG *) fw_arg1; 322f56cfddSAurelien Jarno _prom_envp = (LONG *) fw_arg2; 332f56cfddSAurelien Jarno 342f56cfddSAurelien Jarno if (pb->magic != 0x53435241) { 352f56cfddSAurelien Jarno printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", 362f56cfddSAurelien Jarno (unsigned long) pb->magic); 372f56cfddSAurelien Jarno while(1) 382f56cfddSAurelien Jarno ; 392f56cfddSAurelien Jarno } 402f56cfddSAurelien Jarno 412f56cfddSAurelien Jarno prom_init_cmdline(); 422f56cfddSAurelien Jarno prom_identify_arch(); 432f56cfddSAurelien Jarno printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n", 442f56cfddSAurelien Jarno pb->ver, pb->rev); 452f56cfddSAurelien Jarno prom_meminit(); 462f56cfddSAurelien Jarno 472f56cfddSAurelien Jarno #ifdef DEBUG_PROM_INIT 482f56cfddSAurelien Jarno pr_info("Press a key to reboot\n"); 492f56cfddSAurelien Jarno ArcRead(0, &c, 1, &cnt); 502f56cfddSAurelien Jarno ArcEnterInteractiveMode(); 512f56cfddSAurelien Jarno #endif 52*87353d8aSRalf Baechle #ifdef CONFIG_SGI_IP27 53*87353d8aSRalf Baechle { 54*87353d8aSRalf Baechle extern struct plat_smp_ops ip27_smp_ops; 55*87353d8aSRalf Baechle 56*87353d8aSRalf Baechle register_smp_ops(&ip27_smp_ops); 57*87353d8aSRalf Baechle } 58*87353d8aSRalf Baechle #endif 592f56cfddSAurelien Jarno } 60