2 * Copyright (C) 2005 Nokia Corporation
3 * Author: Paul Mundt <paul.mundt@nokia.com>
5 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
7 * Modified from the original mach-omap/omap2/board-generic.c did by Paul
8 * to support the OMAP2+ device tree boards with an unique board file.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/of_irq.h>
16 #include <linux/of_platform.h>
17 #include <linux/irqdomain.h>
19 #include <asm/mach/arch.h>
23 #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
24 #define intc_of_init NULL
26 #ifndef CONFIG_ARCH_OMAP4
27 #define gic_of_init NULL
30 static const struct of_device_id omap_dt_match_table
[] __initconst
= {
31 { .compatible
= "simple-bus", },
32 { .compatible
= "ti,omap-infra", },
36 static void __init
omap_generic_init(void)
38 omapdss_early_init_of();
40 pdata_quirks_init(omap_dt_match_table
);
45 #ifdef CONFIG_SOC_OMAP2420
46 static const char *const omap242x_boards_compat
[] __initconst
= {
51 DT_MACHINE_START(OMAP242X_DT
, "Generic OMAP2420 (Flattened Device Tree)")
52 .reserve
= omap_reserve
,
53 .map_io
= omap242x_map_io
,
54 .init_early
= omap2420_init_early
,
55 .init_machine
= omap_generic_init
,
56 .init_time
= omap2_sync32k_timer_init
,
57 .dt_compat
= omap242x_boards_compat
,
58 .restart
= omap2xxx_restart
,
62 #ifdef CONFIG_SOC_OMAP2430
63 static const char *const omap243x_boards_compat
[] __initconst
= {
68 DT_MACHINE_START(OMAP243X_DT
, "Generic OMAP2430 (Flattened Device Tree)")
69 .reserve
= omap_reserve
,
70 .map_io
= omap243x_map_io
,
71 .init_early
= omap2430_init_early
,
72 .init_machine
= omap_generic_init
,
73 .init_time
= omap2_sync32k_timer_init
,
74 .dt_compat
= omap243x_boards_compat
,
75 .restart
= omap2xxx_restart
,
79 #ifdef CONFIG_ARCH_OMAP3
80 /* Some boards need board name for legacy userspace in /proc/cpuinfo */
81 static const char *const n900_boards_compat
[] __initconst
= {
86 DT_MACHINE_START(OMAP3_N900_DT
, "Nokia RX-51 board")
87 .reserve
= omap_reserve
,
88 .map_io
= omap3_map_io
,
89 .init_early
= omap3430_init_early
,
90 .init_machine
= omap_generic_init
,
91 .init_late
= omap3_init_late
,
92 .init_time
= omap3_sync32k_timer_init
,
93 .dt_compat
= n900_boards_compat
,
94 .restart
= omap3xxx_restart
,
97 /* Generic omap3 boards, most boards can use these */
98 static const char *const omap3_boards_compat
[] __initconst
= {
104 DT_MACHINE_START(OMAP3_DT
, "Generic OMAP3 (Flattened Device Tree)")
105 .reserve
= omap_reserve
,
106 .map_io
= omap3_map_io
,
107 .init_early
= omap3430_init_early
,
108 .init_machine
= omap_generic_init
,
109 .init_late
= omap3_init_late
,
110 .init_time
= omap3_sync32k_timer_init
,
111 .dt_compat
= omap3_boards_compat
,
112 .restart
= omap3xxx_restart
,
115 static const char *const omap36xx_boards_compat
[] __initconst
= {
120 DT_MACHINE_START(OMAP36XX_DT
, "Generic OMAP36xx (Flattened Device Tree)")
121 .reserve
= omap_reserve
,
122 .map_io
= omap3_map_io
,
123 .init_early
= omap3630_init_early
,
124 .init_machine
= omap_generic_init
,
125 .init_late
= omap3_init_late
,
126 .init_time
= omap3_sync32k_timer_init
,
127 .dt_compat
= omap36xx_boards_compat
,
128 .restart
= omap3xxx_restart
,
131 static const char *const omap3_gp_boards_compat
[] __initconst
= {
133 "timll,omap3-devkit8000",
137 DT_MACHINE_START(OMAP3_GP_DT
, "Generic OMAP3-GP (Flattened Device Tree)")
138 .reserve
= omap_reserve
,
139 .map_io
= omap3_map_io
,
140 .init_early
= omap3430_init_early
,
141 .init_machine
= omap_generic_init
,
142 .init_late
= omap3_init_late
,
143 .init_time
= omap3_secure_sync32k_timer_init
,
144 .dt_compat
= omap3_gp_boards_compat
,
145 .restart
= omap3xxx_restart
,
148 static const char *const am3517_boards_compat
[] __initconst
= {
153 DT_MACHINE_START(AM3517_DT
, "Generic AM3517 (Flattened Device Tree)")
154 .reserve
= omap_reserve
,
155 .map_io
= omap3_map_io
,
156 .init_early
= am35xx_init_early
,
157 .init_machine
= omap_generic_init
,
158 .init_late
= omap3_init_late
,
159 .init_time
= omap3_gptimer_timer_init
,
160 .dt_compat
= am3517_boards_compat
,
161 .restart
= omap3xxx_restart
,
165 #ifdef CONFIG_SOC_AM33XX
166 static const char *const am33xx_boards_compat
[] __initconst
= {
171 DT_MACHINE_START(AM33XX_DT
, "Generic AM33XX (Flattened Device Tree)")
172 .reserve
= omap_reserve
,
173 .map_io
= am33xx_map_io
,
174 .init_early
= am33xx_init_early
,
175 .init_machine
= omap_generic_init
,
176 .init_late
= am33xx_init_late
,
177 .init_time
= omap3_gptimer_timer_init
,
178 .dt_compat
= am33xx_boards_compat
,
179 .restart
= am33xx_restart
,
183 #ifdef CONFIG_ARCH_OMAP4
184 static const char *const omap4_boards_compat
[] __initconst
= {
191 DT_MACHINE_START(OMAP4_DT
, "Generic OMAP4 (Flattened Device Tree)")
192 .l2c_aux_val
= OMAP_L2C_AUX_CTRL
,
193 .l2c_aux_mask
= 0xcf9fffff,
194 .l2c_write_sec
= omap4_l2c310_write_sec
,
195 .reserve
= omap_reserve
,
196 .smp
= smp_ops(omap4_smp_ops
),
197 .map_io
= omap4_map_io
,
198 .init_early
= omap4430_init_early
,
199 .init_irq
= omap_gic_of_init
,
200 .init_machine
= omap_generic_init
,
201 .init_late
= omap4430_init_late
,
202 .init_time
= omap4_local_timer_init
,
203 .dt_compat
= omap4_boards_compat
,
204 .restart
= omap44xx_restart
,
208 #ifdef CONFIG_SOC_OMAP5
209 static const char *const omap5_boards_compat
[] __initconst
= {
216 DT_MACHINE_START(OMAP5_DT
, "Generic OMAP5 (Flattened Device Tree)")
217 .reserve
= omap_reserve
,
218 .smp
= smp_ops(omap4_smp_ops
),
219 .map_io
= omap5_map_io
,
220 .init_early
= omap5_init_early
,
221 .init_irq
= omap_gic_of_init
,
222 .init_machine
= omap_generic_init
,
223 .init_late
= omap5_init_late
,
224 .init_time
= omap5_realtime_timer_init
,
225 .dt_compat
= omap5_boards_compat
,
226 .restart
= omap44xx_restart
,
230 #ifdef CONFIG_SOC_AM43XX
231 static const char *const am43_boards_compat
[] __initconst
= {
237 DT_MACHINE_START(AM43_DT
, "Generic AM43 (Flattened Device Tree)")
238 .l2c_aux_val
= OMAP_L2C_AUX_CTRL
,
239 .l2c_aux_mask
= 0xcf9fffff,
240 .l2c_write_sec
= omap4_l2c310_write_sec
,
241 .map_io
= am33xx_map_io
,
242 .init_early
= am43xx_init_early
,
243 .init_late
= am43xx_init_late
,
244 .init_irq
= omap_gic_of_init
,
245 .init_machine
= omap_generic_init
,
246 .init_time
= omap3_gptimer_timer_init
,
247 .dt_compat
= am43_boards_compat
,
248 .restart
= omap44xx_restart
,
252 #ifdef CONFIG_SOC_DRA7XX
253 static const char *const dra74x_boards_compat
[] __initconst
= {
261 DT_MACHINE_START(DRA74X_DT
, "Generic DRA74X (Flattened Device Tree)")
262 .reserve
= omap_reserve
,
263 .smp
= smp_ops(omap4_smp_ops
),
264 .map_io
= omap5_map_io
,
265 .init_early
= dra7xx_init_early
,
266 .init_late
= dra7xx_init_late
,
267 .init_irq
= omap_gic_of_init
,
268 .init_machine
= omap_generic_init
,
269 .init_time
= omap5_realtime_timer_init
,
270 .dt_compat
= dra74x_boards_compat
,
271 .restart
= omap44xx_restart
,
274 static const char *const dra72x_boards_compat
[] __initconst
= {
281 DT_MACHINE_START(DRA72X_DT
, "Generic DRA72X (Flattened Device Tree)")
282 .reserve
= omap_reserve
,
283 .map_io
= omap5_map_io
,
284 .init_early
= dra7xx_init_early
,
285 .init_late
= dra7xx_init_late
,
286 .init_irq
= omap_gic_of_init
,
287 .init_machine
= omap_generic_init
,
288 .init_time
= omap5_realtime_timer_init
,
289 .dt_compat
= dra72x_boards_compat
,
290 .restart
= omap44xx_restart
,