[ARM] pxa: Fix RCSR handling
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Thu, 8 May 2008 15:50:39 +0000 (16:50 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 8 May 2008 17:04:02 +0000 (18:04 +0100)
Related to d3930614e68bdf83a120d904c039a64e9f75dba1.

RCSR is only present on PXA2xx CPUs, not on PXA3xx CPUs.  Therefore,
we should not be unconditionally writing to RCSR from generic code.

Since we now clear the RCSR status from the SoC specific PXA PM code
and before reset in the arch_reset() function, the duplication in
the corgi, poodle, spitz and tosa code can be removed.

Acked-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-pxa/corgi.c
arch/arm/mach-pxa/pm.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-pxa/tosa.c
include/asm-arm/arch-pxa/system.h

index 259ca82..b757dd7 100644 (file)
@@ -493,8 +493,6 @@ static struct platform_device *devices[] __initdata = {
 
 static void corgi_poweroff(void)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        if (!machine_is_corgi())
                /* Green LED off tells the bootloader to halt */
                reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
@@ -503,8 +501,6 @@ static void corgi_poweroff(void)
 
 static void corgi_restart(char mode)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        if (!machine_is_corgi())
                /* Green LED on tells the bootloader to reboot */
                set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
index 329df21..7d4debb 100644 (file)
@@ -46,9 +46,6 @@ int pxa_pm_enter(suspend_state_t state)
                        sleep_save_checksum += sleep_save[i];
        }
 
-       /* Clear reset status */
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        /* *** go zzz *** */
        pxa_cpu_pm_fns->enter(state);
        cpu_init();
index ca5ac19..0b30f25 100644 (file)
@@ -326,13 +326,11 @@ static struct platform_device *devices[] __initdata = {
 
 static void poodle_poweroff(void)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
        arm_machine_restart('h');
 }
 
 static void poodle_restart(char mode)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
        arm_machine_restart('h');
 }
 
index 3642f81..e5b417d 100644 (file)
@@ -198,6 +198,9 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
 
 static void pxa25x_cpu_pm_enter(suspend_state_t state)
 {
+       /* Clear reset status */
+       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
        switch (state) {
        case PM_SUSPEND_MEM:
                /* set resume return address */
index 505dcca..7e94583 100644 (file)
@@ -249,6 +249,9 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)
        /* Clear edge-detect status register. */
        PEDR = 0xDF12FE1B;
 
+       /* Clear reset status */
+       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
        switch (state) {
        case PM_SUSPEND_STANDBY:
                pxa_cpu_standby();
index 62a02c3..e7d0fcd 100644 (file)
@@ -529,8 +529,6 @@ static struct platform_device *devices[] __initdata = {
 
 static void spitz_poweroff(void)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
        GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);
 
index 7a7f5f9..23f050f 100644 (file)
@@ -119,9 +119,6 @@ static void spitz_presuspend(void)
        /* nRESET_OUT Disable */
        PSLR |= PSLR_SL_ROD;
 
-       /* Clear reset status */
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
        PCFR = PCFR_GPR_EN | PCFR_OPDE;
 }
index 6458f6d..c2cbd66 100644 (file)
@@ -467,8 +467,6 @@ static struct platform_device *devices[] __initdata = {
 
 static void tosa_poweroff(void)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
-
        pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_OUT);
        GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET);
 
index a758a71..9aa6c2e 100644 (file)
@@ -22,7 +22,8 @@ static inline void arch_idle(void)
 
 static inline void arch_reset(char mode)
 {
-       RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+       if (cpu_is_pxa2xx())
+               RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
 
        if (mode == 's') {
                /* Jump into ROM at address 0 */