xref: /openbmc/linux/arch/mips/fw/arc/misc.c (revision 7f84c0a2)
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  * Miscellaneous ARCS PROM routines.
72f56cfddSAurelien Jarno  *
879add627SJustin P. Mattock  * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
92f56cfddSAurelien Jarno  * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org)
102f56cfddSAurelien Jarno  * Copyright (C) 1999 Silicon Graphics, Inc.
112f56cfddSAurelien Jarno  */
127f84c0a2SRalf Baechle #include <linux/compiler.h>
132f56cfddSAurelien Jarno #include <linux/init.h>
142f56cfddSAurelien Jarno #include <linux/kernel.h>
1518f69427SDavid Rientjes #include <linux/irqflags.h>
162f56cfddSAurelien Jarno 
172f56cfddSAurelien Jarno #include <asm/bcache.h>
182f56cfddSAurelien Jarno 
192f56cfddSAurelien Jarno #include <asm/fw/arc/types.h>
202f56cfddSAurelien Jarno #include <asm/sgialib.h>
212f56cfddSAurelien Jarno #include <asm/bootinfo.h>
222f56cfddSAurelien Jarno 
237f84c0a2SRalf Baechle VOID __noreturn
242f56cfddSAurelien Jarno ArcHalt(VOID)
252f56cfddSAurelien Jarno {
262f56cfddSAurelien Jarno 	bc_disable();
272f56cfddSAurelien Jarno 	local_irq_disable();
282f56cfddSAurelien Jarno 	ARC_CALL0(halt);
297f84c0a2SRalf Baechle 
307f84c0a2SRalf Baechle 	unreachable();
312f56cfddSAurelien Jarno }
322f56cfddSAurelien Jarno 
337f84c0a2SRalf Baechle VOID __noreturn
342f56cfddSAurelien Jarno ArcPowerDown(VOID)
352f56cfddSAurelien Jarno {
362f56cfddSAurelien Jarno 	bc_disable();
372f56cfddSAurelien Jarno 	local_irq_disable();
382f56cfddSAurelien Jarno 	ARC_CALL0(pdown);
397f84c0a2SRalf Baechle 
407f84c0a2SRalf Baechle 	unreachable();
412f56cfddSAurelien Jarno }
422f56cfddSAurelien Jarno 
432f56cfddSAurelien Jarno /* XXX is this a soft reset basically? XXX */
447f84c0a2SRalf Baechle VOID __noreturn
452f56cfddSAurelien Jarno ArcRestart(VOID)
462f56cfddSAurelien Jarno {
472f56cfddSAurelien Jarno 	bc_disable();
482f56cfddSAurelien Jarno 	local_irq_disable();
492f56cfddSAurelien Jarno 	ARC_CALL0(restart);
507f84c0a2SRalf Baechle 
517f84c0a2SRalf Baechle 	unreachable();
522f56cfddSAurelien Jarno }
532f56cfddSAurelien Jarno 
547f84c0a2SRalf Baechle VOID __noreturn
552f56cfddSAurelien Jarno ArcReboot(VOID)
562f56cfddSAurelien Jarno {
572f56cfddSAurelien Jarno 	bc_disable();
582f56cfddSAurelien Jarno 	local_irq_disable();
592f56cfddSAurelien Jarno 	ARC_CALL0(reboot);
607f84c0a2SRalf Baechle 
617f84c0a2SRalf Baechle 	unreachable();
622f56cfddSAurelien Jarno }
632f56cfddSAurelien Jarno 
647f84c0a2SRalf Baechle VOID __noreturn
652f56cfddSAurelien Jarno ArcEnterInteractiveMode(VOID)
662f56cfddSAurelien Jarno {
672f56cfddSAurelien Jarno 	bc_disable();
682f56cfddSAurelien Jarno 	local_irq_disable();
692f56cfddSAurelien Jarno 	ARC_CALL0(imode);
707f84c0a2SRalf Baechle 
717f84c0a2SRalf Baechle 	unreachable();
722f56cfddSAurelien Jarno }
732f56cfddSAurelien Jarno 
742f56cfddSAurelien Jarno LONG
752f56cfddSAurelien Jarno ArcSaveConfiguration(VOID)
762f56cfddSAurelien Jarno {
772f56cfddSAurelien Jarno 	return ARC_CALL0(cfg_save);
782f56cfddSAurelien Jarno }
792f56cfddSAurelien Jarno 
802f56cfddSAurelien Jarno struct linux_sysid *
812f56cfddSAurelien Jarno ArcGetSystemId(VOID)
822f56cfddSAurelien Jarno {
832f56cfddSAurelien Jarno 	return (struct linux_sysid *) ARC_CALL0(get_sysid);
842f56cfddSAurelien Jarno }
852f56cfddSAurelien Jarno 
862f56cfddSAurelien Jarno VOID __init
872f56cfddSAurelien Jarno ArcFlushAllCaches(VOID)
882f56cfddSAurelien Jarno {
892f56cfddSAurelien Jarno 	ARC_CALL0(cache_flush);
902f56cfddSAurelien Jarno }
912f56cfddSAurelien Jarno 
922f56cfddSAurelien Jarno DISPLAY_STATUS * __init ArcGetDisplayStatus(ULONG FileID)
932f56cfddSAurelien Jarno {
942f56cfddSAurelien Jarno 	return (DISPLAY_STATUS *) ARC_CALL1(GetDisplayStatus, FileID);
952f56cfddSAurelien Jarno }
96