-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 181132 b: refs/heads/master c: fbb82b0 h: refs/heads/master v: v3
- Loading branch information
Paul Mundt
committed
Jan 20, 2010
1 parent
f31e22d
commit 42ef0af
Showing
12 changed files
with
157 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 2efa53b269ec1e9289a108e1506f53f6f1de440b | ||
refs/heads/master: fbb82b03653cdb7fd1863b911e7540011259d2ce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef __ASM_SH_REBOOT_H | ||
#define __ASM_SH_REBOOT_H | ||
|
||
#include <linux/kdebug.h> | ||
|
||
struct pt_regs; | ||
|
||
struct machine_ops { | ||
void (*restart)(char *cmd); | ||
void (*halt)(void); | ||
void (*power_off)(void); | ||
void (*shutdown)(void); | ||
void (*crash_shutdown)(struct pt_regs *); | ||
}; | ||
|
||
extern struct machine_ops machine_ops; | ||
|
||
/* arch/sh/kernel/machine_kexec.c */ | ||
void native_machine_crash_shutdown(struct pt_regs *regs); | ||
|
||
#endif /* __ASM_SH_REBOOT_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
#include <linux/pm.h> | ||
#include <linux/kexec.h> | ||
#include <linux/kernel.h> | ||
#include <linux/reboot.h> | ||
#include <linux/module.h> | ||
#ifdef CONFIG_SUPERH32 | ||
#include <asm/watchdog.h> | ||
#endif | ||
#include <asm/addrspace.h> | ||
#include <asm/reboot.h> | ||
#include <asm/system.h> | ||
|
||
void (*pm_power_off)(void); | ||
EXPORT_SYMBOL(pm_power_off); | ||
|
||
#ifdef CONFIG_SUPERH32 | ||
static void watchdog_trigger_immediate(void) | ||
{ | ||
sh_wdt_write_cnt(0xFF); | ||
sh_wdt_write_csr(0xC2); | ||
} | ||
#endif | ||
|
||
static void native_machine_restart(char * __unused) | ||
{ | ||
local_irq_disable(); | ||
|
||
/* Address error with SR.BL=1 first. */ | ||
trigger_address_error(); | ||
|
||
#ifdef CONFIG_SUPERH32 | ||
/* If that fails or is unsupported, go for the watchdog next. */ | ||
watchdog_trigger_immediate(); | ||
#endif | ||
|
||
/* | ||
* Give up and sleep. | ||
*/ | ||
while (1) | ||
cpu_sleep(); | ||
} | ||
|
||
static void native_machine_shutdown(void) | ||
{ | ||
smp_send_stop(); | ||
} | ||
|
||
static void native_machine_power_off(void) | ||
{ | ||
if (pm_power_off) | ||
pm_power_off(); | ||
} | ||
|
||
static void native_machine_halt(void) | ||
{ | ||
/* stop other cpus */ | ||
machine_shutdown(); | ||
|
||
/* stop this cpu */ | ||
stop_this_cpu(NULL); | ||
} | ||
|
||
struct machine_ops machine_ops = { | ||
.power_off = native_machine_power_off, | ||
.shutdown = native_machine_shutdown, | ||
.restart = native_machine_restart, | ||
.halt = native_machine_halt, | ||
#ifdef CONFIG_KEXEC | ||
.crash_shutdown = native_machine_crash_shutdown, | ||
#endif | ||
}; | ||
|
||
void machine_power_off(void) | ||
{ | ||
machine_ops.power_off(); | ||
} | ||
|
||
void machine_shutdown(void) | ||
{ | ||
machine_ops.shutdown(); | ||
} | ||
|
||
void machine_restart(char *cmd) | ||
{ | ||
machine_ops.restart(cmd); | ||
} | ||
|
||
void machine_halt(void) | ||
{ | ||
machine_ops.halt(); | ||
} | ||
|
||
#ifdef CONFIG_KEXEC | ||
void machine_crash_shutdown(struct pt_regs *regs) | ||
{ | ||
machine_ops.crash_shutdown(regs); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters