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 | * Miscellaneous ARCS PROM routines. |
| 7 | * |
Justin P. Mattock | 79add62 | 2011-04-04 14:15:29 -0700 | [diff] [blame] | 8 | * Copyright (C) 1996 David S. Miller (davem@davemloft.net) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) |
| 10 | * Copyright (C) 1999 Silicon Graphics, Inc. |
| 11 | */ |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 12 | #include <linux/compiler.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include <linux/init.h> |
| 14 | #include <linux/kernel.h> |
David Rientjes | 18f69427 | 2012-11-16 14:14:52 -0800 | [diff] [blame] | 15 | #include <linux/irqflags.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
| 17 | #include <asm/bcache.h> |
| 18 | |
Aurelien Jarno | 2f56cfd | 2007-09-05 08:59:34 +0200 | [diff] [blame] | 19 | #include <asm/fw/arc/types.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <asm/sgialib.h> |
| 21 | #include <asm/bootinfo.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 23 | VOID __noreturn |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | ArcHalt(VOID) |
| 25 | { |
| 26 | bc_disable(); |
| 27 | local_irq_disable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | ARC_CALL0(halt); |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 29 | |
| 30 | unreachable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 33 | VOID __noreturn |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | ArcPowerDown(VOID) |
| 35 | { |
| 36 | bc_disable(); |
| 37 | local_irq_disable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | ARC_CALL0(pdown); |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 39 | |
| 40 | unreachable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | /* XXX is this a soft reset basically? XXX */ |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 44 | VOID __noreturn |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | ArcRestart(VOID) |
| 46 | { |
| 47 | bc_disable(); |
| 48 | local_irq_disable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | ARC_CALL0(restart); |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 50 | |
| 51 | unreachable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | } |
| 53 | |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 54 | VOID __noreturn |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | ArcReboot(VOID) |
| 56 | { |
| 57 | bc_disable(); |
| 58 | local_irq_disable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | ARC_CALL0(reboot); |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 60 | |
| 61 | unreachable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | } |
| 63 | |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 64 | VOID __noreturn |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | ArcEnterInteractiveMode(VOID) |
| 66 | { |
| 67 | bc_disable(); |
| 68 | local_irq_disable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | ARC_CALL0(imode); |
Ralf Baechle | 7f84c0a | 2015-01-02 17:16:24 +0100 | [diff] [blame] | 70 | |
| 71 | unreachable(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | LONG |
| 75 | ArcSaveConfiguration(VOID) |
| 76 | { |
| 77 | return ARC_CALL0(cfg_save); |
| 78 | } |
| 79 | |
| 80 | struct linux_sysid * |
| 81 | ArcGetSystemId(VOID) |
| 82 | { |
| 83 | return (struct linux_sysid *) ARC_CALL0(get_sysid); |
| 84 | } |
| 85 | |
| 86 | VOID __init |
| 87 | ArcFlushAllCaches(VOID) |
| 88 | { |
| 89 | ARC_CALL0(cache_flush); |
| 90 | } |
| 91 | |
| 92 | DISPLAY_STATUS * __init ArcGetDisplayStatus(ULONG FileID) |
| 93 | { |
| 94 | return (DISPLAY_STATUS *) ARC_CALL1(GetDisplayStatus, FileID); |
| 95 | } |