^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * License. See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * PROM library initialisation code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/bootinfo.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/sgialib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <asm/smp-ops.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #undef DEBUG_PROM_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* Master romvec interface. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct linux_romvec *romvec;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /* stack for calling 32bit ARC prom */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u64 o32_stk[4096];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) void __init prom_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) romvec = ROMVECTOR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) if (pb->magic != 0x53435241) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) (unsigned long) pb->magic);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) while(1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) prom_init_cmdline(fw_arg0, (LONG *)fw_arg1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) prom_identify_arch();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) pb->ver, pb->rev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) prom_meminit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #ifdef DEBUG_PROM_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) pr_info("Press a key to reboot\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ArcRead(0, &c, 1, &cnt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) ArcEnterInteractiveMode();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) }