blob: c2c9233ac443a6a9801ad32a28ade0fdafa179ff [file] [log] [blame]
Brian Swetland30421022007-11-26 04:11:43 -08001/* arch/arm/mach-msm/io.c
2 *
Daniel Walkercf62ffa2010-05-04 15:12:27 -07003 * MSM7K, QSD io support
Brian Swetland30421022007-11-26 04:11:43 -08004 *
5 * Copyright (C) 2007 Google, Inc.
Taniya Das43bcdd62011-12-02 17:33:27 +05306 * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved.
Brian Swetland30421022007-11-26 04:11:43 -08007 * Author: Brian Swetland <swetland@google.com>
8 *
9 * This software is licensed under the terms of the GNU General Public
10 * License version 2, as published by the Free Software Foundation, and
11 * may be copied, distributed, and modified under those terms.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
Russell Kingfced80c2008-09-06 12:10:45 +010022#include <linux/io.h>
Paul Gortmakerdc280942011-07-31 16:17:29 -040023#include <linux/export.h>
Brian Swetland30421022007-11-26 04:11:43 -080024
Russell Kinga09e64f2008-08-05 16:14:15 +010025#include <mach/hardware.h>
Brian Swetland30421022007-11-26 04:11:43 -080026#include <asm/page.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/msm_iomap.h>
Trilok Soni80c19362012-10-15 00:55:00 +053028#include <mach/memory.h>
Brian Swetland30421022007-11-26 04:11:43 -080029#include <asm/mach/map.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070030#include <linux/dma-mapping.h>
Brian Swetland30421022007-11-26 04:11:43 -080031
Russell Kinga09e64f2008-08-05 16:14:15 +010032#include <mach/board.h>
Brian Swetland30421022007-11-26 04:11:43 -080033
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070034#define MSM_CHIP_DEVICE(name, chip) { \
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070035 .virtual = (unsigned long) MSM_##name##_BASE, \
David Brown8c27e6f2011-01-07 10:20:49 -080036 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
37 .length = chip##_##name##_SIZE, \
Rohit Vaswanidba530e2012-06-12 20:04:28 -070038 .type = MT_DEVICE, \
Brian Swetland30421022007-11-26 04:11:43 -080039 }
40
David Brown8c27e6f2011-01-07 10:20:49 -080041#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
42
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043/* msm_shared_ram_phys default value of 0x00100000 is the most common value
44 * and should work as-is for any target without stacked memory.
45 */
46unsigned int msm_shared_ram_phys = 0x00100000;
47
Stephen Boyd552e4292012-02-21 01:27:20 -080048static void __init msm_map_io(struct map_desc *io_desc, int size)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049{
50 int i;
51
52 BUG_ON(!size);
53 for (i = 0; i < size; i++)
54 if (io_desc[i].virtual == (unsigned long)MSM_SHARED_RAM_BASE)
55 io_desc[i].pfn = __phys_to_pfn(msm_shared_ram_phys);
56
57 iotable_init(io_desc, size);
58}
59
60#if defined(CONFIG_ARCH_MSM7X01A) || defined(CONFIG_ARCH_MSM7X27) \
Daniel Walkercf62ffa2010-05-04 15:12:27 -070061 || defined(CONFIG_ARCH_MSM7X25)
Brian Swetland30421022007-11-26 04:11:43 -080062static struct map_desc msm_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +053063 MSM_CHIP_DEVICE(VIC, MSM7XXX),
64 MSM_CHIP_DEVICE(CSR, MSM7XXX),
65 MSM_CHIP_DEVICE(TMR, MSM7XXX),
66 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
67 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
68 MSM_CHIP_DEVICE(CLK_CTL, MSM7XXX),
69 MSM_CHIP_DEVICE(AD5, MSM7XXX),
70 MSM_CHIP_DEVICE(MDC, MSM7XXX),
Stephen Boyd650e3f02011-11-08 10:33:03 -080071#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
72 defined(CONFIG_DEBUG_MSM_UART3)
Pavel Machek6339f662009-11-02 11:48:29 +010073 MSM_DEVICE(DEBUG_UART),
74#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070075#ifdef CONFIG_CACHE_L2X0
76 {
77 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +053078 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
79 .length = MSM7XXX_L2CC_SIZE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070080 .type = MT_DEVICE,
81 },
Dima Zavinb42dc442010-01-29 11:43:42 -080082#endif
Brian Swetland30421022007-11-26 04:11:43 -080083 {
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070084 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Brian Swetland30421022007-11-26 04:11:43 -080085 .length = MSM_SHARED_RAM_SIZE,
86 .type = MT_DEVICE,
87 },
88};
89
90void __init msm_map_common_io(void)
91{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070092 /*Peripheral port memory remap, nothing looks to be there for
93 * cortex a5.
94 */
95#ifndef CONFIG_ARCH_MSM_CORTEX_A5
Brian Swetland30421022007-11-26 04:11:43 -080096 /* Make sure the peripheral register window is closed, since
97 * we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
98 * pages are peripheral interface or not.
99 */
100 asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700101#endif
102 msm_map_io(msm_io_desc, ARRAY_SIZE(msm_io_desc));
Trilok Soni80c19362012-10-15 00:55:00 +0530103 map_page_strongly_ordered();
Brian Swetland30421022007-11-26 04:11:43 -0800104}
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700105#endif
106
107#ifdef CONFIG_ARCH_QSD8X50
108static struct map_desc qsd8x50_io_desc[] __initdata = {
109 MSM_DEVICE(VIC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700110 MSM_DEVICE(CSR),
111 MSM_DEVICE(TMR),
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700112 MSM_DEVICE(GPIO1),
113 MSM_DEVICE(GPIO2),
114 MSM_DEVICE(CLK_CTL),
115 MSM_DEVICE(SIRC),
116 MSM_DEVICE(SCPLL),
117 MSM_DEVICE(AD5),
118 MSM_DEVICE(MDC),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700119 MSM_DEVICE(TCSR),
Stephen Boyd650e3f02011-11-08 10:33:03 -0800120#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
121 defined(CONFIG_DEBUG_MSM_UART3)
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700122 MSM_DEVICE(DEBUG_UART),
123#endif
124 {
125 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700126 .length = MSM_SHARED_RAM_SIZE,
127 .type = MT_DEVICE,
128 },
129};
130
131void __init msm_map_qsd8x50_io(void)
132{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700133 msm_map_io(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc));
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700134}
Brian Swetland30421022007-11-26 04:11:43 -0800135#endif /* CONFIG_ARCH_QSD8X50 */
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700136
137#ifdef CONFIG_ARCH_MSM8X60
138static struct map_desc msm8x60_io_desc[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700139 MSM_DEVICE(QGIC_DIST),
140 MSM_DEVICE(QGIC_CPU),
141 MSM_DEVICE(TMR),
142 MSM_DEVICE(TMR0),
143 MSM_DEVICE(RPM_MPM),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700144 MSM_DEVICE(ACC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700145 MSM_DEVICE(ACC0),
146 MSM_DEVICE(ACC1),
147 MSM_DEVICE(SAW0),
148 MSM_DEVICE(SAW1),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700149 MSM_DEVICE(GCC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700150 MSM_DEVICE(TLMM),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700151 MSM_DEVICE(SCPLL),
152 MSM_DEVICE(RPM),
153 MSM_DEVICE(CLK_CTL),
154 MSM_DEVICE(MMSS_CLK_CTL),
155 MSM_DEVICE(LPASS_CLK_CTL),
156 MSM_DEVICE(TCSR),
157 MSM_DEVICE(IMEM),
158 MSM_DEVICE(HDMI),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800159#ifdef CONFIG_DEBUG_MSM8660_UART
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700160 MSM_DEVICE(DEBUG_UART),
161#endif
162 MSM_DEVICE(SIC_NON_SECURE),
163 {
164 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
165 .length = MSM_SHARED_RAM_SIZE,
166 .type = MT_DEVICE,
167 },
168 MSM_DEVICE(QFPROM),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700169};
170
171void __init msm_map_msm8x60_io(void)
172{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700173 msm_map_io(msm8x60_io_desc, ARRAY_SIZE(msm8x60_io_desc));
Steve Mucklef132c6c2012-06-06 18:30:57 -0700174 init_consistent_dma_size(14*SZ_1M);
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700175}
176#endif /* CONFIG_ARCH_MSM8X60 */
177
178#ifdef CONFIG_ARCH_MSM8960
179static struct map_desc msm8960_io_desc[] __initdata = {
180 MSM_CHIP_DEVICE(QGIC_DIST, MSM8960),
181 MSM_CHIP_DEVICE(QGIC_CPU, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700182 MSM_CHIP_DEVICE(ACC0, MSM8960),
183 MSM_CHIP_DEVICE(ACC1, MSM8960),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700184 MSM_CHIP_DEVICE(TMR, MSM8960),
185 MSM_CHIP_DEVICE(TMR0, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700186 MSM_CHIP_DEVICE(RPM_MPM, MSM8960),
187 MSM_CHIP_DEVICE(CLK_CTL, MSM8960),
188 MSM_CHIP_DEVICE(MMSS_CLK_CTL, MSM8960),
189 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM8960),
190 MSM_CHIP_DEVICE(RPM, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700191 MSM_CHIP_DEVICE(TLMM, MSM8960),
192 MSM_CHIP_DEVICE(HFPLL, MSM8960),
193 MSM_CHIP_DEVICE(SAW0, MSM8960),
194 MSM_CHIP_DEVICE(SAW1, MSM8960),
195 MSM_CHIP_DEVICE(SAW_L2, MSM8960),
196 MSM_CHIP_DEVICE(SIC_NON_SECURE, MSM8960),
197 MSM_CHIP_DEVICE(APCS_GCC, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700198 MSM_CHIP_DEVICE(IMEM, MSM8960),
199 MSM_CHIP_DEVICE(HDMI, MSM8960),
200 {
201 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
202 .length = MSM_SHARED_RAM_SIZE,
203 .type = MT_DEVICE,
204 },
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800205#ifdef CONFIG_DEBUG_MSM8960_UART
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700206 MSM_DEVICE(DEBUG_UART),
207#endif
Siddartha Mohanadossce1315a2011-04-21 15:25:55 -0700208 MSM_CHIP_DEVICE(QFPROM, MSM8960),
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700209};
210
211void __init msm_map_msm8960_io(void)
212{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700213 msm_map_io(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc));
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700214}
215#endif /* CONFIG_ARCH_MSM8960 */
216
Stepan Moskovchenko2b992ad2011-10-18 17:24:18 -0700217#ifdef CONFIG_ARCH_MSM8930
218static struct map_desc msm8930_io_desc[] __initdata = {
219 MSM_CHIP_DEVICE(QGIC_DIST, MSM8930),
220 MSM_CHIP_DEVICE(QGIC_CPU, MSM8930),
221 MSM_CHIP_DEVICE(ACC0, MSM8930),
222 MSM_CHIP_DEVICE(ACC1, MSM8930),
223 MSM_CHIP_DEVICE(TMR, MSM8930),
224 MSM_CHIP_DEVICE(TMR0, MSM8930),
225 MSM_CHIP_DEVICE(RPM_MPM, MSM8930),
226 MSM_CHIP_DEVICE(CLK_CTL, MSM8930),
227 MSM_CHIP_DEVICE(MMSS_CLK_CTL, MSM8930),
228 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM8930),
229 MSM_CHIP_DEVICE(RPM, MSM8930),
230 MSM_CHIP_DEVICE(TLMM, MSM8930),
231 MSM_CHIP_DEVICE(HFPLL, MSM8930),
232 MSM_CHIP_DEVICE(SAW0, MSM8930),
233 MSM_CHIP_DEVICE(SAW1, MSM8930),
234 MSM_CHIP_DEVICE(SAW_L2, MSM8930),
235 MSM_CHIP_DEVICE(SIC_NON_SECURE, MSM8930),
236 MSM_CHIP_DEVICE(APCS_GCC, MSM8930),
237 MSM_CHIP_DEVICE(IMEM, MSM8930),
238 MSM_CHIP_DEVICE(HDMI, MSM8930),
239 {
240 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
241 .length = MSM_SHARED_RAM_SIZE,
242 .type = MT_DEVICE,
243 },
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800244#ifdef CONFIG_DEBUG_MSM8930_UART
Stepan Moskovchenko2b992ad2011-10-18 17:24:18 -0700245 MSM_DEVICE(DEBUG_UART),
246#endif
247 MSM_CHIP_DEVICE(QFPROM, MSM8930),
248};
249
250void __init msm_map_msm8930_io(void)
251{
252 msm_map_io(msm8930_io_desc, ARRAY_SIZE(msm8930_io_desc));
253}
254#endif /* CONFIG_ARCH_MSM8930 */
255
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700256#ifdef CONFIG_ARCH_APQ8064
257static struct map_desc apq8064_io_desc[] __initdata = {
258 MSM_CHIP_DEVICE(QGIC_DIST, APQ8064),
259 MSM_CHIP_DEVICE(QGIC_CPU, APQ8064),
260 MSM_CHIP_DEVICE(TMR, APQ8064),
261 MSM_CHIP_DEVICE(TMR0, APQ8064),
Joel King4ebccc62011-07-22 09:43:22 -0700262 MSM_CHIP_DEVICE(TLMM, APQ8064),
Vikram Mulukutlabb408eb2011-08-04 09:28:56 -0700263 MSM_CHIP_DEVICE(ACC0, APQ8064),
264 MSM_CHIP_DEVICE(ACC1, APQ8064),
265 MSM_CHIP_DEVICE(ACC2, APQ8064),
266 MSM_CHIP_DEVICE(ACC3, APQ8064),
267 MSM_CHIP_DEVICE(HFPLL, APQ8064),
Tianyi Gou33430412011-09-07 21:50:42 -0700268 MSM_CHIP_DEVICE(CLK_CTL, APQ8064),
269 MSM_CHIP_DEVICE(MMSS_CLK_CTL, APQ8064),
270 MSM_CHIP_DEVICE(LPASS_CLK_CTL, APQ8064),
Vikram Mulukutlabb408eb2011-08-04 09:28:56 -0700271 MSM_CHIP_DEVICE(APCS_GCC, APQ8064),
Praveen Chidambaramd9a41732011-10-17 09:41:05 -0600272 MSM_CHIP_DEVICE(RPM, APQ8064),
273 MSM_CHIP_DEVICE(RPM_MPM, APQ8064),
274 MSM_CHIP_DEVICE(SAW0, APQ8064),
275 MSM_CHIP_DEVICE(SAW1, APQ8064),
276 MSM_CHIP_DEVICE(SAW2, APQ8064),
277 MSM_CHIP_DEVICE(SAW3, APQ8064),
278 MSM_CHIP_DEVICE(SAW_L2, APQ8064),
Stepan Moskovchenko3e444e52011-08-05 17:59:48 -0700279 MSM_CHIP_DEVICE(IMEM, APQ8064),
Aravind Venkateswaran7eb05da2012-02-16 14:23:03 -0800280 MSM_CHIP_DEVICE(HDMI, APQ8064),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700281 {
282 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
283 .length = MSM_SHARED_RAM_SIZE,
284 .type = MT_DEVICE,
285 },
Vijayakumar Muthuvel Manickamf35fd732012-01-13 16:17:52 -0800286 MSM_CHIP_DEVICE(QFPROM, APQ8064),
Jeff Hugo85bfed42012-01-31 10:10:14 -0700287 MSM_CHIP_DEVICE(SIC_NON_SECURE, APQ8064),
Stepan Moskovchenko824db172012-05-29 18:05:09 -0700288#ifdef CONFIG_DEBUG_APQ8064_UART
289 MSM_DEVICE(DEBUG_UART),
290#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700291};
292
293void __init msm_map_apq8064_io(void)
294{
295 msm_map_io(apq8064_io_desc, ARRAY_SIZE(apq8064_io_desc));
296}
297#endif /* CONFIG_ARCH_APQ8064 */
298
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700299#ifdef CONFIG_ARCH_MSM8974
300static struct map_desc msm_8974_io_desc[] __initdata = {
301 MSM_CHIP_DEVICE(QGIC_DIST, MSM8974),
302 MSM_CHIP_DEVICE(QGIC_CPU, MSM8974),
303 MSM_CHIP_DEVICE(APCS_GCC, MSM8974),
304 MSM_CHIP_DEVICE(TLMM, MSM8974),
Stepan Moskovchenkoda7ce9c2012-08-14 21:02:21 -0700305 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM8974),
Hanumant Singh3d7d8422012-08-22 21:13:18 -0700306 MSM_CHIP_DEVICE(IMEM, MSM8974),
Jeff Hugo70946092012-02-10 11:30:43 -0700307 {
308 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
309 .length = MSM_SHARED_RAM_SIZE,
310 .type = MT_DEVICE,
311 },
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700312#ifdef CONFIG_DEBUG_MSM8974_UART
Sathish Ambleyf5bebd62011-11-03 23:36:36 -0700313 MSM_DEVICE(DEBUG_UART),
314#endif
Hanumant Singh5e289fc2012-08-27 17:38:40 -0700315 MSM_CHIP_DEVICE(DBG_IMEM, MSM8974),
Sathish Ambley6829db12011-10-08 22:41:23 -0700316};
317
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700318void __init msm_map_8974_io(void)
Sathish Ambley6829db12011-10-08 22:41:23 -0700319{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700320 msm_shared_ram_phys = MSM8974_MSM_SHARED_RAM_PHYS;
321 msm_map_io(msm_8974_io_desc, ARRAY_SIZE(msm_8974_io_desc));
Sathish Ambley6829db12011-10-08 22:41:23 -0700322}
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700323#endif /* CONFIG_ARCH_MSM8974 */
Sathish Ambley6829db12011-10-08 22:41:23 -0700324
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700325#ifdef CONFIG_ARCH_MSM7X30
326static struct map_desc msm7x30_io_desc[] __initdata = {
Taniya Das298de8c2012-02-16 11:45:31 +0530327 MSM_CHIP_DEVICE(VIC, MSM7X30),
328 MSM_CHIP_DEVICE(CSR, MSM7X30),
329 MSM_CHIP_DEVICE(TMR, MSM7X30),
330 MSM_CHIP_DEVICE(GPIO1, MSM7X30),
331 MSM_CHIP_DEVICE(GPIO2, MSM7X30),
332 MSM_CHIP_DEVICE(CLK_CTL, MSM7X30),
333 MSM_CHIP_DEVICE(CLK_CTL_SH2, MSM7X30),
334 MSM_CHIP_DEVICE(AD5, MSM7X30),
335 MSM_CHIP_DEVICE(MDC, MSM7X30),
336 MSM_CHIP_DEVICE(ACC0, MSM7X30),
337 MSM_CHIP_DEVICE(SAW0, MSM7X30),
338 MSM_CHIP_DEVICE(APCS_GCC, MSM7X30),
339 MSM_CHIP_DEVICE(TCSR, MSM7X30),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800340#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
341 defined(CONFIG_DEBUG_MSM_UART3)
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700342 MSM_DEVICE(DEBUG_UART),
343#endif
344 {
345 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700346 .length = MSM_SHARED_RAM_SIZE,
347 .type = MT_DEVICE,
348 },
349};
350
351void __init msm_map_msm7x30_io(void)
352{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700353 msm_map_io(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700354}
355#endif /* CONFIG_ARCH_MSM7X30 */
356
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700357#ifdef CONFIG_ARCH_FSM9XXX
358static struct map_desc fsm9xxx_io_desc[] __initdata = {
359 MSM_DEVICE(VIC),
360 MSM_DEVICE(SIRC),
361 MSM_DEVICE(CSR),
362 MSM_DEVICE(TLMM),
363 MSM_DEVICE(TCSR),
364 MSM_DEVICE(CLK_CTL),
365 MSM_DEVICE(ACC),
366 MSM_DEVICE(SAW),
367 MSM_DEVICE(GCC),
368 MSM_DEVICE(GRFC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700369 MSM_DEVICE(QFP_FUSE),
370 MSM_DEVICE(HH),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800371#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
372 defined(CONFIG_DEBUG_MSM_UART3)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700373 MSM_DEVICE(DEBUG_UART),
374#endif
375 {
376 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
377 .length = MSM_SHARED_RAM_SIZE,
378 .type = MT_DEVICE,
379 },
380};
Brian Swetland30421022007-11-26 04:11:43 -0800381
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700382void __init msm_map_fsm9xxx_io(void)
383{
384 msm_map_io(fsm9xxx_io_desc, ARRAY_SIZE(fsm9xxx_io_desc));
Brian Swetland30421022007-11-26 04:11:43 -0800385}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700386#endif /* CONFIG_ARCH_FSM9XXX */
387
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700388#ifdef CONFIG_ARCH_MSM9615
389static struct map_desc msm9615_io_desc[] __initdata = {
390 MSM_CHIP_DEVICE(QGIC_DIST, MSM9615),
391 MSM_CHIP_DEVICE(QGIC_CPU, MSM9615),
392 MSM_CHIP_DEVICE(ACC0, MSM9615),
393 MSM_CHIP_DEVICE(TMR, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700394 MSM_CHIP_DEVICE(TLMM, MSM9615),
395 MSM_CHIP_DEVICE(SAW0, MSM9615),
396 MSM_CHIP_DEVICE(APCS_GCC, MSM9615),
397 MSM_CHIP_DEVICE(TCSR, MSM9615),
Vikram Mulukutla489e39e2011-08-31 18:04:05 -0700398 MSM_CHIP_DEVICE(L2CC, MSM9615),
399 MSM_CHIP_DEVICE(CLK_CTL, MSM9615),
400 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM9615),
Rohit Vaswani71c86b72011-09-09 16:51:46 -0700401 MSM_CHIP_DEVICE(RPM, MSM9615),
402 MSM_CHIP_DEVICE(RPM_MPM, MSM9615),
403 MSM_CHIP_DEVICE(APCS_GLB, MSM9615),
Rohit Vaswani4f96570c2011-10-13 18:14:37 -0700404 MSM_CHIP_DEVICE(IMEM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700405 {
406 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
407 .length = MSM_SHARED_RAM_SIZE,
408 .type = MT_DEVICE,
409 },
Siddartha Mohanadoss5d49cec2011-09-21 10:26:15 -0700410 MSM_CHIP_DEVICE(QFPROM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700411};
412
413void __init msm_map_msm9615_io(void)
414{
415 msm_map_io(msm9615_io_desc, ARRAY_SIZE(msm9615_io_desc));
416}
417#endif /* CONFIG_ARCH_MSM9615 */
418
Taniya Das43bcdd62011-12-02 17:33:27 +0530419#ifdef CONFIG_ARCH_MSM8625
420static struct map_desc msm8625_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +0530421 MSM_CHIP_DEVICE(CSR, MSM7XXX),
422 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
423 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
424 MSM_CHIP_DEVICE(QGIC_DIST, MSM8625),
425 MSM_CHIP_DEVICE(QGIC_CPU, MSM8625),
426 MSM_CHIP_DEVICE(TMR, MSM8625),
427 MSM_CHIP_DEVICE(TMR0, MSM8625),
428 MSM_CHIP_DEVICE(SCU, MSM8625),
429 MSM_CHIP_DEVICE(CFG_CTL, MSM8625),
430 MSM_CHIP_DEVICE(CLK_CTL, MSM8625),
Taniya Das12df7bf2012-02-15 11:36:19 +0530431 MSM_CHIP_DEVICE(SAW0, MSM8625),
432 MSM_CHIP_DEVICE(SAW1, MSM8625),
Manish Dewangan504430a2012-02-29 17:34:38 +0530433 MSM_CHIP_DEVICE(AD5, MSM7XXX),
Taniya Dase3027e22012-02-27 16:32:27 +0530434 MSM_CHIP_DEVICE(MDC, MSM7XXX),
Taniya Das43bcdd62011-12-02 17:33:27 +0530435#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
436 defined(CONFIG_DEBUG_MSM_UART3)
Taniya Dasfa4ee7f2012-02-21 15:04:51 +0530437 MSM_DEVICE(DEBUG_UART),
Taniya Das43bcdd62011-12-02 17:33:27 +0530438#endif
439#ifdef CONFIG_CACHE_L2X0
440 {
441 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +0530442 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
443 .length = MSM7XXX_L2CC_SIZE,
Taniya Das43bcdd62011-12-02 17:33:27 +0530444 .type = MT_DEVICE,
445 },
446#endif
447 {
448 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
449 .length = MSM_SHARED_RAM_SIZE,
450 .type = MT_DEVICE,
451 },
452};
453
454void __init msm_map_msm8625_io(void)
455{
456 msm_map_io(msm8625_io_desc, ARRAY_SIZE(msm8625_io_desc));
Trilok Soni80c19362012-10-15 00:55:00 +0530457 map_page_strongly_ordered();
Taniya Das43bcdd62011-12-02 17:33:27 +0530458}
459#else
460void __init msm_map_msm8625_io(void) { return; }
461#endif /* CONFIG_ARCH_MSM8625 */
462
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700463#ifdef CONFIG_ARCH_MSM9625
464static struct map_desc msm9625_io_desc[] __initdata = {
465 MSM_CHIP_DEVICE(APCS_GCC, MSM9625),
Girish Mahadevan88170712012-10-09 15:27:06 -0700466 MSM_CHIP_DEVICE(QGIC_DIST, MSM9625),
467 MSM_CHIP_DEVICE(QGIC_CPU, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700468 MSM_CHIP_DEVICE(TLMM, MSM9625),
Abhimanyu Kapur46e5e2b2012-10-02 20:45:37 -0700469 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700470 MSM_CHIP_DEVICE(TMR, MSM9625),
Mitchel Humpherys68bb5dd2012-10-02 16:32:27 -0700471 MSM_CHIP_DEVICE(IMEM, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700472 {
473 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
474 .length = MSM_SHARED_RAM_SIZE,
475 .type = MT_DEVICE,
476 },
477#ifdef CONFIG_DEBUG_MSM9625_UART
478 MSM_DEVICE(DEBUG_UART),
479#endif
Mitchel Humpherys68bb5dd2012-10-02 16:32:27 -0700480 MSM_CHIP_DEVICE(DBG_IMEM, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700481};
482
483void __init msm_map_msm9625_io(void)
484{
485 msm_shared_ram_phys = MSM9625_SHARED_RAM_PHYS;
486 msm_map_io(msm9625_io_desc, ARRAY_SIZE(msm9625_io_desc));
487}
488#endif /* CONFIG_ARCH_MSM9625 */
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530489
490#ifdef CONFIG_ARCH_MPQ8092
491static struct map_desc mpq8092_io_desc[] __initdata = {
492 MSM_CHIP_DEVICE(QGIC_DIST, MPQ8092),
493 MSM_CHIP_DEVICE(QGIC_CPU, MPQ8092),
494 MSM_CHIP_DEVICE(APCS_GCC, MPQ8092),
495 MSM_CHIP_DEVICE(TLMM, MPQ8092),
496 {
497 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
498 .length = MSM_SHARED_RAM_SIZE,
499 .type = MT_DEVICE,
500 },
501#ifdef CONFIG_DEBUG_MPQ8092_UART
502 MSM_DEVICE(DEBUG_UART),
503#endif
504};
505
506void __init msm_map_mpq8092_io(void)
507{
Ravi Kumar V8485af62012-09-21 13:15:17 +0530508 msm_shared_ram_phys = MPQ8092_MSM_SHARED_RAM_PHYS;
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530509 msm_map_io(mpq8092_io_desc, ARRAY_SIZE(mpq8092_io_desc));
510}
511#endif /* CONFIG_ARCH_MPQ8092 */
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700512
513#ifdef CONFIG_ARCH_MSM8226
514static struct map_desc msm_8226_io_desc[] __initdata = {
515 MSM_CHIP_DEVICE(QGIC_DIST, MSM8226),
516 MSM_CHIP_DEVICE(QGIC_CPU, MSM8226),
517 MSM_CHIP_DEVICE(APCS_GCC, MSM8226),
518 MSM_CHIP_DEVICE(TLMM, MSM8226),
519 MSM_CHIP_DEVICE(IMEM, MSM8226),
Syed Rameez Mustafa16b1bf32012-09-10 19:21:45 -0700520 MSM_CHIP_DEVICE(DBG_IMEM, MSM8226),
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700521 {
522 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
523 .length = MSM_SHARED_RAM_SIZE,
524 .type = MT_DEVICE,
525 },
Syed Rameez Mustafa16b1bf32012-09-10 19:21:45 -0700526#ifdef CONFIG_DEBUG_MSM8226_UART
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700527 MSM_DEVICE(DEBUG_UART),
528#endif
529};
530
531
532void __init msm_map_msm8226_io(void)
533{
534 msm_shared_ram_phys = MSM8226_MSM_SHARED_RAM_PHYS;
535 msm_map_io(msm_8226_io_desc, ARRAY_SIZE(msm_8226_io_desc));
536}
537#endif /* CONFIG_ARCH_MSM8226 */
Syed Rameez Mustafa8f210052012-09-21 18:28:31 -0700538
539#ifdef CONFIG_ARCH_MSM8910
540static struct map_desc msm8910_io_desc[] __initdata = {
541 MSM_CHIP_DEVICE(APCS_GCC, MSM8910),
542 MSM_CHIP_DEVICE(TLMM, MSM8910),
543 MSM_CHIP_DEVICE(IMEM, MSM8910),
544 {
545 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
546 .length = MSM_SHARED_RAM_SIZE,
547 .type = MT_DEVICE,
548 },
549};
550
551void __init msm_map_msm8910_io(void)
552{
553 msm_shared_ram_phys = MSM8910_MSM_SHARED_RAM_PHYS;
554 msm_map_io(msm8910_io_desc, ARRAY_SIZE(msm8910_io_desc));
555}
556#endif /* CONFIG_ARCH_MSM8910 */