blob: f736b30851f82eb208a2b41792f1e7d90675895a [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.
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -08006 * Copyright (c) 2008-2013, The Linux Foundation. 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>
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -080031#include <linux/of_fdt.h>
Brian Swetland30421022007-11-26 04:11:43 -080032
Russell Kinga09e64f2008-08-05 16:14:15 +010033#include <mach/board.h>
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -080034#include "board-dt.h"
Brian Swetland30421022007-11-26 04:11:43 -080035
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070036#define MSM_CHIP_DEVICE(name, chip) { \
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070037 .virtual = (unsigned long) MSM_##name##_BASE, \
David Brown8c27e6f2011-01-07 10:20:49 -080038 .pfn = __phys_to_pfn(chip##_##name##_PHYS), \
39 .length = chip##_##name##_SIZE, \
Rohit Vaswanidba530e2012-06-12 20:04:28 -070040 .type = MT_DEVICE, \
Brian Swetland30421022007-11-26 04:11:43 -080041 }
42
David Brown8c27e6f2011-01-07 10:20:49 -080043#define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM)
44
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070045/* msm_shared_ram_phys default value of 0x00100000 is the most common value
46 * and should work as-is for any target without stacked memory.
47 */
Eric Holmberg51edef72013-04-11 14:28:33 -060048phys_addr_t msm_shared_ram_phys = 0x00100000;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049
Stephen Boyd552e4292012-02-21 01:27:20 -080050static void __init msm_map_io(struct map_desc *io_desc, int size)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070051{
52 int i;
53
54 BUG_ON(!size);
55 for (i = 0; i < size; i++)
56 if (io_desc[i].virtual == (unsigned long)MSM_SHARED_RAM_BASE)
57 io_desc[i].pfn = __phys_to_pfn(msm_shared_ram_phys);
58
59 iotable_init(io_desc, size);
60}
61
62#if defined(CONFIG_ARCH_MSM7X01A) || defined(CONFIG_ARCH_MSM7X27) \
Daniel Walkercf62ffa2010-05-04 15:12:27 -070063 || defined(CONFIG_ARCH_MSM7X25)
Brian Swetland30421022007-11-26 04:11:43 -080064static struct map_desc msm_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +053065 MSM_CHIP_DEVICE(VIC, MSM7XXX),
66 MSM_CHIP_DEVICE(CSR, MSM7XXX),
67 MSM_CHIP_DEVICE(TMR, MSM7XXX),
68 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
69 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
70 MSM_CHIP_DEVICE(CLK_CTL, MSM7XXX),
71 MSM_CHIP_DEVICE(AD5, MSM7XXX),
Stephen Boyd650e3f02011-11-08 10:33:03 -080072#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
73 defined(CONFIG_DEBUG_MSM_UART3)
Pavel Machek6339f662009-11-02 11:48:29 +010074 MSM_DEVICE(DEBUG_UART),
75#endif
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070076#ifdef CONFIG_CACHE_L2X0
77 {
78 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +053079 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
80 .length = MSM7XXX_L2CC_SIZE,
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070081 .type = MT_DEVICE,
82 },
Dima Zavinb42dc442010-01-29 11:43:42 -080083#endif
Brian Swetland30421022007-11-26 04:11:43 -080084 {
Brian Swetlandbcc0f6a2008-09-10 14:00:53 -070085 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Brian Swetland30421022007-11-26 04:11:43 -080086 .length = MSM_SHARED_RAM_SIZE,
87 .type = MT_DEVICE,
88 },
89};
90
91void __init msm_map_common_io(void)
92{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070093 /*Peripheral port memory remap, nothing looks to be there for
94 * cortex a5.
95 */
96#ifndef CONFIG_ARCH_MSM_CORTEX_A5
Brian Swetland30421022007-11-26 04:11:43 -080097 /* Make sure the peripheral register window is closed, since
98 * we will use PTE flags (TEX[1]=1,B=0,C=1) to determine which
99 * pages are peripheral interface or not.
100 */
101 asm("mcr p15, 0, %0, c15, c2, 4" : : "r" (0));
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700102#endif
103 msm_map_io(msm_io_desc, ARRAY_SIZE(msm_io_desc));
Trilok Soni80c19362012-10-15 00:55:00 +0530104 map_page_strongly_ordered();
Brian Swetland30421022007-11-26 04:11:43 -0800105}
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700106#endif
107
108#ifdef CONFIG_ARCH_QSD8X50
109static struct map_desc qsd8x50_io_desc[] __initdata = {
110 MSM_DEVICE(VIC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700111 MSM_DEVICE(CSR),
112 MSM_DEVICE(TMR),
Daniel Walkercf62ffa2010-05-04 15:12:27 -0700113 MSM_DEVICE(GPIO1),
114 MSM_DEVICE(GPIO2),
115 MSM_DEVICE(CLK_CTL),
116 MSM_DEVICE(SIRC),
117 MSM_DEVICE(SCPLL),
118 MSM_DEVICE(AD5),
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),
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700302 MSM_CHIP_DEVICE(TLMM, MSM8974),
Stepan Moskovchenkoda7ce9c2012-08-14 21:02:21 -0700303 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM8974),
Jeff Hugo70946092012-02-10 11:30:43 -0700304 {
305 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
306 .length = MSM_SHARED_RAM_SIZE,
307 .type = MT_DEVICE,
308 },
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700309#ifdef CONFIG_DEBUG_MSM8974_UART
Sathish Ambleyf5bebd62011-11-03 23:36:36 -0700310 MSM_DEVICE(DEBUG_UART),
311#endif
Sathish Ambley6829db12011-10-08 22:41:23 -0700312};
313
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700314void __init msm_map_8974_io(void)
Sathish Ambley6829db12011-10-08 22:41:23 -0700315{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700316 msm_shared_ram_phys = MSM8974_MSM_SHARED_RAM_PHYS;
317 msm_map_io(msm_8974_io_desc, ARRAY_SIZE(msm_8974_io_desc));
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -0800318 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Sathish Ambley6829db12011-10-08 22:41:23 -0700319}
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700320#endif /* CONFIG_ARCH_MSM8974 */
Sathish Ambley6829db12011-10-08 22:41:23 -0700321
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700322#ifdef CONFIG_ARCH_APQ8084
323static struct map_desc msm_8084_io_desc[] __initdata = {
324 MSM_CHIP_DEVICE(QGIC_DIST, APQ8084),
325 MSM_CHIP_DEVICE(TLMM, APQ8084),
Stepan Moskovchenkob6bd0bb2013-01-24 15:55:35 -0800326 {
327 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
328 .length = MSM_SHARED_RAM_SIZE,
329 .type = MT_DEVICE,
330 },
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700331#ifdef CONFIG_DEBUG_APQ8084_UART
Stepan Moskovchenko80064f32013-03-05 16:58:39 -0800332 MSM_DEVICE(DEBUG_UART),
333#endif
Stepan Moskovchenkob6bd0bb2013-01-24 15:55:35 -0800334};
335
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700336void __init msm_map_8084_io(void)
Stepan Moskovchenkob6bd0bb2013-01-24 15:55:35 -0800337{
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700338 msm_shared_ram_phys = APQ8084_SHARED_RAM_PHYS;
339 msm_map_io(msm_8084_io_desc, ARRAY_SIZE(msm_8084_io_desc));
Stepan Moskovchenkob8dd6a92013-03-18 18:53:34 -0700340 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Stepan Moskovchenkob6bd0bb2013-01-24 15:55:35 -0800341}
Stepan Moskovchenkoe90cd652013-04-18 12:54:47 -0700342#endif /* CONFIG_ARCH_APQ8084 */
Stepan Moskovchenkob6bd0bb2013-01-24 15:55:35 -0800343
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700344#ifdef CONFIG_ARCH_MSM7X30
345static struct map_desc msm7x30_io_desc[] __initdata = {
Taniya Das298de8c2012-02-16 11:45:31 +0530346 MSM_CHIP_DEVICE(VIC, MSM7X30),
347 MSM_CHIP_DEVICE(CSR, MSM7X30),
348 MSM_CHIP_DEVICE(TMR, MSM7X30),
349 MSM_CHIP_DEVICE(GPIO1, MSM7X30),
350 MSM_CHIP_DEVICE(GPIO2, MSM7X30),
351 MSM_CHIP_DEVICE(CLK_CTL, MSM7X30),
352 MSM_CHIP_DEVICE(CLK_CTL_SH2, MSM7X30),
353 MSM_CHIP_DEVICE(AD5, MSM7X30),
Taniya Das298de8c2012-02-16 11:45:31 +0530354 MSM_CHIP_DEVICE(ACC0, MSM7X30),
355 MSM_CHIP_DEVICE(SAW0, MSM7X30),
356 MSM_CHIP_DEVICE(APCS_GCC, MSM7X30),
357 MSM_CHIP_DEVICE(TCSR, MSM7X30),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800358#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
359 defined(CONFIG_DEBUG_MSM_UART3)
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700360 MSM_DEVICE(DEBUG_UART),
361#endif
362 {
363 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700364 .length = MSM_SHARED_RAM_SIZE,
365 .type = MT_DEVICE,
366 },
367};
368
369void __init msm_map_msm7x30_io(void)
370{
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700371 msm_map_io(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc));
Daniel Walkerc83b2bf2010-05-04 15:26:13 -0700372}
373#endif /* CONFIG_ARCH_MSM7X30 */
374
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700375#ifdef CONFIG_ARCH_FSM9XXX
376static struct map_desc fsm9xxx_io_desc[] __initdata = {
377 MSM_DEVICE(VIC),
378 MSM_DEVICE(SIRC),
379 MSM_DEVICE(CSR),
380 MSM_DEVICE(TLMM),
381 MSM_DEVICE(TCSR),
382 MSM_DEVICE(CLK_CTL),
383 MSM_DEVICE(ACC),
384 MSM_DEVICE(SAW),
385 MSM_DEVICE(GCC),
386 MSM_DEVICE(GRFC),
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700387 MSM_DEVICE(QFP_FUSE),
388 MSM_DEVICE(HH),
Sathish Ambleybb87d5f2011-11-08 15:14:01 -0800389#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
390 defined(CONFIG_DEBUG_MSM_UART3)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700391 MSM_DEVICE(DEBUG_UART),
392#endif
393 {
394 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
395 .length = MSM_SHARED_RAM_SIZE,
396 .type = MT_DEVICE,
397 },
398};
Brian Swetland30421022007-11-26 04:11:43 -0800399
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700400void __init msm_map_fsm9xxx_io(void)
401{
402 msm_map_io(fsm9xxx_io_desc, ARRAY_SIZE(fsm9xxx_io_desc));
Brian Swetland30421022007-11-26 04:11:43 -0800403}
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700404#endif /* CONFIG_ARCH_FSM9XXX */
405
Rohit Vaswani695d2232013-03-20 19:12:59 -0700406#ifdef CONFIG_ARCH_FSM9900
407static struct map_desc fsm9900_io_desc[] __initdata = {
408 MSM_CHIP_DEVICE(QGIC_DIST, FSM9900),
409 MSM_CHIP_DEVICE(TLMM, FSM9900),
410 {
411 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
412 .length = MSM_SHARED_RAM_SIZE,
413 .type = MT_DEVICE,
414 },
415#ifdef CONFIG_DEBUG_FSM9900_UART
416 MSM_DEVICE(DEBUG_UART),
417#endif
418};
419
420void __init msm_map_fsm9900_io(void)
421{
422 msm_shared_ram_phys = FSM9900_SHARED_RAM_PHYS;
423 msm_map_io(fsm9900_io_desc, ARRAY_SIZE(fsm9900_io_desc));
424 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
425}
426#endif /* CONFIG_ARCH_FSM9900 */
427
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700428#ifdef CONFIG_ARCH_MSM9615
429static struct map_desc msm9615_io_desc[] __initdata = {
430 MSM_CHIP_DEVICE(QGIC_DIST, MSM9615),
431 MSM_CHIP_DEVICE(QGIC_CPU, MSM9615),
432 MSM_CHIP_DEVICE(ACC0, MSM9615),
433 MSM_CHIP_DEVICE(TMR, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700434 MSM_CHIP_DEVICE(TLMM, MSM9615),
435 MSM_CHIP_DEVICE(SAW0, MSM9615),
436 MSM_CHIP_DEVICE(APCS_GCC, MSM9615),
437 MSM_CHIP_DEVICE(TCSR, MSM9615),
Vikram Mulukutla489e39e2011-08-31 18:04:05 -0700438 MSM_CHIP_DEVICE(L2CC, MSM9615),
439 MSM_CHIP_DEVICE(CLK_CTL, MSM9615),
440 MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM9615),
Rohit Vaswani71c86b72011-09-09 16:51:46 -0700441 MSM_CHIP_DEVICE(RPM, MSM9615),
442 MSM_CHIP_DEVICE(RPM_MPM, MSM9615),
443 MSM_CHIP_DEVICE(APCS_GLB, MSM9615),
Rohit Vaswani4f96570c2011-10-13 18:14:37 -0700444 MSM_CHIP_DEVICE(IMEM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700445 {
446 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
447 .length = MSM_SHARED_RAM_SIZE,
448 .type = MT_DEVICE,
449 },
Siddartha Mohanadoss5d49cec2011-09-21 10:26:15 -0700450 MSM_CHIP_DEVICE(QFPROM, MSM9615),
Rohit Vaswani99fb6f22011-08-15 13:37:32 -0700451};
452
453void __init msm_map_msm9615_io(void)
454{
455 msm_map_io(msm9615_io_desc, ARRAY_SIZE(msm9615_io_desc));
456}
457#endif /* CONFIG_ARCH_MSM9615 */
458
Taniya Das43bcdd62011-12-02 17:33:27 +0530459#ifdef CONFIG_ARCH_MSM8625
460static struct map_desc msm8625_io_desc[] __initdata = {
Taniya Das13b811a2011-12-09 18:33:45 +0530461 MSM_CHIP_DEVICE(CSR, MSM7XXX),
462 MSM_CHIP_DEVICE(GPIO1, MSM7XXX),
463 MSM_CHIP_DEVICE(GPIO2, MSM7XXX),
464 MSM_CHIP_DEVICE(QGIC_DIST, MSM8625),
465 MSM_CHIP_DEVICE(QGIC_CPU, MSM8625),
466 MSM_CHIP_DEVICE(TMR, MSM8625),
467 MSM_CHIP_DEVICE(TMR0, MSM8625),
468 MSM_CHIP_DEVICE(SCU, MSM8625),
469 MSM_CHIP_DEVICE(CFG_CTL, MSM8625),
470 MSM_CHIP_DEVICE(CLK_CTL, MSM8625),
Taniya Das12df7bf2012-02-15 11:36:19 +0530471 MSM_CHIP_DEVICE(SAW0, MSM8625),
472 MSM_CHIP_DEVICE(SAW1, MSM8625),
Murali Nalajala1d1df9c2012-10-31 14:15:52 +0530473 MSM_CHIP_DEVICE(SAW2, MSM8625),
474 MSM_CHIP_DEVICE(SAW3, MSM8625),
Manish Dewangan504430a2012-02-29 17:34:38 +0530475 MSM_CHIP_DEVICE(AD5, MSM7XXX),
Taniya Das43bcdd62011-12-02 17:33:27 +0530476#if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \
477 defined(CONFIG_DEBUG_MSM_UART3)
Taniya Dasfa4ee7f2012-02-21 15:04:51 +0530478 MSM_DEVICE(DEBUG_UART),
Taniya Das43bcdd62011-12-02 17:33:27 +0530479#endif
480#ifdef CONFIG_CACHE_L2X0
481 {
482 .virtual = (unsigned long) MSM_L2CC_BASE,
Taniya Das13b811a2011-12-09 18:33:45 +0530483 .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS),
484 .length = MSM7XXX_L2CC_SIZE,
Taniya Das43bcdd62011-12-02 17:33:27 +0530485 .type = MT_DEVICE,
486 },
487#endif
488 {
489 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
490 .length = MSM_SHARED_RAM_SIZE,
491 .type = MT_DEVICE,
492 },
493};
494
495void __init msm_map_msm8625_io(void)
496{
497 msm_map_io(msm8625_io_desc, ARRAY_SIZE(msm8625_io_desc));
Trilok Soni80c19362012-10-15 00:55:00 +0530498 map_page_strongly_ordered();
Taniya Das43bcdd62011-12-02 17:33:27 +0530499}
500#else
501void __init msm_map_msm8625_io(void) { return; }
502#endif /* CONFIG_ARCH_MSM8625 */
503
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700504#ifdef CONFIG_ARCH_MSM9625
505static struct map_desc msm9625_io_desc[] __initdata = {
Girish Mahadevan88170712012-10-09 15:27:06 -0700506 MSM_CHIP_DEVICE(QGIC_DIST, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700507 MSM_CHIP_DEVICE(TLMM, MSM9625),
Abhimanyu Kapur46e5e2b2012-10-02 20:45:37 -0700508 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM9625),
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700509 MSM_CHIP_DEVICE(TMR, MSM9625),
510 {
511 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
512 .length = MSM_SHARED_RAM_SIZE,
513 .type = MT_DEVICE,
514 },
515#ifdef CONFIG_DEBUG_MSM9625_UART
516 MSM_DEVICE(DEBUG_UART),
517#endif
518};
519
520void __init msm_map_msm9625_io(void)
521{
522 msm_shared_ram_phys = MSM9625_SHARED_RAM_PHYS;
523 msm_map_io(msm9625_io_desc, ARRAY_SIZE(msm9625_io_desc));
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -0800524 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Rohit Vaswani58fc0c62012-04-23 18:50:26 -0700525}
526#endif /* CONFIG_ARCH_MSM9625 */
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530527
Abhimanyu Kapurb2e89142013-03-18 15:59:57 -0700528#ifdef CONFIG_ARCH_MSMKRYPTON
529static struct map_desc msmkrypton_io_desc[] __initdata = {
530 MSM_CHIP_DEVICE(TLMM, MSMKRYPTON),
531 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSMKRYPTON),
532 {
533 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
534 .length = MSM_SHARED_RAM_SIZE,
535 .type = MT_DEVICE,
536 },
537};
538
539void __init msm_map_msmkrypton_io(void)
540{
541 msm_shared_ram_phys = MSMKRYPTON_SHARED_RAM_PHYS;
542 msm_map_io(msmkrypton_io_desc, ARRAY_SIZE(msmkrypton_io_desc));
543 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
544}
545#endif /* CONFIG_ARCH_MSMKRYPTON */
546
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530547#ifdef CONFIG_ARCH_MPQ8092
548static struct map_desc mpq8092_io_desc[] __initdata = {
549 MSM_CHIP_DEVICE(QGIC_DIST, MPQ8092),
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530550 MSM_CHIP_DEVICE(TLMM, MPQ8092),
551 {
552 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
553 .length = MSM_SHARED_RAM_SIZE,
554 .type = MT_DEVICE,
555 },
556#ifdef CONFIG_DEBUG_MPQ8092_UART
557 MSM_DEVICE(DEBUG_UART),
558#endif
559};
560
561void __init msm_map_mpq8092_io(void)
562{
Ravi Kumar V8485af62012-09-21 13:15:17 +0530563 msm_shared_ram_phys = MPQ8092_MSM_SHARED_RAM_PHYS;
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530564 msm_map_io(mpq8092_io_desc, ARRAY_SIZE(mpq8092_io_desc));
Srinivas Ramana2a28d522013-05-22 13:05:22 +0530565 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Ravi Kumar V8834dad2012-08-31 22:49:55 +0530566}
567#endif /* CONFIG_ARCH_MPQ8092 */
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700568
569#ifdef CONFIG_ARCH_MSM8226
570static struct map_desc msm_8226_io_desc[] __initdata = {
571 MSM_CHIP_DEVICE(QGIC_DIST, MSM8226),
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700572 MSM_CHIP_DEVICE(APCS_GCC, MSM8226),
573 MSM_CHIP_DEVICE(TLMM, MSM8226),
Syed Rameez Mustafa17838192012-11-19 16:42:29 -0800574 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM8226),
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700575 {
576 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
577 .length = MSM_SHARED_RAM_SIZE,
578 .type = MT_DEVICE,
579 },
Syed Rameez Mustafa16b1bf32012-09-10 19:21:45 -0700580#ifdef CONFIG_DEBUG_MSM8226_UART
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700581 MSM_DEVICE(DEBUG_UART),
582#endif
583};
584
585
586void __init msm_map_msm8226_io(void)
587{
588 msm_shared_ram_phys = MSM8226_MSM_SHARED_RAM_PHYS;
589 msm_map_io(msm_8226_io_desc, ARRAY_SIZE(msm_8226_io_desc));
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -0800590 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Syed Rameez Mustafa61c9a572012-08-23 16:10:07 -0700591}
592#endif /* CONFIG_ARCH_MSM8226 */
Syed Rameez Mustafa8f210052012-09-21 18:28:31 -0700593
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800594#ifdef CONFIG_ARCH_MSM8610
595static struct map_desc msm8610_io_desc[] __initdata = {
Priyanka Mathur5ea448f2013-04-30 15:33:19 -0700596 MSM_CHIP_DEVICE(QGIC_DIST, MSM8610),
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800597 MSM_CHIP_DEVICE(APCS_GCC, MSM8610),
598 MSM_CHIP_DEVICE(TLMM, MSM8610),
599 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSM8610),
Syed Rameez Mustafa8f210052012-09-21 18:28:31 -0700600 {
601 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
602 .length = MSM_SHARED_RAM_SIZE,
603 .type = MT_DEVICE,
604 },
605};
606
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800607void __init msm_map_msm8610_io(void)
Syed Rameez Mustafa8f210052012-09-21 18:28:31 -0700608{
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800609 msm_shared_ram_phys = MSM8610_MSM_SHARED_RAM_PHYS;
610 msm_map_io(msm8610_io_desc, ARRAY_SIZE(msm8610_io_desc));
Abhimanyu Kapur032b1f42013-01-18 00:10:50 -0800611 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
Syed Rameez Mustafa8f210052012-09-21 18:28:31 -0700612}
Syed Rameez Mustafa3971c142013-01-09 19:04:53 -0800613#endif /* CONFIG_ARCH_MSM8610 */
Jay Chokshi184a7df2013-05-10 17:35:59 -0700614
615#ifdef CONFIG_ARCH_MSMSAMARIUM
616static struct map_desc msmsamarium_io_desc[] __initdata = {
617 MSM_CHIP_DEVICE(QGIC_DIST, MSMSAMARIUM),
618 MSM_CHIP_DEVICE(TLMM, MSMSAMARIUM),
619 MSM_CHIP_DEVICE(MPM2_PSHOLD, MSMSAMARIUM),
620 {
621 .virtual = (unsigned long) MSM_SHARED_RAM_BASE,
622 .length = MSM_SHARED_RAM_SIZE,
623 .type = MT_DEVICE,
624 },
625#if defined(CONFIG_DEBUG_MSMSAMARIUM_UART) || defined(CONFIG_DEBUG_MSM8974_UART)
626 MSM_DEVICE(DEBUG_UART),
627#endif
628};
629
630void __init msm_map_msmsamarium_io(void)
631{
632 msm_shared_ram_phys = MSMSAMARIUM_SHARED_RAM_PHYS;
633 msm_map_io(msmsamarium_io_desc, ARRAY_SIZE(msmsamarium_io_desc));
634 of_scan_flat_dt(msm_scan_dt_map_imem, NULL);
635}
636#endif /* CONFIG_ARCH_MSMSAMARIUM */