Commit 1b2073e7 authored by Russell King's avatar Russell King

ARM: restart: at91: use new restart hook

Rather than using a private function pointer, use the existing
arm_pm_restart function pointer instead.  We no longer need to enable
the I-cache in at91sam9_alt_reset() as the caches will now be on when
this function is called.

Update the function names to use the 'restart' terminology rather than
the 'reboot' terminology.
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 83909188
...@@ -313,7 +313,7 @@ static struct at91_gpio_bank at91cap9_gpio[] = { ...@@ -313,7 +313,7 @@ static struct at91_gpio_bank at91cap9_gpio[] = {
} }
}; };
static void at91cap9_reset(void) static void at91cap9_restart(char mode, const char *cmd)
{ {
at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
} }
...@@ -335,7 +335,7 @@ static void __init at91cap9_map_io(void) ...@@ -335,7 +335,7 @@ static void __init at91cap9_map_io(void)
static void __init at91cap9_initialize(void) static void __init at91cap9_initialize(void)
{ {
at91_arch_reset = at91cap9_reset; arm_pm_restart = at91cap9_restart;
pm_power_off = at91cap9_poweroff; pm_power_off = at91cap9_poweroff;
at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
......
...@@ -288,7 +288,7 @@ static struct at91_gpio_bank at91rm9200_gpio[] = { ...@@ -288,7 +288,7 @@ static struct at91_gpio_bank at91rm9200_gpio[] = {
} }
}; };
static void at91rm9200_reset(void) static void at91rm9200_restart(char mode, const char *cmd)
{ {
/* /*
* Perform a hardware reset with the use of the Watchdog timer. * Perform a hardware reset with the use of the Watchdog timer.
...@@ -309,7 +309,7 @@ static void __init at91rm9200_map_io(void) ...@@ -309,7 +309,7 @@ static void __init at91rm9200_map_io(void)
static void __init at91rm9200_initialize(void) static void __init at91rm9200_initialize(void)
{ {
at91_arch_reset = at91rm9200_reset; arm_pm_restart = at91rm9200_restart;
at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1) at91_extern_irq = (1 << AT91RM9200_ID_IRQ0) | (1 << AT91RM9200_ID_IRQ1)
| (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3) | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
| (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5) | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
......
...@@ -327,7 +327,7 @@ static void __init at91sam9260_map_io(void) ...@@ -327,7 +327,7 @@ static void __init at91sam9260_map_io(void)
static void __init at91sam9260_initialize(void) static void __init at91sam9260_initialize(void)
{ {
at91_arch_reset = at91sam9_alt_reset; arm_pm_restart = at91sam9_alt_restart;
pm_power_off = at91sam9260_poweroff; pm_power_off = at91sam9260_poweroff;
at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
| (1 << AT91SAM9260_ID_IRQ2); | (1 << AT91SAM9260_ID_IRQ2);
......
...@@ -287,7 +287,7 @@ static void __init at91sam9261_map_io(void) ...@@ -287,7 +287,7 @@ static void __init at91sam9261_map_io(void)
static void __init at91sam9261_initialize(void) static void __init at91sam9261_initialize(void)
{ {
at91_arch_reset = at91sam9_alt_reset; arm_pm_restart = at91sam9_alt_restart;
pm_power_off = at91sam9261_poweroff; pm_power_off = at91sam9261_poweroff;
at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
| (1 << AT91SAM9261_ID_IRQ2); | (1 << AT91SAM9261_ID_IRQ2);
......
...@@ -305,7 +305,7 @@ static void __init at91sam9263_map_io(void) ...@@ -305,7 +305,7 @@ static void __init at91sam9263_map_io(void)
static void __init at91sam9263_initialize(void) static void __init at91sam9263_initialize(void)
{ {
at91_arch_reset = at91sam9_alt_reset; arm_pm_restart = at91sam9_alt_restart;
pm_power_off = at91sam9263_poweroff; pm_power_off = at91sam9263_poweroff;
at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
......
...@@ -14,20 +14,15 @@ ...@@ -14,20 +14,15 @@
*/ */
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/system.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <mach/at91sam9_sdramc.h> #include <mach/at91sam9_sdramc.h>
#include <mach/at91_rstc.h> #include <mach/at91_rstc.h>
.arm .arm
.globl at91sam9_alt_reset .globl at91sam9_alt_restart
at91sam9_alt_reset: mrc p15, 0, r0, c1, c0, 0 at91sam9_alt_restart: ldr r0, .at91_va_base_sdramc @ preload constants
orr r0, r0, #CR_I
mcr p15, 0, r0, c1, c0, 0 @ enable I-cache
ldr r0, .at91_va_base_sdramc @ preload constants
ldr r1, .at91_va_base_rstc_cr ldr r1, .at91_va_base_rstc_cr
mov r2, #1 mov r2, #1
......
...@@ -317,7 +317,7 @@ static struct at91_gpio_bank at91sam9g45_gpio[] = { ...@@ -317,7 +317,7 @@ static struct at91_gpio_bank at91sam9g45_gpio[] = {
} }
}; };
static void at91sam9g45_reset(void) static void at91sam9g45_restart(char mode, const char *cmd)
{ {
at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
} }
...@@ -340,7 +340,7 @@ static void __init at91sam9g45_map_io(void) ...@@ -340,7 +340,7 @@ static void __init at91sam9g45_map_io(void)
static void __init at91sam9g45_initialize(void) static void __init at91sam9g45_initialize(void)
{ {
at91_arch_reset = at91sam9g45_reset; arm_pm_restart = at91sam9g45_restart;
pm_power_off = at91sam9g45_poweroff; pm_power_off = at91sam9g45_poweroff;
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
......
...@@ -292,7 +292,7 @@ static void __init at91sam9rl_map_io(void) ...@@ -292,7 +292,7 @@ static void __init at91sam9rl_map_io(void)
static void __init at91sam9rl_initialize(void) static void __init at91sam9rl_initialize(void)
{ {
at91_arch_reset = at91sam9_alt_reset; arm_pm_restart = at91sam9_alt_restart;
pm_power_off = at91sam9rl_poweroff; pm_power_off = at91sam9rl_poweroff;
at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0); at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
......
...@@ -57,7 +57,7 @@ extern void at91_irq_suspend(void); ...@@ -57,7 +57,7 @@ extern void at91_irq_suspend(void);
extern void at91_irq_resume(void); extern void at91_irq_resume(void);
/* reset */ /* reset */
extern void at91sam9_alt_reset(void); extern void at91sam9_alt_restart(char, const char *);
/* GPIO */ /* GPIO */
#define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */
...@@ -71,5 +71,4 @@ struct at91_gpio_bank { ...@@ -71,5 +71,4 @@ struct at91_gpio_bank {
extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks);
extern void __init at91_gpio_irq_setup(void); extern void __init at91_gpio_irq_setup(void);
extern void (*at91_arch_reset)(void);
extern int at91_extern_irq; extern int at91_extern_irq;
...@@ -47,13 +47,8 @@ static inline void arch_idle(void) ...@@ -47,13 +47,8 @@ static inline void arch_idle(void)
#endif #endif
} }
void (*at91_arch_reset)(void);
static inline void arch_reset(char mode, const char *cmd) static inline void arch_reset(char mode, const char *cmd)
{ {
/* call the CPU-specific reset function */
if (at91_arch_reset)
(at91_arch_reset)();
} }
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment