xref: /linux/arch/arm/mach-omap2/board-generic.c (revision 44e97ff6dc455a74bd76029a02ce6559e846f1c9)
11dbae815STony Lindgren /*
21dbae815STony Lindgren  * Copyright (C) 2005 Nokia Corporation
31dbae815STony Lindgren  * Author: Paul Mundt <paul.mundt@nokia.com>
41dbae815STony Lindgren  *
58d61649dSBenoit Cousson  * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
61dbae815STony Lindgren  *
78d61649dSBenoit Cousson  * Modified from the original mach-omap/omap2/board-generic.c did by Paul
88d61649dSBenoit Cousson  * to support the OMAP2+ device tree boards with an unique board file.
91dbae815STony Lindgren  *
101dbae815STony Lindgren  * This program is free software; you can redistribute it and/or modify
111dbae815STony Lindgren  * it under the terms of the GNU General Public License version 2 as
121dbae815STony Lindgren  * published by the Free Software Foundation.
131dbae815STony Lindgren  */
148d61649dSBenoit Cousson #include <linux/io.h>
15fbf75da7SBenoit Cousson #include <linux/of_irq.h>
168d61649dSBenoit Cousson #include <linux/of_platform.h>
178d61649dSBenoit Cousson #include <linux/irqdomain.h>
181dbae815STony Lindgren 
191dbae815STony Lindgren #include <asm/mach/arch.h>
201dbae815STony Lindgren 
214e65331cSTony Lindgren #include "common.h"
221dbae815STony Lindgren 
2375a57fe9STony Lindgren #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
24c4082d49SR Sricharan #define intc_of_init	NULL
2575a57fe9STony Lindgren #endif
2675a57fe9STony Lindgren #ifndef CONFIG_ARCH_OMAP4
2775a57fe9STony Lindgren #define gic_of_init		NULL
2875a57fe9STony Lindgren #endif
2975a57fe9STony Lindgren 
308d61649dSBenoit Cousson static struct of_device_id omap_dt_match_table[] __initdata = {
318d61649dSBenoit Cousson 	{ .compatible = "simple-bus", },
328d61649dSBenoit Cousson 	{ .compatible = "ti,omap-infra", },
338d61649dSBenoit Cousson 	{ }
34b3c6df3aSPaul Walmsley };
35b3c6df3aSPaul Walmsley 
361dbae815STony Lindgren static void __init omap_generic_init(void)
371dbae815STony Lindgren {
386a0e6b38STomi Valkeinen 	omapdss_early_init_of();
396a0e6b38STomi Valkeinen 
408651bd8cSTony Lindgren 	pdata_quirks_init(omap_dt_match_table);
41dcdf407bSTomi Valkeinen 
42dcdf407bSTomi Valkeinen 	omapdss_init_of();
431dbae815STony Lindgren }
441dbae815STony Lindgren 
450e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2420
461509e24bSRajendra Nayak static const char *omap242x_boards_compat[] __initconst = {
478d61649dSBenoit Cousson 	"ti,omap2420",
488d61649dSBenoit Cousson 	NULL,
498d61649dSBenoit Cousson };
501dbae815STony Lindgren 
518d61649dSBenoit Cousson DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
5271ee7dadSRussell King 	.reserve	= omap_reserve,
538d61649dSBenoit Cousson 	.map_io		= omap242x_map_io,
548d61649dSBenoit Cousson 	.init_early	= omap2420_init_early,
55c4082d49SR Sricharan 	.init_irq	= omap_intc_of_init,
56b755706cSBenoit Cousson 	.handle_irq	= omap2_intc_handle_irq,
571dbae815STony Lindgren 	.init_machine	= omap_generic_init,
586bb27d73SStephen Warren 	.init_time	= omap2_sync32k_timer_init,
598d61649dSBenoit Cousson 	.dt_compat	= omap242x_boards_compat,
60187e3e06SPaul Walmsley 	.restart	= omap2xxx_restart,
611dbae815STony Lindgren MACHINE_END
628d61649dSBenoit Cousson #endif
638d61649dSBenoit Cousson 
640e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2430
651509e24bSRajendra Nayak static const char *omap243x_boards_compat[] __initconst = {
668d61649dSBenoit Cousson 	"ti,omap2430",
678d61649dSBenoit Cousson 	NULL,
688d61649dSBenoit Cousson };
698d61649dSBenoit Cousson 
708d61649dSBenoit Cousson DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
718d61649dSBenoit Cousson 	.reserve	= omap_reserve,
728d61649dSBenoit Cousson 	.map_io		= omap243x_map_io,
738d61649dSBenoit Cousson 	.init_early	= omap2430_init_early,
74c4082d49SR Sricharan 	.init_irq	= omap_intc_of_init,
756b2f55d7SMarc Zyngier 	.handle_irq	= omap2_intc_handle_irq,
768d61649dSBenoit Cousson 	.init_machine	= omap_generic_init,
776bb27d73SStephen Warren 	.init_time	= omap2_sync32k_timer_init,
788d61649dSBenoit Cousson 	.dt_compat	= omap243x_boards_compat,
79187e3e06SPaul Walmsley 	.restart	= omap2xxx_restart,
808d61649dSBenoit Cousson MACHINE_END
818d61649dSBenoit Cousson #endif
828d61649dSBenoit Cousson 
830e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP3
841509e24bSRajendra Nayak static const char *omap3_boards_compat[] __initconst = {
85b83a08feSNishanth Menon 	"ti,omap3430",
868d61649dSBenoit Cousson 	"ti,omap3",
878d61649dSBenoit Cousson 	NULL,
888d61649dSBenoit Cousson };
898d61649dSBenoit Cousson 
908d61649dSBenoit Cousson DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
918d61649dSBenoit Cousson 	.reserve	= omap_reserve,
928d61649dSBenoit Cousson 	.map_io		= omap3_map_io,
938d61649dSBenoit Cousson 	.init_early	= omap3430_init_early,
94c4082d49SR Sricharan 	.init_irq	= omap_intc_of_init,
95b755706cSBenoit Cousson 	.handle_irq	= omap3_intc_handle_irq,
9693651b85SBenoit Cousson 	.init_machine	= omap_generic_init,
97990fa4f5SRajendra Nayak 	.init_late	= omap3_init_late,
986bb27d73SStephen Warren 	.init_time	= omap3_sync32k_timer_init,
998d61649dSBenoit Cousson 	.dt_compat	= omap3_boards_compat,
100187e3e06SPaul Walmsley 	.restart	= omap3xxx_restart,
1018d61649dSBenoit Cousson MACHINE_END
1027dd9d502SJon Hunter 
1031509e24bSRajendra Nayak static const char *omap36xx_boards_compat[] __initconst = {
104016c12d2SNishanth Menon 	"ti,omap36xx",
105016c12d2SNishanth Menon 	NULL,
106016c12d2SNishanth Menon };
107016c12d2SNishanth Menon 
108016c12d2SNishanth Menon DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)")
109016c12d2SNishanth Menon 	.reserve	= omap_reserve,
110016c12d2SNishanth Menon 	.map_io		= omap3_map_io,
111016c12d2SNishanth Menon 	.init_early	= omap3630_init_early,
112016c12d2SNishanth Menon 	.init_irq	= omap_intc_of_init,
113016c12d2SNishanth Menon 	.handle_irq	= omap3_intc_handle_irq,
114016c12d2SNishanth Menon 	.init_machine	= omap_generic_init,
115016c12d2SNishanth Menon 	.init_late	= omap3_init_late,
116016c12d2SNishanth Menon 	.init_time	= omap3_sync32k_timer_init,
117016c12d2SNishanth Menon 	.dt_compat	= omap36xx_boards_compat,
118016c12d2SNishanth Menon 	.restart	= omap3xxx_restart,
119016c12d2SNishanth Menon MACHINE_END
120016c12d2SNishanth Menon 
1211509e24bSRajendra Nayak static const char *omap3_gp_boards_compat[] __initconst = {
1227dd9d502SJon Hunter 	"ti,omap3-beagle",
1234bfe6341SAnil Kumar 	"timll,omap3-devkit8000",
1247dd9d502SJon Hunter 	NULL,
1257dd9d502SJon Hunter };
1267dd9d502SJon Hunter 
1277dd9d502SJon Hunter DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
1287dd9d502SJon Hunter 	.reserve	= omap_reserve,
1297dd9d502SJon Hunter 	.map_io		= omap3_map_io,
1307dd9d502SJon Hunter 	.init_early	= omap3430_init_early,
1317dd9d502SJon Hunter 	.init_irq	= omap_intc_of_init,
1327dd9d502SJon Hunter 	.handle_irq	= omap3_intc_handle_irq,
1337dd9d502SJon Hunter 	.init_machine	= omap_generic_init,
134990fa4f5SRajendra Nayak 	.init_late	= omap3_init_late,
1356bb27d73SStephen Warren 	.init_time	= omap3_secure_sync32k_timer_init,
1367dd9d502SJon Hunter 	.dt_compat	= omap3_gp_boards_compat,
137d01e4afdSLinus Torvalds 	.restart	= omap3xxx_restart,
1388d61649dSBenoit Cousson MACHINE_END
139caef4ee8SNishanth Menon 
1401509e24bSRajendra Nayak static const char *am3517_boards_compat[] __initconst = {
141caef4ee8SNishanth Menon 	"ti,am3517",
142caef4ee8SNishanth Menon 	NULL,
143caef4ee8SNishanth Menon };
144caef4ee8SNishanth Menon 
145caef4ee8SNishanth Menon DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)")
146caef4ee8SNishanth Menon 	.reserve	= omap_reserve,
147caef4ee8SNishanth Menon 	.map_io		= omap3_map_io,
148caef4ee8SNishanth Menon 	.init_early	= am35xx_init_early,
149caef4ee8SNishanth Menon 	.init_irq	= omap_intc_of_init,
150caef4ee8SNishanth Menon 	.handle_irq	= omap3_intc_handle_irq,
151caef4ee8SNishanth Menon 	.init_machine	= omap_generic_init,
152caef4ee8SNishanth Menon 	.init_late	= omap3_init_late,
153caef4ee8SNishanth Menon 	.init_time	= omap3_gptimer_timer_init,
154caef4ee8SNishanth Menon 	.dt_compat	= am3517_boards_compat,
155caef4ee8SNishanth Menon 	.restart	= omap3xxx_restart,
156caef4ee8SNishanth Menon MACHINE_END
1578d61649dSBenoit Cousson #endif
1588d61649dSBenoit Cousson 
15908f30989SAfzal Mohammed #ifdef CONFIG_SOC_AM33XX
1601509e24bSRajendra Nayak static const char *am33xx_boards_compat[] __initconst = {
16108f30989SAfzal Mohammed 	"ti,am33xx",
16208f30989SAfzal Mohammed 	NULL,
16308f30989SAfzal Mohammed };
16408f30989SAfzal Mohammed 
16508f30989SAfzal Mohammed DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
16608f30989SAfzal Mohammed 	.reserve	= omap_reserve,
16708f30989SAfzal Mohammed 	.map_io		= am33xx_map_io,
16808f30989SAfzal Mohammed 	.init_early	= am33xx_init_early,
169c4082d49SR Sricharan 	.init_irq	= omap_intc_of_init,
17008f30989SAfzal Mohammed 	.handle_irq	= omap3_intc_handle_irq,
17108f30989SAfzal Mohammed 	.init_machine	= omap_generic_init,
172765e7a06SNishanth Menon 	.init_late	= am33xx_init_late,
17300ea4d56SJon Hunter 	.init_time	= omap3_gptimer_timer_init,
17408f30989SAfzal Mohammed 	.dt_compat	= am33xx_boards_compat,
17514e067c1SJean-Sebastien A. Beaudry 	.restart	= am33xx_restart,
17608f30989SAfzal Mohammed MACHINE_END
17708f30989SAfzal Mohammed #endif
17808f30989SAfzal Mohammed 
1790e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP4
1801509e24bSRajendra Nayak static const char *omap4_boards_compat[] __initconst = {
181b83a08feSNishanth Menon 	"ti,omap4460",
182b83a08feSNishanth Menon 	"ti,omap4430",
1838d61649dSBenoit Cousson 	"ti,omap4",
1848d61649dSBenoit Cousson 	NULL,
1858d61649dSBenoit Cousson };
1868d61649dSBenoit Cousson 
1878d61649dSBenoit Cousson DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
1888d61649dSBenoit Cousson 	.reserve	= omap_reserve,
18906915321SMarc Zyngier 	.smp		= smp_ops(omap4_smp_ops),
1908d61649dSBenoit Cousson 	.map_io		= omap4_map_io,
1918d61649dSBenoit Cousson 	.init_early	= omap4430_init_early,
192c4082d49SR Sricharan 	.init_irq	= omap_gic_of_init,
19393651b85SBenoit Cousson 	.init_machine	= omap_generic_init,
194bbd707acSShawn Guo 	.init_late	= omap4430_init_late,
1956bb27d73SStephen Warren 	.init_time	= omap4_local_timer_init,
1968d61649dSBenoit Cousson 	.dt_compat	= omap4_boards_compat,
197187e3e06SPaul Walmsley 	.restart	= omap44xx_restart,
1988d61649dSBenoit Cousson MACHINE_END
1998d61649dSBenoit Cousson #endif
2000c1b6facSR Sricharan 
2010c1b6facSR Sricharan #ifdef CONFIG_SOC_OMAP5
2021509e24bSRajendra Nayak static const char *omap5_boards_compat[] __initconst = {
203b83a08feSNishanth Menon 	"ti,omap5432",
204b83a08feSNishanth Menon 	"ti,omap5430",
2050c1b6facSR Sricharan 	"ti,omap5",
2060c1b6facSR Sricharan 	NULL,
2070c1b6facSR Sricharan };
2080c1b6facSR Sricharan 
2090c1b6facSR Sricharan DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
2100c1b6facSR Sricharan 	.reserve	= omap_reserve,
21106915321SMarc Zyngier 	.smp		= smp_ops(omap4_smp_ops),
2120c1b6facSR Sricharan 	.map_io		= omap5_map_io,
2130c1b6facSR Sricharan 	.init_early	= omap5_init_early,
2140c1b6facSR Sricharan 	.init_irq	= omap_gic_of_init,
2150c1b6facSR Sricharan 	.init_machine	= omap_generic_init,
216765e7a06SNishanth Menon 	.init_late	= omap5_init_late,
2176bb27d73SStephen Warren 	.init_time	= omap5_realtime_timer_init,
2180c1b6facSR Sricharan 	.dt_compat	= omap5_boards_compat,
219187e3e06SPaul Walmsley 	.restart	= omap44xx_restart,
2200c1b6facSR Sricharan MACHINE_END
2210c1b6facSR Sricharan #endif
222bb256f80SAfzal Mohammed 
223bb256f80SAfzal Mohammed #ifdef CONFIG_SOC_AM43XX
2241509e24bSRajendra Nayak static const char *am43_boards_compat[] __initconst = {
225b83a08feSNishanth Menon 	"ti,am4372",
226bb256f80SAfzal Mohammed 	"ti,am43",
227bb256f80SAfzal Mohammed 	NULL,
228bb256f80SAfzal Mohammed };
229bb256f80SAfzal Mohammed 
230bb256f80SAfzal Mohammed DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
231bb256f80SAfzal Mohammed 	.map_io		= am33xx_map_io,
232bb256f80SAfzal Mohammed 	.init_early	= am43xx_init_early,
233765e7a06SNishanth Menon 	.init_late	= am43xx_init_late,
234bb256f80SAfzal Mohammed 	.init_irq	= omap_gic_of_init,
235bb256f80SAfzal Mohammed 	.init_machine	= omap_generic_init,
2365b5c0135SRajendra Nayak 	.init_time	= omap3_gptimer_timer_init,
237bb256f80SAfzal Mohammed 	.dt_compat	= am43_boards_compat,
238a7daf64aSLokesh Vutla 	.restart	= omap44xx_restart,
239bb256f80SAfzal Mohammed MACHINE_END
240bb256f80SAfzal Mohammed #endif
241439bf39eSR Sricharan 
242439bf39eSR Sricharan #ifdef CONFIG_SOC_DRA7XX
243*44e97ff6SRajendra Nayak static const char *dra74x_boards_compat[] __initconst = {
244*44e97ff6SRajendra Nayak 	"ti,dra742",
245439bf39eSR Sricharan 	"ti,dra7",
246439bf39eSR Sricharan 	NULL,
247439bf39eSR Sricharan };
248439bf39eSR Sricharan 
249*44e97ff6SRajendra Nayak DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)")
250439bf39eSR Sricharan 	.reserve	= omap_reserve,
251439bf39eSR Sricharan 	.smp		= smp_ops(omap4_smp_ops),
252439bf39eSR Sricharan 	.map_io		= omap5_map_io,
253439bf39eSR Sricharan 	.init_early	= dra7xx_init_early,
254765e7a06SNishanth Menon 	.init_late	= dra7xx_init_late,
255439bf39eSR Sricharan 	.init_irq	= omap_gic_of_init,
256439bf39eSR Sricharan 	.init_machine	= omap_generic_init,
257439bf39eSR Sricharan 	.init_time	= omap5_realtime_timer_init,
258*44e97ff6SRajendra Nayak 	.dt_compat	= dra74x_boards_compat,
259*44e97ff6SRajendra Nayak 	.restart	= omap44xx_restart,
260*44e97ff6SRajendra Nayak MACHINE_END
261*44e97ff6SRajendra Nayak 
262*44e97ff6SRajendra Nayak static const char *dra72x_boards_compat[] __initconst = {
263*44e97ff6SRajendra Nayak 	"ti,dra722",
264*44e97ff6SRajendra Nayak 	NULL,
265*44e97ff6SRajendra Nayak };
266*44e97ff6SRajendra Nayak 
267*44e97ff6SRajendra Nayak DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)")
268*44e97ff6SRajendra Nayak 	.reserve	= omap_reserve,
269*44e97ff6SRajendra Nayak 	.map_io		= omap5_map_io,
270*44e97ff6SRajendra Nayak 	.init_early	= dra7xx_init_early,
271*44e97ff6SRajendra Nayak 	.init_late	= dra7xx_init_late,
272*44e97ff6SRajendra Nayak 	.init_irq	= omap_gic_of_init,
273*44e97ff6SRajendra Nayak 	.init_machine	= omap_generic_init,
274*44e97ff6SRajendra Nayak 	.init_time	= omap5_realtime_timer_init,
275*44e97ff6SRajendra Nayak 	.dt_compat	= dra72x_boards_compat,
2761d597b07SRajendra Nayak 	.restart	= omap44xx_restart,
277439bf39eSR Sricharan MACHINE_END
278439bf39eSR Sricharan #endif
279