diff options
Diffstat (limited to 'arch/arm/mach-at91/at91sam9263.c')
| -rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index f83fbb0ee0c..79e3669b111 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 14 | #include <linux/pm.h> | ||
| 15 | 14 | ||
| 16 | #include <asm/irq.h> | 15 | #include <asm/irq.h> |
| 17 | #include <asm/mach/arch.h> | 16 | #include <asm/mach/arch.h> |
| @@ -19,11 +18,11 @@ | |||
| 19 | #include <mach/at91sam9263.h> | 18 | #include <mach/at91sam9263.h> |
| 20 | #include <mach/at91_pmc.h> | 19 | #include <mach/at91_pmc.h> |
| 21 | #include <mach/at91_rstc.h> | 20 | #include <mach/at91_rstc.h> |
| 22 | #include <mach/at91_shdwc.h> | ||
| 23 | 21 | ||
| 24 | #include "soc.h" | 22 | #include "soc.h" |
| 25 | #include "generic.h" | 23 | #include "generic.h" |
| 26 | #include "clock.h" | 24 | #include "clock.h" |
| 25 | #include "sam9_smc.h" | ||
| 27 | 26 | ||
| 28 | /* -------------------------------------------------------------------- | 27 | /* -------------------------------------------------------------------- |
| 29 | * Clocks | 28 | * Clocks |
| @@ -118,7 +117,7 @@ static struct clk pwm_clk = { | |||
| 118 | .type = CLK_TYPE_PERIPHERAL, | 117 | .type = CLK_TYPE_PERIPHERAL, |
| 119 | }; | 118 | }; |
| 120 | static struct clk macb_clk = { | 119 | static struct clk macb_clk = { |
| 121 | .name = "macb_clk", | 120 | .name = "pclk", |
| 122 | .pmc_mask = 1 << AT91SAM9263_ID_EMAC, | 121 | .pmc_mask = 1 << AT91SAM9263_ID_EMAC, |
| 123 | .type = CLK_TYPE_PERIPHERAL, | 122 | .type = CLK_TYPE_PERIPHERAL, |
| 124 | }; | 123 | }; |
| @@ -182,6 +181,8 @@ static struct clk *periph_clocks[] __initdata = { | |||
| 182 | }; | 181 | }; |
| 183 | 182 | ||
| 184 | static struct clk_lookup periph_clocks_lookups[] = { | 183 | static struct clk_lookup periph_clocks_lookups[] = { |
| 184 | /* One additional fake clock for macb_hclk */ | ||
| 185 | CLKDEV_CON_ID("hclk", &macb_clk), | ||
| 185 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 186 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
| 186 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 187 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
| 187 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), | 188 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), |
| @@ -191,6 +192,11 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
| 191 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | 192 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
| 192 | /* fake hclk clock */ | 193 | /* fake hclk clock */ |
| 193 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 194 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
| 195 | CLKDEV_CON_ID("pioA", &pioA_clk), | ||
| 196 | CLKDEV_CON_ID("pioB", &pioB_clk), | ||
| 197 | CLKDEV_CON_ID("pioC", &pioCDE_clk), | ||
| 198 | CLKDEV_CON_ID("pioD", &pioCDE_clk), | ||
| 199 | CLKDEV_CON_ID("pioE", &pioCDE_clk), | ||
| 194 | }; | 200 | }; |
| 195 | 201 | ||
| 196 | static struct clk_lookup usart_clocks_lookups[] = { | 202 | static struct clk_lookup usart_clocks_lookups[] = { |
| @@ -263,36 +269,25 @@ void __init at91sam9263_set_console_clock(int id) | |||
| 263 | * GPIO | 269 | * GPIO |
| 264 | * -------------------------------------------------------------------- */ | 270 | * -------------------------------------------------------------------- */ |
| 265 | 271 | ||
| 266 | static struct at91_gpio_bank at91sam9263_gpio[] = { | 272 | static struct at91_gpio_bank at91sam9263_gpio[] __initdata = { |
| 267 | { | 273 | { |
| 268 | .id = AT91SAM9263_ID_PIOA, | 274 | .id = AT91SAM9263_ID_PIOA, |
| 269 | .offset = AT91_PIOA, | 275 | .regbase = AT91SAM9263_BASE_PIOA, |
| 270 | .clock = &pioA_clk, | ||
| 271 | }, { | 276 | }, { |
| 272 | .id = AT91SAM9263_ID_PIOB, | 277 | .id = AT91SAM9263_ID_PIOB, |
| 273 | .offset = AT91_PIOB, | 278 | .regbase = AT91SAM9263_BASE_PIOB, |
| 274 | .clock = &pioB_clk, | ||
| 275 | }, { | 279 | }, { |
| 276 | .id = AT91SAM9263_ID_PIOCDE, | 280 | .id = AT91SAM9263_ID_PIOCDE, |
| 277 | .offset = AT91_PIOC, | 281 | .regbase = AT91SAM9263_BASE_PIOC, |
| 278 | .clock = &pioCDE_clk, | ||
| 279 | }, { | 282 | }, { |
| 280 | .id = AT91SAM9263_ID_PIOCDE, | 283 | .id = AT91SAM9263_ID_PIOCDE, |
| 281 | .offset = AT91_PIOD, | 284 | .regbase = AT91SAM9263_BASE_PIOD, |
| 282 | .clock = &pioCDE_clk, | ||
| 283 | }, { | 285 | }, { |
| 284 | .id = AT91SAM9263_ID_PIOCDE, | 286 | .id = AT91SAM9263_ID_PIOCDE, |
| 285 | .offset = AT91_PIOE, | 287 | .regbase = AT91SAM9263_BASE_PIOE, |
| 286 | .clock = &pioCDE_clk, | ||
| 287 | } | 288 | } |
| 288 | }; | 289 | }; |
| 289 | 290 | ||
| 290 | static void at91sam9263_poweroff(void) | ||
| 291 | { | ||
| 292 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
| 293 | } | ||
| 294 | |||
| 295 | |||
| 296 | /* -------------------------------------------------------------------- | 291 | /* -------------------------------------------------------------------- |
| 297 | * AT91SAM9263 processor initialization | 292 | * AT91SAM9263 processor initialization |
| 298 | * -------------------------------------------------------------------- */ | 293 | * -------------------------------------------------------------------- */ |
| @@ -303,10 +298,17 @@ static void __init at91sam9263_map_io(void) | |||
| 303 | at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE); | 298 | at91_init_sram(1, AT91SAM9263_SRAM1_BASE, AT91SAM9263_SRAM1_SIZE); |
| 304 | } | 299 | } |
| 305 | 300 | ||
| 301 | static void __init at91sam9263_ioremap_registers(void) | ||
| 302 | { | ||
| 303 | at91_ioremap_shdwc(AT91SAM9263_BASE_SHDWC); | ||
| 304 | at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT); | ||
| 305 | at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0); | ||
| 306 | at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1); | ||
| 307 | } | ||
| 308 | |||
| 306 | static void __init at91sam9263_initialize(void) | 309 | static void __init at91sam9263_initialize(void) |
| 307 | { | 310 | { |
| 308 | at91_arch_reset = at91sam9_alt_reset; | 311 | arm_pm_restart = at91sam9_alt_restart; |
| 309 | pm_power_off = at91sam9263_poweroff; | ||
| 310 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); | 312 | at91_extern_irq = (1 << AT91SAM9263_ID_IRQ0) | (1 << AT91SAM9263_ID_IRQ1); |
| 311 | 313 | ||
| 312 | /* Register GPIO subsystem */ | 314 | /* Register GPIO subsystem */ |
| @@ -358,6 +360,7 @@ static unsigned int at91sam9263_default_irq_priority[NR_AIC_IRQS] __initdata = { | |||
| 358 | struct at91_init_soc __initdata at91sam9263_soc = { | 360 | struct at91_init_soc __initdata at91sam9263_soc = { |
| 359 | .map_io = at91sam9263_map_io, | 361 | .map_io = at91sam9263_map_io, |
| 360 | .default_irq_priority = at91sam9263_default_irq_priority, | 362 | .default_irq_priority = at91sam9263_default_irq_priority, |
| 363 | .ioremap_registers = at91sam9263_ioremap_registers, | ||
| 361 | .register_clocks = at91sam9263_register_clocks, | 364 | .register_clocks = at91sam9263_register_clocks, |
| 362 | .init = at91sam9263_initialize, | 365 | .init = at91sam9263_initialize, |
| 363 | }; | 366 | }; |
