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 { 388651bd8cSTony Lindgren pdata_quirks_init(omap_dt_match_table); 391dbae815STony Lindgren } 401dbae815STony Lindgren 410e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2420 428d61649dSBenoit Cousson static const char *omap242x_boards_compat[] __initdata = { 438d61649dSBenoit Cousson "ti,omap2420", 448d61649dSBenoit Cousson NULL, 458d61649dSBenoit Cousson }; 461dbae815STony Lindgren 478d61649dSBenoit Cousson DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") 4871ee7dadSRussell King .reserve = omap_reserve, 498d61649dSBenoit Cousson .map_io = omap242x_map_io, 508d61649dSBenoit Cousson .init_early = omap2420_init_early, 51c4082d49SR Sricharan .init_irq = omap_intc_of_init, 52b755706cSBenoit Cousson .handle_irq = omap2_intc_handle_irq, 531dbae815STony Lindgren .init_machine = omap_generic_init, 546bb27d73SStephen Warren .init_time = omap2_sync32k_timer_init, 558d61649dSBenoit Cousson .dt_compat = omap242x_boards_compat, 56187e3e06SPaul Walmsley .restart = omap2xxx_restart, 571dbae815STony Lindgren MACHINE_END 588d61649dSBenoit Cousson #endif 598d61649dSBenoit Cousson 600e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2430 618d61649dSBenoit Cousson static const char *omap243x_boards_compat[] __initdata = { 628d61649dSBenoit Cousson "ti,omap2430", 638d61649dSBenoit Cousson NULL, 648d61649dSBenoit Cousson }; 658d61649dSBenoit Cousson 668d61649dSBenoit Cousson DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") 678d61649dSBenoit Cousson .reserve = omap_reserve, 688d61649dSBenoit Cousson .map_io = omap243x_map_io, 698d61649dSBenoit Cousson .init_early = omap2430_init_early, 70c4082d49SR Sricharan .init_irq = omap_intc_of_init, 716b2f55d7SMarc Zyngier .handle_irq = omap2_intc_handle_irq, 728d61649dSBenoit Cousson .init_machine = omap_generic_init, 736bb27d73SStephen Warren .init_time = omap2_sync32k_timer_init, 748d61649dSBenoit Cousson .dt_compat = omap243x_boards_compat, 75187e3e06SPaul Walmsley .restart = omap2xxx_restart, 768d61649dSBenoit Cousson MACHINE_END 778d61649dSBenoit Cousson #endif 788d61649dSBenoit Cousson 790e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP3 808d61649dSBenoit Cousson static const char *omap3_boards_compat[] __initdata = { 81b83a08feSNishanth Menon "ti,omap3430", 828d61649dSBenoit Cousson "ti,omap3", 838d61649dSBenoit Cousson NULL, 848d61649dSBenoit Cousson }; 858d61649dSBenoit Cousson 868d61649dSBenoit Cousson DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") 878d61649dSBenoit Cousson .reserve = omap_reserve, 888d61649dSBenoit Cousson .map_io = omap3_map_io, 898d61649dSBenoit Cousson .init_early = omap3430_init_early, 90c4082d49SR Sricharan .init_irq = omap_intc_of_init, 91b755706cSBenoit Cousson .handle_irq = omap3_intc_handle_irq, 9293651b85SBenoit Cousson .init_machine = omap_generic_init, 93990fa4f5SRajendra Nayak .init_late = omap3_init_late, 946bb27d73SStephen Warren .init_time = omap3_sync32k_timer_init, 958d61649dSBenoit Cousson .dt_compat = omap3_boards_compat, 96187e3e06SPaul Walmsley .restart = omap3xxx_restart, 978d61649dSBenoit Cousson MACHINE_END 987dd9d502SJon Hunter 99016c12d2SNishanth Menon static const char *omap36xx_boards_compat[] __initdata = { 100016c12d2SNishanth Menon "ti,omap36xx", 101016c12d2SNishanth Menon NULL, 102016c12d2SNishanth Menon }; 103016c12d2SNishanth Menon 104016c12d2SNishanth Menon DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)") 105016c12d2SNishanth Menon .reserve = omap_reserve, 106016c12d2SNishanth Menon .map_io = omap3_map_io, 107016c12d2SNishanth Menon .init_early = omap3630_init_early, 108016c12d2SNishanth Menon .init_irq = omap_intc_of_init, 109016c12d2SNishanth Menon .handle_irq = omap3_intc_handle_irq, 110016c12d2SNishanth Menon .init_machine = omap_generic_init, 111016c12d2SNishanth Menon .init_late = omap3_init_late, 112016c12d2SNishanth Menon .init_time = omap3_sync32k_timer_init, 113016c12d2SNishanth Menon .dt_compat = omap36xx_boards_compat, 114016c12d2SNishanth Menon .restart = omap3xxx_restart, 115016c12d2SNishanth Menon MACHINE_END 116016c12d2SNishanth Menon 1177dd9d502SJon Hunter static const char *omap3_gp_boards_compat[] __initdata = { 1187dd9d502SJon Hunter "ti,omap3-beagle", 1194bfe6341SAnil Kumar "timll,omap3-devkit8000", 1207dd9d502SJon Hunter NULL, 1217dd9d502SJon Hunter }; 1227dd9d502SJon Hunter 1237dd9d502SJon Hunter DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") 1247dd9d502SJon Hunter .reserve = omap_reserve, 1257dd9d502SJon Hunter .map_io = omap3_map_io, 1267dd9d502SJon Hunter .init_early = omap3430_init_early, 1277dd9d502SJon Hunter .init_irq = omap_intc_of_init, 1287dd9d502SJon Hunter .handle_irq = omap3_intc_handle_irq, 1297dd9d502SJon Hunter .init_machine = omap_generic_init, 130990fa4f5SRajendra Nayak .init_late = omap3_init_late, 1316bb27d73SStephen Warren .init_time = omap3_secure_sync32k_timer_init, 1327dd9d502SJon Hunter .dt_compat = omap3_gp_boards_compat, 133d01e4afdSLinus Torvalds .restart = omap3xxx_restart, 1348d61649dSBenoit Cousson MACHINE_END 135caef4ee8SNishanth Menon 136caef4ee8SNishanth Menon static const char *am3517_boards_compat[] __initdata = { 137caef4ee8SNishanth Menon "ti,am3517", 138caef4ee8SNishanth Menon NULL, 139caef4ee8SNishanth Menon }; 140caef4ee8SNishanth Menon 141caef4ee8SNishanth Menon DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)") 142caef4ee8SNishanth Menon .reserve = omap_reserve, 143caef4ee8SNishanth Menon .map_io = omap3_map_io, 144caef4ee8SNishanth Menon .init_early = am35xx_init_early, 145caef4ee8SNishanth Menon .init_irq = omap_intc_of_init, 146caef4ee8SNishanth Menon .handle_irq = omap3_intc_handle_irq, 147caef4ee8SNishanth Menon .init_machine = omap_generic_init, 148caef4ee8SNishanth Menon .init_late = omap3_init_late, 149caef4ee8SNishanth Menon .init_time = omap3_gptimer_timer_init, 150caef4ee8SNishanth Menon .dt_compat = am3517_boards_compat, 151caef4ee8SNishanth Menon .restart = omap3xxx_restart, 152caef4ee8SNishanth Menon MACHINE_END 1538d61649dSBenoit Cousson #endif 1548d61649dSBenoit Cousson 15508f30989SAfzal Mohammed #ifdef CONFIG_SOC_AM33XX 15608f30989SAfzal Mohammed static const char *am33xx_boards_compat[] __initdata = { 15708f30989SAfzal Mohammed "ti,am33xx", 15808f30989SAfzal Mohammed NULL, 15908f30989SAfzal Mohammed }; 16008f30989SAfzal Mohammed 16108f30989SAfzal Mohammed DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") 16208f30989SAfzal Mohammed .reserve = omap_reserve, 16308f30989SAfzal Mohammed .map_io = am33xx_map_io, 16408f30989SAfzal Mohammed .init_early = am33xx_init_early, 165c4082d49SR Sricharan .init_irq = omap_intc_of_init, 16608f30989SAfzal Mohammed .handle_irq = omap3_intc_handle_irq, 16708f30989SAfzal Mohammed .init_machine = omap_generic_init, 168765e7a06SNishanth Menon .init_late = am33xx_init_late, 16900ea4d56SJon Hunter .init_time = omap3_gptimer_timer_init, 17008f30989SAfzal Mohammed .dt_compat = am33xx_boards_compat, 17114e067c1SJean-Sebastien A. Beaudry .restart = am33xx_restart, 17208f30989SAfzal Mohammed MACHINE_END 17308f30989SAfzal Mohammed #endif 17408f30989SAfzal Mohammed 1750e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP4 1768d61649dSBenoit Cousson static const char *omap4_boards_compat[] __initdata = { 177b83a08feSNishanth Menon "ti,omap4460", 178b83a08feSNishanth Menon "ti,omap4430", 1798d61649dSBenoit Cousson "ti,omap4", 1808d61649dSBenoit Cousson NULL, 1818d61649dSBenoit Cousson }; 1828d61649dSBenoit Cousson 1838d61649dSBenoit Cousson DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") 1848d61649dSBenoit Cousson .reserve = omap_reserve, 18506915321SMarc Zyngier .smp = smp_ops(omap4_smp_ops), 1868d61649dSBenoit Cousson .map_io = omap4_map_io, 1878d61649dSBenoit Cousson .init_early = omap4430_init_early, 188c4082d49SR Sricharan .init_irq = omap_gic_of_init, 18993651b85SBenoit Cousson .init_machine = omap_generic_init, 190bbd707acSShawn Guo .init_late = omap4430_init_late, 1916bb27d73SStephen Warren .init_time = omap4_local_timer_init, 1928d61649dSBenoit Cousson .dt_compat = omap4_boards_compat, 193187e3e06SPaul Walmsley .restart = omap44xx_restart, 1948d61649dSBenoit Cousson MACHINE_END 1958d61649dSBenoit Cousson #endif 1960c1b6facSR Sricharan 1970c1b6facSR Sricharan #ifdef CONFIG_SOC_OMAP5 1980c1b6facSR Sricharan static const char *omap5_boards_compat[] __initdata = { 199b83a08feSNishanth Menon "ti,omap5432", 200b83a08feSNishanth Menon "ti,omap5430", 2010c1b6facSR Sricharan "ti,omap5", 2020c1b6facSR Sricharan NULL, 2030c1b6facSR Sricharan }; 2040c1b6facSR Sricharan 2050c1b6facSR Sricharan DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 2060c1b6facSR Sricharan .reserve = omap_reserve, 20706915321SMarc Zyngier .smp = smp_ops(omap4_smp_ops), 2080c1b6facSR Sricharan .map_io = omap5_map_io, 2090c1b6facSR Sricharan .init_early = omap5_init_early, 2100c1b6facSR Sricharan .init_irq = omap_gic_of_init, 2110c1b6facSR Sricharan .init_machine = omap_generic_init, 212765e7a06SNishanth Menon .init_late = omap5_init_late, 2136bb27d73SStephen Warren .init_time = omap5_realtime_timer_init, 2140c1b6facSR Sricharan .dt_compat = omap5_boards_compat, 215187e3e06SPaul Walmsley .restart = omap44xx_restart, 2160c1b6facSR Sricharan MACHINE_END 2170c1b6facSR Sricharan #endif 218bb256f80SAfzal Mohammed 219bb256f80SAfzal Mohammed #ifdef CONFIG_SOC_AM43XX 220bb256f80SAfzal Mohammed static const char *am43_boards_compat[] __initdata = { 221b83a08feSNishanth Menon "ti,am4372", 222bb256f80SAfzal Mohammed "ti,am43", 223bb256f80SAfzal Mohammed NULL, 224bb256f80SAfzal Mohammed }; 225bb256f80SAfzal Mohammed 226bb256f80SAfzal Mohammed DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") 227bb256f80SAfzal Mohammed .map_io = am33xx_map_io, 228bb256f80SAfzal Mohammed .init_early = am43xx_init_early, 229765e7a06SNishanth Menon .init_late = am43xx_init_late, 230bb256f80SAfzal Mohammed .init_irq = omap_gic_of_init, 231bb256f80SAfzal Mohammed .init_machine = omap_generic_init, 232bb256f80SAfzal Mohammed .init_time = omap3_sync32k_timer_init, 233bb256f80SAfzal Mohammed .dt_compat = am43_boards_compat, 234*a7daf64aSLokesh Vutla .restart = omap44xx_restart, 235bb256f80SAfzal Mohammed MACHINE_END 236bb256f80SAfzal Mohammed #endif 237439bf39eSR Sricharan 238439bf39eSR Sricharan #ifdef CONFIG_SOC_DRA7XX 239439bf39eSR Sricharan static const char *dra7xx_boards_compat[] __initdata = { 240b83a08feSNishanth Menon "ti,dra7xx", 241439bf39eSR Sricharan "ti,dra7", 242439bf39eSR Sricharan NULL, 243439bf39eSR Sricharan }; 244439bf39eSR Sricharan 245439bf39eSR Sricharan DT_MACHINE_START(DRA7XX_DT, "Generic DRA7XX (Flattened Device Tree)") 246439bf39eSR Sricharan .reserve = omap_reserve, 247439bf39eSR Sricharan .smp = smp_ops(omap4_smp_ops), 248439bf39eSR Sricharan .map_io = omap5_map_io, 249439bf39eSR Sricharan .init_early = dra7xx_init_early, 250765e7a06SNishanth Menon .init_late = dra7xx_init_late, 251439bf39eSR Sricharan .init_irq = omap_gic_of_init, 252439bf39eSR Sricharan .init_machine = omap_generic_init, 253439bf39eSR Sricharan .init_time = omap5_realtime_timer_init, 254439bf39eSR Sricharan .dt_compat = dra7xx_boards_compat, 2551d597b07SRajendra Nayak .restart = omap44xx_restart, 256439bf39eSR Sricharan MACHINE_END 257439bf39eSR Sricharan #endif 258