]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-at91/at91sam9261.c
[ARM] 4903/1: [AT91] SAM9/CAP9 system shutdown
[linux-2.6-omap-h63xx.git] / arch / arm / mach-at91 / at91sam9261.c
index 784d1e682d6db426fa19b2f4b1317da95a071e7b..35bf6fd52516d8ba20dc8a363ea0c1bf2b67929b 100644 (file)
  */
 
 #include <linux/module.h>
+#include <linux/pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 #include <asm/arch/at91sam9261.h>
 #include <asm/arch/at91_pmc.h>
 #include <asm/arch/at91_rstc.h>
+#include <asm/arch/at91_shdwc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -97,6 +99,21 @@ static struct clk spi1_clk = {
        .pmc_mask       = 1 << AT91SAM9261_ID_SPI1,
        .type           = CLK_TYPE_PERIPHERAL,
 };
+static struct clk ssc0_clk = {
+       .name           = "ssc0_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_SSC0,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc1_clk = {
+       .name           = "ssc1_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_SSC1,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
+static struct clk ssc2_clk = {
+       .name           = "ssc2_clk",
+       .pmc_mask       = 1 << AT91SAM9261_ID_SSC2,
+       .type           = CLK_TYPE_PERIPHERAL,
+};
 static struct clk tc0_clk = {
        .name           = "tc0_clk",
        .pmc_mask       = 1 << AT91SAM9261_ID_TC0,
@@ -135,7 +152,9 @@ static struct clk *periph_clocks[] __initdata = {
        &twi_clk,
        &spi0_clk,
        &spi1_clk,
-       // ssc 0 .. ssc2
+       &ssc0_clk,
+       &ssc1_clk,
+       &ssc2_clk,
        &tc0_clk,
        &tc1_clk,
        &tc2_clk,
@@ -228,6 +247,11 @@ static void at91sam9261_reset(void)
        at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST);
 }
 
+static void at91sam9261_poweroff(void)
+{
+       at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW);
+}
+
 
 /* --------------------------------------------------------------------
  *  AT91SAM9261 processor initialization
@@ -239,6 +263,7 @@ void __init at91sam9261_initialize(unsigned long main_clock)
        iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
 
        at91_arch_reset = at91sam9261_reset;
+       pm_power_off = at91sam9261_poweroff;
        at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
                        | (1 << AT91SAM9261_ID_IRQ2);
 
@@ -262,25 +287,25 @@ void __init at91sam9261_initialize(unsigned long main_clock)
 static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
        7,      /* Advanced Interrupt Controller */
        7,      /* System Peripherals */
-       0,      /* Parallel IO Controller A */
-       0,      /* Parallel IO Controller B */
-       0,      /* Parallel IO Controller C */
+       1,      /* Parallel IO Controller A */
+       1,      /* Parallel IO Controller B */
+       1,      /* Parallel IO Controller C */
        0,
-       6,      /* USART 0 */
-       6,      /* USART 1 */
-       6,      /* USART 2 */
+       5,      /* USART 0 */
+       5,      /* USART 1 */
+       5,      /* USART 2 */
        0,      /* Multimedia Card Interface */
-       4,      /* USB Device Port */
-       0,      /* Two-Wire Interface */
-       6,      /* Serial Peripheral Interface 0 */
-       6,      /* Serial Peripheral Interface 1 */
-       5,      /* Serial Synchronous Controller 0 */
-       5,      /* Serial Synchronous Controller 1 */
-       5,      /* Serial Synchronous Controller 2 */
+       2,      /* USB Device Port */
+       6,      /* Two-Wire Interface */
+       5,      /* Serial Peripheral Interface 0 */
+       5,      /* Serial Peripheral Interface 1 */
+       4,      /* Serial Synchronous Controller 0 */
+       4,      /* Serial Synchronous Controller 1 */
+       4,      /* Serial Synchronous Controller 2 */
        0,      /* Timer Counter 0 */
        0,      /* Timer Counter 1 */
        0,      /* Timer Counter 2 */
-       3,      /* USB Host port */
+       2,      /* USB Host port */
        3,      /* LCD Controller */
        0,
        0,