2 * Copyright (C) 2007 Atmel Corporation.
3 * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
8 #include <linux/module.h>
11 #include <asm/mach/map.h>
13 #include <mach/hardware.h>
19 struct at91_soc __initdata at91_boot_soc;
21 void __init at91_init_irq_default(void)
23 at91_init_interrupts(at91_boot_soc.default_irq_priority);
26 void __init at91_init_interrupts(unsigned int *priority)
28 /* Initialize the AIC interrupt controller */
29 at91_aic_init(priority);
31 /* Enable GPIO interrupts */
32 at91_gpio_irq_setup();
35 static struct map_desc at91_io_desc __initdata = {
36 .virtual = AT91_VA_BASE_SYS,
37 .pfn = __phys_to_pfn(AT91_BASE_SYS),
42 void __init at91_map_io(void)
45 iotable_init(&at91_io_desc, 1);
47 if (cpu_is_at91cap9())
48 at91_boot_soc = at91cap9_soc;
49 else if (cpu_is_at91rm9200())
50 at91_boot_soc = at91rm9200_soc;
51 else if (cpu_is_at91sam9260())
52 at91_boot_soc = at91sam9260_soc;
53 else if (cpu_is_at91sam9261())
54 at91_boot_soc = at91sam9261_soc;
55 else if (cpu_is_at91sam9263())
56 at91_boot_soc = at91sam9263_soc;
57 else if (cpu_is_at91sam9g10())
58 at91_boot_soc = at91sam9261_soc;
59 else if (cpu_is_at91sam9g20())
60 at91_boot_soc = at91sam9260_soc;
61 else if (cpu_is_at91sam9g45())
62 at91_boot_soc = at91sam9g45_soc;
63 else if (cpu_is_at91sam9rl())
64 at91_boot_soc = at91sam9rl_soc;
65 else if (cpu_is_at91sam9x5())
66 at91_boot_soc = at91sam9x5_soc;
68 panic("Impossible to detect the SOC type");
70 if (at91_boot_soc.map_io)
71 at91_boot_soc.map_io();
74 void __init at91_initialize(unsigned long main_clock)
76 at91_boot_soc.init(main_clock);