diff options
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index e76cd49ebc9e..5e46e4a96430 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.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> |
@@ -21,11 +20,11 @@ | |||
21 | #include <mach/at91sam9260.h> | 20 | #include <mach/at91sam9260.h> |
22 | #include <mach/at91_pmc.h> | 21 | #include <mach/at91_pmc.h> |
23 | #include <mach/at91_rstc.h> | 22 | #include <mach/at91_rstc.h> |
24 | #include <mach/at91_shdwc.h> | ||
25 | 23 | ||
26 | #include "soc.h" | 24 | #include "soc.h" |
27 | #include "generic.h" | 25 | #include "generic.h" |
28 | #include "clock.h" | 26 | #include "clock.h" |
27 | #include "sam9_smc.h" | ||
29 | 28 | ||
30 | /* -------------------------------------------------------------------- | 29 | /* -------------------------------------------------------------------- |
31 | * Clocks | 30 | * Clocks |
@@ -120,7 +119,7 @@ static struct clk ohci_clk = { | |||
120 | .type = CLK_TYPE_PERIPHERAL, | 119 | .type = CLK_TYPE_PERIPHERAL, |
121 | }; | 120 | }; |
122 | static struct clk macb_clk = { | 121 | static struct clk macb_clk = { |
123 | .name = "macb_clk", | 122 | .name = "pclk", |
124 | .pmc_mask = 1 << AT91SAM9260_ID_EMAC, | 123 | .pmc_mask = 1 << AT91SAM9260_ID_EMAC, |
125 | .type = CLK_TYPE_PERIPHERAL, | 124 | .type = CLK_TYPE_PERIPHERAL, |
126 | }; | 125 | }; |
@@ -190,6 +189,8 @@ static struct clk *periph_clocks[] __initdata = { | |||
190 | }; | 189 | }; |
191 | 190 | ||
192 | static struct clk_lookup periph_clocks_lookups[] = { | 191 | static struct clk_lookup periph_clocks_lookups[] = { |
192 | /* One additional fake clock for macb_hclk */ | ||
193 | CLKDEV_CON_ID("hclk", &macb_clk), | ||
193 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | 194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), |
194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 195 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | 196 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), |
@@ -209,6 +210,9 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
209 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), | 210 | CLKDEV_CON_DEV_ID("usart", "fffd8000.serial", &usart5_clk), |
210 | /* fake hclk clock */ | 211 | /* fake hclk clock */ |
211 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 212 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
213 | CLKDEV_CON_ID("pioA", &pioA_clk), | ||
214 | CLKDEV_CON_ID("pioB", &pioB_clk), | ||
215 | CLKDEV_CON_ID("pioC", &pioC_clk), | ||
212 | }; | 216 | }; |
213 | 217 | ||
214 | static struct clk_lookup usart_clocks_lookups[] = { | 218 | static struct clk_lookup usart_clocks_lookups[] = { |
@@ -270,28 +274,19 @@ void __init at91sam9260_set_console_clock(int id) | |||
270 | * GPIO | 274 | * GPIO |
271 | * -------------------------------------------------------------------- */ | 275 | * -------------------------------------------------------------------- */ |
272 | 276 | ||
273 | static struct at91_gpio_bank at91sam9260_gpio[] = { | 277 | static struct at91_gpio_bank at91sam9260_gpio[] __initdata = { |
274 | { | 278 | { |
275 | .id = AT91SAM9260_ID_PIOA, | 279 | .id = AT91SAM9260_ID_PIOA, |
276 | .offset = AT91_PIOA, | 280 | .regbase = AT91SAM9260_BASE_PIOA, |
277 | .clock = &pioA_clk, | ||
278 | }, { | 281 | }, { |
279 | .id = AT91SAM9260_ID_PIOB, | 282 | .id = AT91SAM9260_ID_PIOB, |
280 | .offset = AT91_PIOB, | 283 | .regbase = AT91SAM9260_BASE_PIOB, |
281 | .clock = &pioB_clk, | ||
282 | }, { | 284 | }, { |
283 | .id = AT91SAM9260_ID_PIOC, | 285 | .id = AT91SAM9260_ID_PIOC, |
284 | .offset = AT91_PIOC, | 286 | .regbase = AT91SAM9260_BASE_PIOC, |
285 | .clock = &pioC_clk, | ||
286 | } | 287 | } |
287 | }; | 288 | }; |
288 | 289 | ||
289 | static void at91sam9260_poweroff(void) | ||
290 | { | ||
291 | at91_sys_write(AT91_SHDW_CR, AT91_SHDW_KEY | AT91_SHDW_SHDW); | ||
292 | } | ||
293 | |||
294 | |||
295 | /* -------------------------------------------------------------------- | 290 | /* -------------------------------------------------------------------- |
296 | * AT91SAM9260 processor initialization | 291 | * AT91SAM9260 processor initialization |
297 | * -------------------------------------------------------------------- */ | 292 | * -------------------------------------------------------------------- */ |
@@ -325,10 +320,16 @@ static void __init at91sam9260_map_io(void) | |||
325 | } | 320 | } |
326 | } | 321 | } |
327 | 322 | ||
323 | static void __init at91sam9260_ioremap_registers(void) | ||
324 | { | ||
325 | at91_ioremap_shdwc(AT91SAM9260_BASE_SHDWC); | ||
326 | at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); | ||
327 | at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC); | ||
328 | } | ||
329 | |||
328 | static void __init at91sam9260_initialize(void) | 330 | static void __init at91sam9260_initialize(void) |
329 | { | 331 | { |
330 | arm_pm_restart = at91sam9_alt_restart; | 332 | arm_pm_restart = at91sam9_alt_restart; |
331 | pm_power_off = at91sam9260_poweroff; | ||
332 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) | 333 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) |
333 | | (1 << AT91SAM9260_ID_IRQ2); | 334 | | (1 << AT91SAM9260_ID_IRQ2); |
334 | 335 | ||
@@ -381,6 +382,7 @@ static unsigned int at91sam9260_default_irq_priority[NR_AIC_IRQS] __initdata = { | |||
381 | struct at91_init_soc __initdata at91sam9260_soc = { | 382 | struct at91_init_soc __initdata at91sam9260_soc = { |
382 | .map_io = at91sam9260_map_io, | 383 | .map_io = at91sam9260_map_io, |
383 | .default_irq_priority = at91sam9260_default_irq_priority, | 384 | .default_irq_priority = at91sam9260_default_irq_priority, |
385 | .ioremap_registers = at91sam9260_ioremap_registers, | ||
384 | .register_clocks = at91sam9260_register_clocks, | 386 | .register_clocks = at91sam9260_register_clocks, |
385 | .init = at91sam9260_initialize, | 387 | .init = at91sam9260_initialize, |
386 | }; | 388 | }; |