Merge tag 'at91-drivers2' of git://github.com/at91linux/linux-at91 into next/drivers
[cascardo/linux.git] / arch / arm / mach-at91 / soc.h
1 /*
2  * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
3  *
4  * Under GPLv2
5  */
6
7 struct at91_init_soc {
8         int builtin;
9         u32 extern_irq;
10         unsigned int *default_irq_priority;
11         void (*map_io)(void);
12         void (*ioremap_registers)(void);
13         void (*register_clocks)(void);
14         void (*register_devices)(void);
15         void (*init)(void);
16         void (*init_time)(void);
17 };
18
19 extern struct at91_init_soc at91_boot_soc;
20 extern struct at91_init_soc at91rm9200_soc;
21 extern struct at91_init_soc at91sam9260_soc;
22 extern struct at91_init_soc at91sam9261_soc;
23 extern struct at91_init_soc at91sam9263_soc;
24 extern struct at91_init_soc at91sam9g45_soc;
25 extern struct at91_init_soc at91sam9rl_soc;
26 extern struct at91_init_soc at91sam9x5_soc;
27 extern struct at91_init_soc at91sam9n12_soc;
28 extern struct at91_init_soc sama5d3_soc;
29
30 #define AT91_SOC_START(_name)                           \
31 struct at91_init_soc __initdata _name##_soc             \
32  __used                                                 \
33                                                 = {     \
34         .builtin        = 1,                            \
35
36 #define AT91_SOC_END                                    \
37 };
38
39 static inline int at91_soc_is_enabled(void)
40 {
41         return at91_boot_soc.builtin;
42 }
43
44 #if !defined(CONFIG_SOC_AT91RM9200)
45 #define at91rm9200_soc  at91_boot_soc
46 #endif
47
48 #if !defined(CONFIG_SOC_AT91SAM9260)
49 #define at91sam9260_soc at91_boot_soc
50 #endif
51
52 #if !defined(CONFIG_SOC_AT91SAM9261)
53 #define at91sam9261_soc at91_boot_soc
54 #endif
55
56 #if !defined(CONFIG_SOC_AT91SAM9263)
57 #define at91sam9263_soc at91_boot_soc
58 #endif
59
60 #if !defined(CONFIG_SOC_AT91SAM9G45)
61 #define at91sam9g45_soc at91_boot_soc
62 #endif
63
64 #if !defined(CONFIG_SOC_AT91SAM9RL)
65 #define at91sam9rl_soc  at91_boot_soc
66 #endif
67
68 #if !defined(CONFIG_SOC_AT91SAM9X5)
69 #define at91sam9x5_soc  at91_boot_soc
70 #endif
71
72 #if !defined(CONFIG_SOC_AT91SAM9N12)
73 #define at91sam9n12_soc at91_boot_soc
74 #endif
75
76 #if !defined(CONFIG_SOC_SAMA5D3)
77 #define sama5d3_soc     at91_boot_soc
78 #endif