2 * linux/arch/arm/mach-omap2/common.c
4 * Code common to all OMAP2+ machines.
6 * Copyright (C) 2009 Texas Instruments
7 * Copyright (C) 2010 Nokia Corporation
8 * Tony Lindgren <tony@atomide.com>
9 * Added OMAP4 support - Santosh Shilimkar <santosh.shilimkar@ti.com>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/clk.h>
21 #include <plat/clock.h>
29 /* Global address base setup code */
31 static void __init __omap2_set_globals(struct omap_globals *omap2_globals)
33 omap2_set_globals_tap(omap2_globals);
34 omap2_set_globals_sdrc(omap2_globals);
35 omap2_set_globals_control(omap2_globals);
36 omap2_set_globals_prcm(omap2_globals);
39 #if defined(CONFIG_SOC_OMAP2420)
41 static struct omap_globals omap242x_globals = {
42 .class = OMAP242X_CLASS,
43 .tap = OMAP2_L4_IO_ADDRESS(0x48014000),
44 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP2420_SDRC_BASE),
45 .sms = OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE),
46 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE),
47 .prm = OMAP2_L4_IO_ADDRESS(OMAP2420_PRM_BASE),
48 .cm = OMAP2_L4_IO_ADDRESS(OMAP2420_CM_BASE),
51 void __init omap2_set_globals_242x(void)
53 __omap2_set_globals(&omap242x_globals);
56 void __init omap242x_map_io(void)
58 omap242x_map_common_io();
62 #if defined(CONFIG_SOC_OMAP2430)
64 static struct omap_globals omap243x_globals = {
65 .class = OMAP243X_CLASS,
66 .tap = OMAP2_L4_IO_ADDRESS(0x4900a000),
67 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP243X_SDRC_BASE),
68 .sms = OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE),
69 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP243X_CTRL_BASE),
70 .prm = OMAP2_L4_IO_ADDRESS(OMAP2430_PRM_BASE),
71 .cm = OMAP2_L4_IO_ADDRESS(OMAP2430_CM_BASE),
74 void __init omap2_set_globals_243x(void)
76 __omap2_set_globals(&omap243x_globals);
79 void __init omap243x_map_io(void)
81 omap243x_map_common_io();
85 #if defined(CONFIG_ARCH_OMAP3)
87 static struct omap_globals omap3_globals = {
88 .class = OMAP343X_CLASS,
89 .tap = OMAP2_L4_IO_ADDRESS(0x4830A000),
90 .sdrc = OMAP2_L3_IO_ADDRESS(OMAP343X_SDRC_BASE),
91 .sms = OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE),
92 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE),
93 .prm = OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE),
94 .cm = OMAP2_L4_IO_ADDRESS(OMAP3430_CM_BASE),
97 void __init omap2_set_globals_3xxx(void)
99 __omap2_set_globals(&omap3_globals);
102 void __init omap3_map_io(void)
104 omap34xx_map_common_io();
108 * Adjust TAP register base such that omap3_check_revision accesses the correct
109 * TI81XX register for checking device ID (it adds 0x204 to tap base while
110 * TI81XX DEVICE ID register is at offset 0x600 from control base).
112 #define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \
113 TI81XX_CONTROL_DEVICE_ID - 0x204)
115 static struct omap_globals ti81xx_globals = {
116 .class = OMAP343X_CLASS,
117 .tap = OMAP2_L4_IO_ADDRESS(TI81XX_TAP_BASE),
118 .ctrl = OMAP2_L4_IO_ADDRESS(TI81XX_CTRL_BASE),
119 .prm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
120 .cm = OMAP2_L4_IO_ADDRESS(TI81XX_PRCM_BASE),
123 void __init omap2_set_globals_ti81xx(void)
125 __omap2_set_globals(&ti81xx_globals);
128 void __init ti81xx_map_io(void)
130 omapti81xx_map_common_io();
134 #if defined(CONFIG_SOC_AM33XX)
135 #define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \
136 TI81XX_CONTROL_DEVICE_ID - 0x204)
138 static struct omap_globals am33xx_globals = {
139 .class = AM335X_CLASS,
140 .tap = AM33XX_L4_WK_IO_ADDRESS(AM33XX_TAP_BASE),
141 .ctrl = AM33XX_L4_WK_IO_ADDRESS(AM33XX_CTRL_BASE),
142 .prm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
143 .cm = AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRCM_BASE),
146 void __init omap2_set_globals_am33xx(void)
148 __omap2_set_globals(&am33xx_globals);
151 void __init am33xx_map_io(void)
153 omapam33xx_map_common_io();
157 #if defined(CONFIG_ARCH_OMAP4)
158 static struct omap_globals omap4_globals = {
159 .class = OMAP443X_CLASS,
160 .tap = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
161 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP443X_SCM_BASE),
162 .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP443X_CTRL_BASE),
163 .prm = OMAP2_L4_IO_ADDRESS(OMAP4430_PRM_BASE),
164 .cm = OMAP2_L4_IO_ADDRESS(OMAP4430_CM_BASE),
165 .cm2 = OMAP2_L4_IO_ADDRESS(OMAP4430_CM2_BASE),
166 .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE),
169 void __init omap2_set_globals_443x(void)
171 __omap2_set_globals(&omap4_globals);
174 void __init omap4_map_io(void)
176 omap44xx_map_common_io();
180 #if defined(CONFIG_SOC_OMAP5)
181 static struct omap_globals omap5_globals = {
182 .class = OMAP54XX_CLASS,
183 .tap = OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
184 .ctrl = OMAP2_L4_IO_ADDRESS(OMAP54XX_SCM_BASE),
185 .ctrl_pad = OMAP2_L4_IO_ADDRESS(OMAP54XX_CTRL_BASE),
186 .prm = OMAP2_L4_IO_ADDRESS(OMAP54XX_PRM_BASE),
187 .cm = OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_AON_BASE),
188 .cm2 = OMAP2_L4_IO_ADDRESS(OMAP54XX_CM_CORE_BASE),
189 .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP54XX_PRCM_MPU_BASE),
192 void __init omap2_set_globals_5xxx(void)
194 omap2_set_globals_tap(&omap5_globals);
195 omap2_set_globals_control(&omap5_globals);
196 omap2_set_globals_prcm(&omap5_globals);
199 void __init omap5_map_io(void)
201 omap5_map_common_io();