| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
 | 2 |  * This file is subject to the terms and conditions of the GNU General Public | 
 | 3 |  * License.  See the file "COPYING" in the main directory of this archive | 
 | 4 |  * for more details. | 
 | 5 |  * | 
 | 6 |  * PROM library initialisation code. | 
 | 7 |  * | 
 | 8 |  * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) | 
 | 9 |  */ | 
 | 10 | #include <linux/init.h> | 
 | 11 | #include <linux/kernel.h> | 
 | 12 |  | 
 | 13 | #include <asm/bootinfo.h> | 
 | 14 | #include <asm/sgialib.h> | 
 | 15 |  | 
 | 16 | #undef DEBUG_PROM_INIT | 
 | 17 |  | 
 | 18 | /* Master romvec interface. */ | 
 | 19 | struct linux_romvec *romvec; | 
 | 20 | int prom_argc; | 
 | 21 | LONG *_prom_argv, *_prom_envp; | 
 | 22 |  | 
 | 23 | void __init prom_init(void) | 
 | 24 | { | 
 | 25 | 	PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK; | 
| Ralf Baechle | b2e569d | 2007-03-08 00:47:11 +0000 | [diff] [blame] | 26 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | 	romvec = ROMVECTOR; | 
| Ralf Baechle | 36a8853 | 2007-03-01 11:56:43 +0000 | [diff] [blame] | 28 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | 	prom_argc = fw_arg0; | 
 | 30 | 	_prom_argv = (LONG *) fw_arg1; | 
 | 31 | 	_prom_envp = (LONG *) fw_arg2; | 
 | 32 |  | 
 | 33 | 	if (pb->magic != 0x53435241) { | 
| Ralf Baechle | b2e569d | 2007-03-08 00:47:11 +0000 | [diff] [blame] | 34 | 		printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n", | 
 | 35 | 		       (unsigned long) pb->magic); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | 		while(1) | 
 | 37 | 			; | 
 | 38 | 	} | 
 | 39 |  | 
 | 40 | 	prom_init_cmdline(); | 
 | 41 | 	prom_identify_arch(); | 
 | 42 | 	printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n", | 
 | 43 | 	       pb->ver, pb->rev); | 
 | 44 | 	prom_meminit(); | 
 | 45 |  | 
 | 46 | #ifdef DEBUG_PROM_INIT | 
| Ralf Baechle | 36a8853 | 2007-03-01 11:56:43 +0000 | [diff] [blame] | 47 | 	pr_info("Press a key to reboot\n"); | 
 | 48 | 	ArcRead(0, &c, 1, &cnt); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | 	ArcEnterInteractiveMode(); | 
 | 50 | #endif | 
 | 51 | } |