blob: a1e1482c6da860536e3e44980a501274527990d9 [file] [log] [blame]
Jean-Christophe PLAGNIOL-VILLARD21d08b92011-04-23 15:28:34 +08001/*
2 * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
3 *
4 * Under GPLv2
5 */
6
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +08007struct at91_init_soc {
Jean-Christophe PLAGNIOL-VILLARD8d39e0fd02012-08-16 17:36:55 +08008 int builtin;
Jean-Christophe PLAGNIOL-VILLARD546c8302013-06-01 16:40:11 +02009 u32 extern_irq;
Jean-Christophe PLAGNIOL-VILLARD92100c12011-04-23 15:28:34 +080010 unsigned int *default_irq_priority;
Jean-Christophe PLAGNIOL-VILLARD21d08b92011-04-23 15:28:34 +080011 void (*map_io)(void);
Jean-Christophe PLAGNIOL-VILLARDcfa5a1f2011-10-14 01:17:18 +080012 void (*ioremap_registers)(void);
Jean-Christophe PLAGNIOL-VILLARD51ddec72011-04-24 18:15:34 +080013 void (*register_clocks)(void);
Jean-Christophe PLAGNIOL-VILLARD46539372011-04-24 18:20:28 +080014 void (*init)(void);
Jean-Christophe PLAGNIOL-VILLARD21d08b92011-04-23 15:28:34 +080015};
16
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080017extern struct at91_init_soc at91_boot_soc;
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080018extern struct at91_init_soc at91rm9200_soc;
19extern struct at91_init_soc at91sam9260_soc;
20extern struct at91_init_soc at91sam9261_soc;
21extern struct at91_init_soc at91sam9263_soc;
22extern struct at91_init_soc at91sam9g45_soc;
23extern struct at91_init_soc at91sam9rl_soc;
24extern struct at91_init_soc at91sam9x5_soc;
Hong Xu02059682012-04-17 14:26:30 +080025extern struct at91_init_soc at91sam9n12_soc;
Ludovic Desroches8f4b4792013-03-22 13:24:12 +000026extern struct at91_init_soc sama5d3_soc;
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080027
Jean-Christophe PLAGNIOL-VILLARD8d39e0fd02012-08-16 17:36:55 +080028#define AT91_SOC_START(_name) \
Ludovic Desroches84ddb082013-03-22 13:24:09 +000029struct at91_init_soc __initdata _name##_soc \
Jean-Christophe PLAGNIOL-VILLARD8d39e0fd02012-08-16 17:36:55 +080030 __used \
31 = { \
32 .builtin = 1, \
33
34#define AT91_SOC_END \
35};
36
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080037static inline int at91_soc_is_enabled(void)
38{
Jean-Christophe PLAGNIOL-VILLARD8d39e0fd02012-08-16 17:36:55 +080039 return at91_boot_soc.builtin;
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080040}
41
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080042#if !defined(CONFIG_SOC_AT91RM9200)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080043#define at91rm9200_soc at91_boot_soc
44#endif
45
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080046#if !defined(CONFIG_SOC_AT91SAM9260)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080047#define at91sam9260_soc at91_boot_soc
48#endif
49
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080050#if !defined(CONFIG_SOC_AT91SAM9261)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080051#define at91sam9261_soc at91_boot_soc
52#endif
53
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080054#if !defined(CONFIG_SOC_AT91SAM9263)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080055#define at91sam9263_soc at91_boot_soc
56#endif
57
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080058#if !defined(CONFIG_SOC_AT91SAM9G45)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080059#define at91sam9g45_soc at91_boot_soc
60#endif
61
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080062#if !defined(CONFIG_SOC_AT91SAM9RL)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080063#define at91sam9rl_soc at91_boot_soc
64#endif
65
Jean-Christophe PLAGNIOL-VILLARD1e3ce2b2012-04-06 11:51:50 +080066#if !defined(CONFIG_SOC_AT91SAM9X5)
Jean-Christophe PLAGNIOL-VILLARD8c3583b2011-04-23 22:12:57 +080067#define at91sam9x5_soc at91_boot_soc
68#endif
Hong Xu02059682012-04-17 14:26:30 +080069
70#if !defined(CONFIG_SOC_AT91SAM9N12)
71#define at91sam9n12_soc at91_boot_soc
72#endif
Ludovic Desroches8f4b4792013-03-22 13:24:12 +000073
74#if !defined(CONFIG_SOC_SAMA5D3)
75#define sama5d3_soc at91_boot_soc
76#endif