Skip to content

Commit b56a7c6

Browse files
author
Russell King
committed
ARM: restart: versatile: use new restart hook
Hook these platforms restart code into the new restart hook rather than using arch_reset(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 7e3974b commit b56a7c6

6 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎arch/arm/mach-versatile/core.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,19 @@ static void versatile_leds_event(led_event_t ledevt)
745745
}
746746
#endif /* CONFIG_LEDS */
747747

748+
void versatile_restart(char mode, const char *cmd)
749+
{
750+
void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
751+
u32 val;
752+
753+
val = __raw_readl(sys + VERSATILE_SYS_RESETCTL_OFFSET);
754+
val |= 0x105;
755+
756+
__raw_writel(0xa05f, sys + VERSATILE_SYS_LOCK_OFFSET);
757+
__raw_writel(val, sys + VERSATILE_SYS_RESETCTL_OFFSET);
758+
__raw_writel(0, sys + VERSATILE_SYS_LOCK_OFFSET);
759+
}
760+
748761
/* Early initializations */
749762
void __init versatile_init_early(void)
750763
{

‎arch/arm/mach-versatile/core.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern void __init versatile_init_early(void);
3030
extern void __init versatile_init_irq(void);
3131
extern void __init versatile_map_io(void);
3232
extern struct sys_timer versatile_timer;
33+
extern void versatile_restart(char, const char *);
3334
extern unsigned int mmc_status(struct device *dev);
3435
#ifdef CONFIG_OF
3536
extern struct of_dev_auxdata versatile_auxdata_lookup[];

‎arch/arm/mach-versatile/include/mach/system.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
#ifndef __ASM_ARCH_SYSTEM_H
2222
#define __ASM_ARCH_SYSTEM_H
2323

24-
#include <linux/io.h>
25-
#include <mach/hardware.h>
26-
#include <mach/platform.h>
27-
2824
static inline void arch_idle(void)
2925
{
3026
/*
@@ -36,14 +32,6 @@ static inline void arch_idle(void)
3632

3733
static inline void arch_reset(char mode, const char *cmd)
3834
{
39-
u32 val;
40-
41-
val = __raw_readl(IO_ADDRESS(VERSATILE_SYS_RESETCTL)) & ~0x7;
42-
val |= 0x105;
43-
44-
__raw_writel(0xa05f, IO_ADDRESS(VERSATILE_SYS_LOCK));
45-
__raw_writel(val, IO_ADDRESS(VERSATILE_SYS_RESETCTL));
46-
__raw_writel(0, IO_ADDRESS(VERSATILE_SYS_LOCK));
4735
}
4836

4937
#endif

‎arch/arm/mach-versatile/versatile_ab.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
4141
.init_irq = versatile_init_irq,
4242
.timer = &versatile_timer,
4343
.init_machine = versatile_init,
44+
.restart = versatile_restart,
4445
MACHINE_END

‎arch/arm/mach-versatile/versatile_dt.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
4848
.timer = &versatile_timer,
4949
.init_machine = versatile_dt_init,
5050
.dt_compat = versatile_dt_match,
51+
.restart = versatile_restart,
5152
MACHINE_END

‎arch/arm/mach-versatile/versatile_pb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,5 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
109109
.init_irq = versatile_init_irq,
110110
.timer = &versatile_timer,
111111
.init_machine = versatile_pb_init,
112+
.restart = versatile_restart,
112113
MACHINE_END

0 commit comments

Comments
 (0)