]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Thu, 7 Aug 2008 10:05:25 +0000 (11:05 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 7 Aug 2008 10:06:47 +0000 (11:06 +0100)
Conflicts:

arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa2xx.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/reset.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c
drivers/watchdog/sa1100_wdt.c

14 files changed:
arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/include/mach/hardware.h
arch/arm/mach-pxa/include/mach/reset.h [new file with mode: 0644]
arch/arm/mach-pxa/pxa25x.c
arch/arm/mach-pxa/pxa27x.c
arch/arm/mach-pxa/pxa2xx.c
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/reset.c
arch/arm/mach-pxa/spitz.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-sa1100/generic.c
arch/arm/mach-sa1100/include/mach/reset.h [new file with mode: 0644]
drivers/watchdog/sa1100_wdt.c

index 2834b7fff78c350c3dc3422d7ccf1ed9d6693aa6..ceaed007636631f6aa5d471222dcde9b743010a6 100644 (file)
 #include <asm/mach/map.h>
 
 #include <mach/pxa-regs.h>
+#include <mach/reset.h>
 
 #include "generic.h"
 
+void clear_reset_status(unsigned int mask)
+{
+       if (cpu_is_pxa2xx())
+               pxa2xx_clear_reset_status(mask);
+
+       if (cpu_is_pxa3xx())
+               pxa3xx_clear_reset_status(mask);
+}
+
 /*
  * Get the clock frequency as reflected by CCCR and the turbo flag.
  * We assume these values have been applied via a fcs.
index 5bb7ae757831b2e5dbcb172fb12c792fe7c37df9..041c048320e471f07fb2e1cff0a453ea1255d5bd 100644 (file)
@@ -47,12 +47,20 @@ extern unsigned pxa27x_get_memclk_frequency_10khz(void);
 #define pxa27x_get_memclk_frequency_10khz()    (0)
 #endif
 
+#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
+extern void pxa2xx_clear_reset_status(unsigned int);
+#else
+static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
+#endif
+
 #ifdef CONFIG_PXA3xx
 extern unsigned pxa3xx_get_clk_frequency_khz(int);
 extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
+extern void pxa3xx_clear_reset_status(unsigned int);
 #else
 #define pxa3xx_get_clk_frequency_khz(x)                (0)
 #define pxa3xx_get_memclk_frequency_10khz()    (0)
+static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
 #endif
 
 extern struct sysdev_class pxa_irq_sysclass;
index f8fb1e75997f9450c114298a15d82c7f8fc94d98..e89df4d0d23999278dfdab688ed76aa3ecfc07d9 100644 (file)
@@ -224,11 +224,6 @@ extern void pxa_gpio_set_value(unsigned gpio, int value);
  */
 extern unsigned int get_memclk_frequency_10khz(void);
 
-/*
- * register GPIO as reset generator
- */
-extern int init_gpio_reset(int gpio);
-
 #endif
 
 #if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
diff --git a/arch/arm/mach-pxa/include/mach/reset.h b/arch/arm/mach-pxa/include/mach/reset.h
new file mode 100644 (file)
index 0000000..9489a48
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __ASM_ARCH_RESET_H
+#define __ASM_ARCH_RESET_H
+
+#define RESET_STATUS_HARDWARE  (1 << 0)        /* Hardware Reset */
+#define RESET_STATUS_WATCHDOG  (1 << 1)        /* Watchdog Reset */
+#define RESET_STATUS_LOWPOWER  (1 << 2)        /* Low Power/Sleep Exit */
+#define RESET_STATUS_GPIO      (1 << 3)        /* GPIO Reset */
+#define RESET_STATUS_ALL       (0xf)
+
+extern unsigned int reset_status;
+extern void clear_reset_status(unsigned int mask);
+
+/*
+ * register GPIO as reset generator
+ */
+extern int init_gpio_reset(int gpio);
+
+#endif /* __ASM_ARCH_RESET_H */
index 3c2d22de9a13db08bb34ba021cb1b9932e81004f..9e5d8a8c6424f64a0d3bdead6622373f57a6603e 100644 (file)
@@ -28,6 +28,7 @@
 #include <mach/pxa-regs.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa25x.h>
+#include <mach/reset.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
 
@@ -348,6 +349,9 @@ static int __init pxa25x_init(void)
                clks_register(&pxa25x_hwuart_clk, 1);
 
        if (cpu_is_pxa21x() || cpu_is_pxa25x()) {
+
+               reset_status = RCSR;
+
                clks_register(pxa25x_clks, ARRAY_SIZE(pxa25x_clks));
 
                if ((ret = pxa_init_dma(16)))
index 6bec43484ba7dc5e05b555672a3afa9b63338908..f9f6a9c31f4b06237ab4751c66b9bfc68d55e254 100644 (file)
@@ -24,6 +24,7 @@
 #include <mach/pxa-regs.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa27x.h>
+#include <mach/reset.h>
 #include <mach/ohci.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
@@ -384,6 +385,9 @@ static int __init pxa27x_init(void)
        int i, ret = 0;
 
        if (cpu_is_pxa27x()) {
+
+               reset_status = RCSR;
+
                clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks));
 
                if ((ret = pxa_init_dma(32)))
index 00b4de6d6bdd421a754330eef2c2cbadc1a553f8..73d04d81c75a2307b245ce27b155e01e5838eea1 100644 (file)
 #include <linux/kernel.h>
 #include <linux/device.h>
 
+#include <mach/hardware.h>
+#include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa2xx.h>
 #include <mach/mfp-pxa25x.h>
+#include <mach/reset.h>
 #include <mach/irda.h>
 
+void pxa2xx_clear_reset_status(unsigned int mask)
+{
+       /* RESET_STATUS_* has a 1:1 mapping with RCSR */
+       RCSR = mask;
+}
+
 static unsigned long pxa2xx_mfp_fir[] = {
        GPIO46_FICP_RXD,
        GPIO47_FICP_TXD,
index 37b07212b5a519760785bb82cfc5057dcab1cf0f..03cbc38103ed230d3bf4f1309b9d8b6a6d0fba99 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <mach/hardware.h>
 #include <mach/pxa3xx-regs.h>
+#include <mach/reset.h>
 #include <mach/ohci.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
@@ -109,6 +110,12 @@ unsigned int pxa3xx_get_memclk_frequency_10khz(void)
        return (clk / 10000);
 }
 
+void pxa3xx_clear_reset_status(unsigned int mask)
+{
+       /* RESET_STATUS_* has a 1:1 mapping with ARSR */
+       ARSR = mask;
+}
+
 /*
  * Return the current AC97 clock frequency.
  */
@@ -532,6 +539,9 @@ static int __init pxa3xx_init(void)
        int i, ret = 0;
 
        if (cpu_is_pxa3xx()) {
+
+               reset_status = ARSR;
+
                /*
                 * clear RDH bit every time after reset
                 *
index fabead71d681a88272343bbd01b296648f0e1379..9996c612c3d685d2ed749578f118b93262bfb6cc 100644 (file)
 #include <asm/proc-fns.h>
 
 #include <mach/pxa-regs.h>
-#include <mach/pxa2xx-regs.h>
+#include <mach/reset.h>
+
+unsigned int reset_status;
+EXPORT_SYMBOL(reset_status);
 
 static void do_hw_reset(void);
 
@@ -77,8 +80,7 @@ static void do_hw_reset(void)
 
 void arch_reset(char mode)
 {
-       if (cpu_is_pxa2xx())
-               RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+       clear_reset_status(RESET_STATUS_ALL);
 
        switch (mode) {
        case 's':
index 26b9fa56cffd9ed6b81a1fc8c453855f5892dca0..cd39005c98ff2279124a2b23d00b4fb79eae41a3 100644 (file)
@@ -39,6 +39,7 @@
 #include <mach/pxa2xx-regs.h>
 #include <mach/pxa2xx-gpio.h>
 #include <mach/pxa27x-udc.h>
+#include <mach/reset.h>
 #include <mach/irda.h>
 #include <mach/mmc.h>
 #include <mach/ohci.h>
index 38bc59c441101324e94b668ee96ec57cf907366b..5dab30eafddc83c750d46a7990b51c1c032c8271 100644 (file)
@@ -36,6 +36,7 @@
 #include <asm/mach-types.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa25x.h>
+#include <mach/reset.h>
 #include <mach/irda.h>
 #include <mach/i2c.h>
 #include <mach/mmc.h>
index 5a08fe20a31934c06aeef301b7182e6de4384128..1362994c78aa1ede98cdc4661cb1cb56623378e0 100644 (file)
@@ -31,6 +31,9 @@
 
 #include "generic.h"
 
+unsigned int reset_status;
+EXPORT_SYMBOL(reset_status);
+
 #define NR_FREQS       16
 
 /*
diff --git a/arch/arm/mach-sa1100/include/mach/reset.h b/arch/arm/mach-sa1100/include/mach/reset.h
new file mode 100644 (file)
index 0000000..f61957e
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef __ASM_ARCH_RESET_H
+#define __ASM_ARCH_RESET_H
+
+#include "hardware.h"
+
+#define RESET_STATUS_HARDWARE  (1 << 0)        /* Hardware Reset */
+#define RESET_STATUS_WATCHDOG  (1 << 1)        /* Watchdog Reset */
+#define RESET_STATUS_LOWPOWER  (1 << 2)        /* Exit from Low Power/Sleep */
+#define RESET_STATUS_GPIO      (1 << 3)        /* GPIO Reset */
+#define RESET_STATUS_ALL       (0xf)
+
+extern unsigned int reset_status;
+static inline void clear_reset_status(unsigned int mask)
+{
+       RCSR = mask;
+}
+
+#endif /* __ASM_ARCH_RESET_H */
index 52a533c274fdda2afc785e00af1af6f76ffa7637..97d9da758dccd7a0977ffea9d93ec0938f4b749b 100644 (file)
@@ -31,6 +31,7 @@
 #include <mach/pxa-regs.h>
 #endif
 
+#include <mach/reset.h>
 #include <mach/hardware.h>
 #include <asm/uaccess.h>
 
@@ -162,7 +163,8 @@ static int __init sa1100dog_init(void)
         * we suspend, RCSR will be cleared, and the watchdog
         * reset reason will be lost.
         */
-       boot_status = (RCSR & RCSR_WDR) ? WDIOF_CARDRESET : 0;
+       boot_status = (reset_status & RESET_STATUS_WATCHDOG) ?
+                               WDIOF_CARDRESET : 0;
        pre_margin = OSCR_FREQ * margin;
 
        ret = misc_register(&sa1100dog_miscdev);