xref: /kernel/linux/linux-5.10/arch/mips/fw/arc/init.c (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public
38c2ecf20Sopenharmony_ci * License.  See the file "COPYING" in the main directory of this archive
48c2ecf20Sopenharmony_ci * for more details.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * PROM library initialisation code.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#include <linux/init.h>
118c2ecf20Sopenharmony_ci#include <linux/kernel.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <asm/bootinfo.h>
148c2ecf20Sopenharmony_ci#include <asm/sgialib.h>
158c2ecf20Sopenharmony_ci#include <asm/smp-ops.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#undef DEBUG_PROM_INIT
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* Master romvec interface. */
208c2ecf20Sopenharmony_cistruct linux_romvec *romvec;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#if defined(CONFIG_64BIT) && defined(CONFIG_FW_ARC32)
238c2ecf20Sopenharmony_ci/* stack for calling 32bit ARC prom */
248c2ecf20Sopenharmony_ciu64 o32_stk[4096];
258c2ecf20Sopenharmony_ci#endif
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_civoid __init prom_init(void)
288c2ecf20Sopenharmony_ci{
298c2ecf20Sopenharmony_ci	PSYSTEM_PARAMETER_BLOCK pb = PROMBLOCK;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	romvec = ROMVECTOR;
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci	if (pb->magic != 0x53435241) {
348c2ecf20Sopenharmony_ci		printk(KERN_CRIT "Aieee, bad prom vector magic %08lx\n",
358c2ecf20Sopenharmony_ci		       (unsigned long) pb->magic);
368c2ecf20Sopenharmony_ci		while(1)
378c2ecf20Sopenharmony_ci			;
388c2ecf20Sopenharmony_ci	}
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci	prom_init_cmdline(fw_arg0, (LONG *)fw_arg1);
418c2ecf20Sopenharmony_ci	prom_identify_arch();
428c2ecf20Sopenharmony_ci	printk(KERN_INFO "PROMLIB: ARC firmware Version %d Revision %d\n",
438c2ecf20Sopenharmony_ci	       pb->ver, pb->rev);
448c2ecf20Sopenharmony_ci	prom_meminit();
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#ifdef DEBUG_PROM_INIT
478c2ecf20Sopenharmony_ci	pr_info("Press a key to reboot\n");
488c2ecf20Sopenharmony_ci	ArcRead(0, &c, 1, &cnt);
498c2ecf20Sopenharmony_ci	ArcEnterInteractiveMode();
508c2ecf20Sopenharmony_ci#endif
518c2ecf20Sopenharmony_ci}
52