ARM: OMAP2+: Add quirk support for legacy platform data init
[linux-2.6.git] / arch / arm / mach-omap2 / board-generic.c
blob022b0df94e0d4ca900c31d1154714e27a84f2598
1 /*
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.
14 #include <linux/io.h>
15 #include <linux/of_irq.h>
16 #include <linux/of_platform.h>
17 #include <linux/irqdomain.h>
18 #include <linux/clk.h>
20 #include <asm/mach/arch.h>
22 #include "common.h"
23 #include "common-board-devices.h"
24 #include "dss-common.h"
26 #if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
27 #define intc_of_init NULL
28 #endif
29 #ifndef CONFIG_ARCH_OMAP4
30 #define gic_of_init NULL
31 #endif
33 static struct of_device_id omap_dt_match_table[] __initdata = {
34 { .compatible = "simple-bus", },
35 { .compatible = "ti,omap-infra", },
36 { }
40 * Create alias for USB host PHY clock.
41 * Remove this when clock phandle can be provided via DT
43 static void __init legacy_init_ehci_clk(char *clkname)
45 int ret;
47 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
48 if (ret) {
49 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
50 __func__, clkname, ret);
54 static void __init omap_generic_init(void)
56 omap_sdrc_init(NULL, NULL);
58 of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);
59 pdata_quirks_init();
62 * HACK: call display setup code for selected boards to enable omapdss.
63 * This will be removed when omapdss supports DT.
65 if (of_machine_is_compatible("ti,omap4-panda")) {
66 omap4_panda_display_init_of();
67 legacy_init_ehci_clk("auxclk3_ck");
70 else if (of_machine_is_compatible("ti,omap4-sdp"))
71 omap_4430sdp_display_init_of();
72 else if (of_machine_is_compatible("ti,omap5-uevm"))
73 legacy_init_ehci_clk("auxclk1_ck");
76 #ifdef CONFIG_SOC_OMAP2420
77 static const char *omap242x_boards_compat[] __initdata = {
78 "ti,omap2420",
79 NULL,
82 DT_MACHINE_START(OMAP242X_DT, "Generic OMAP2420 (Flattened Device Tree)")
83 .reserve = omap_reserve,
84 .map_io = omap242x_map_io,
85 .init_early = omap2420_init_early,
86 .init_irq = omap_intc_of_init,
87 .handle_irq = omap2_intc_handle_irq,
88 .init_machine = omap_generic_init,
89 .init_time = omap2_sync32k_timer_init,
90 .dt_compat = omap242x_boards_compat,
91 .restart = omap2xxx_restart,
92 MACHINE_END
93 #endif
95 #ifdef CONFIG_SOC_OMAP2430
96 static const char *omap243x_boards_compat[] __initdata = {
97 "ti,omap2430",
98 NULL,
101 DT_MACHINE_START(OMAP243X_DT, "Generic OMAP2430 (Flattened Device Tree)")
102 .reserve = omap_reserve,
103 .map_io = omap243x_map_io,
104 .init_early = omap2430_init_early,
105 .init_irq = omap_intc_of_init,
106 .handle_irq = omap2_intc_handle_irq,
107 .init_machine = omap_generic_init,
108 .init_time = omap2_sync32k_timer_init,
109 .dt_compat = omap243x_boards_compat,
110 .restart = omap2xxx_restart,
111 MACHINE_END
112 #endif
114 #ifdef CONFIG_ARCH_OMAP3
115 static const char *omap3_boards_compat[] __initdata = {
116 "ti,omap3",
117 NULL,
120 DT_MACHINE_START(OMAP3_DT, "Generic OMAP3 (Flattened Device Tree)")
121 .reserve = omap_reserve,
122 .map_io = omap3_map_io,
123 .init_early = omap3430_init_early,
124 .init_irq = omap_intc_of_init,
125 .handle_irq = omap3_intc_handle_irq,
126 .init_machine = omap_generic_init,
127 .init_late = omap3_init_late,
128 .init_time = omap3_sync32k_timer_init,
129 .dt_compat = omap3_boards_compat,
130 .restart = omap3xxx_restart,
131 MACHINE_END
133 static const char *omap3_gp_boards_compat[] __initdata = {
134 "ti,omap3-beagle",
135 "timll,omap3-devkit8000",
136 NULL,
139 DT_MACHINE_START(OMAP3_GP_DT, "Generic OMAP3-GP (Flattened Device Tree)")
140 .reserve = omap_reserve,
141 .map_io = omap3_map_io,
142 .init_early = omap3430_init_early,
143 .init_irq = omap_intc_of_init,
144 .handle_irq = omap3_intc_handle_irq,
145 .init_machine = omap_generic_init,
146 .init_late = omap3_init_late,
147 .init_time = omap3_secure_sync32k_timer_init,
148 .dt_compat = omap3_gp_boards_compat,
149 .restart = omap3xxx_restart,
150 MACHINE_END
151 #endif
153 #ifdef CONFIG_SOC_AM33XX
154 static const char *am33xx_boards_compat[] __initdata = {
155 "ti,am33xx",
156 NULL,
159 DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
160 .reserve = omap_reserve,
161 .map_io = am33xx_map_io,
162 .init_early = am33xx_init_early,
163 .init_irq = omap_intc_of_init,
164 .handle_irq = omap3_intc_handle_irq,
165 .init_machine = omap_generic_init,
166 .init_time = omap3_gptimer_timer_init,
167 .dt_compat = am33xx_boards_compat,
168 .restart = am33xx_restart,
169 MACHINE_END
170 #endif
172 #ifdef CONFIG_ARCH_OMAP4
173 static const char *omap4_boards_compat[] __initdata = {
174 "ti,omap4",
175 NULL,
178 DT_MACHINE_START(OMAP4_DT, "Generic OMAP4 (Flattened Device Tree)")
179 .reserve = omap_reserve,
180 .smp = smp_ops(omap4_smp_ops),
181 .map_io = omap4_map_io,
182 .init_early = omap4430_init_early,
183 .init_irq = omap_gic_of_init,
184 .init_machine = omap_generic_init,
185 .init_late = omap4430_init_late,
186 .init_time = omap4_local_timer_init,
187 .dt_compat = omap4_boards_compat,
188 .restart = omap44xx_restart,
189 MACHINE_END
190 #endif
192 #ifdef CONFIG_SOC_OMAP5
193 static const char *omap5_boards_compat[] __initdata = {
194 "ti,omap5",
195 NULL,
198 DT_MACHINE_START(OMAP5_DT, "Generic OMAP5 (Flattened Device Tree)")
199 .reserve = omap_reserve,
200 .smp = smp_ops(omap4_smp_ops),
201 .map_io = omap5_map_io,
202 .init_early = omap5_init_early,
203 .init_irq = omap_gic_of_init,
204 .init_machine = omap_generic_init,
205 .init_time = omap5_realtime_timer_init,
206 .dt_compat = omap5_boards_compat,
207 .restart = omap44xx_restart,
208 MACHINE_END
209 #endif
211 #ifdef CONFIG_SOC_AM43XX
212 static const char *am43_boards_compat[] __initdata = {
213 "ti,am43",
214 NULL,
217 DT_MACHINE_START(AM43_DT, "Generic AM43 (Flattened Device Tree)")
218 .map_io = am33xx_map_io,
219 .init_early = am43xx_init_early,
220 .init_irq = omap_gic_of_init,
221 .init_machine = omap_generic_init,
222 .init_time = omap3_sync32k_timer_init,
223 .dt_compat = am43_boards_compat,
224 MACHINE_END
225 #endif
227 #ifdef CONFIG_SOC_DRA7XX
228 static const char *dra7xx_boards_compat[] __initdata = {
229 "ti,dra7",
230 NULL,
233 DT_MACHINE_START(DRA7XX_DT, "Generic DRA7XX (Flattened Device Tree)")
234 .reserve = omap_reserve,
235 .smp = smp_ops(omap4_smp_ops),
236 .map_io = omap5_map_io,
237 .init_early = dra7xx_init_early,
238 .init_irq = omap_gic_of_init,
239 .init_machine = omap_generic_init,
240 .init_time = omap5_realtime_timer_init,
241 .dt_compat = dra7xx_boards_compat,
242 .restart = omap44xx_restart,
243 MACHINE_END
244 #endif