Commit | Line | Data |
---|---|---|
aa218daf PW |
1 | /* |
2 | * linux/arch/arm/mach-omap2/common.c | |
3 | * | |
4 | * Code common to all OMAP2+ machines. | |
5 | * | |
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> | |
10 | * | |
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. | |
14 | */ | |
15 | #include <linux/kernel.h> | |
16 | #include <linux/init.h> | |
17 | #include <linux/clk.h> | |
18 | #include <linux/io.h> | |
19 | ||
2b43e4e5 | 20 | #include <plat/hardware.h> |
aa218daf | 21 | #include <plat/mux.h> |
aa218daf PW |
22 | #include <plat/clock.h> |
23 | ||
ee0839c2 TL |
24 | #include "iomap.h" |
25 | #include "common.h" | |
aa218daf | 26 | #include "sdrc.h" |
4814ced5 | 27 | #include "control.h" |
aa218daf PW |
28 | |
29 | /* Global address base setup code */ | |
30 | ||
aa218daf PW |
31 | static void __init __omap2_set_globals(struct omap_globals *omap2_globals) |
32 | { | |
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); | |
37 | } | |
38 | ||
59b479e0 | 39 | #if defined(CONFIG_SOC_OMAP2420) |
aa218daf PW |
40 | |
41 | static struct omap_globals omap242x_globals = { | |
42 | .class = OMAP242X_CLASS, | |
43 | .tap = OMAP2_L4_IO_ADDRESS(0x48014000), | |
4c3cf901 TL |
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), | |
aa218daf PW |
49 | }; |
50 | ||
51 | void __init omap2_set_globals_242x(void) | |
52 | { | |
53 | __omap2_set_globals(&omap242x_globals); | |
54 | } | |
35549ec3 BC |
55 | |
56 | void __init omap242x_map_io(void) | |
57 | { | |
35549ec3 BC |
58 | omap242x_map_common_io(); |
59 | } | |
aa218daf PW |
60 | #endif |
61 | ||
59b479e0 | 62 | #if defined(CONFIG_SOC_OMAP2430) |
aa218daf PW |
63 | |
64 | static struct omap_globals omap243x_globals = { | |
65 | .class = OMAP243X_CLASS, | |
66 | .tap = OMAP2_L4_IO_ADDRESS(0x4900a000), | |
4c3cf901 TL |
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), | |
aa218daf PW |
72 | }; |
73 | ||
74 | void __init omap2_set_globals_243x(void) | |
75 | { | |
76 | __omap2_set_globals(&omap243x_globals); | |
77 | } | |
35549ec3 BC |
78 | |
79 | void __init omap243x_map_io(void) | |
80 | { | |
35549ec3 BC |
81 | omap243x_map_common_io(); |
82 | } | |
aa218daf PW |
83 | #endif |
84 | ||
85 | #if defined(CONFIG_ARCH_OMAP3) | |
86 | ||
87 | static struct omap_globals omap3_globals = { | |
88 | .class = OMAP343X_CLASS, | |
89 | .tap = OMAP2_L4_IO_ADDRESS(0x4830A000), | |
4c3cf901 TL |
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), | |
aa218daf PW |
95 | }; |
96 | ||
97 | void __init omap2_set_globals_3xxx(void) | |
98 | { | |
99 | __omap2_set_globals(&omap3_globals); | |
100 | } | |
101 | ||
102 | void __init omap3_map_io(void) | |
103 | { | |
aa218daf PW |
104 | omap34xx_map_common_io(); |
105 | } | |
01001712 HP |
106 | |
107 | /* | |
108 | * Adjust TAP register base such that omap3_check_revision accesses the correct | |
a920360f HP |
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). | |
01001712 | 111 | */ |
a920360f HP |
112 | #define TI81XX_TAP_BASE (TI81XX_CTRL_BASE + \ |
113 | TI81XX_CONTROL_DEVICE_ID - 0x204) | |
01001712 | 114 | |
a920360f | 115 | static struct omap_globals ti81xx_globals = { |
01001712 | 116 | .class = OMAP343X_CLASS, |
a920360f HP |
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), | |
01001712 HP |
121 | }; |
122 | ||
a920360f | 123 | void __init omap2_set_globals_ti81xx(void) |
01001712 | 124 | { |
a920360f HP |
125 | __omap2_set_globals(&ti81xx_globals); |
126 | } | |
127 | ||
128 | void __init ti81xx_map_io(void) | |
129 | { | |
130 | omapti81xx_map_common_io(); | |
01001712 | 131 | } |
1c213ba1 | 132 | #endif |
1e6cb146 | 133 | |
1c213ba1 | 134 | #if defined(CONFIG_SOC_AM33XX) |
1e6cb146 | 135 | #define AM33XX_TAP_BASE (AM33XX_CTRL_BASE + \ |
a920360f | 136 | TI81XX_CONTROL_DEVICE_ID - 0x204) |
1e6cb146 AM |
137 | |
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), | |
144 | }; | |
145 | ||
146 | void __init omap2_set_globals_am33xx(void) | |
147 | { | |
148 | __omap2_set_globals(&am33xx_globals); | |
149 | } | |
150 | ||
151 | void __init am33xx_map_io(void) | |
152 | { | |
153 | omapam33xx_map_common_io(); | |
154 | } | |
aa218daf PW |
155 | #endif |
156 | ||
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), | |
4c3cf901 TL |
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), | |
610eb8c2 | 166 | .prcm_mpu = OMAP2_L4_IO_ADDRESS(OMAP4430_PRCM_MPU_BASE), |
aa218daf PW |
167 | }; |
168 | ||
169 | void __init omap2_set_globals_443x(void) | |
170 | { | |
ecc46cfd | 171 | __omap2_set_globals(&omap4_globals); |
aa218daf | 172 | } |
35549ec3 BC |
173 | |
174 | void __init omap4_map_io(void) | |
175 | { | |
35549ec3 BC |
176 | omap44xx_map_common_io(); |
177 | } | |
aa218daf PW |
178 | #endif |
179 | ||
05e152c7 S |
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), | |
190 | }; | |
191 | ||
192 | void __init omap2_set_globals_5xxx(void) | |
193 | { | |
194 | omap2_set_globals_tap(&omap5_globals); | |
195 | omap2_set_globals_control(&omap5_globals); | |
196 | omap2_set_globals_prcm(&omap5_globals); | |
197 | } | |
198 | ||
199 | void __init omap5_map_io(void) | |
200 | { | |
201 | omap5_map_common_io(); | |
202 | } | |
203 | #endif |