diff options
Diffstat (limited to 'arch/arm/mach-at91/at91cap9.c')
| -rw-r--r-- | arch/arm/mach-at91/at91cap9.c | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c index 29373397d2d..edb879ac04c 100644 --- a/arch/arm/mach-at91/at91cap9.c +++ b/arch/arm/mach-at91/at91cap9.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/pm.h> | ||
| 17 | 16 | ||
| 18 | #include <asm/irq.h> | 17 | #include <asm/irq.h> |
| 19 | #include <asm/mach/arch.h> | 18 | #include <asm/mach/arch.h> |
| @@ -23,11 +22,11 @@ | |||
| 23 | #include <mach/at91cap9.h> | 22 | #include <mach/at91cap9.h> |
| 24 | #include <mach/at91_pmc.h> | 23 | #include <mach/at91_pmc.h> |
| 25 | #include <mach/at91_rstc.h> | 24 | #include <mach/at91_rstc.h> |
| 26 | #include <mach/at91_shdwc.h> | ||
| 27 | 25 | ||
| 28 | #include "soc.h" | 26 | #include "soc.h" |
| 29 | #include "generic.h" | 27 | #include "generic.h" |
| 30 | #include "clock.h" | 28 | #include "clock.h" |
| 29 | #include "sam9_smc.h" | ||
| 31 | 30 | ||
| 32 | /* -------------------------------------------------------------------- | 31 | /* -------------------------------------------------------------------- |
| 33 | * Clocks | 32 | * Clocks |
| @@ -137,7 +136,7 @@ static struct clk pwm_clk = { | |||
| 137 | .type = CLK_TYPE_PERIPHERAL, | 136 | .type = CLK_TYPE_PERIPHERAL, |
| 138 | }; | 137 | }; |
| 139 | static struct clk macb_clk = { | 138 | static struct clk macb_clk = { |
| 140 | .name = "macb_clk", | 139 | .name = "pclk", |
| 141 | .pmc_mask = 1 << AT91CAP9_ID_EMAC, | 140 | .pmc_mask = 1 << AT91CAP9_ID_EMAC, |
| 142 | .type = CLK_TYPE_PERIPHERAL, | 141 | .type = CLK_TYPE_PERIPHERAL, |
| 143 | }; | 142 | }; |
| @@ -210,6 +209,8 @@ static struct clk *periph_clocks[] __initdata = { | |||
| 210 | }; | 209 | }; |
| 211 | 210 | ||
| 212 | static struct clk_lookup periph_clocks_lookups[] = { | 211 | static struct clk_lookup periph_clocks_lookups[] = { |
| 212 | /* One additional fake clock for macb_hclk */ | ||
| 213 | CLKDEV_CON_ID("hclk", &macb_clk), | ||
| 213 | CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), | 214 | CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk), |
| 214 | CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), | 215 | CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk), |
| 215 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), | 216 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), |
| @@ -221,6 +222,10 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
| 221 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 222 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
| 222 | /* fake hclk clock */ | 223 | /* fake hclk clock */ |
| 223 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 224 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
| 225 | CLKDEV_CON_ID("pioA", &pioABCD_clk), | ||
| 226 | CLKDEV_CON_ID("pioB", &pioABCD_clk), | ||
| 227 | CLKDEV_CON_ID("pioC", &pioABCD_clk), | ||
| 228 | CLKDEV_CON_ID("pioD", &pioABCD_clk), | ||
| 224 | }; | 229 | }; |
| 225 | 230 | ||
| 226 | static struct clk_lookup usart_clocks_lookups[] = { | 231 | static struct clk_lookup usart_clocks_lookups[] = { |
| @@ -293,23 +298,19 @@ void __init at91cap9_set_console_clock(int id) | |||
| 293 | * GPIO | 298 | * GPIO |
| 294 | * -------------------------------------------------------------------- */ | 299 | * -------------------------------------------------------------------- */ |
| 295 | 300 | ||
| 296 | static struct at91_gpio_bank at91cap9_gpio[] = { | 301 | static struct at91_gpio_bank at91cap9_gpio[] __initdata = { |
| 297 | { | 302 | { |
| 298 | .id = AT91CAP9_ID_PIOABCD, | 303 | .id = AT91CAP9_ID_PIOABCD, |
| 299 | .offset = AT91_PIOA, | 304 | .regbase = AT91CAP9_BASE_PIOA, |
| 300 | .clock = &pioABCD_clk, | ||
| 301 | }, { | 305 | }, { |
| 302 | .id = AT91CAP9_ID_PIOABCD, | 306 | .id = AT91CAP9_ID_PIOABCD, |
| 303 | .offset = AT91_PIOB, | 307 | .regbase = AT91CAP9_BASE_PIOB, |
| 304 | .clock = &pioABCD_clk, | ||
| 305 | }, { | 308 | }, { |
| 306 | .id = AT91CAP9_ID_PIOABCD, | 309 | .id = AT91CAP9_ID_PIOABCD, |
| 307 | .offset = AT91_PIOC, | 310 | .regbase = AT91CAP9_BASE_PIOC, |
| 308 | .clock = &pioABCD_clk, | ||
| 309 | }, { | 311 | }, { |
| 310 | .id = AT91CAP9_ID_PIOABCD, | 312 | .id = AT91CAP9_ID_PIOABCD, |
| 311 | .offset = AT91_PIOD, | 313 | .regbase = AT91CAP9_BASE_PIOD, |
| 312 | .clock = &pioABCD_clk, | ||
| 313 | } | 314 | } |
| 314 | }; | 315 | }; |
| 315 | 316 | ||
| @@ -318,12 +319,6 @@ static void at91cap9_restart(char mode, const char *cmd) | |||
| 318 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); | 319 | at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_PROCRST | AT91_RSTC_PERRST); |
| 319 | } | 320 | } |
| 320 | 321 | ||
| 321 | static void at91cap9_poweroff(void) | ||
| 322 | { | ||
| 323 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
| 324 | } | ||
| 325 | |||
| 326 | |||
| 327 | /* -------------------------------------------------------------------- | 322 | /* -------------------------------------------------------------------- |
| 328 | * AT91CAP9 processor initialization | 323 | * AT91CAP9 processor initialization |
| 329 | * -------------------------------------------------------------------- */ | 324 | * -------------------------------------------------------------------- */ |
| @@ -333,10 +328,16 @@ static void __init at91cap9_map_io(void) | |||
| 333 | at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); | 328 | at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE); |
| 334 | } | 329 | } |
| 335 | 330 | ||
| 331 | static void __init at91cap9_ioremap_registers(void) | ||
| 332 | { | ||
| 333 | at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC); | ||
| 334 | at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT); | ||
| 335 | at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC); | ||
| 336 | } | ||
| 337 | |||
| 336 | static void __init at91cap9_initialize(void) | 338 | static void __init at91cap9_initialize(void) |
| 337 | { | 339 | { |
| 338 | arm_pm_restart = at91cap9_restart; | 340 | arm_pm_restart = at91cap9_restart; |
| 339 | pm_power_off = at91cap9_poweroff; | ||
| 340 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); | 341 | at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1); |
| 341 | 342 | ||
| 342 | /* Register GPIO subsystem */ | 343 | /* Register GPIO subsystem */ |
| @@ -394,6 +395,7 @@ static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = { | |||
| 394 | struct at91_init_soc __initdata at91cap9_soc = { | 395 | struct at91_init_soc __initdata at91cap9_soc = { |
| 395 | .map_io = at91cap9_map_io, | 396 | .map_io = at91cap9_map_io, |
| 396 | .default_irq_priority = at91cap9_default_irq_priority, | 397 | .default_irq_priority = at91cap9_default_irq_priority, |
| 398 | .ioremap_registers = at91cap9_ioremap_registers, | ||
| 397 | .register_clocks = at91cap9_register_clocks, | 399 | .register_clocks = at91cap9_register_clocks, |
| 398 | .init = at91cap9_initialize, | 400 | .init = at91cap9_initialize, |
| 399 | }; | 401 | }; |
