diff options
author | 2025-03-08 22:04:20 +0800 | |
---|---|---|
committer | 2025-03-08 22:04:20 +0800 | |
commit | a07bb8fd1299070229f0e8f3dcb57ffd5ef9870a (patch) | |
tree | 84f21bd0bf7071bc5fc7dd989e77d7ceb5476682 /arch/mips/sgi-ip30/ip30-power.c | |
download | ohosKernel-a07bb8fd1299070229f0e8f3dcb57ffd5ef9870a.tar.gz ohosKernel-a07bb8fd1299070229f0e8f3dcb57ffd5ef9870a.zip |
Initial commit: OpenHarmony-v4.0-ReleaseOpenHarmony-v4.0-Release
Diffstat (limited to 'arch/mips/sgi-ip30/ip30-power.c')
-rw-r--r-- | arch/mips/sgi-ip30/ip30-power.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/mips/sgi-ip30/ip30-power.c b/arch/mips/sgi-ip30/ip30-power.c new file mode 100644 index 000000000..120b3f3d5 --- /dev/null +++ b/arch/mips/sgi-ip30/ip30-power.c | |||
@@ -0,0 +1,41 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | /* | ||
3 | * ip30-power.c: Software powerdown and reset handling for IP30 architecture. | ||
4 | * | ||
5 | * Copyright (C) 2004-2007 Stanislaw Skowronek <skylark@unaligned.org> | ||
6 | * 2014 Joshua Kinard <kumba@gentoo.org> | ||
7 | * 2009 Johannes Dickgreber <tanzy@gmx.de> | ||
8 | */ | ||
9 | |||
10 | #include <linux/init.h> | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/sched.h> | ||
14 | #include <linux/notifier.h> | ||
15 | #include <linux/delay.h> | ||
16 | #include <linux/rtc/ds1685.h> | ||
17 | #include <linux/interrupt.h> | ||
18 | #include <linux/pm.h> | ||
19 | |||
20 | #include <asm/reboot.h> | ||
21 | #include <asm/sgi/heart.h> | ||
22 | |||
23 | static void __noreturn ip30_machine_restart(char *cmd) | ||
24 | { | ||
25 | /* | ||
26 | * Execute HEART cold reset | ||
27 | * Yes, it's cold-HEARTed! | ||
28 | */ | ||
29 | heart_write((heart_read(&heart_regs->mode) | HM_COLD_RST), | ||
30 | &heart_regs->mode); | ||
31 | unreachable(); | ||
32 | } | ||
33 | |||
34 | static int __init ip30_reboot_setup(void) | ||
35 | { | ||
36 | _machine_restart = ip30_machine_restart; | ||
37 | |||
38 | return 0; | ||
39 | } | ||
40 | |||
41 | subsys_initcall(ip30_reboot_setup); | ||