blob: 3df01f1da347cd663437ce4b0aad5612853f68b4 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Reset a DECstation machine.
4 *
5 * Copyright (C) 199x the Anonymous
6 * Copyright (C) 2001, 2002, 2003 Maciej W. Rozycki
7 */
8#include <linux/interrupt.h>
9#include <linux/linkage.h>
10
11#include <asm/addrspace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Robert P. J. Dayb3f6df92007-05-25 14:32:28 -040013typedef void __noreturn (* noret_func_t)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Robert P. J. Dayb3f6df92007-05-25 14:32:28 -040015static inline void __noreturn back_to_prom(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070016{
Maciej W. Rozycki3bd4c902005-06-16 20:30:54 +000017 noret_func_t func = (void *)CKSEG1ADDR(0x1fc00000);
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
19 func();
20}
21
Robert P. J. Dayb3f6df92007-05-25 14:32:28 -040022void __noreturn dec_machine_restart(char *command)
Linus Torvalds1da177e2005-04-16 15:20:36 -070023{
24 back_to_prom();
25}
26
Robert P. J. Dayb3f6df92007-05-25 14:32:28 -040027void __noreturn dec_machine_halt(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070028{
29 back_to_prom();
30}
31
Robert P. J. Dayb3f6df92007-05-25 14:32:28 -040032void __noreturn dec_machine_power_off(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070033{
34 /* DECstations don't have a software power switch */
35 back_to_prom();
36}
37
Ralf Baechled62801e2006-10-08 17:38:18 +010038irqreturn_t dec_intr_halt(int irq, void *dev_id)
Linus Torvalds1da177e2005-04-16 15:20:36 -070039{
40 dec_machine_halt();
41}