blob: 7c0de57607a77e18ec8819485e15d1e1ae024af2 [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>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070023#include <linux/module.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>
Brian Swetland30421022007-11-26 04:11:43 -080028#include <asm/mach/map.h>
29
Russell Kinga09e64f2008-08-05 16:14:15 +010030#include <mach/board.h>
Brian Swetland30421022007-11-26 04:11:43 -080031
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070032#define MSM_CHIP_DEVICE(name, chip) { \
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070033 .virtual = (unsigned long) MSM_##name##_BASE, \
David Brown8c27e6f2011-01-07 10:20:49 -080034 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
35 .length = chip##_##name##_SIZE, \
Brian Swetland30421022007-11-26 04:11:43 -080036 .type = MT_DEVICE_NONSHARED, \
37 }
38
David Brown8c27e6f2011-01-07 10:20:49 -080039#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
40
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041/* msm_shared_ram_phys default value of 0x00100000 is the most common value
42 * and should work as-is for any target without stacked memory.
43 */
44unsigned int msm_shared_ram_phys = 0x00100000;
45
Stephen Boyd552e4292012-02-21 01:27:20 -080046static void __init msm_map_io(struct map_desc *io_desc, int size)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047{
48 int i;
49
50 BUG_ON(!size);
51 for (i = 0; i < size; i++)
52 if (io_desc[i].virtual == (unsigned long)MSM_SHARED_RAM_BASE)
53 io_desc[i].pfn = __phys_to_pfn(msm_shared_ram_phys);
54
55 iotable_init(io_desc, size);
56}
57
58#if defined(CONFIG_ARCH_MSM7X01A) || defined(CONFIG_ARCH_MSM7X27) \
Daniel Walkercf62ffa2010-05-04 15:12:27 -070059 || defined(CONFIG_ARCH_MSM7X25)
Brian Swetland30421022007-11-26 04:11:43 -080060static struct map_desc msm_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +053061 MSM_CHIP_DEVICE(VIC, MSM7XXX),
62 MSM_CHIP_DEVICE(CSR, MSM7XXX),
63 MSM_CHIP_DEVICE(TMR, MSM7XXX),
64 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
65 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
66 MSM_CHIP_DEVICE(CLK_CTL, MSM7XXX),
67 MSM_CHIP_DEVICE(AD5, MSM7XXX),
68 MSM_CHIP_DEVICE(MDC, MSM7XXX),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -080069#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
70 defined(CONFIG_DEBUG_MSM_UART3)
Taniya Dasfa4ee7f2012-02-21 15:04:51 +053071 MSM_DEVICE(DEBUG_UART),
Pavel Machek6339f662009-11-02 11:48:29 +010072#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070073#ifdef CONFIG_CACHE_L2X0
74 {
75 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +053076 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
77 .length = MSM7XXX_L2CC_SIZE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078 .type = MT_DEVICE,
79 },
Dima Zavinb42dc442010-01-29 11:43:42 -080080#endif
Brian Swetland30421022007-11-26 04:11:43 -080081 {
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070082 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Brian Swetland30421022007-11-26 04:11:43 -080083 .length = MSM_SHARED_RAM_SIZE,
84 .type = MT_DEVICE,
85 },
86};
87
88void __init msm_map_common_io(void)
89{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070090 /*Peripheral port memory remap, nothing looks to be there for
91 * cortex a5.
92 */
93#ifndef CONFIG_ARCH_MSM_CORTEX_A5
Brian Swetland30421022007-11-26 04:11:43 -080094 /* Make sure the peripheral register window is closed, since
95 * we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
96 * pages are peripheral interface or not.
97 */
98 asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070099#endif
100 msm_map_io(msm_io_desc, ARRAY_SIZE(msm_io_desc));
Brian Swetland30421022007-11-26 04:11:43 -0800101}
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700102#endif
103
104#ifdef CONFIG_ARCH_QSD8X50
105static struct map_desc qsd8x50_io_desc[] __initdata = {
106 MSM_DEVICE(VIC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700107 MSM_DEVICE(CSR),
108 MSM_DEVICE(TMR),
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700109 MSM_DEVICE(GPIO1),
110 MSM_DEVICE(GPIO2),
111 MSM_DEVICE(CLK_CTL),
112 MSM_DEVICE(SIRC),
113 MSM_DEVICE(SCPLL),
114 MSM_DEVICE(AD5),
115 MSM_DEVICE(MDC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700116 MSM_DEVICE(TCSR),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800117#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
118 defined(CONFIG_DEBUG_MSM_UART3)
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700119 MSM_DEVICE(DEBUG_UART),
120#endif
121 {
122 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700123 .length = MSM_SHARED_RAM_SIZE,
124 .type = MT_DEVICE,
125 },
126};
127
128void __init msm_map_qsd8x50_io(void)
129{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700130 msm_map_io(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc));
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700131}
132#endif /* CONFIG_ARCH_QSD8X50 */
Brian Swetland30421022007-11-26 04:11:43 -0800133
Steve Muckle6cf6dfe2010-01-06 14:55:24 -0800134#ifdef CONFIG_ARCH_MSM8X60
135static struct map_desc msm8x60_io_desc[] __initdata = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700136 MSM_DEVICE(QGIC_DIST),
137 MSM_DEVICE(QGIC_CPU),
138 MSM_DEVICE(TMR),
139 MSM_DEVICE(TMR0),
140 MSM_DEVICE(RPM_MPM),
Steve Muckle6cf6dfe2010-01-06 14:55:24 -0800141 MSM_DEVICE(ACC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700142 MSM_DEVICE(ACC0),
143 MSM_DEVICE(ACC1),
144 MSM_DEVICE(SAW0),
145 MSM_DEVICE(SAW1),
Steve Muckle6cf6dfe2010-01-06 14:55:24 -0800146 MSM_DEVICE(GCC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700147 MSM_DEVICE(TLMM),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700148 MSM_DEVICE(SCPLL),
149 MSM_DEVICE(RPM),
150 MSM_DEVICE(CLK_CTL),
151 MSM_DEVICE(MMSS_CLK_CTL),
152 MSM_DEVICE(LPASS_CLK_CTL),
153 MSM_DEVICE(TCSR),
154 MSM_DEVICE(IMEM),
155 MSM_DEVICE(HDMI),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800156#ifdef CONFIG_DEBUG_MSM8660_UART
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700157 MSM_DEVICE(DEBUG_UART),
158#endif
159 MSM_DEVICE(SIC_NON_SECURE),
160 {
161 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
162 .length = MSM_SHARED_RAM_SIZE,
163 .type = MT_DEVICE,
164 },
165 MSM_DEVICE(QFPROM),
Steve Muckle6cf6dfe2010-01-06 14:55:24 -0800166};
167
168void __init msm_map_msm8x60_io(void)
169{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700170 msm_map_io(msm8x60_io_desc, ARRAY_SIZE(msm8x60_io_desc));
Steve Muckle6cf6dfe2010-01-06 14:55:24 -0800171}
172#endif /* CONFIG_ARCH_MSM8X60 */
173
Stepan Moskovchenko5d0afd72010-12-01 19:05:49 -0800174#ifdef CONFIG_ARCH_MSM8960
175static struct map_desc msm8960_io_desc[] __initdata = {
176 MSM_CHIP_DEVICE(QGIC_DIST, MSM8960),
177 MSM_CHIP_DEVICE(QGIC_CPU, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700178 MSM_CHIP_DEVICE(ACC0, MSM8960),
179 MSM_CHIP_DEVICE(ACC1, MSM8960),
Stepan Moskovchenko5d0afd72010-12-01 19:05:49 -0800180 MSM_CHIP_DEVICE(TMR, MSM8960),
181 MSM_CHIP_DEVICE(TMR0, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700182 MSM_CHIP_DEVICE(RPM_MPM, MSM8960),
183 MSM_CHIP_DEVICE(CLK_CTL, MSM8960),
184 MSM_CHIP_DEVICE(MMSS_CLK_CTL, MSM8960),
185 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM8960),
186 MSM_CHIP_DEVICE(RPM, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700187 MSM_CHIP_DEVICE(TLMM, MSM8960),
188 MSM_CHIP_DEVICE(HFPLL, MSM8960),
189 MSM_CHIP_DEVICE(SAW0, MSM8960),
190 MSM_CHIP_DEVICE(SAW1, MSM8960),
191 MSM_CHIP_DEVICE(SAW_L2, MSM8960),
192 MSM_CHIP_DEVICE(SIC_NON_SECURE, MSM8960),
193 MSM_CHIP_DEVICE(APCS_GCC, MSM8960),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700194 MSM_CHIP_DEVICE(IMEM, MSM8960),
195 MSM_CHIP_DEVICE(HDMI, MSM8960),
196 {
197 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
198 .length = MSM_SHARED_RAM_SIZE,
199 .type = MT_DEVICE,
200 },
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800201#ifdef CONFIG_DEBUG_MSM8960_UART
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700202 MSM_DEVICE(DEBUG_UART),
203#endif
Siddartha Mohanadossce1315a2011-04-21 15:25:55 -0700204 MSM_CHIP_DEVICE(QFPROM, MSM8960),
Stepan Moskovchenko5d0afd72010-12-01 19:05:49 -0800205};
206
207void __init msm_map_msm8960_io(void)
208{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700209 msm_map_io(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc));
Stepan Moskovchenko5d0afd72010-12-01 19:05:49 -0800210}
211#endif /* CONFIG_ARCH_MSM8960 */
212
Stepan Moskovchenko2b992ad2011-10-18 17:24:18 -0700213#ifdef CONFIG_ARCH_MSM8930
214static struct map_desc msm8930_io_desc[] __initdata = {
215 MSM_CHIP_DEVICE(QGIC_DIST, MSM8930),
216 MSM_CHIP_DEVICE(QGIC_CPU, MSM8930),
217 MSM_CHIP_DEVICE(ACC0, MSM8930),
218 MSM_CHIP_DEVICE(ACC1, MSM8930),
219 MSM_CHIP_DEVICE(TMR, MSM8930),
220 MSM_CHIP_DEVICE(TMR0, MSM8930),
221 MSM_CHIP_DEVICE(RPM_MPM, MSM8930),
222 MSM_CHIP_DEVICE(CLK_CTL, MSM8930),
223 MSM_CHIP_DEVICE(MMSS_CLK_CTL, MSM8930),
224 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM8930),
225 MSM_CHIP_DEVICE(RPM, MSM8930),
226 MSM_CHIP_DEVICE(TLMM, MSM8930),
227 MSM_CHIP_DEVICE(HFPLL, MSM8930),
228 MSM_CHIP_DEVICE(SAW0, MSM8930),
229 MSM_CHIP_DEVICE(SAW1, MSM8930),
230 MSM_CHIP_DEVICE(SAW_L2, MSM8930),
231 MSM_CHIP_DEVICE(SIC_NON_SECURE, MSM8930),
232 MSM_CHIP_DEVICE(APCS_GCC, MSM8930),
233 MSM_CHIP_DEVICE(IMEM, MSM8930),
234 MSM_CHIP_DEVICE(HDMI, MSM8930),
235 {
236 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
237 .length = MSM_SHARED_RAM_SIZE,
238 .type = MT_DEVICE,
239 },
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800240#ifdef CONFIG_DEBUG_MSM8930_UART
Stepan Moskovchenko2b992ad2011-10-18 17:24:18 -0700241 MSM_DEVICE(DEBUG_UART),
242#endif
243 MSM_CHIP_DEVICE(QFPROM, MSM8930),
244};
245
246void __init msm_map_msm8930_io(void)
247{
248 msm_map_io(msm8930_io_desc, ARRAY_SIZE(msm8930_io_desc));
249}
250#endif /* CONFIG_ARCH_MSM8930 */
251
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700252#ifdef CONFIG_ARCH_APQ8064
253static struct map_desc apq8064_io_desc[] __initdata = {
254 MSM_CHIP_DEVICE(QGIC_DIST, APQ8064),
255 MSM_CHIP_DEVICE(QGIC_CPU, APQ8064),
256 MSM_CHIP_DEVICE(TMR, APQ8064),
257 MSM_CHIP_DEVICE(TMR0, APQ8064),
Joel King4ebccc62011-07-22 09:43:22 -0700258 MSM_CHIP_DEVICE(TLMM, APQ8064),
Vikram Mulukutlabb408eb2011-08-04 09:28:56 -0700259 MSM_CHIP_DEVICE(ACC0, APQ8064),
260 MSM_CHIP_DEVICE(ACC1, APQ8064),
261 MSM_CHIP_DEVICE(ACC2, APQ8064),
262 MSM_CHIP_DEVICE(ACC3, APQ8064),
263 MSM_CHIP_DEVICE(HFPLL, APQ8064),
Tianyi Gou33430412011-09-07 21:50:42 -0700264 MSM_CHIP_DEVICE(CLK_CTL, APQ8064),
265 MSM_CHIP_DEVICE(MMSS_CLK_CTL, APQ8064),
266 MSM_CHIP_DEVICE(LPASS_CLK_CTL, APQ8064),
Vikram Mulukutlabb408eb2011-08-04 09:28:56 -0700267 MSM_CHIP_DEVICE(APCS_GCC, APQ8064),
Praveen Chidambaramd9a41732011-10-17 09:41:05 -0600268 MSM_CHIP_DEVICE(RPM, APQ8064),
269 MSM_CHIP_DEVICE(RPM_MPM, APQ8064),
270 MSM_CHIP_DEVICE(SAW0, APQ8064),
271 MSM_CHIP_DEVICE(SAW1, APQ8064),
272 MSM_CHIP_DEVICE(SAW2, APQ8064),
273 MSM_CHIP_DEVICE(SAW3, APQ8064),
274 MSM_CHIP_DEVICE(SAW_L2, APQ8064),
Stepan Moskovchenko3e444e52011-08-05 17:59:48 -0700275 MSM_CHIP_DEVICE(IMEM, APQ8064),
Aravind Venkateswaran7eb05da2012-02-16 14:23:03 -0800276 MSM_CHIP_DEVICE(HDMI, APQ8064),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700277 {
278 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
279 .length = MSM_SHARED_RAM_SIZE,
280 .type = MT_DEVICE,
281 },
Vijayakumar Muthuvel Manickamf35fd732012-01-13 16:17:52 -0800282 MSM_CHIP_DEVICE(QFPROM, APQ8064),
Jeff Hugo85bfed42012-01-31 10:10:14 -0700283 MSM_CHIP_DEVICE(SIC_NON_SECURE, APQ8064),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700284};
285
286void __init msm_map_apq8064_io(void)
287{
288 msm_map_io(apq8064_io_desc, ARRAY_SIZE(apq8064_io_desc));
289}
290#endif /* CONFIG_ARCH_APQ8064 */
291
Sathish Ambley6829db12011-10-08 22:41:23 -0700292#ifdef CONFIG_ARCH_MSMCOPPER
293static struct map_desc msm_copper_io_desc[] __initdata = {
294 MSM_CHIP_DEVICE(QGIC_DIST, COPPER),
295 MSM_CHIP_DEVICE(QGIC_CPU, COPPER),
Jeff Hugo70946092012-02-10 11:30:43 -0700296 MSM_CHIP_DEVICE(APCS_GCC, COPPER),
Sathish Ambley6829db12011-10-08 22:41:23 -0700297 MSM_CHIP_DEVICE(TLMM, COPPER),
Jeff Hugo70946092012-02-10 11:30:43 -0700298 {
299 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
300 .length = MSM_SHARED_RAM_SIZE,
301 .type = MT_DEVICE,
302 },
Sathish Ambleyf5bebd62011-11-03 23:36:36 -0700303#ifdef CONFIG_DEBUG_MSMCOPPER_UART
304 MSM_DEVICE(DEBUG_UART),
305#endif
Sathish Ambley6829db12011-10-08 22:41:23 -0700306};
307
308void __init msm_map_copper_io(void)
309{
Jeff Hugo70946092012-02-10 11:30:43 -0700310 msm_shared_ram_phys = COPPER_MSM_SHARED_RAM_PHYS;
Sathish Ambley6829db12011-10-08 22:41:23 -0700311 msm_map_io(msm_copper_io_desc, ARRAY_SIZE(msm_copper_io_desc));
312}
313#endif /* CONFIG_ARCH_MSMCOPPER */
314
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700315#ifdef CONFIG_ARCH_MSM7X30
316static struct map_desc msm7x30_io_desc[] __initdata = {
Taniya Das298de8c2012-02-16 11:45:31 +0530317 MSM_CHIP_DEVICE(VIC, MSM7X30),
318 MSM_CHIP_DEVICE(CSR, MSM7X30),
319 MSM_CHIP_DEVICE(TMR, MSM7X30),
320 MSM_CHIP_DEVICE(GPIO1, MSM7X30),
321 MSM_CHIP_DEVICE(GPIO2, MSM7X30),
322 MSM_CHIP_DEVICE(CLK_CTL, MSM7X30),
323 MSM_CHIP_DEVICE(CLK_CTL_SH2, MSM7X30),
324 MSM_CHIP_DEVICE(AD5, MSM7X30),
325 MSM_CHIP_DEVICE(MDC, MSM7X30),
326 MSM_CHIP_DEVICE(ACC0, MSM7X30),
327 MSM_CHIP_DEVICE(SAW0, MSM7X30),
328 MSM_CHIP_DEVICE(APCS_GCC, MSM7X30),
329 MSM_CHIP_DEVICE(TCSR, MSM7X30),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800330#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
331 defined(CONFIG_DEBUG_MSM_UART3)
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700332 MSM_DEVICE(DEBUG_UART),
333#endif
334 {
335 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700336 .length = MSM_SHARED_RAM_SIZE,
337 .type = MT_DEVICE,
338 },
339};
340
341void __init msm_map_msm7x30_io(void)
342{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700343 msm_map_io(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700344}
345#endif /* CONFIG_ARCH_MSM7X30 */
346
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700347#ifdef CONFIG_ARCH_FSM9XXX
348static struct map_desc fsm9xxx_io_desc[] __initdata = {
349 MSM_DEVICE(VIC),
350 MSM_DEVICE(SIRC),
351 MSM_DEVICE(CSR),
352 MSM_DEVICE(TLMM),
353 MSM_DEVICE(TCSR),
354 MSM_DEVICE(CLK_CTL),
355 MSM_DEVICE(ACC),
356 MSM_DEVICE(SAW),
357 MSM_DEVICE(GCC),
358 MSM_DEVICE(GRFC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700359 MSM_DEVICE(QFP_FUSE),
360 MSM_DEVICE(HH),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800361#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
362 defined(CONFIG_DEBUG_MSM_UART3)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700363 MSM_DEVICE(DEBUG_UART),
364#endif
365 {
366 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
367 .length = MSM_SHARED_RAM_SIZE,
368 .type = MT_DEVICE,
369 },
370};
371
372void __init msm_map_fsm9xxx_io(void)
373{
374 msm_map_io(fsm9xxx_io_desc, ARRAY_SIZE(fsm9xxx_io_desc));
375}
376#endif /* CONFIG_ARCH_FSM9XXX */
377
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700378#ifdef CONFIG_ARCH_MSM9615
379static struct map_desc msm9615_io_desc[] __initdata = {
380 MSM_CHIP_DEVICE(QGIC_DIST, MSM9615),
381 MSM_CHIP_DEVICE(QGIC_CPU, MSM9615),
382 MSM_CHIP_DEVICE(ACC0, MSM9615),
383 MSM_CHIP_DEVICE(TMR, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700384 MSM_CHIP_DEVICE(TLMM, MSM9615),
385 MSM_CHIP_DEVICE(SAW0, MSM9615),
386 MSM_CHIP_DEVICE(APCS_GCC, MSM9615),
387 MSM_CHIP_DEVICE(TCSR, MSM9615),
Vikram Mulukutla489e39e2011-08-31 18:04:05 -0700388 MSM_CHIP_DEVICE(L2CC, MSM9615),
389 MSM_CHIP_DEVICE(CLK_CTL, MSM9615),
390 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM9615),
Rohit Vaswani71c86b72011-09-09 16:51:46 -0700391 MSM_CHIP_DEVICE(RPM, MSM9615),
392 MSM_CHIP_DEVICE(RPM_MPM, MSM9615),
393 MSM_CHIP_DEVICE(APCS_GLB, MSM9615),
Rohit Vaswani4f96570c2011-10-13 18:14:37 -0700394 MSM_CHIP_DEVICE(IMEM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700395 {
396 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
397 .length = MSM_SHARED_RAM_SIZE,
398 .type = MT_DEVICE,
399 },
Siddartha Mohanadoss5d49cec2011-09-21 10:26:15 -0700400 MSM_CHIP_DEVICE(QFPROM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700401};
402
403void __init msm_map_msm9615_io(void)
404{
405 msm_map_io(msm9615_io_desc, ARRAY_SIZE(msm9615_io_desc));
406}
407#endif /* CONFIG_ARCH_MSM9615 */
408
Taniya Das43bcdd62011-12-02 17:33:27 +0530409#ifdef CONFIG_ARCH_MSM8625
410static struct map_desc msm8625_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +0530411 MSM_CHIP_DEVICE(CSR, MSM7XXX),
412 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
413 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
414 MSM_CHIP_DEVICE(QGIC_DIST, MSM8625),
415 MSM_CHIP_DEVICE(QGIC_CPU, MSM8625),
416 MSM_CHIP_DEVICE(TMR, MSM8625),
417 MSM_CHIP_DEVICE(TMR0, MSM8625),
418 MSM_CHIP_DEVICE(SCU, MSM8625),
419 MSM_CHIP_DEVICE(CFG_CTL, MSM8625),
420 MSM_CHIP_DEVICE(CLK_CTL, MSM8625),
Taniya Das12df7bf2012-02-15 11:36:19 +0530421 MSM_CHIP_DEVICE(SAW0, MSM8625),
422 MSM_CHIP_DEVICE(SAW1, MSM8625),
Manish Dewangan504430a2012-02-29 17:34:38 +0530423 MSM_CHIP_DEVICE(AD5, MSM7XXX),
Taniya Dase3027e22012-02-27 16:32:27 +0530424 MSM_CHIP_DEVICE(MDC, MSM7XXX),
Taniya Das43bcdd62011-12-02 17:33:27 +0530425#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
426 defined(CONFIG_DEBUG_MSM_UART3)
Taniya Dasfa4ee7f2012-02-21 15:04:51 +0530427 MSM_DEVICE(DEBUG_UART),
Taniya Das43bcdd62011-12-02 17:33:27 +0530428#endif
429#ifdef CONFIG_CACHE_L2X0
430 {
431 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +0530432 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
433 .length = MSM7XXX_L2CC_SIZE,
Taniya Das43bcdd62011-12-02 17:33:27 +0530434 .type = MT_DEVICE,
435 },
436#endif
437 {
438 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
439 .length = MSM_SHARED_RAM_SIZE,
440 .type = MT_DEVICE,
441 },
442};
443
444void __init msm_map_msm8625_io(void)
445{
446 msm_map_io(msm8625_io_desc, ARRAY_SIZE(msm8625_io_desc));
447}
448#else
449void __init msm_map_msm8625_io(void) { return; }
450#endif /* CONFIG_ARCH_MSM8625 */
451
Brian Swetland30421022007-11-26 04:11:43 -0800452void __iomem *
453__msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
454{
455 if (mtype == MT_DEVICE) {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700456 /* The peripherals in the 88000000 - F0000000 range
457 * are only accessable by type MT_DEVICE_NONSHARED.
Brian Swetland30421022007-11-26 04:11:43 -0800458 * Adjust mtype as necessary to make this "just work."
459 */
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700460 if ((phys_addr >= 0x88000000) && (phys_addr < 0xF0000000))
Brian Swetland30421022007-11-26 04:11:43 -0800461 mtype = MT_DEVICE_NONSHARED;
462 }
463
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700464 return __arm_ioremap(phys_addr, size, mtype);
Brian Swetland30421022007-11-26 04:11:43 -0800465}
Pavankumar Kondeti4916a102010-11-09 15:41:29 +0530466EXPORT_SYMBOL(__msm_ioremap);