Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 1 | /* arch/arm/mach-msm/io.c |
| 2 | * |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 3 | * MSM7K, QSD io support |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 4 | * |
| 5 | * Copyright (C) 2007 Google, Inc. |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 6 | * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved. |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 7 | * 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 King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 22 | #include <linux/io.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | #include <linux/module.h> |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 24 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 25 | #include <mach/hardware.h> |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 26 | #include <asm/page.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 27 | #include <mach/msm_iomap.h> |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 28 | #include <asm/mach/map.h> |
| 29 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | #include <mach/board.h> |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 31 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 32 | #define MSM_CHIP_DEVICE(name, chip) { \ |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 33 | .virtual = (unsigned long) MSM_##name##_BASE, \ |
David Brown | 8c27e6f | 2011-01-07 10:20:49 -0800 | [diff] [blame] | 34 | .pfn = __phys_to_pfn(chip##_##name##_PHYS), \ |
| 35 | .length = chip##_##name##_SIZE, \ |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 36 | .type = MT_DEVICE_NONSHARED, \ |
| 37 | } |
| 38 | |
David Brown | 8c27e6f | 2011-01-07 10:20:49 -0800 | [diff] [blame] | 39 | #define MSM_DEVICE(name) MSM_CHIP_DEVICE(name, MSM) |
| 40 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 41 | /* 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 | */ |
| 44 | unsigned int msm_shared_ram_phys = 0x00100000; |
| 45 | |
Stephen Boyd | 552e429 | 2012-02-21 01:27:20 -0800 | [diff] [blame] | 46 | static void __init msm_map_io(struct map_desc *io_desc, int size) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | { |
| 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 Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 59 | || defined(CONFIG_ARCH_MSM7X25) |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 60 | static struct map_desc msm_io_desc[] __initdata = { |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 61 | 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 Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 69 | #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ |
| 70 | defined(CONFIG_DEBUG_MSM_UART3) |
Taniya Das | fa4ee7f | 2012-02-21 15:04:51 +0530 | [diff] [blame] | 71 | MSM_DEVICE(DEBUG_UART), |
Pavel Machek | 6339f66 | 2009-11-02 11:48:29 +0100 | [diff] [blame] | 72 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 73 | #ifdef CONFIG_CACHE_L2X0 |
| 74 | { |
| 75 | .virtual = (unsigned long) MSM_L2CC_BASE, |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 76 | .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS), |
| 77 | .length = MSM7XXX_L2CC_SIZE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 78 | .type = MT_DEVICE, |
| 79 | }, |
Dima Zavin | b42dc44 | 2010-01-29 11:43:42 -0800 | [diff] [blame] | 80 | #endif |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 81 | { |
Brian Swetland | bcc0f6a | 2008-09-10 14:00:53 -0700 | [diff] [blame] | 82 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 83 | .length = MSM_SHARED_RAM_SIZE, |
| 84 | .type = MT_DEVICE, |
| 85 | }, |
| 86 | }; |
| 87 | |
| 88 | void __init msm_map_common_io(void) |
| 89 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 90 | /*Peripheral port memory remap, nothing looks to be there for |
| 91 | * cortex a5. |
| 92 | */ |
| 93 | #ifndef CONFIG_ARCH_MSM_CORTEX_A5 |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 94 | /* 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 99 | #endif |
| 100 | msm_map_io(msm_io_desc, ARRAY_SIZE(msm_io_desc)); |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 101 | } |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 102 | #endif |
| 103 | |
| 104 | #ifdef CONFIG_ARCH_QSD8X50 |
| 105 | static struct map_desc qsd8x50_io_desc[] __initdata = { |
| 106 | MSM_DEVICE(VIC), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 107 | MSM_DEVICE(CSR), |
| 108 | MSM_DEVICE(TMR), |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 109 | 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 116 | MSM_DEVICE(TCSR), |
Sathish Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 117 | #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ |
| 118 | defined(CONFIG_DEBUG_MSM_UART3) |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 119 | MSM_DEVICE(DEBUG_UART), |
| 120 | #endif |
| 121 | { |
| 122 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 123 | .length = MSM_SHARED_RAM_SIZE, |
| 124 | .type = MT_DEVICE, |
| 125 | }, |
| 126 | }; |
| 127 | |
| 128 | void __init msm_map_qsd8x50_io(void) |
| 129 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 130 | msm_map_io(qsd8x50_io_desc, ARRAY_SIZE(qsd8x50_io_desc)); |
Daniel Walker | cf62ffa | 2010-05-04 15:12:27 -0700 | [diff] [blame] | 131 | } |
| 132 | #endif /* CONFIG_ARCH_QSD8X50 */ |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 133 | |
Steve Muckle | 6cf6dfe | 2010-01-06 14:55:24 -0800 | [diff] [blame] | 134 | #ifdef CONFIG_ARCH_MSM8X60 |
| 135 | static struct map_desc msm8x60_io_desc[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 136 | MSM_DEVICE(QGIC_DIST), |
| 137 | MSM_DEVICE(QGIC_CPU), |
| 138 | MSM_DEVICE(TMR), |
| 139 | MSM_DEVICE(TMR0), |
| 140 | MSM_DEVICE(RPM_MPM), |
Steve Muckle | 6cf6dfe | 2010-01-06 14:55:24 -0800 | [diff] [blame] | 141 | MSM_DEVICE(ACC), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 142 | MSM_DEVICE(ACC0), |
| 143 | MSM_DEVICE(ACC1), |
| 144 | MSM_DEVICE(SAW0), |
| 145 | MSM_DEVICE(SAW1), |
Steve Muckle | 6cf6dfe | 2010-01-06 14:55:24 -0800 | [diff] [blame] | 146 | MSM_DEVICE(GCC), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 147 | MSM_DEVICE(TLMM), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 148 | 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 Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 156 | #ifdef CONFIG_DEBUG_MSM8660_UART |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 157 | 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 Muckle | 6cf6dfe | 2010-01-06 14:55:24 -0800 | [diff] [blame] | 166 | }; |
| 167 | |
| 168 | void __init msm_map_msm8x60_io(void) |
| 169 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 170 | msm_map_io(msm8x60_io_desc, ARRAY_SIZE(msm8x60_io_desc)); |
Steve Muckle | 6cf6dfe | 2010-01-06 14:55:24 -0800 | [diff] [blame] | 171 | } |
| 172 | #endif /* CONFIG_ARCH_MSM8X60 */ |
| 173 | |
Stepan Moskovchenko | 5d0afd7 | 2010-12-01 19:05:49 -0800 | [diff] [blame] | 174 | #ifdef CONFIG_ARCH_MSM8960 |
| 175 | static struct map_desc msm8960_io_desc[] __initdata = { |
| 176 | MSM_CHIP_DEVICE(QGIC_DIST, MSM8960), |
| 177 | MSM_CHIP_DEVICE(QGIC_CPU, MSM8960), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 178 | MSM_CHIP_DEVICE(ACC0, MSM8960), |
| 179 | MSM_CHIP_DEVICE(ACC1, MSM8960), |
Stepan Moskovchenko | 5d0afd7 | 2010-12-01 19:05:49 -0800 | [diff] [blame] | 180 | MSM_CHIP_DEVICE(TMR, MSM8960), |
| 181 | MSM_CHIP_DEVICE(TMR0, MSM8960), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 182 | 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 187 | 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 194 | 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 Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 201 | #ifdef CONFIG_DEBUG_MSM8960_UART |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 202 | MSM_DEVICE(DEBUG_UART), |
| 203 | #endif |
Siddartha Mohanadoss | ce1315a | 2011-04-21 15:25:55 -0700 | [diff] [blame] | 204 | MSM_CHIP_DEVICE(QFPROM, MSM8960), |
Stepan Moskovchenko | 5d0afd7 | 2010-12-01 19:05:49 -0800 | [diff] [blame] | 205 | }; |
| 206 | |
| 207 | void __init msm_map_msm8960_io(void) |
| 208 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 209 | msm_map_io(msm8960_io_desc, ARRAY_SIZE(msm8960_io_desc)); |
Stepan Moskovchenko | 5d0afd7 | 2010-12-01 19:05:49 -0800 | [diff] [blame] | 210 | } |
| 211 | #endif /* CONFIG_ARCH_MSM8960 */ |
| 212 | |
Stepan Moskovchenko | 2b992ad | 2011-10-18 17:24:18 -0700 | [diff] [blame] | 213 | #ifdef CONFIG_ARCH_MSM8930 |
| 214 | static 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 Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 240 | #ifdef CONFIG_DEBUG_MSM8930_UART |
Stepan Moskovchenko | 2b992ad | 2011-10-18 17:24:18 -0700 | [diff] [blame] | 241 | MSM_DEVICE(DEBUG_UART), |
| 242 | #endif |
| 243 | MSM_CHIP_DEVICE(QFPROM, MSM8930), |
| 244 | }; |
| 245 | |
| 246 | void __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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 252 | #ifdef CONFIG_ARCH_APQ8064 |
| 253 | static 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 King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 258 | MSM_CHIP_DEVICE(TLMM, APQ8064), |
Vikram Mulukutla | bb408eb | 2011-08-04 09:28:56 -0700 | [diff] [blame] | 259 | 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 Gou | 3343041 | 2011-09-07 21:50:42 -0700 | [diff] [blame] | 264 | MSM_CHIP_DEVICE(CLK_CTL, APQ8064), |
| 265 | MSM_CHIP_DEVICE(MMSS_CLK_CTL, APQ8064), |
| 266 | MSM_CHIP_DEVICE(LPASS_CLK_CTL, APQ8064), |
Vikram Mulukutla | bb408eb | 2011-08-04 09:28:56 -0700 | [diff] [blame] | 267 | MSM_CHIP_DEVICE(APCS_GCC, APQ8064), |
Praveen Chidambaram | d9a4173 | 2011-10-17 09:41:05 -0600 | [diff] [blame] | 268 | 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 Moskovchenko | 3e444e5 | 2011-08-05 17:59:48 -0700 | [diff] [blame] | 275 | MSM_CHIP_DEVICE(IMEM, APQ8064), |
Aravind Venkateswaran | 7eb05da | 2012-02-16 14:23:03 -0800 | [diff] [blame] | 276 | MSM_CHIP_DEVICE(HDMI, APQ8064), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 277 | { |
| 278 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
| 279 | .length = MSM_SHARED_RAM_SIZE, |
| 280 | .type = MT_DEVICE, |
| 281 | }, |
Vijayakumar Muthuvel Manickam | f35fd73 | 2012-01-13 16:17:52 -0800 | [diff] [blame] | 282 | MSM_CHIP_DEVICE(QFPROM, APQ8064), |
Jeff Hugo | 85bfed4 | 2012-01-31 10:10:14 -0700 | [diff] [blame] | 283 | MSM_CHIP_DEVICE(SIC_NON_SECURE, APQ8064), |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 284 | }; |
| 285 | |
| 286 | void __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 Ambley | 6829db1 | 2011-10-08 22:41:23 -0700 | [diff] [blame] | 292 | #ifdef CONFIG_ARCH_MSMCOPPER |
| 293 | static struct map_desc msm_copper_io_desc[] __initdata = { |
| 294 | MSM_CHIP_DEVICE(QGIC_DIST, COPPER), |
| 295 | MSM_CHIP_DEVICE(QGIC_CPU, COPPER), |
Jeff Hugo | 7094609 | 2012-02-10 11:30:43 -0700 | [diff] [blame] | 296 | MSM_CHIP_DEVICE(APCS_GCC, COPPER), |
Sathish Ambley | 6829db1 | 2011-10-08 22:41:23 -0700 | [diff] [blame] | 297 | MSM_CHIP_DEVICE(TLMM, COPPER), |
Jeff Hugo | 7094609 | 2012-02-10 11:30:43 -0700 | [diff] [blame] | 298 | { |
| 299 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
| 300 | .length = MSM_SHARED_RAM_SIZE, |
| 301 | .type = MT_DEVICE, |
| 302 | }, |
Sathish Ambley | f5bebd6 | 2011-11-03 23:36:36 -0700 | [diff] [blame] | 303 | #ifdef CONFIG_DEBUG_MSMCOPPER_UART |
| 304 | MSM_DEVICE(DEBUG_UART), |
| 305 | #endif |
Sathish Ambley | 6829db1 | 2011-10-08 22:41:23 -0700 | [diff] [blame] | 306 | }; |
| 307 | |
| 308 | void __init msm_map_copper_io(void) |
| 309 | { |
Jeff Hugo | 7094609 | 2012-02-10 11:30:43 -0700 | [diff] [blame] | 310 | msm_shared_ram_phys = COPPER_MSM_SHARED_RAM_PHYS; |
Sathish Ambley | 6829db1 | 2011-10-08 22:41:23 -0700 | [diff] [blame] | 311 | msm_map_io(msm_copper_io_desc, ARRAY_SIZE(msm_copper_io_desc)); |
| 312 | } |
| 313 | #endif /* CONFIG_ARCH_MSMCOPPER */ |
| 314 | |
Daniel Walker | c83b2bf | 2010-05-04 15:26:13 -0700 | [diff] [blame] | 315 | #ifdef CONFIG_ARCH_MSM7X30 |
| 316 | static struct map_desc msm7x30_io_desc[] __initdata = { |
Taniya Das | 298de8c | 2012-02-16 11:45:31 +0530 | [diff] [blame] | 317 | 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 Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 330 | #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ |
| 331 | defined(CONFIG_DEBUG_MSM_UART3) |
Daniel Walker | c83b2bf | 2010-05-04 15:26:13 -0700 | [diff] [blame] | 332 | MSM_DEVICE(DEBUG_UART), |
| 333 | #endif |
| 334 | { |
| 335 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
Daniel Walker | c83b2bf | 2010-05-04 15:26:13 -0700 | [diff] [blame] | 336 | .length = MSM_SHARED_RAM_SIZE, |
| 337 | .type = MT_DEVICE, |
| 338 | }, |
| 339 | }; |
| 340 | |
| 341 | void __init msm_map_msm7x30_io(void) |
| 342 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 343 | msm_map_io(msm7x30_io_desc, ARRAY_SIZE(msm7x30_io_desc)); |
Daniel Walker | c83b2bf | 2010-05-04 15:26:13 -0700 | [diff] [blame] | 344 | } |
| 345 | #endif /* CONFIG_ARCH_MSM7X30 */ |
| 346 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 347 | #ifdef CONFIG_ARCH_FSM9XXX |
| 348 | static 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 Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 359 | MSM_DEVICE(QFP_FUSE), |
| 360 | MSM_DEVICE(HH), |
Sathish Ambley | bb87d5f | 2011-11-08 15:14:01 -0800 | [diff] [blame] | 361 | #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ |
| 362 | defined(CONFIG_DEBUG_MSM_UART3) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 363 | 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 | |
| 372 | void __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 Vaswani | 99fb6f2 | 2011-08-15 13:37:32 -0700 | [diff] [blame] | 378 | #ifdef CONFIG_ARCH_MSM9615 |
| 379 | static 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 Vaswani | 99fb6f2 | 2011-08-15 13:37:32 -0700 | [diff] [blame] | 384 | 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 Mulukutla | 489e39e | 2011-08-31 18:04:05 -0700 | [diff] [blame] | 388 | MSM_CHIP_DEVICE(L2CC, MSM9615), |
| 389 | MSM_CHIP_DEVICE(CLK_CTL, MSM9615), |
| 390 | MSM_CHIP_DEVICE(LPASS_CLK_CTL, MSM9615), |
Rohit Vaswani | 71c86b7 | 2011-09-09 16:51:46 -0700 | [diff] [blame] | 391 | MSM_CHIP_DEVICE(RPM, MSM9615), |
| 392 | MSM_CHIP_DEVICE(RPM_MPM, MSM9615), |
| 393 | MSM_CHIP_DEVICE(APCS_GLB, MSM9615), |
Rohit Vaswani | 4f96570c | 2011-10-13 18:14:37 -0700 | [diff] [blame] | 394 | MSM_CHIP_DEVICE(IMEM, MSM9615), |
Rohit Vaswani | 99fb6f2 | 2011-08-15 13:37:32 -0700 | [diff] [blame] | 395 | { |
| 396 | .virtual = (unsigned long) MSM_SHARED_RAM_BASE, |
| 397 | .length = MSM_SHARED_RAM_SIZE, |
| 398 | .type = MT_DEVICE, |
| 399 | }, |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 400 | MSM_CHIP_DEVICE(QFPROM, MSM9615), |
Rohit Vaswani | 99fb6f2 | 2011-08-15 13:37:32 -0700 | [diff] [blame] | 401 | }; |
| 402 | |
| 403 | void __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 Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 409 | #ifdef CONFIG_ARCH_MSM8625 |
| 410 | static struct map_desc msm8625_io_desc[] __initdata = { |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 411 | 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 Das | 12df7bf | 2012-02-15 11:36:19 +0530 | [diff] [blame] | 421 | MSM_CHIP_DEVICE(SAW0, MSM8625), |
| 422 | MSM_CHIP_DEVICE(SAW1, MSM8625), |
Manish Dewangan | 504430a | 2012-02-29 17:34:38 +0530 | [diff] [blame] | 423 | MSM_CHIP_DEVICE(AD5, MSM7XXX), |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 424 | MSM_CHIP_DEVICE(MDC, MSM7XXX), |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 425 | #if defined(CONFIG_DEBUG_MSM_UART1) || defined(CONFIG_DEBUG_MSM_UART2) || \ |
| 426 | defined(CONFIG_DEBUG_MSM_UART3) |
Taniya Das | fa4ee7f | 2012-02-21 15:04:51 +0530 | [diff] [blame] | 427 | MSM_DEVICE(DEBUG_UART), |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 428 | #endif |
| 429 | #ifdef CONFIG_CACHE_L2X0 |
| 430 | { |
| 431 | .virtual = (unsigned long) MSM_L2CC_BASE, |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 432 | .pfn = __phys_to_pfn(MSM7XXX_L2CC_PHYS), |
| 433 | .length = MSM7XXX_L2CC_SIZE, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 434 | .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 | |
| 444 | void __init msm_map_msm8625_io(void) |
| 445 | { |
| 446 | msm_map_io(msm8625_io_desc, ARRAY_SIZE(msm8625_io_desc)); |
| 447 | } |
| 448 | #else |
| 449 | void __init msm_map_msm8625_io(void) { return; } |
| 450 | #endif /* CONFIG_ARCH_MSM8625 */ |
| 451 | |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 452 | void __iomem * |
| 453 | __msm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype) |
| 454 | { |
| 455 | if (mtype == MT_DEVICE) { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 456 | /* The peripherals in the 88000000 - F0000000 range |
| 457 | * are only accessable by type MT_DEVICE_NONSHARED. |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 458 | * Adjust mtype as necessary to make this "just work." |
| 459 | */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 460 | if ((phys_addr >= 0x88000000) && (phys_addr < 0xF0000000)) |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 461 | mtype = MT_DEVICE_NONSHARED; |
| 462 | } |
| 463 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 464 | return __arm_ioremap(phys_addr, size, mtype); |
Brian Swetland | 3042102 | 2007-11-26 04:11:43 -0800 | [diff] [blame] | 465 | } |
Pavankumar Kondeti | 4916a10 | 2010-11-09 15:41:29 +0530 | [diff] [blame] | 466 | EXPORT_SYMBOL(__msm_ioremap); |