Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/bcm2835', 'spi/fix/doc'...
[deliverable/linux.git] / arch / arm / mach-omap2 / board-generic.c
CommitLineData
1dbae815 1/*
1dbae815
TL
2 * Copyright (C) 2005 Nokia Corporation
3 * Author: Paul Mundt <paul.mundt@nokia.com>
4 *
8d61649d 5 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
1dbae815 6 *
8d61649d
BC
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.
1dbae815
TL
9 *
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.
13 */
8d61649d 14#include <linux/io.h>
fbf75da7 15#include <linux/of_irq.h>
8d61649d
BC
16#include <linux/of_platform.h>
17#include <linux/irqdomain.h>
1dbae815 18
1dbae815 19#include <asm/mach/arch.h>
1dbae815 20
4e65331c 21#include "common.h"
8d61649d 22
75a57fe9 23#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
c4082d49 24#define intc_of_init NULL
75a57fe9
TL
25#endif
26#ifndef CONFIG_ARCH_OMAP4
27#define gic_of_init NULL
28#endif
29
31957609 30static const struct of_device_id omap_dt_match_table[] __initconst = {
8d61649d
BC
31 { .compatible = "simple-bus", },
32 { .compatible = "ti,omap-infra", },
33 { }
b3c6df3a
PW
34};
35
1dbae815
TL
36static void __init omap_generic_init(void)
37{
6a0e6b38
TV
38 omapdss_early_init_of();
39
8651bd8c 40 pdata_quirks_init(omap_dt_match_table);
dcdf407b
TV
41
42 omapdss_init_of();
1dbae815
TL
43}
44
0e02a8c1 45#ifdef CONFIG_SOC_OMAP2420
58cda01e 46static const char *const omap242x_boards_compat[] __initconst = {
8d61649d
BC
47 "ti,omap2420",
48 NULL,
49};
50
51DT_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,
8d61649d 55 .init_machine = omap_generic_init,
6bb27d73 56 .init_time = omap2_sync32k_timer_init,
8d61649d 57 .dt_compat = omap242x_boards_compat,
187e3e06 58 .restart = omap2xxx_restart,
8d61649d
BC
59MACHINE_END
60#endif
61
0e02a8c1 62#ifdef CONFIG_SOC_OMAP2430
58cda01e 63static const char *const omap243x_boards_compat[] __initconst = {
8d61649d
BC
64 "ti,omap2430",
65 NULL,
66};
67
68DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
71ee7dad 69 .reserve = omap_reserve,
8d61649d
BC
70 .map_io = omap243x_map_io,
71 .init_early = omap2430_init_early,
1dbae815 72 .init_machine = omap_generic_init,
6bb27d73 73 .init_time = omap2_sync32k_timer_init,
8d61649d 74 .dt_compat = omap243x_boards_compat,
187e3e06 75 .restart = omap2xxx_restart,
8d61649d
BC
76MACHINE_END
77#endif
78
0e02a8c1 79#ifdef CONFIG_ARCH_OMAP3
71c4f602
TL
80/* Some boards need board name for legacy userspace in /proc/cpuinfo */
81static const char *const n900_boards_compat[] __initconst = {
82 "nokia,omap3-n900",
83 NULL,
84};
85
86DT_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,
95MACHINE_END
96
97/* Generic omap3 boards, most boards can use these */
58cda01e 98static const char *const omap3_boards_compat[] __initconst = {
b83a08fe 99 "ti,omap3430",
8d61649d
BC
100 "ti,omap3",
101 NULL,
102};
103
104DT_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,
93651b85 108 .init_machine = omap_generic_init,
990fa4f5 109 .init_late = omap3_init_late,
6bb27d73 110 .init_time = omap3_sync32k_timer_init,
8d61649d 111 .dt_compat = omap3_boards_compat,
187e3e06 112 .restart = omap3xxx_restart,
8d61649d 113MACHINE_END
7dd9d502 114
58cda01e 115static const char *const omap36xx_boards_compat[] __initconst = {
016c12d2
NM
116 "ti,omap36xx",
117 NULL,
118};
119
120DT_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,
016c12d2
NM
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,
129MACHINE_END
130
58cda01e 131static const char *const omap3_gp_boards_compat[] __initconst = {
7dd9d502 132 "ti,omap3-beagle",
4bfe6341 133 "timll,omap3-devkit8000",
7dd9d502
JH
134 NULL,
135};
136
137DT_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,
7dd9d502 141 .init_machine = omap_generic_init,
990fa4f5 142 .init_late = omap3_init_late,
6bb27d73 143 .init_time = omap3_secure_sync32k_timer_init,
7dd9d502 144 .dt_compat = omap3_gp_boards_compat,
d01e4afd 145 .restart = omap3xxx_restart,
8d61649d 146MACHINE_END
caef4ee8 147
58cda01e 148static const char *const am3517_boards_compat[] __initconst = {
caef4ee8
NM
149 "ti,am3517",
150 NULL,
151};
152
153DT_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,
caef4ee8
NM
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,
162MACHINE_END
8d61649d
BC
163#endif
164
abf8cc1d
TL
165#ifdef CONFIG_SOC_TI81XX
166static const char *const ti814x_boards_compat[] __initconst = {
167 "ti,dm8148",
168 "ti,dm814",
169 NULL,
170};
171
9fd274c0 172DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)")
abf8cc1d
TL
173 .reserve = omap_reserve,
174 .map_io = ti81xx_map_io,
175 .init_early = ti814x_init_early,
176 .init_machine = omap_generic_init,
177 .init_late = ti81xx_init_late,
178 .init_time = omap3_gptimer_timer_init,
179 .dt_compat = ti814x_boards_compat,
180 .restart = ti81xx_restart,
181MACHINE_END
182
183static const char *const ti816x_boards_compat[] __initconst = {
184 "ti,dm8168",
185 "ti,dm816",
186 NULL,
187};
188
189DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)")
190 .reserve = omap_reserve,
191 .map_io = ti81xx_map_io,
192 .init_early = ti816x_init_early,
193 .init_machine = omap_generic_init,
194 .init_late = ti81xx_init_late,
195 .init_time = omap3_gptimer_timer_init,
196 .dt_compat = ti816x_boards_compat,
197 .restart = ti81xx_restart,
198MACHINE_END
199#endif
200
08f30989 201#ifdef CONFIG_SOC_AM33XX
58cda01e 202static const char *const am33xx_boards_compat[] __initconst = {
08f30989
AM
203 "ti,am33xx",
204 NULL,
205};
206
207DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
208 .reserve = omap_reserve,
209 .map_io = am33xx_map_io,
210 .init_early = am33xx_init_early,
08f30989 211 .init_machine = omap_generic_init,
765e7a06 212 .init_late = am33xx_init_late,
00ea4d56 213 .init_time = omap3_gptimer_timer_init,
08f30989 214 .dt_compat = am33xx_boards_compat,
14e067c1 215 .restart = am33xx_restart,
08f30989
AM
216MACHINE_END
217#endif
218
0e02a8c1 219#ifdef CONFIG_ARCH_OMAP4
58cda01e 220static const char *const omap4_boards_compat[] __initconst = {
b83a08fe
NM
221 "ti,omap4460",
222 "ti,omap4430",
8d61649d
BC
223 "ti,omap4",
224 NULL,
225};
226
227DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
944e9df1
MS
228 .l2c_aux_val = OMAP_L2C_AUX_CTRL,
229 .l2c_aux_mask = 0xcf9fffff,
230 .l2c_write_sec = omap4_l2c310_write_sec,
8d61649d 231 .reserve = omap_reserve,
06915321 232 .smp = smp_ops(omap4_smp_ops),
8d61649d
BC
233 .map_io = omap4_map_io,
234 .init_early = omap4430_init_early,
c4082d49 235 .init_irq = omap_gic_of_init,
93651b85 236 .init_machine = omap_generic_init,
bbd707ac 237 .init_late = omap4430_init_late,
6bb27d73 238 .init_time = omap4_local_timer_init,
8d61649d 239 .dt_compat = omap4_boards_compat,
187e3e06 240 .restart = omap44xx_restart,
1dbae815 241MACHINE_END
8d61649d 242#endif
0c1b6fac
S
243
244#ifdef CONFIG_SOC_OMAP5
58cda01e 245static const char *const omap5_boards_compat[] __initconst = {
b83a08fe
NM
246 "ti,omap5432",
247 "ti,omap5430",
0c1b6fac
S
248 "ti,omap5",
249 NULL,
250};
251
252DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
253 .reserve = omap_reserve,
06915321 254 .smp = smp_ops(omap4_smp_ops),
0c1b6fac
S
255 .map_io = omap5_map_io,
256 .init_early = omap5_init_early,
257 .init_irq = omap_gic_of_init,
0c1b6fac 258 .init_machine = omap_generic_init,
765e7a06 259 .init_late = omap5_init_late,
6bb27d73 260 .init_time = omap5_realtime_timer_init,
0c1b6fac 261 .dt_compat = omap5_boards_compat,
187e3e06 262 .restart = omap44xx_restart,
0c1b6fac
S
263MACHINE_END
264#endif
bb256f80
AM
265
266#ifdef CONFIG_SOC_AM43XX
58cda01e 267static const char *const am43_boards_compat[] __initconst = {
b83a08fe 268 "ti,am4372",
bb256f80
AM
269 "ti,am43",
270 NULL,
271};
272
273DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
944e9df1
MS
274 .l2c_aux_val = OMAP_L2C_AUX_CTRL,
275 .l2c_aux_mask = 0xcf9fffff,
276 .l2c_write_sec = omap4_l2c310_write_sec,
bb256f80
AM
277 .map_io = am33xx_map_io,
278 .init_early = am43xx_init_early,
765e7a06 279 .init_late = am43xx_init_late,
bb256f80
AM
280 .init_irq = omap_gic_of_init,
281 .init_machine = omap_generic_init,
5b5c0135 282 .init_time = omap3_gptimer_timer_init,
bb256f80 283 .dt_compat = am43_boards_compat,
a7daf64a 284 .restart = omap44xx_restart,
bb256f80
AM
285MACHINE_END
286#endif
439bf39e
S
287
288#ifdef CONFIG_SOC_DRA7XX
58cda01e 289static const char *const dra74x_boards_compat[] __initconst = {
0e0cb99d
NM
290 "ti,am5728",
291 "ti,am5726",
44e97ff6 292 "ti,dra742",
439bf39e
S
293 "ti,dra7",
294 NULL,
295};
296
44e97ff6 297DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
439bf39e
S
298 .reserve = omap_reserve,
299 .smp = smp_ops(omap4_smp_ops),
ea827ad5 300 .map_io = dra7xx_map_io,
439bf39e 301 .init_early = dra7xx_init_early,
765e7a06 302 .init_late = dra7xx_init_late,
439bf39e
S
303 .init_irq = omap_gic_of_init,
304 .init_machine = omap_generic_init,
305 .init_time = omap5_realtime_timer_init,
44e97ff6
RN
306 .dt_compat = dra74x_boards_compat,
307 .restart = omap44xx_restart,
308MACHINE_END
309
58cda01e 310static const char *const dra72x_boards_compat[] __initconst = {
0e0cb99d
NM
311 "ti,am5718",
312 "ti,am5716",
44e97ff6
RN
313 "ti,dra722",
314 NULL,
315};
316
317DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
318 .reserve = omap_reserve,
ea827ad5 319 .map_io = dra7xx_map_io,
44e97ff6
RN
320 .init_early = dra7xx_init_early,
321 .init_late = dra7xx_init_late,
322 .init_irq = omap_gic_of_init,
323 .init_machine = omap_generic_init,
324 .init_time = omap5_realtime_timer_init,
325 .dt_compat = dra72x_boards_compat,
1d597b07 326 .restart = omap44xx_restart,
439bf39e
S
327MACHINE_END
328#endif
This page took 0.729142 seconds and 5 git commands to generate.