ARM: restart: at91: use new restart hook
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 3 Nov 2011 09:53:29 +0000 (09:53 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 5 Jan 2012 12:57:08 +0000 (12:57 +0000)
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: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/at91cap9.c
arch/arm/mach-at91/at91rm9200.c
arch/arm/mach-at91/at91sam9260.c
arch/arm/mach-at91/at91sam9261.c
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9_alt_reset.S
arch/arm/mach-at91/at91sam9g45.c
arch/arm/mach-at91/at91sam9rl.c
arch/arm/mach-at91/generic.h
arch/arm/mach-at91/include/mach/system.h

index ecdd54dd68c6c0139d10ca50595283bcf94545d7..29373397d2df83c6766a5ee87c098ec55c3892df 100644 (file)
@@ -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);
 }
@@ -335,7 +335,7 @@ static void __init at91cap9_map_io(void)
 
 static void __init at91cap9_initialize(void)
 {
-       at91_arch_reset = at91cap9_reset;
+       arm_pm_restart = at91cap9_restart;
        pm_power_off = at91cap9_poweroff;
        at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
 
index 713d3bdbd28447a7280adb746f4acc13af602cfd..430a9fdc3dbf5e04662802c17f6cba825d1a16da 100644 (file)
@@ -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.
@@ -309,7 +309,7 @@ static void __init at91rm9200_map_io(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)
                        | (1 << AT91RM9200_ID_IRQ2) | (1 << AT91RM9200_ID_IRQ3)
                        | (1 << AT91RM9200_ID_IRQ4) | (1 << AT91RM9200_ID_IRQ5)
index 0d20677fbef027591c91c2d442d528f7fa6c73f0..e76cd49ebc9e8252fc6502c6b071cd4d5a03177c 100644 (file)
@@ -327,7 +327,7 @@ static void __init at91sam9260_map_io(void)
 
 static void __init at91sam9260_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
+       arm_pm_restart = at91sam9_alt_restart;
        pm_power_off = at91sam9260_poweroff;
        at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1)
                        | (1 << AT91SAM9260_ID_IRQ2);
index 658a5185abfd44cf4671c5d5fa7c6f44b4fc229e..19ac7c0729a0bc2d38b1ac9a2dbce81c299f5604 100644 (file)
@@ -287,7 +287,7 @@ static void __init at91sam9261_map_io(void)
 
 static void __init at91sam9261_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
+       arm_pm_restart = at91sam9_alt_restart;
        pm_power_off = at91sam9261_poweroff;
        at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
                        | (1 << AT91SAM9261_ID_IRQ2);
index f83fbb0ee0c58e9bdaab924071bedaf148096bb2..50d016310031aefd557da1323d82549edc9db595 100644 (file)
@@ -305,7 +305,7 @@ static void __init at91sam9263_map_io(void)
 
 static void __init at91sam9263_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
+       arm_pm_restart = at91sam9_alt_restart;
        pm_power_off = at91sam9263_poweroff;
        at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1);
 
index e0256deb91fbfd7acc478e29609831fcfdf39c12..d3f931c5942e9078bcb31803e50a6fefed398c8b 100644 (file)
  */
 
 #include <linux/linkage.h>
-#include <asm/system.h>
 #include <mach/hardware.h>
 #include <mach/at91sam9_sdramc.h>
 #include <mach/at91_rstc.h>
 
                        .arm
 
-                       .globl  at91sam9_alt_reset
+                       .globl  at91sam9_alt_restart
 
-at91sam9_alt_reset:    mrc     p15, 0, r0, c1, c0, 0
-                       orr     r0, r0, #CR_I
-                       mcr     p15, 0, r0, c1, c0, 0           @ enable I-cache
-
-                       ldr     r0, .at91_va_base_sdramc        @ preload constants
+at91sam9_alt_restart:  ldr     r0, .at91_va_base_sdramc        @ preload constants
                        ldr     r1, .at91_va_base_rstc_cr
 
                        mov     r2, #1
index 318b0407ea041fa8d8dae59c106d8427ea48b8ec..ff21f7a60c63dfa0e32bbfb3e999783109925e9f 100644 (file)
@@ -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);
 }
@@ -340,7 +340,7 @@ static void __init at91sam9g45_map_io(void)
 
 static void __init at91sam9g45_initialize(void)
 {
-       at91_arch_reset = at91sam9g45_reset;
+       arm_pm_restart = at91sam9g45_restart;
        pm_power_off = at91sam9g45_poweroff;
        at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);
 
index a238105d2c11dabb385c7f8bbbcfa20be87b2982..61cbb46f5b0eed6b8bd5a8269efa657696b1e3c2 100644 (file)
@@ -292,7 +292,7 @@ static void __init at91sam9rl_map_io(void)
 
 static void __init at91sam9rl_initialize(void)
 {
-       at91_arch_reset = at91sam9_alt_reset;
+       arm_pm_restart = at91sam9_alt_restart;
        pm_power_off = at91sam9rl_poweroff;
        at91_extern_irq = (1 << AT91SAM9RL_ID_IRQ0);
 
index 938b34f577419b9dba43f466c3d59dfe4b73fe69..7f4503bc4cbb10f89da3b3bf025829ebaa9319b5 100644 (file)
@@ -57,7 +57,7 @@ extern void at91_irq_suspend(void);
 extern void at91_irq_resume(void);
 
 /* reset */
-extern void at91sam9_alt_reset(void);
+extern void at91sam9_alt_restart(char, const char *);
 
  /* GPIO */
 #define AT91RM9200_PQFP                3       /* AT91RM9200 PQFP package has 3 banks */
@@ -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_irq_setup(void);
 
-extern void (*at91_arch_reset)(void);
 extern int at91_extern_irq;
index 36af14bc13bbbbc88aad80487b6d3cc85b924f0b..079eb12b073f354982b5ada5cd0bd1d45e44f8ea 100644 (file)
@@ -47,13 +47,8 @@ static inline void arch_idle(void)
 #endif
 }
 
-void (*at91_arch_reset)(void);
-
 static inline void arch_reset(char mode, const char *cmd)
 {
-       /* call the CPU-specific reset function */
-       if (at91_arch_reset)
-               (at91_arch_reset)();
 }
 
 #endif