Commit fbb82b03 authored by Paul Mundt's avatar Paul Mundt
Browse files

sh: machine_ops based reboot support.



This provides a machine_ops-based reboot interface loosely cloned from
x86, and converts the native sh32 and sh64 cases over to it.

Necessary both for tying in SMP support and also enabling platforms like
SDK7786 to add support for their microcontroller-based power managers.

Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 2efa53b2
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
#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 */
+1 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ extern struct dentry *sh_debugfs_root;
void per_cpu_trap_init(void);
void default_idle(void);
void cpu_idle_wait(void);
void stop_this_cpu(void *);

#ifdef CONFIG_SUPERH32
#define BUILD_TRAP_HANDLER(name)					\
+12 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#define __ASM_SH_SYSTEM_32_H

#include <linux/types.h>
#include <asm/mmu.h>

#ifdef CONFIG_SH_DSP

@@ -216,6 +217,17 @@ static inline reg_size_t register_align(void *val)
int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs,
			    struct mem_access *ma, int);

static inline void trigger_address_error(void)
{
	if (__in_29bit_mode())
		__asm__ __volatile__ (
			"ldc %0, sr\n\t"
			"mov.l @%1, %0"
			:
			: "r" (0x10000000), "r" (0x80000001)
		);
}

asmlinkage void do_address_error(struct pt_regs *regs,
				 unsigned long writeaccess,
				 unsigned long address);
+7 −0
Original line number Diff line number Diff line
@@ -48,6 +48,13 @@ static inline reg_size_t register_align(void *val)
	return (unsigned long long)(signed long long)(signed long)val;
}

extern void phys_stext(void);

static inline void trigger_address_error(void)
{
	phys_stext();
}

#define SR_BL_LL	0x0000000010000000LL

static inline void set_bl_bit(void)
+2 −1
Original line number Diff line number Diff line
@@ -14,7 +14,8 @@ CFLAGS_REMOVE_return_address.o = -pg
obj-y	:= debugtraps.o dma-nommu.o dumpstack.o 			\
	   idle.o io.o io_generic.o irq.o				\
	   irq_$(BITS).o machvec.o nmi_debug.o process.o		\
	   process_$(BITS).o ptrace_$(BITS).o return_address.o		\
	   process_$(BITS).o ptrace_$(BITS).o				\
	   reboot.o return_address.o					\
	   setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o		\
	   syscalls_$(BITS).o time.o topology.o traps.o			\
	   traps_$(BITS).o unwinder.o
Loading