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 * 879add627SJustin P. Mattock * Copyright (C) 1996 David S. Miller (davem@davemloft.net) 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> 1587353d8aSRalf 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 22ce6c0a59SThomas Bogendoerfer #if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32) 23ce6c0a59SThomas Bogendoerfer /* stack for calling 32bit ARC prom */ 24ce6c0a59SThomas Bogendoerfer u64 o32_stk[4096]; 25ce6c0a59SThomas Bogendoerfer #endif 26ce6c0a59SThomas Bogendoerfer prom_init(void)272f56cfddSAurelien Jarnovoid __init prom_init(void) 282f56cfddSAurelien Jarno { 292f56cfddSAurelien Jarno PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; 302f56cfddSAurelien Jarno 312f56cfddSAurelien Jarno romvec = ROMVECTOR; 322f56cfddSAurelien Jarno 332f56cfddSAurelien Jarno if (pb->magic != 0x53435241) { 342f56cfddSAurelien Jarno printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", 352f56cfddSAurelien Jarno (unsigned long) pb->magic); 362f56cfddSAurelien Jarno while(1) 372f56cfddSAurelien Jarno ; 382f56cfddSAurelien Jarno } 392f56cfddSAurelien Jarno 40*7b16831dSThomas Bogendoerfer prom_init_cmdline(fw_arg0, (LONG *)fw_arg1); 412f56cfddSAurelien Jarno prom_identify_arch(); 422f56cfddSAurelien Jarno printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n", 432f56cfddSAurelien Jarno pb->ver, pb->rev); 442f56cfddSAurelien Jarno prom_meminit(); 452f56cfddSAurelien Jarno 462f56cfddSAurelien Jarno #ifdef DEBUG_PROM_INIT 472f56cfddSAurelien Jarno pr_info("Press a key to reboot\n"); 482f56cfddSAurelien Jarno ArcRead(0, &c, 1, &cnt); 492f56cfddSAurelien Jarno ArcEnterInteractiveMode(); 502f56cfddSAurelien Jarno #endif 512f56cfddSAurelien Jarno } 52