Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> |
| 3 | * |
| 4 | * Under GPLv2 |
| 5 | */ |
| 6 | |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 7 | struct at91_init_soc { |
Jean-Christophe PLAGNIOL-VILLARD | 8d39e0fd0 | 2012-08-16 17:36:55 +0800 | [diff] [blame] | 8 | int builtin; |
Jean-Christophe PLAGNIOL-VILLARD | 546c830 | 2013-06-01 16:40:11 +0200 | [diff] [blame] | 9 | u32 extern_irq; |
Jean-Christophe PLAGNIOL-VILLARD | 92100c1 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 10 | unsigned int *default_irq_priority; |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 11 | void (*map_io)(void); |
Jean-Christophe PLAGNIOL-VILLARD | cfa5a1f | 2011-10-14 01:17:18 +0800 | [diff] [blame] | 12 | void (*ioremap_registers)(void); |
Jean-Christophe PLAGNIOL-VILLARD | 51ddec7 | 2011-04-24 18:15:34 +0800 | [diff] [blame] | 13 | void (*register_clocks)(void); |
Maxime Ripard | 65f2ce9 | 2014-07-02 17:49:28 +0200 | [diff] [blame] | 14 | void (*register_devices)(void); |
Jean-Christophe PLAGNIOL-VILLARD | 4653937 | 2011-04-24 18:20:28 +0800 | [diff] [blame] | 15 | void (*init)(void); |
Maxime Ripard | d2992e5 | 2014-09-02 18:05:04 +0200 | [diff] [blame] | 16 | void (*init_time)(void); |
Jean-Christophe PLAGNIOL-VILLARD | 21d08b9 | 2011-04-23 15:28:34 +0800 | [diff] [blame] | 17 | }; |
| 18 | |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 19 | extern struct at91_init_soc at91_boot_soc; |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 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; |
Hong Xu | 0205968 | 2012-04-17 14:26:30 +0800 | [diff] [blame] | 27 | extern struct at91_init_soc at91sam9n12_soc; |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 28 | extern struct at91_init_soc sama5d3_soc; |
Nicolas Ferre | 2dc850b | 2014-09-15 18:15:54 +0200 | [diff] [blame] | 29 | extern struct at91_init_soc sama5d4_soc; |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 30 | |
Jean-Christophe PLAGNIOL-VILLARD | 8d39e0fd0 | 2012-08-16 17:36:55 +0800 | [diff] [blame] | 31 | #define AT91_SOC_START(_name) \ |
Ludovic Desroches | 84ddb08 | 2013-03-22 13:24:09 +0000 | [diff] [blame] | 32 | struct at91_init_soc __initdata _name##_soc \ |
Jean-Christophe PLAGNIOL-VILLARD | 8d39e0fd0 | 2012-08-16 17:36:55 +0800 | [diff] [blame] | 33 | __used \ |
| 34 | = { \ |
| 35 | .builtin = 1, \ |
| 36 | |
| 37 | #define AT91_SOC_END \ |
| 38 | }; |
| 39 | |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 40 | static inline int at91_soc_is_enabled(void) |
| 41 | { |
Jean-Christophe PLAGNIOL-VILLARD | 8d39e0fd0 | 2012-08-16 17:36:55 +0800 | [diff] [blame] | 42 | return at91_boot_soc.builtin; |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 43 | } |
| 44 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 45 | #if !defined(CONFIG_SOC_AT91RM9200) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 46 | #define at91rm9200_soc at91_boot_soc |
| 47 | #endif |
| 48 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 49 | #if !defined(CONFIG_SOC_AT91SAM9260) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 50 | #define at91sam9260_soc at91_boot_soc |
| 51 | #endif |
| 52 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 53 | #if !defined(CONFIG_SOC_AT91SAM9261) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 54 | #define at91sam9261_soc at91_boot_soc |
| 55 | #endif |
| 56 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 57 | #if !defined(CONFIG_SOC_AT91SAM9263) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 58 | #define at91sam9263_soc at91_boot_soc |
| 59 | #endif |
| 60 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 61 | #if !defined(CONFIG_SOC_AT91SAM9G45) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 62 | #define at91sam9g45_soc at91_boot_soc |
| 63 | #endif |
| 64 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 65 | #if !defined(CONFIG_SOC_AT91SAM9RL) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 66 | #define at91sam9rl_soc at91_boot_soc |
| 67 | #endif |
| 68 | |
Jean-Christophe PLAGNIOL-VILLARD | 1e3ce2b | 2012-04-06 11:51:50 +0800 | [diff] [blame] | 69 | #if !defined(CONFIG_SOC_AT91SAM9X5) |
Jean-Christophe PLAGNIOL-VILLARD | 8c3583b | 2011-04-23 22:12:57 +0800 | [diff] [blame] | 70 | #define at91sam9x5_soc at91_boot_soc |
| 71 | #endif |
Hong Xu | 0205968 | 2012-04-17 14:26:30 +0800 | [diff] [blame] | 72 | |
| 73 | #if !defined(CONFIG_SOC_AT91SAM9N12) |
| 74 | #define at91sam9n12_soc at91_boot_soc |
| 75 | #endif |
Ludovic Desroches | 8f4b479 | 2013-03-22 13:24:12 +0000 | [diff] [blame] | 76 | |
| 77 | #if !defined(CONFIG_SOC_SAMA5D3) |
| 78 | #define sama5d3_soc at91_boot_soc |
| 79 | #endif |
Nicolas Ferre | 2dc850b | 2014-09-15 18:15:54 +0200 | [diff] [blame] | 80 | |
| 81 | #if !defined(CONFIG_SOC_SAMA5D4) |
| 82 | #define sama5d4_soc at91_boot_soc |
| 83 | #endif |