1d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 21dbae815STony Lindgren /* 31dbae815STony Lindgren * Copyright (C) 2005 Nokia Corporation 41dbae815STony Lindgren * Author: Paul Mundt <paul.mundt@nokia.com> 51dbae815STony Lindgren * 68d61649dSBenoit Cousson * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 71dbae815STony Lindgren * 88d61649dSBenoit Cousson * Modified from the original mach-omap/omap2/board-generic.c did by Paul 98d61649dSBenoit Cousson * to support the OMAP2+ device tree boards with an unique board file. 101dbae815STony Lindgren */ 118d61649dSBenoit Cousson #include <linux/io.h> 12fbf75da7SBenoit Cousson #include <linux/of_irq.h> 138d61649dSBenoit Cousson #include <linux/of_platform.h> 148d61649dSBenoit Cousson #include <linux/irqdomain.h> 151dbae815STony Lindgren 168c51b034SIvaylo Dimitrov #include <asm/setup.h> 171dbae815STony Lindgren #include <asm/mach/arch.h> 185f35dc47SIvaylo Dimitrov #include <asm/system_info.h> 191dbae815STony Lindgren 204e65331cSTony Lindgren #include "common.h" 211dbae815STony Lindgren 2231957609SUwe Kleine-König static const struct of_device_id omap_dt_match_table[] __initconst = { 238d61649dSBenoit Cousson { .compatible = "simple-bus", }, 248d61649dSBenoit Cousson { .compatible = "ti,omap-infra", }, 258d61649dSBenoit Cousson { } 26b3c6df3aSPaul Walmsley }; 27b3c6df3aSPaul Walmsley 28293ea3d0SArnd Bergmann static void __init __maybe_unused omap_generic_init(void) 291dbae815STony Lindgren { 308651bd8cSTony Lindgren pdata_quirks_init(omap_dt_match_table); 3107e72f9aSLaurent Pinchart omap_soc_device_init(); 321dbae815STony Lindgren } 331dbae815STony Lindgren 340e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2420 3558cda01eSUwe Kleine-König static const char *const omap242x_boards_compat[] __initconst = { 368d61649dSBenoit Cousson "ti,omap2420", 378d61649dSBenoit Cousson NULL, 388d61649dSBenoit Cousson }; 391dbae815STony Lindgren 408d61649dSBenoit Cousson DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)") 4171ee7dadSRussell King .reserve = omap_reserve, 428d61649dSBenoit Cousson .map_io = omap242x_map_io, 438d61649dSBenoit Cousson .init_early = omap2420_init_early, 441dbae815STony Lindgren .init_machine = omap_generic_init, 456f82e25dSFelipe Balbi .init_time = omap_init_time, 468d61649dSBenoit Cousson .dt_compat = omap242x_boards_compat, 47187e3e06SPaul Walmsley .restart = omap2xxx_restart, 481dbae815STony Lindgren MACHINE_END 498d61649dSBenoit Cousson #endif 508d61649dSBenoit Cousson 510e02a8c1SBenoit Cousson #ifdef CONFIG_SOC_OMAP2430 5258cda01eSUwe Kleine-König static const char *const omap243x_boards_compat[] __initconst = { 538d61649dSBenoit Cousson "ti,omap2430", 548d61649dSBenoit Cousson NULL, 558d61649dSBenoit Cousson }; 568d61649dSBenoit Cousson 578d61649dSBenoit Cousson DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)") 588d61649dSBenoit Cousson .reserve = omap_reserve, 598d61649dSBenoit Cousson .map_io = omap243x_map_io, 608d61649dSBenoit Cousson .init_early = omap2430_init_early, 618d61649dSBenoit Cousson .init_machine = omap_generic_init, 626f82e25dSFelipe Balbi .init_time = omap_init_time, 638d61649dSBenoit Cousson .dt_compat = omap243x_boards_compat, 64187e3e06SPaul Walmsley .restart = omap2xxx_restart, 658d61649dSBenoit Cousson MACHINE_END 668d61649dSBenoit Cousson #endif 678d61649dSBenoit Cousson 680e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP3 6971c4f602STony Lindgren /* Some boards need board name for legacy userspace in /proc/cpuinfo */ 7071c4f602STony Lindgren static const char *const n900_boards_compat[] __initconst = { 7171c4f602STony Lindgren "nokia,omap3-n900", 7271c4f602STony Lindgren NULL, 7371c4f602STony Lindgren }; 7471c4f602STony Lindgren 755f35dc47SIvaylo Dimitrov /* Set system_rev from atags */ 765f35dc47SIvaylo Dimitrov static void __init rx51_set_system_rev(const struct tag *tags) 775f35dc47SIvaylo Dimitrov { 785f35dc47SIvaylo Dimitrov const struct tag *tag; 795f35dc47SIvaylo Dimitrov 805f35dc47SIvaylo Dimitrov if (tags->hdr.tag != ATAG_CORE) 815f35dc47SIvaylo Dimitrov return; 825f35dc47SIvaylo Dimitrov 835f35dc47SIvaylo Dimitrov for_each_tag(tag, tags) { 845f35dc47SIvaylo Dimitrov if (tag->hdr.tag == ATAG_REVISION) { 855f35dc47SIvaylo Dimitrov system_rev = tag->u.revision.rev; 865f35dc47SIvaylo Dimitrov break; 875f35dc47SIvaylo Dimitrov } 885f35dc47SIvaylo Dimitrov } 895f35dc47SIvaylo Dimitrov } 905f35dc47SIvaylo Dimitrov 918c51b034SIvaylo Dimitrov /* Legacy userspace on Nokia N900 needs ATAGS exported in /proc/atags, 928c51b034SIvaylo Dimitrov * save them while the data is still not overwritten 938c51b034SIvaylo Dimitrov */ 948c51b034SIvaylo Dimitrov static void __init rx51_reserve(void) 958c51b034SIvaylo Dimitrov { 965f35dc47SIvaylo Dimitrov const struct tag *tags = (const struct tag *)(PAGE_OFFSET + 0x100); 975f35dc47SIvaylo Dimitrov 985f35dc47SIvaylo Dimitrov save_atags(tags); 995f35dc47SIvaylo Dimitrov rx51_set_system_rev(tags); 1008c51b034SIvaylo Dimitrov omap_reserve(); 1018c51b034SIvaylo Dimitrov } 1028c51b034SIvaylo Dimitrov 10371c4f602STony Lindgren DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board") 1048c51b034SIvaylo Dimitrov .reserve = rx51_reserve, 10571c4f602STony Lindgren .map_io = omap3_map_io, 10671c4f602STony Lindgren .init_early = omap3430_init_early, 10771c4f602STony Lindgren .init_machine = omap_generic_init, 10871c4f602STony Lindgren .init_late = omap3_init_late, 1096f82e25dSFelipe Balbi .init_time = omap_init_time, 11071c4f602STony Lindgren .dt_compat = n900_boards_compat, 11171c4f602STony Lindgren .restart = omap3xxx_restart, 11271c4f602STony Lindgren MACHINE_END 11371c4f602STony Lindgren 11471c4f602STony Lindgren /* Generic omap3 boards, most boards can use these */ 11558cda01eSUwe Kleine-König static const char *const omap3_boards_compat[] __initconst = { 116b83a08feSNishanth Menon "ti,omap3430", 1178d61649dSBenoit Cousson "ti,omap3", 1188d61649dSBenoit Cousson NULL, 1198d61649dSBenoit Cousson }; 1208d61649dSBenoit Cousson 1218d61649dSBenoit Cousson DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)") 1228d61649dSBenoit Cousson .reserve = omap_reserve, 1238d61649dSBenoit Cousson .map_io = omap3_map_io, 1248d61649dSBenoit Cousson .init_early = omap3430_init_early, 12593651b85SBenoit Cousson .init_machine = omap_generic_init, 126990fa4f5SRajendra Nayak .init_late = omap3_init_late, 1276f82e25dSFelipe Balbi .init_time = omap_init_time, 1288d61649dSBenoit Cousson .dt_compat = omap3_boards_compat, 129187e3e06SPaul Walmsley .restart = omap3xxx_restart, 1308d61649dSBenoit Cousson MACHINE_END 1317dd9d502SJon Hunter 13258cda01eSUwe Kleine-König static const char *const omap36xx_boards_compat[] __initconst = { 13357df5380STony Lindgren "ti,omap3630", 134016c12d2SNishanth Menon "ti,omap36xx", 135016c12d2SNishanth Menon NULL, 136016c12d2SNishanth Menon }; 137016c12d2SNishanth Menon 138016c12d2SNishanth Menon DT_MACHINE_START(OMAP36XX_DT, "Generic OMAP36xx (Flattened Device Tree)") 139016c12d2SNishanth Menon .reserve = omap_reserve, 140016c12d2SNishanth Menon .map_io = omap3_map_io, 141016c12d2SNishanth Menon .init_early = omap3630_init_early, 142016c12d2SNishanth Menon .init_machine = omap_generic_init, 143016c12d2SNishanth Menon .init_late = omap3_init_late, 1446f82e25dSFelipe Balbi .init_time = omap_init_time, 145016c12d2SNishanth Menon .dt_compat = omap36xx_boards_compat, 146016c12d2SNishanth Menon .restart = omap3xxx_restart, 147016c12d2SNishanth Menon MACHINE_END 148016c12d2SNishanth Menon 14958cda01eSUwe Kleine-König static const char *const omap3_gp_boards_compat[] __initconst = { 1507dd9d502SJon Hunter "ti,omap3-beagle", 1514bfe6341SAnil Kumar "timll,omap3-devkit8000", 1527dd9d502SJon Hunter NULL, 1537dd9d502SJon Hunter }; 1547dd9d502SJon Hunter 1557dd9d502SJon Hunter DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)") 1567dd9d502SJon Hunter .reserve = omap_reserve, 1577dd9d502SJon Hunter .map_io = omap3_map_io, 1587dd9d502SJon Hunter .init_early = omap3430_init_early, 1597dd9d502SJon Hunter .init_machine = omap_generic_init, 160990fa4f5SRajendra Nayak .init_late = omap3_init_late, 1616bb27d73SStephen Warren .init_time = omap3_secure_sync32k_timer_init, 1627dd9d502SJon Hunter .dt_compat = omap3_gp_boards_compat, 163d01e4afdSLinus Torvalds .restart = omap3xxx_restart, 1648d61649dSBenoit Cousson MACHINE_END 165caef4ee8SNishanth Menon 16658cda01eSUwe Kleine-König static const char *const am3517_boards_compat[] __initconst = { 167caef4ee8SNishanth Menon "ti,am3517", 168caef4ee8SNishanth Menon NULL, 169caef4ee8SNishanth Menon }; 170caef4ee8SNishanth Menon 171caef4ee8SNishanth Menon DT_MACHINE_START(AM3517_DT, "Generic AM3517 (Flattened Device Tree)") 172caef4ee8SNishanth Menon .reserve = omap_reserve, 173caef4ee8SNishanth Menon .map_io = omap3_map_io, 174caef4ee8SNishanth Menon .init_early = am35xx_init_early, 175caef4ee8SNishanth Menon .init_machine = omap_generic_init, 176caef4ee8SNishanth Menon .init_late = omap3_init_late, 177caef4ee8SNishanth Menon .init_time = omap3_gptimer_timer_init, 178caef4ee8SNishanth Menon .dt_compat = am3517_boards_compat, 179caef4ee8SNishanth Menon .restart = omap3xxx_restart, 180caef4ee8SNishanth Menon MACHINE_END 1818d61649dSBenoit Cousson #endif 1828d61649dSBenoit Cousson 183abf8cc1dSTony Lindgren #ifdef CONFIG_SOC_TI81XX 184abf8cc1dSTony Lindgren static const char *const ti814x_boards_compat[] __initconst = { 185abf8cc1dSTony Lindgren "ti,dm8148", 186abf8cc1dSTony Lindgren "ti,dm814", 187abf8cc1dSTony Lindgren NULL, 188abf8cc1dSTony Lindgren }; 189abf8cc1dSTony Lindgren 1909fd274c0STony Lindgren DT_MACHINE_START(TI814X_DT, "Generic ti814x (Flattened Device Tree)") 191abf8cc1dSTony Lindgren .reserve = omap_reserve, 192abf8cc1dSTony Lindgren .map_io = ti81xx_map_io, 193abf8cc1dSTony Lindgren .init_early = ti814x_init_early, 194abf8cc1dSTony Lindgren .init_machine = omap_generic_init, 195abf8cc1dSTony Lindgren .init_late = ti81xx_init_late, 196abf8cc1dSTony Lindgren .init_time = omap3_gptimer_timer_init, 197abf8cc1dSTony Lindgren .dt_compat = ti814x_boards_compat, 198abf8cc1dSTony Lindgren .restart = ti81xx_restart, 199abf8cc1dSTony Lindgren MACHINE_END 200abf8cc1dSTony Lindgren 201abf8cc1dSTony Lindgren static const char *const ti816x_boards_compat[] __initconst = { 202abf8cc1dSTony Lindgren "ti,dm8168", 203abf8cc1dSTony Lindgren "ti,dm816", 204abf8cc1dSTony Lindgren NULL, 205abf8cc1dSTony Lindgren }; 206abf8cc1dSTony Lindgren 207abf8cc1dSTony Lindgren DT_MACHINE_START(TI816X_DT, "Generic ti816x (Flattened Device Tree)") 208abf8cc1dSTony Lindgren .reserve = omap_reserve, 209abf8cc1dSTony Lindgren .map_io = ti81xx_map_io, 210abf8cc1dSTony Lindgren .init_early = ti816x_init_early, 211abf8cc1dSTony Lindgren .init_machine = omap_generic_init, 212abf8cc1dSTony Lindgren .init_late = ti81xx_init_late, 213abf8cc1dSTony Lindgren .init_time = omap3_gptimer_timer_init, 214abf8cc1dSTony Lindgren .dt_compat = ti816x_boards_compat, 215abf8cc1dSTony Lindgren .restart = ti81xx_restart, 216abf8cc1dSTony Lindgren MACHINE_END 217abf8cc1dSTony Lindgren #endif 218abf8cc1dSTony Lindgren 21908f30989SAfzal Mohammed #ifdef CONFIG_SOC_AM33XX 22058cda01eSUwe Kleine-König static const char *const am33xx_boards_compat[] __initconst = { 22108f30989SAfzal Mohammed "ti,am33xx", 22208f30989SAfzal Mohammed NULL, 22308f30989SAfzal Mohammed }; 22408f30989SAfzal Mohammed 22508f30989SAfzal Mohammed DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)") 22608f30989SAfzal Mohammed .reserve = omap_reserve, 22708f30989SAfzal Mohammed .map_io = am33xx_map_io, 22808f30989SAfzal Mohammed .init_early = am33xx_init_early, 22908f30989SAfzal Mohammed .init_machine = omap_generic_init, 230765e7a06SNishanth Menon .init_late = am33xx_init_late, 23100ea4d56SJon Hunter .init_time = omap3_gptimer_timer_init, 23208f30989SAfzal Mohammed .dt_compat = am33xx_boards_compat, 23314e067c1SJean-Sebastien A. Beaudry .restart = am33xx_restart, 23408f30989SAfzal Mohammed MACHINE_END 23508f30989SAfzal Mohammed #endif 23608f30989SAfzal Mohammed 2370e02a8c1SBenoit Cousson #ifdef CONFIG_ARCH_OMAP4 23858cda01eSUwe Kleine-König static const char *const omap4_boards_compat[] __initconst = { 239b83a08feSNishanth Menon "ti,omap4460", 240b83a08feSNishanth Menon "ti,omap4430", 2418d61649dSBenoit Cousson "ti,omap4", 2428d61649dSBenoit Cousson NULL, 2438d61649dSBenoit Cousson }; 2448d61649dSBenoit Cousson 2458d61649dSBenoit Cousson DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)") 246944e9df1SMarek Szyprowski .l2c_aux_val = OMAP_L2C_AUX_CTRL, 247944e9df1SMarek Szyprowski .l2c_aux_mask = 0xcf9fffff, 248944e9df1SMarek Szyprowski .l2c_write_sec = omap4_l2c310_write_sec, 2498d61649dSBenoit Cousson .reserve = omap_reserve, 25006915321SMarc Zyngier .smp = smp_ops(omap4_smp_ops), 2518d61649dSBenoit Cousson .map_io = omap4_map_io, 2528d61649dSBenoit Cousson .init_early = omap4430_init_early, 253c4082d49SR Sricharan .init_irq = omap_gic_of_init, 25493651b85SBenoit Cousson .init_machine = omap_generic_init, 255bbd707acSShawn Guo .init_late = omap4430_init_late, 2566bb27d73SStephen Warren .init_time = omap4_local_timer_init, 2578d61649dSBenoit Cousson .dt_compat = omap4_boards_compat, 258187e3e06SPaul Walmsley .restart = omap44xx_restart, 2598d61649dSBenoit Cousson MACHINE_END 2608d61649dSBenoit Cousson #endif 2610c1b6facSR Sricharan 2620c1b6facSR Sricharan #ifdef CONFIG_SOC_OMAP5 26358cda01eSUwe Kleine-König static const char *const omap5_boards_compat[] __initconst = { 264b83a08feSNishanth Menon "ti,omap5432", 265b83a08feSNishanth Menon "ti,omap5430", 2660c1b6facSR Sricharan "ti,omap5", 2670c1b6facSR Sricharan NULL, 2680c1b6facSR Sricharan }; 2690c1b6facSR Sricharan 2700c1b6facSR Sricharan DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)") 2716a3b764bSTony Lindgren #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 2726a3b764bSTony Lindgren .dma_zone_size = SZ_2G, 2736a3b764bSTony Lindgren #endif 2740c1b6facSR Sricharan .reserve = omap_reserve, 27506915321SMarc Zyngier .smp = smp_ops(omap4_smp_ops), 2760c1b6facSR Sricharan .map_io = omap5_map_io, 2770c1b6facSR Sricharan .init_early = omap5_init_early, 2780c1b6facSR Sricharan .init_irq = omap_gic_of_init, 2790c1b6facSR Sricharan .init_machine = omap_generic_init, 280765e7a06SNishanth Menon .init_late = omap5_init_late, 2816bb27d73SStephen Warren .init_time = omap5_realtime_timer_init, 2820c1b6facSR Sricharan .dt_compat = omap5_boards_compat, 283187e3e06SPaul Walmsley .restart = omap44xx_restart, 2840c1b6facSR Sricharan MACHINE_END 2850c1b6facSR Sricharan #endif 286bb256f80SAfzal Mohammed 287bb256f80SAfzal Mohammed #ifdef CONFIG_SOC_AM43XX 28858cda01eSUwe Kleine-König static const char *const am43_boards_compat[] __initconst = { 289b83a08feSNishanth Menon "ti,am4372", 290bb256f80SAfzal Mohammed "ti,am43", 291bb256f80SAfzal Mohammed NULL, 292bb256f80SAfzal Mohammed }; 293bb256f80SAfzal Mohammed 294bb256f80SAfzal Mohammed DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)") 295944e9df1SMarek Szyprowski .l2c_aux_val = OMAP_L2C_AUX_CTRL, 296944e9df1SMarek Szyprowski .l2c_aux_mask = 0xcf9fffff, 297944e9df1SMarek Szyprowski .l2c_write_sec = omap4_l2c310_write_sec, 298bb256f80SAfzal Mohammed .map_io = am33xx_map_io, 299bb256f80SAfzal Mohammed .init_early = am43xx_init_early, 300765e7a06SNishanth Menon .init_late = am43xx_init_late, 301bb256f80SAfzal Mohammed .init_irq = omap_gic_of_init, 302bb256f80SAfzal Mohammed .init_machine = omap_generic_init, 303f86a2c87SGrygorii Strashko .init_time = omap3_gptimer_timer_init, 304bb256f80SAfzal Mohammed .dt_compat = am43_boards_compat, 305a7daf64aSLokesh Vutla .restart = omap44xx_restart, 306bb256f80SAfzal Mohammed MACHINE_END 307bb256f80SAfzal Mohammed #endif 308439bf39eSR Sricharan 309439bf39eSR Sricharan #ifdef CONFIG_SOC_DRA7XX 31058cda01eSUwe Kleine-König static const char *const dra74x_boards_compat[] __initconst = { 3114dc6760dSLokesh Vutla "ti,dra762", 3120e0cb99dSNishanth Menon "ti,am5728", 3130e0cb99dSNishanth Menon "ti,am5726", 31444e97ff6SRajendra Nayak "ti,dra742", 315439bf39eSR Sricharan "ti,dra7", 316439bf39eSR Sricharan NULL, 317439bf39eSR Sricharan }; 318439bf39eSR Sricharan 31944e97ff6SRajendra Nayak DT_MACHINE_START(DRA74X_DT, "Generic DRA74X (Flattened Device Tree)") 3206a3b764bSTony Lindgren #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 3216a3b764bSTony Lindgren .dma_zone_size = SZ_2G, 3226a3b764bSTony Lindgren #endif 323439bf39eSR Sricharan .reserve = omap_reserve, 324439bf39eSR Sricharan .smp = smp_ops(omap4_smp_ops), 325ea827ad5SNishanth Menon .map_io = dra7xx_map_io, 326439bf39eSR Sricharan .init_early = dra7xx_init_early, 327765e7a06SNishanth Menon .init_late = dra7xx_init_late, 328439bf39eSR Sricharan .init_irq = omap_gic_of_init, 329439bf39eSR Sricharan .init_machine = omap_generic_init, 330439bf39eSR Sricharan .init_time = omap5_realtime_timer_init, 33144e97ff6SRajendra Nayak .dt_compat = dra74x_boards_compat, 33244e97ff6SRajendra Nayak .restart = omap44xx_restart, 33344e97ff6SRajendra Nayak MACHINE_END 33444e97ff6SRajendra Nayak 33558cda01eSUwe Kleine-König static const char *const dra72x_boards_compat[] __initconst = { 3360e0cb99dSNishanth Menon "ti,am5718", 3370e0cb99dSNishanth Menon "ti,am5716", 33844e97ff6SRajendra Nayak "ti,dra722", 339a2af765aSLokesh Vutla "ti,dra718", 34044e97ff6SRajendra Nayak NULL, 34144e97ff6SRajendra Nayak }; 34244e97ff6SRajendra Nayak 34344e97ff6SRajendra Nayak DT_MACHINE_START(DRA72X_DT, "Generic DRA72X (Flattened Device Tree)") 3446a3b764bSTony Lindgren #if defined(CONFIG_ZONE_DMA) && defined(CONFIG_ARM_LPAE) 3456a3b764bSTony Lindgren .dma_zone_size = SZ_2G, 3466a3b764bSTony Lindgren #endif 34744e97ff6SRajendra Nayak .reserve = omap_reserve, 348ea827ad5SNishanth Menon .map_io = dra7xx_map_io, 34944e97ff6SRajendra Nayak .init_early = dra7xx_init_early, 35044e97ff6SRajendra Nayak .init_late = dra7xx_init_late, 35144e97ff6SRajendra Nayak .init_irq = omap_gic_of_init, 35244e97ff6SRajendra Nayak .init_machine = omap_generic_init, 35344e97ff6SRajendra Nayak .init_time = omap5_realtime_timer_init, 35444e97ff6SRajendra Nayak .dt_compat = dra72x_boards_compat, 3551d597b07SRajendra Nayak .restart = omap44xx_restart, 356439bf39eSR Sricharan MACHINE_END 357439bf39eSR Sricharan #endif 358