AT91: fix use of clock disable on idle for AT91x40 devices
authorGreg Ungerer <gerg@snapgear.com>
Tue, 21 Sep 2010 10:39:40 +0000 (20:39 +1000)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Thu, 7 Oct 2010 17:56:54 +0000 (19:56 +0200)
The simpler AT91x40 processors do not have the same power management
controller as the new AT91 devices. They do have a simpler power
controller module that we can use to disable the CPU clock at idle
time. Add code to support that.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
arch/arm/mach-at91/include/mach/at91x40.h
arch/arm/mach-at91/include/mach/system.h

index d34cdb8abdca652dfcc64523e089361ed3ff2c0e..063ac44a020423119b52749dc3c866b6dd7eb965 100644 (file)
 #define AT91_DBGU_CIDR (AT91_SF + 0)   /* CIDR in PS segment */
 #define AT91_DBGU_EXID (AT91_SF + 4)   /* EXID in PS segment */
 
+/*
+ * Support defines for the simple Power Controller module.
+ */
+#define        AT91_PS_CR      (AT91_PS + 0)   /* PS Control register */
+#define        AT91_PS_CR_CPU  (1 << 0)        /* CPU clock disable bit */
+
 #endif /* AT91X40_H */
index c80e090b36708706671d8c66ff1a67a1c0106d61..bfbb612265d69b0fbf39a6c36b756b9a8783a11f 100644 (file)
@@ -33,7 +33,11 @@ static inline void arch_idle(void)
         * Disable the processor clock.  The processor will be automatically
         * re-enabled by an interrupt or by a reset.
         */
+#ifdef AT91_PS
+       at91_sys_write(AT91_PS_CR, AT91_PS_CR_CPU);
+#else
        at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
+#endif
 #else
        /*
         * Set the processor (CP15) into 'Wait for Interrupt' mode.