aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9261.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/at91sam9261.c')
-rw-r--r--arch/arm/mach-at91/at91sam9261.c62
1 files changed, 11 insertions, 51 deletions
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index c1483168c97a..d522b47e30b5 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -22,36 +22,10 @@
22#include <mach/at91_rstc.h> 22#include <mach/at91_rstc.h>
23#include <mach/at91_shdwc.h> 23#include <mach/at91_shdwc.h>
24 24
25#include "soc.h"
25#include "generic.h" 26#include "generic.h"
26#include "clock.h" 27#include "clock.h"
27 28
28static struct map_desc at91sam9261_io_desc[] __initdata = {
29 {
30 .virtual = AT91_VA_BASE_SYS,
31 .pfn = __phys_to_pfn(AT91_BASE_SYS),
32 .length = SZ_16K,
33 .type = MT_DEVICE,
34 },
35};
36
37static struct map_desc at91sam9261_sram_desc[] __initdata = {
38 {
39 .virtual = AT91_IO_VIRT_BASE - AT91SAM9261_SRAM_SIZE,
40 .pfn = __phys_to_pfn(AT91SAM9261_SRAM_BASE),
41 .length = AT91SAM9261_SRAM_SIZE,
42 .type = MT_DEVICE,
43 },
44};
45
46static struct map_desc at91sam9g10_sram_desc[] __initdata = {
47 {
48 .virtual = AT91_IO_VIRT_BASE - AT91SAM9G10_SRAM_SIZE,
49 .pfn = __phys_to_pfn(AT91SAM9G10_SRAM_BASE),
50 .length = AT91SAM9G10_SRAM_SIZE,
51 .type = MT_DEVICE,
52 },
53};
54
55/* -------------------------------------------------------------------- 29/* --------------------------------------------------------------------
56 * Clocks 30 * Clocks
57 * -------------------------------------------------------------------- */ 31 * -------------------------------------------------------------------- */
@@ -302,30 +276,21 @@ static void at91sam9261_poweroff(void)
302 * AT91SAM9261 processor initialization 276 * AT91SAM9261 processor initialization
303 * -------------------------------------------------------------------- */ 277 * -------------------------------------------------------------------- */
304 278
305void __init at91sam9261_map_io(void) 279static void __init at91sam9261_map_io(void)
306{ 280{
307 /* Map peripherals */
308 iotable_init(at91sam9261_io_desc, ARRAY_SIZE(at91sam9261_io_desc));
309
310 if (cpu_is_at91sam9g10()) 281 if (cpu_is_at91sam9g10())
311 iotable_init(at91sam9g10_sram_desc, ARRAY_SIZE(at91sam9g10_sram_desc)); 282 at91_init_sram(0, AT91SAM9G10_SRAM_BASE, AT91SAM9G10_SRAM_SIZE);
312 else 283 else
313 iotable_init(at91sam9261_sram_desc, ARRAY_SIZE(at91sam9261_sram_desc)); 284 at91_init_sram(0, AT91SAM9261_SRAM_BASE, AT91SAM9261_SRAM_SIZE);
314} 285}
315 286
316void __init at91sam9261_initialize(unsigned long main_clock) 287static void __init at91sam9261_initialize(void)
317{ 288{
318 at91_arch_reset = at91sam9_alt_reset; 289 at91_arch_reset = at91sam9_alt_reset;
319 pm_power_off = at91sam9261_poweroff; 290 pm_power_off = at91sam9261_poweroff;
320 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1) 291 at91_extern_irq = (1 << AT91SAM9261_ID_IRQ0) | (1 << AT91SAM9261_ID_IRQ1)
321 | (1 << AT91SAM9261_ID_IRQ2); 292 | (1 << AT91SAM9261_ID_IRQ2);
322 293
323 /* Init clock subsystem */
324 at91_clock_init(main_clock);
325
326 /* Register the processor-specific clocks */
327 at91sam9261_register_clocks();
328
329 /* Register GPIO subsystem */ 294 /* Register GPIO subsystem */
330 at91_gpio_init(at91sam9261_gpio, 3); 295 at91_gpio_init(at91sam9261_gpio, 3);
331} 296}
@@ -372,14 +337,9 @@ static unsigned int at91sam9261_default_irq_priority[NR_AIC_IRQS] __initdata = {
372 0, /* Advanced Interrupt Controller */ 337 0, /* Advanced Interrupt Controller */
373}; 338};
374 339
375void __init at91sam9261_init_interrupts(unsigned int priority[NR_AIC_IRQS]) 340struct at91_init_soc __initdata at91sam9261_soc = {
376{ 341 .map_io = at91sam9261_map_io,
377 if (!priority) 342 .default_irq_priority = at91sam9261_default_irq_priority,
378 priority = at91sam9261_default_irq_priority; 343 .register_clocks = at91sam9261_register_clocks,
379 344 .init = at91sam9261_initialize,
380 /* Initialize the AIC interrupt controller */ 345};
381 at91_aic_init(priority);
382
383 /* Enable GPIO interrupts */
384 at91_gpio_irq_setup();
385}