blob: ff6fc5b2add581673bd447a026d5ca3045f80be4 [file] [log] [blame]
Tony Lindgren1dbae812005-11-10 14:26:51 +00001/*
2 * linux/arch/arm/mach-omap2/io.c
3 *
4 * OMAP2 I/O mapping code
5 *
6 * Copyright (C) 2005 Nokia Corporation
Santosh Shilimkar44169072009-05-28 14:16:04 -07007 * Copyright (C) 2007-2009 Texas Instruments
Tony Lindgren646e3ed2008-10-06 15:49:36 +03008 *
9 * Author:
10 * Juha Yrjola <juha.yrjola@nokia.com>
11 * Syed Khasim <x0khasim@ti.com>
Tony Lindgren1dbae812005-11-10 14:26:51 +000012 *
Santosh Shilimkar44169072009-05-28 14:16:04 -070013 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
14 *
Tony Lindgren1dbae812005-11-10 14:26:51 +000015 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License version 2 as
17 * published by the Free Software Foundation.
18 */
Tony Lindgren1dbae812005-11-10 14:26:51 +000019#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/init.h>
Russell Kingfced80c2008-09-06 12:10:45 +010022#include <linux/io.h>
Paul Walmsley2f135ea2009-06-19 19:08:25 -060023#include <linux/clk.h>
Tony Lindgren1dbae812005-11-10 14:26:51 +000024
Tony Lindgren120db2c2006-04-02 17:46:27 +010025#include <asm/tlb.h>
Tony Lindgren120db2c2006-04-02 17:46:27 +010026#include <asm/mach/map.h>
27
Tony Lindgrence491cf2009-10-20 09:40:47 -070028#include <plat/sram.h>
29#include <plat/sdrc.h>
Tony Lindgrence491cf2009-10-20 09:40:47 -070030#include <plat/serial.h>
Tony Lindgrenee0839c2012-02-24 10:34:35 -080031#include <plat/omap-pm.h>
32#include <plat/omap_hwmod.h>
33#include <plat/multi.h>
Paul Walmsleye2ed89f2012-04-13 06:34:26 -060034#include <plat/dma.h>
Tony Lindgren646e3ed2008-10-06 15:49:36 +030035
Tony Lindgren7d7e1eb2012-08-27 17:43:01 -070036#include <mach/hardware.h>
37
Tony Lindgrenee0839c2012-02-24 10:34:35 -080038#include "iomap.h"
39#include "voltage.h"
40#include "powerdomain.h"
41#include "clockdomain.h"
42#include "common.h"
Vaibhav Hiremathe30384a2012-05-29 15:26:41 +053043#include "clock.h"
Paul Walmsleye80a9722010-01-26 20:13:12 -070044#include "clock2xxx.h"
Paul Walmsley657ebfa2010-02-22 22:09:20 -070045#include "clock3xxx.h"
Paul Walmsleye80a9722010-01-26 20:13:12 -070046#include "clock44xx.h"
Tony Lindgren1dbae812005-11-10 14:26:51 +000047
Tony Lindgren1dbae812005-11-10 14:26:51 +000048/*
49 * The machine specific code may provide the extra mapping besides the
50 * default mapping provided here.
51 */
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030052
Tony Lindgrene48f8142012-03-06 11:49:22 -080053#if defined(CONFIG_SOC_OMAP2420) || defined(CONFIG_SOC_OMAP2430)
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030054static struct map_desc omap24xx_io_desc[] __initdata = {
Tony Lindgren1dbae812005-11-10 14:26:51 +000055 {
56 .virtual = L3_24XX_VIRT,
57 .pfn = __phys_to_pfn(L3_24XX_PHYS),
58 .length = L3_24XX_SIZE,
59 .type = MT_DEVICE
60 },
Kyungmin Park09f21ed2008-02-20 15:30:06 -080061 {
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030062 .virtual = L4_24XX_VIRT,
63 .pfn = __phys_to_pfn(L4_24XX_PHYS),
64 .length = L4_24XX_SIZE,
Syed Mohammed Khasim72d0f1c2006-12-06 17:14:05 -080065 .type = MT_DEVICE
66 },
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030067};
68
Tony Lindgren59b479e2011-01-27 16:39:40 -080069#ifdef CONFIG_SOC_OMAP2420
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030070static struct map_desc omap242x_io_desc[] __initdata = {
Tony Lindgren1dbae812005-11-10 14:26:51 +000071 {
Paul Walmsley7adb9982010-01-08 15:23:05 -070072 .virtual = DSP_MEM_2420_VIRT,
73 .pfn = __phys_to_pfn(DSP_MEM_2420_PHYS),
74 .length = DSP_MEM_2420_SIZE,
Tony Lindgrenc40fae952006-12-07 13:58:10 -080075 .type = MT_DEVICE
76 },
77 {
Paul Walmsley7adb9982010-01-08 15:23:05 -070078 .virtual = DSP_IPI_2420_VIRT,
79 .pfn = __phys_to_pfn(DSP_IPI_2420_PHYS),
80 .length = DSP_IPI_2420_SIZE,
Tony Lindgrenc40fae952006-12-07 13:58:10 -080081 .type = MT_DEVICE
82 },
83 {
Paul Walmsley7adb9982010-01-08 15:23:05 -070084 .virtual = DSP_MMU_2420_VIRT,
85 .pfn = __phys_to_pfn(DSP_MMU_2420_PHYS),
86 .length = DSP_MMU_2420_SIZE,
Tony Lindgren1dbae812005-11-10 14:26:51 +000087 .type = MT_DEVICE
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030088 },
Tony Lindgren1dbae812005-11-10 14:26:51 +000089};
90
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030091#endif
92
Tony Lindgren59b479e2011-01-27 16:39:40 -080093#ifdef CONFIG_SOC_OMAP2430
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +030094static struct map_desc omap243x_io_desc[] __initdata = {
95 {
96 .virtual = L4_WK_243X_VIRT,
97 .pfn = __phys_to_pfn(L4_WK_243X_PHYS),
98 .length = L4_WK_243X_SIZE,
99 .type = MT_DEVICE
100 },
101 {
102 .virtual = OMAP243X_GPMC_VIRT,
103 .pfn = __phys_to_pfn(OMAP243X_GPMC_PHYS),
104 .length = OMAP243X_GPMC_SIZE,
105 .type = MT_DEVICE
106 },
107 {
108 .virtual = OMAP243X_SDRC_VIRT,
109 .pfn = __phys_to_pfn(OMAP243X_SDRC_PHYS),
110 .length = OMAP243X_SDRC_SIZE,
111 .type = MT_DEVICE
112 },
113 {
114 .virtual = OMAP243X_SMS_VIRT,
115 .pfn = __phys_to_pfn(OMAP243X_SMS_PHYS),
116 .length = OMAP243X_SMS_SIZE,
117 .type = MT_DEVICE
118 },
119};
120#endif
121#endif
122
Tony Lindgrena8eb7ca2010-02-12 12:26:48 -0800123#ifdef CONFIG_ARCH_OMAP3
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +0300124static struct map_desc omap34xx_io_desc[] __initdata = {
125 {
126 .virtual = L3_34XX_VIRT,
127 .pfn = __phys_to_pfn(L3_34XX_PHYS),
128 .length = L3_34XX_SIZE,
129 .type = MT_DEVICE
130 },
131 {
132 .virtual = L4_34XX_VIRT,
133 .pfn = __phys_to_pfn(L4_34XX_PHYS),
134 .length = L4_34XX_SIZE,
135 .type = MT_DEVICE
136 },
137 {
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +0300138 .virtual = OMAP34XX_GPMC_VIRT,
139 .pfn = __phys_to_pfn(OMAP34XX_GPMC_PHYS),
140 .length = OMAP34XX_GPMC_SIZE,
141 .type = MT_DEVICE
142 },
143 {
144 .virtual = OMAP343X_SMS_VIRT,
145 .pfn = __phys_to_pfn(OMAP343X_SMS_PHYS),
146 .length = OMAP343X_SMS_SIZE,
147 .type = MT_DEVICE
148 },
149 {
150 .virtual = OMAP343X_SDRC_VIRT,
151 .pfn = __phys_to_pfn(OMAP343X_SDRC_PHYS),
152 .length = OMAP343X_SDRC_SIZE,
153 .type = MT_DEVICE
154 },
155 {
156 .virtual = L4_PER_34XX_VIRT,
157 .pfn = __phys_to_pfn(L4_PER_34XX_PHYS),
158 .length = L4_PER_34XX_SIZE,
159 .type = MT_DEVICE
160 },
161 {
162 .virtual = L4_EMU_34XX_VIRT,
163 .pfn = __phys_to_pfn(L4_EMU_34XX_PHYS),
164 .length = L4_EMU_34XX_SIZE,
165 .type = MT_DEVICE
166 },
Tony Lindgrena4f57b82010-04-30 12:57:14 -0700167#if defined(CONFIG_DEBUG_LL) && \
168 (defined(CONFIG_MACH_OMAP_ZOOM2) || defined(CONFIG_MACH_OMAP_ZOOM3))
169 {
170 .virtual = ZOOM_UART_VIRT,
171 .pfn = __phys_to_pfn(ZOOM_UART_BASE),
172 .length = SZ_1M,
173 .type = MT_DEVICE
174 },
175#endif
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +0300176};
177#endif
Hemant Pedanekar01001712011-02-16 08:31:39 -0800178
Kevin Hilman33959552012-05-10 11:10:07 -0700179#ifdef CONFIG_SOC_TI81XX
Hemant Pedanekara9203602011-12-13 10:46:44 -0800180static struct map_desc omapti81xx_io_desc[] __initdata = {
Hemant Pedanekar01001712011-02-16 08:31:39 -0800181 {
182 .virtual = L4_34XX_VIRT,
183 .pfn = __phys_to_pfn(L4_34XX_PHYS),
184 .length = L4_34XX_SIZE,
185 .type = MT_DEVICE
Afzal Mohammed1e6cb142011-12-13 10:46:43 -0800186 }
187};
188#endif
189
Kevin Hilmanbb6abcf2012-05-10 11:10:07 -0700190#ifdef CONFIG_SOC_AM33XX
Afzal Mohammed1e6cb142011-12-13 10:46:43 -0800191static struct map_desc omapam33xx_io_desc[] __initdata = {
Hemant Pedanekar01001712011-02-16 08:31:39 -0800192 {
193 .virtual = L4_34XX_VIRT,
194 .pfn = __phys_to_pfn(L4_34XX_PHYS),
195 .length = L4_34XX_SIZE,
196 .type = MT_DEVICE
197 },
Afzal Mohammed1e6cb142011-12-13 10:46:43 -0800198 {
199 .virtual = L4_WK_AM33XX_VIRT,
200 .pfn = __phys_to_pfn(L4_WK_AM33XX_PHYS),
201 .length = L4_WK_AM33XX_SIZE,
202 .type = MT_DEVICE
203 }
Hemant Pedanekar01001712011-02-16 08:31:39 -0800204};
205#endif
206
Santosh Shilimkar44169072009-05-28 14:16:04 -0700207#ifdef CONFIG_ARCH_OMAP4
208static struct map_desc omap44xx_io_desc[] __initdata = {
209 {
210 .virtual = L3_44XX_VIRT,
211 .pfn = __phys_to_pfn(L3_44XX_PHYS),
212 .length = L3_44XX_SIZE,
213 .type = MT_DEVICE,
214 },
215 {
216 .virtual = L4_44XX_VIRT,
217 .pfn = __phys_to_pfn(L4_44XX_PHYS),
218 .length = L4_44XX_SIZE,
219 .type = MT_DEVICE,
220 },
221 {
Santosh Shilimkar44169072009-05-28 14:16:04 -0700222 .virtual = L4_PER_44XX_VIRT,
223 .pfn = __phys_to_pfn(L4_PER_44XX_PHYS),
224 .length = L4_PER_44XX_SIZE,
225 .type = MT_DEVICE,
226 },
Santosh Shilimkar137d1052011-06-25 18:04:31 -0700227#ifdef CONFIG_OMAP4_ERRATA_I688
228 {
229 .virtual = OMAP4_SRAM_VA,
230 .pfn = __phys_to_pfn(OMAP4_SRAM_PA),
231 .length = PAGE_SIZE,
232 .type = MT_MEMORY_SO,
233 },
234#endif
235
Santosh Shilimkar44169072009-05-28 14:16:04 -0700236};
237#endif
Syed Mohammed, Khasimcc26b3b2008-10-09 17:51:41 +0300238
R Sricharan05e152c2012-06-05 16:21:32 +0530239#ifdef CONFIG_SOC_OMAP5
240static struct map_desc omap54xx_io_desc[] __initdata = {
241 {
242 .virtual = L3_54XX_VIRT,
243 .pfn = __phys_to_pfn(L3_54XX_PHYS),
244 .length = L3_54XX_SIZE,
245 .type = MT_DEVICE,
246 },
247 {
248 .virtual = L4_54XX_VIRT,
249 .pfn = __phys_to_pfn(L4_54XX_PHYS),
250 .length = L4_54XX_SIZE,
251 .type = MT_DEVICE,
252 },
253 {
254 .virtual = L4_WK_54XX_VIRT,
255 .pfn = __phys_to_pfn(L4_WK_54XX_PHYS),
256 .length = L4_WK_54XX_SIZE,
257 .type = MT_DEVICE,
258 },
259 {
260 .virtual = L4_PER_54XX_VIRT,
261 .pfn = __phys_to_pfn(L4_PER_54XX_PHYS),
262 .length = L4_PER_54XX_SIZE,
263 .type = MT_DEVICE,
264 },
265};
266#endif
267
Tony Lindgren59b479e2011-01-27 16:39:40 -0800268#ifdef CONFIG_SOC_OMAP2420
Aaro Koskinen8185e462010-03-03 16:24:53 +0000269void __init omap242x_map_common_io(void)
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800270{
271 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
272 iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc));
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800273}
274#endif
275
Tony Lindgren59b479e2011-01-27 16:39:40 -0800276#ifdef CONFIG_SOC_OMAP2430
Aaro Koskinen8185e462010-03-03 16:24:53 +0000277void __init omap243x_map_common_io(void)
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800278{
279 iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));
280 iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc));
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800281}
282#endif
283
Tony Lindgrena8eb7ca2010-02-12 12:26:48 -0800284#ifdef CONFIG_ARCH_OMAP3
Aaro Koskinen8185e462010-03-03 16:24:53 +0000285void __init omap34xx_map_common_io(void)
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800286{
287 iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800288}
289#endif
290
Kevin Hilman33959552012-05-10 11:10:07 -0700291#ifdef CONFIG_SOC_TI81XX
Hemant Pedanekara9203602011-12-13 10:46:44 -0800292void __init omapti81xx_map_common_io(void)
Hemant Pedanekar01001712011-02-16 08:31:39 -0800293{
Hemant Pedanekara9203602011-12-13 10:46:44 -0800294 iotable_init(omapti81xx_io_desc, ARRAY_SIZE(omapti81xx_io_desc));
Hemant Pedanekar01001712011-02-16 08:31:39 -0800295}
296#endif
297
Kevin Hilmanbb6abcf2012-05-10 11:10:07 -0700298#ifdef CONFIG_SOC_AM33XX
Afzal Mohammed1e6cb142011-12-13 10:46:43 -0800299void __init omapam33xx_map_common_io(void)
300{
301 iotable_init(omapam33xx_io_desc, ARRAY_SIZE(omapam33xx_io_desc));
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800302}
303#endif
304
305#ifdef CONFIG_ARCH_OMAP4
Aaro Koskinen8185e462010-03-03 16:24:53 +0000306void __init omap44xx_map_common_io(void)
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800307{
308 iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));
Santosh Shilimkar2ec1fc42012-02-02 19:33:55 +0530309 omap_barriers_init();
Tony Lindgren6fbd55d2010-02-12 12:26:47 -0800310}
311#endif
312
R Sricharan05e152c2012-06-05 16:21:32 +0530313#ifdef CONFIG_SOC_OMAP5
314void __init omap5_map_common_io(void)
315{
316 iotable_init(omap54xx_io_desc, ARRAY_SIZE(omap54xx_io_desc));
317}
318#endif
Paul Walmsley2f135ea2009-06-19 19:08:25 -0600319/*
320 * omap2_init_reprogram_sdrc - reprogram SDRC timing parameters
321 *
322 * Sets the CORE DPLL3 M2 divider to the same value that it's at
323 * currently. This has the effect of setting the SDRC SDRAM AC timing
324 * registers to the values currently defined by the kernel. Currently
325 * only defined for OMAP3; will return 0 if called on OMAP2. Returns
326 * -EINVAL if the dpll3_m2_ck cannot be found, 0 if called on OMAP2,
327 * or passes along the return value of clk_set_rate().
328 */
329static int __init _omap2_init_reprogram_sdrc(void)
330{
331 struct clk *dpll3_m2_ck;
332 int v = -EINVAL;
333 long rate;
334
335 if (!cpu_is_omap34xx())
336 return 0;
337
338 dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck");
Aaro Koskinene281f7e2010-11-30 14:17:58 +0000339 if (IS_ERR(dpll3_m2_ck))
Paul Walmsley2f135ea2009-06-19 19:08:25 -0600340 return -EINVAL;
341
342 rate = clk_get_rate(dpll3_m2_ck);
343 pr_info("Reprogramming SDRC clock to %ld Hz\n", rate);
344 v = clk_set_rate(dpll3_m2_ck, rate);
345 if (v)
346 pr_err("dpll3_m2_clk rate change failed: %d\n", v);
347
348 clk_put(dpll3_m2_ck);
349
350 return v;
351}
352
Paul Walmsley2092e5c2010-12-14 12:42:35 -0700353static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data)
354{
355 return omap_hwmod_set_postsetup_state(oh, *(u8 *)data);
356}
357
Tony Lindgren7b250af2011-10-04 18:26:28 -0700358static void __init omap_common_init_early(void)
359{
Arnd Bergmanndf804422011-11-01 13:47:27 +0100360 omap_init_consistent_dma_size();
Tony Lindgren7b250af2011-10-04 18:26:28 -0700361}
362
363static void __init omap_hwmod_init_postsetup(void)
Tony Lindgren120db2c2006-04-02 17:46:27 +0100364{
Paul Walmsley2092e5c2010-12-14 12:42:35 -0700365 u8 postsetup_state;
366
Paul Walmsley2092e5c2010-12-14 12:42:35 -0700367 /* Set the default postsetup state for all hwmods */
368#ifdef CONFIG_PM_RUNTIME
369 postsetup_state = _HWMOD_STATE_IDLE;
370#else
371 postsetup_state = _HWMOD_STATE_ENABLED;
372#endif
373 omap_hwmod_for_each(_set_hwmod_postsetup_state, &postsetup_state);
Benoit Cousson55d2cb02010-05-12 17:54:36 +0200374
Kevin Hilman53da4ce2010-12-09 09:13:48 -0600375 omap_pm_if_early_init();
Paul Walmsley48057342010-12-21 15:25:10 -0700376}
377
Paul Walmsley16110792012-01-25 12:57:46 -0700378#ifdef CONFIG_SOC_OMAP2420
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700379void __init omap2420_init_early(void)
380{
Tony Lindgren4c3cf902011-10-04 18:17:41 -0700381 omap2_set_globals_242x();
Vaibhav Hiremath4de34f32011-12-19 15:50:15 +0530382 omap2xxx_check_revision();
Tony Lindgren7b250af2011-10-04 18:26:28 -0700383 omap_common_init_early();
384 omap2xxx_voltagedomains_init();
385 omap242x_powerdomains_init();
386 omap242x_clockdomains_init();
387 omap2420_hwmod_init();
388 omap_hwmod_init_postsetup();
389 omap2420_clk_init();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700390}
Shawn Guobbd707a2012-04-26 16:06:50 +0800391
392void __init omap2420_init_late(void)
393{
394 omap_mux_late_init();
395 omap2_common_pm_late_init();
396 omap2_pm_init();
397}
Paul Walmsley16110792012-01-25 12:57:46 -0700398#endif
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700399
Paul Walmsley16110792012-01-25 12:57:46 -0700400#ifdef CONFIG_SOC_OMAP2430
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700401void __init omap2430_init_early(void)
402{
Tony Lindgren4c3cf902011-10-04 18:17:41 -0700403 omap2_set_globals_243x();
Vaibhav Hiremath4de34f32011-12-19 15:50:15 +0530404 omap2xxx_check_revision();
Tony Lindgren7b250af2011-10-04 18:26:28 -0700405 omap_common_init_early();
406 omap2xxx_voltagedomains_init();
407 omap243x_powerdomains_init();
408 omap243x_clockdomains_init();
409 omap2430_hwmod_init();
410 omap_hwmod_init_postsetup();
411 omap2430_clk_init();
412}
Shawn Guobbd707a2012-04-26 16:06:50 +0800413
414void __init omap2430_init_late(void)
415{
416 omap_mux_late_init();
417 omap2_common_pm_late_init();
418 omap2_pm_init();
419}
Sanjeev Premic4e2d242011-10-13 21:44:10 +0530420#endif
Tony Lindgren7b250af2011-10-04 18:26:28 -0700421
422/*
423 * Currently only board-omap3beagle.c should call this because of the
424 * same machine_id for 34xx and 36xx beagle.. Will get fixed with DT.
425 */
Sanjeev Premic4e2d242011-10-13 21:44:10 +0530426#ifdef CONFIG_ARCH_OMAP3
Tony Lindgren7b250af2011-10-04 18:26:28 -0700427void __init omap3_init_early(void)
428{
Tony Lindgren4c3cf902011-10-04 18:17:41 -0700429 omap2_set_globals_3xxx();
Vaibhav Hiremath4de34f32011-12-19 15:50:15 +0530430 omap3xxx_check_revision();
431 omap3xxx_check_features();
Tony Lindgren7b250af2011-10-04 18:26:28 -0700432 omap_common_init_early();
433 omap3xxx_voltagedomains_init();
434 omap3xxx_powerdomains_init();
435 omap3xxx_clockdomains_init();
436 omap3xxx_hwmod_init();
437 omap_hwmod_init_postsetup();
438 omap3xxx_clk_init();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700439}
440
441void __init omap3430_init_early(void)
442{
Tony Lindgren7b250af2011-10-04 18:26:28 -0700443 omap3_init_early();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700444}
445
446void __init omap35xx_init_early(void)
447{
Tony Lindgren7b250af2011-10-04 18:26:28 -0700448 omap3_init_early();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700449}
450
451void __init omap3630_init_early(void)
452{
Tony Lindgren7b250af2011-10-04 18:26:28 -0700453 omap3_init_early();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700454}
455
456void __init am35xx_init_early(void)
457{
Tony Lindgren7b250af2011-10-04 18:26:28 -0700458 omap3_init_early();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700459}
460
Hemant Pedanekara9203602011-12-13 10:46:44 -0800461void __init ti81xx_init_early(void)
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700462{
Hemant Pedanekara9203602011-12-13 10:46:44 -0800463 omap2_set_globals_ti81xx();
Vaibhav Hiremath4de34f32011-12-19 15:50:15 +0530464 omap3xxx_check_revision();
465 ti81xx_check_features();
Tony Lindgren4c3cf902011-10-04 18:17:41 -0700466 omap_common_init_early();
467 omap3xxx_voltagedomains_init();
468 omap3xxx_powerdomains_init();
469 omap3xxx_clockdomains_init();
470 omap3xxx_hwmod_init();
471 omap_hwmod_init_postsetup();
472 omap3xxx_clk_init();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700473}
Shawn Guobbd707a2012-04-26 16:06:50 +0800474
475void __init omap3_init_late(void)
476{
477 omap_mux_late_init();
478 omap2_common_pm_late_init();
479 omap3_pm_init();
480}
481
482void __init omap3430_init_late(void)
483{
484 omap_mux_late_init();
485 omap2_common_pm_late_init();
486 omap3_pm_init();
487}
488
489void __init omap35xx_init_late(void)
490{
491 omap_mux_late_init();
492 omap2_common_pm_late_init();
493 omap3_pm_init();
494}
495
496void __init omap3630_init_late(void)
497{
498 omap_mux_late_init();
499 omap2_common_pm_late_init();
500 omap3_pm_init();
501}
502
503void __init am35xx_init_late(void)
504{
505 omap_mux_late_init();
506 omap2_common_pm_late_init();
507 omap3_pm_init();
508}
509
510void __init ti81xx_init_late(void)
511{
512 omap_mux_late_init();
513 omap2_common_pm_late_init();
514 omap3_pm_init();
515}
Sanjeev Premic4e2d242011-10-13 21:44:10 +0530516#endif
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700517
Afzal Mohammed08f30982012-05-11 00:38:49 +0530518#ifdef CONFIG_SOC_AM33XX
519void __init am33xx_init_early(void)
520{
521 omap2_set_globals_am33xx();
522 omap3xxx_check_revision();
523 ti81xx_check_features();
524 omap_common_init_early();
Vaibhav Hiremathce3fc892012-06-18 00:47:26 -0600525 am33xx_voltagedomains_init();
Vaibhav Hiremath3f0ea762012-06-18 00:47:27 -0600526 am33xx_powerdomains_init();
Vaibhav Hiremath9c80f3a2012-06-18 00:47:27 -0600527 am33xx_clockdomains_init();
Vaibhav Hiremathe30384a2012-05-29 15:26:41 +0530528 am33xx_clk_init();
Afzal Mohammed08f30982012-05-11 00:38:49 +0530529}
530#endif
531
Sanjeev Premic4e2d242011-10-13 21:44:10 +0530532#ifdef CONFIG_ARCH_OMAP4
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700533void __init omap4430_init_early(void)
534{
Tony Lindgren4c3cf902011-10-04 18:17:41 -0700535 omap2_set_globals_443x();
Vaibhav Hiremath4de34f32011-12-19 15:50:15 +0530536 omap4xxx_check_revision();
537 omap4xxx_check_features();
Tony Lindgren7b250af2011-10-04 18:26:28 -0700538 omap_common_init_early();
539 omap44xx_voltagedomains_init();
540 omap44xx_powerdomains_init();
541 omap44xx_clockdomains_init();
542 omap44xx_hwmod_init();
543 omap_hwmod_init_postsetup();
544 omap4xxx_clk_init();
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700545}
Shawn Guobbd707a2012-04-26 16:06:50 +0800546
547void __init omap4430_init_late(void)
548{
549 omap_mux_late_init();
550 omap2_common_pm_late_init();
551 omap4_pm_init();
552}
Sanjeev Premic4e2d242011-10-13 21:44:10 +0530553#endif
Tony Lindgren8f5b5a42011-08-22 23:57:24 -0700554
R Sricharan05e152c2012-06-05 16:21:32 +0530555#ifdef CONFIG_SOC_OMAP5
556void __init omap5_init_early(void)
557{
558 omap2_set_globals_5xxx();
559 omap5xxx_check_revision();
560 omap_common_init_early();
561}
562#endif
563
Tony Lindgrena4ca9db2011-08-22 23:57:23 -0700564void __init omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,
Paul Walmsley48057342010-12-21 15:25:10 -0700565 struct omap_sdrc_params *sdrc_cs1)
566{
Tony Lindgrena66cb342011-10-04 13:52:57 -0700567 omap_sram_init();
568
Hemant Pedanekar01001712011-02-16 08:31:39 -0800569 if (cpu_is_omap24xx() || omap3_has_sdrc()) {
Kevin Hilmanaa4b1f62010-03-10 17:16:31 +0000570 omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
571 _omap2_init_reprogram_sdrc();
572 }
Tony Lindgren1dbae812005-11-10 14:26:51 +0000573}