Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/irq.h> |
| 17 | #include <linux/io.h> |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 18 | #include <linux/msm_tsens.h> |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 19 | #include <linux/platform_data/qcom_crypto_device.h> |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 20 | #include <linux/dma-mapping.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 21 | #include <asm/hardware/gic.h> |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 22 | #include <asm/mach/flash.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 23 | #include <mach/board.h> |
| 24 | #include <mach/msm_iomap.h> |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 25 | #include <mach/msm_hsusb.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 26 | #include <mach/irqs.h> |
| 27 | #include <mach/socinfo.h> |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 28 | #include <mach/rpm.h> |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame^] | 29 | #include <mach/msm_bus_board.h> |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 30 | #include <asm/hardware/cache-l2x0.h> |
Yan He | 092b727 | 2011-09-21 15:25:03 -0700 | [diff] [blame] | 31 | #include <mach/msm_sps.h> |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 32 | #include <mach/dma.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 33 | #include "devices.h" |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 34 | #include "mpm.h" |
| 35 | #include "spm.h" |
| 36 | #include "pm.h" |
| 37 | #include "rpm_resources.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 38 | #include "msm_watchdog.h" |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 39 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 40 | /* Address of GSBI blocks */ |
| 41 | #define MSM_GSBI1_PHYS 0x16000000 |
| 42 | #define MSM_GSBI2_PHYS 0x16100000 |
| 43 | #define MSM_GSBI3_PHYS 0x16200000 |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 44 | #define MSM_GSBI4_PHYS 0x16300000 |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 45 | #define MSM_GSBI5_PHYS 0x16400000 |
| 46 | |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 47 | #define MSM_UART4DM_PHYS (MSM_GSBI4_PHYS + 0x40000) |
| 48 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 49 | /* GSBI QUP devices */ |
| 50 | #define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000) |
| 51 | #define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000) |
| 52 | #define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000) |
| 53 | #define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000) |
| 54 | #define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000) |
| 55 | #define MSM_QUP_SIZE SZ_4K |
| 56 | |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 57 | /* Address of SSBI CMD */ |
| 58 | #define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000 |
| 59 | #define MSM_PMIC_SSBI_SIZE SZ_4K |
| 60 | |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 61 | static struct msm_watchdog_pdata msm_watchdog_pdata = { |
| 62 | .pet_time = 10000, |
| 63 | .bark_time = 11000, |
| 64 | .has_secure = true, |
| 65 | }; |
| 66 | |
| 67 | struct platform_device msm9615_device_watchdog = { |
| 68 | .name = "msm_watchdog", |
| 69 | .id = -1, |
| 70 | .dev = { |
| 71 | .platform_data = &msm_watchdog_pdata, |
| 72 | }, |
| 73 | }; |
| 74 | |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 75 | static struct resource msm_dmov_resource[] = { |
| 76 | { |
| 77 | .start = ADM_0_SCSS_1_IRQ, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 78 | .flags = IORESOURCE_IRQ, |
| 79 | }, |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 80 | { |
| 81 | .start = 0x18320000, |
| 82 | .end = 0x18320000 + SZ_1M - 1, |
| 83 | .flags = IORESOURCE_MEM, |
| 84 | }, |
| 85 | }; |
| 86 | |
| 87 | static struct msm_dmov_pdata msm_dmov_pdata = { |
| 88 | .sd = 1, |
| 89 | .sd_size = 0x800, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 90 | }; |
| 91 | |
| 92 | struct platform_device msm9615_device_dmov = { |
| 93 | .name = "msm_dmov", |
| 94 | .id = -1, |
| 95 | .resource = msm_dmov_resource, |
| 96 | .num_resources = ARRAY_SIZE(msm_dmov_resource), |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 97 | .dev = { |
| 98 | .platform_data = &msm_dmov_pdata, |
| 99 | }, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 100 | }; |
| 101 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 102 | static struct resource resources_otg[] = { |
| 103 | { |
| 104 | .start = MSM9615_HSUSB_PHYS, |
| 105 | .end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1, |
| 106 | .flags = IORESOURCE_MEM, |
| 107 | }, |
| 108 | { |
| 109 | .start = USB1_HS_IRQ, |
| 110 | .end = USB1_HS_IRQ, |
| 111 | .flags = IORESOURCE_IRQ, |
| 112 | }, |
| 113 | }; |
| 114 | |
| 115 | struct platform_device msm_device_otg = { |
| 116 | .name = "msm_otg", |
| 117 | .id = -1, |
| 118 | .num_resources = ARRAY_SIZE(resources_otg), |
| 119 | .resource = resources_otg, |
| 120 | .dev = { |
| 121 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 122 | }, |
| 123 | }; |
| 124 | |
| 125 | static struct resource resources_hsusb[] = { |
| 126 | { |
| 127 | .start = MSM9615_HSUSB_PHYS, |
| 128 | .end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1, |
| 129 | .flags = IORESOURCE_MEM, |
| 130 | }, |
| 131 | { |
| 132 | .start = USB1_HS_IRQ, |
| 133 | .end = USB1_HS_IRQ, |
| 134 | .flags = IORESOURCE_IRQ, |
| 135 | }, |
| 136 | }; |
| 137 | |
| 138 | struct platform_device msm_device_gadget_peripheral = { |
| 139 | .name = "msm_hsusb", |
| 140 | .id = -1, |
| 141 | .num_resources = ARRAY_SIZE(resources_hsusb), |
| 142 | .resource = resources_hsusb, |
| 143 | .dev = { |
| 144 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 145 | }, |
| 146 | }; |
| 147 | |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 148 | static struct resource resources_uart_gsbi4[] = { |
| 149 | { |
| 150 | .start = GSBI4_UARTDM_IRQ, |
| 151 | .end = GSBI4_UARTDM_IRQ, |
| 152 | .flags = IORESOURCE_IRQ, |
| 153 | }, |
| 154 | { |
| 155 | .start = MSM_UART4DM_PHYS, |
| 156 | .end = MSM_UART4DM_PHYS + PAGE_SIZE - 1, |
| 157 | .name = "uartdm_resource", |
| 158 | .flags = IORESOURCE_MEM, |
| 159 | }, |
| 160 | { |
| 161 | .start = MSM_GSBI4_PHYS, |
| 162 | .end = MSM_GSBI4_PHYS + PAGE_SIZE - 1, |
| 163 | .name = "gsbi_resource", |
| 164 | .flags = IORESOURCE_MEM, |
| 165 | }, |
| 166 | }; |
| 167 | |
| 168 | struct platform_device msm9615_device_uart_gsbi4 = { |
| 169 | .name = "msm_serial_hsl", |
| 170 | .id = 0, |
| 171 | .num_resources = ARRAY_SIZE(resources_uart_gsbi4), |
| 172 | .resource = resources_uart_gsbi4, |
| 173 | }; |
| 174 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 175 | static struct resource resources_qup_i2c_gsbi5[] = { |
| 176 | { |
| 177 | .name = "gsbi_qup_i2c_addr", |
| 178 | .start = MSM_GSBI5_PHYS, |
Harini Jayaraman | 7a60bc1 | 2011-09-15 14:58:54 -0600 | [diff] [blame] | 179 | .end = MSM_GSBI5_PHYS + 4 - 1, |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 180 | .flags = IORESOURCE_MEM, |
| 181 | }, |
| 182 | { |
| 183 | .name = "qup_phys_addr", |
| 184 | .start = MSM_GSBI5_QUP_PHYS, |
Harini Jayaraman | 7a60bc1 | 2011-09-15 14:58:54 -0600 | [diff] [blame] | 185 | .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1, |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 186 | .flags = IORESOURCE_MEM, |
| 187 | }, |
| 188 | { |
| 189 | .name = "qup_err_intr", |
| 190 | .start = GSBI5_QUP_IRQ, |
| 191 | .end = GSBI5_QUP_IRQ, |
| 192 | .flags = IORESOURCE_IRQ, |
| 193 | }, |
| 194 | }; |
| 195 | |
| 196 | struct platform_device msm9615_device_qup_i2c_gsbi5 = { |
| 197 | .name = "qup_i2c", |
| 198 | .id = 0, |
| 199 | .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5), |
| 200 | .resource = resources_qup_i2c_gsbi5, |
| 201 | }; |
| 202 | |
Harini Jayaraman | 738c931 | 2011-09-08 15:22:38 -0600 | [diff] [blame] | 203 | static struct resource resources_qup_spi_gsbi3[] = { |
| 204 | { |
| 205 | .name = "spi_base", |
| 206 | .start = MSM_GSBI3_QUP_PHYS, |
| 207 | .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1, |
| 208 | .flags = IORESOURCE_MEM, |
| 209 | }, |
| 210 | { |
| 211 | .name = "gsbi_base", |
| 212 | .start = MSM_GSBI3_PHYS, |
| 213 | .end = MSM_GSBI3_PHYS + 4 - 1, |
| 214 | .flags = IORESOURCE_MEM, |
| 215 | }, |
| 216 | { |
| 217 | .name = "spi_irq_in", |
| 218 | .start = GSBI3_QUP_IRQ, |
| 219 | .end = GSBI3_QUP_IRQ, |
| 220 | .flags = IORESOURCE_IRQ, |
| 221 | }, |
| 222 | }; |
| 223 | |
| 224 | struct platform_device msm9615_device_qup_spi_gsbi3 = { |
| 225 | .name = "spi_qsd", |
| 226 | .id = 0, |
| 227 | .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi3), |
| 228 | .resource = resources_qup_spi_gsbi3, |
| 229 | }; |
| 230 | |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 231 | static struct resource resources_ssbi_pmic1[] = { |
| 232 | { |
| 233 | .start = MSM_PMIC1_SSBI_CMD_PHYS, |
| 234 | .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1, |
| 235 | .flags = IORESOURCE_MEM, |
| 236 | }, |
| 237 | }; |
| 238 | |
| 239 | struct platform_device msm9615_device_ssbi_pmic1 = { |
| 240 | .name = "msm_ssbi", |
| 241 | .id = 0, |
| 242 | .resource = resources_ssbi_pmic1, |
| 243 | .num_resources = ARRAY_SIZE(resources_ssbi_pmic1), |
| 244 | }; |
| 245 | |
Yan He | 092b727 | 2011-09-21 15:25:03 -0700 | [diff] [blame] | 246 | static struct resource resources_sps[] = { |
| 247 | { |
| 248 | .name = "pipe_mem", |
| 249 | .start = 0x12800000, |
| 250 | .end = 0x12800000 + 0x4000 - 1, |
| 251 | .flags = IORESOURCE_MEM, |
| 252 | }, |
| 253 | { |
| 254 | .name = "bamdma_dma", |
| 255 | .start = 0x12240000, |
| 256 | .end = 0x12240000 + 0x1000 - 1, |
| 257 | .flags = IORESOURCE_MEM, |
| 258 | }, |
| 259 | { |
| 260 | .name = "bamdma_bam", |
| 261 | .start = 0x12244000, |
| 262 | .end = 0x12244000 + 0x4000 - 1, |
| 263 | .flags = IORESOURCE_MEM, |
| 264 | }, |
| 265 | { |
| 266 | .name = "bamdma_irq", |
| 267 | .start = SPS_BAM_DMA_IRQ, |
| 268 | .end = SPS_BAM_DMA_IRQ, |
| 269 | .flags = IORESOURCE_IRQ, |
| 270 | }, |
| 271 | }; |
| 272 | |
| 273 | struct msm_sps_platform_data msm_sps_pdata = { |
| 274 | .bamdma_restricted_pipes = 0x06, |
| 275 | }; |
| 276 | |
| 277 | struct platform_device msm_device_sps = { |
| 278 | .name = "msm_sps", |
| 279 | .id = -1, |
| 280 | .num_resources = ARRAY_SIZE(resources_sps), |
| 281 | .resource = resources_sps, |
| 282 | .dev.platform_data = &msm_sps_pdata, |
| 283 | }; |
| 284 | |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 285 | static struct tsens_platform_data msm_tsens_pdata = { |
| 286 | .slope = 910, |
| 287 | .tsens_factor = 1000, |
| 288 | .hw_type = MSM_9615, |
| 289 | .tsens_num_sensor = 5, |
| 290 | }; |
| 291 | |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 292 | struct platform_device msm9615_device_tsens = { |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 293 | .name = "tsens8960-tm", |
| 294 | .id = -1, |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 295 | .dev = { |
| 296 | .platform_data = &msm_tsens_pdata, |
| 297 | }, |
| 298 | }; |
| 299 | |
| 300 | #define MSM_NAND_PHYS 0x1B400000 |
| 301 | static struct resource resources_nand[] = { |
| 302 | [0] = { |
| 303 | .name = "msm_nand_dmac", |
| 304 | .start = DMOV_NAND_CHAN, |
| 305 | .end = DMOV_NAND_CHAN, |
| 306 | .flags = IORESOURCE_DMA, |
| 307 | }, |
| 308 | [1] = { |
| 309 | .name = "msm_nand_phys", |
| 310 | .start = MSM_NAND_PHYS, |
| 311 | .end = MSM_NAND_PHYS + 0x7FF, |
| 312 | .flags = IORESOURCE_MEM, |
| 313 | }, |
| 314 | }; |
| 315 | |
| 316 | struct flash_platform_data msm_nand_data = { |
| 317 | .parts = NULL, |
| 318 | .nr_parts = 0, |
| 319 | }; |
| 320 | |
| 321 | struct platform_device msm_device_nand = { |
| 322 | .name = "msm_nand", |
| 323 | .id = -1, |
| 324 | .num_resources = ARRAY_SIZE(resources_nand), |
| 325 | .resource = resources_nand, |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 326 | .dev = { |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 327 | .platform_data = &msm_nand_data, |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 328 | }, |
| 329 | }; |
| 330 | |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 331 | struct platform_device msm_device_smd = { |
| 332 | .name = "msm_smd", |
| 333 | .id = -1, |
| 334 | }; |
| 335 | |
Eric Holmberg | 0c96e70 | 2011-11-08 18:04:31 -0700 | [diff] [blame] | 336 | struct platform_device msm_device_bam_dmux = { |
| 337 | .name = "BAM_RMNT", |
| 338 | .id = -1, |
| 339 | }; |
| 340 | |
Ramesh Masavarapu | 5ad3739 | 2011-10-10 10:44:10 -0700 | [diff] [blame] | 341 | #ifdef CONFIG_HW_RANDOM_MSM |
| 342 | /* PRNG device */ |
| 343 | #define MSM_PRNG_PHYS 0x1A500000 |
| 344 | static struct resource rng_resources = { |
| 345 | .flags = IORESOURCE_MEM, |
| 346 | .start = MSM_PRNG_PHYS, |
| 347 | .end = MSM_PRNG_PHYS + SZ_512 - 1, |
| 348 | }; |
| 349 | |
| 350 | struct platform_device msm_device_rng = { |
| 351 | .name = "msm_rng", |
| 352 | .id = 0, |
| 353 | .num_resources = 1, |
| 354 | .resource = &rng_resources, |
| 355 | }; |
| 356 | #endif |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 357 | |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 358 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 359 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 360 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 361 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 362 | |
| 363 | #define QCE_SIZE 0x10000 |
| 364 | #define QCE_0_BASE 0x18500000 |
| 365 | |
| 366 | #define QCE_HW_KEY_SUPPORT 0 |
| 367 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 368 | #define QCE_SHARE_CE_RESOURCE 1 |
| 369 | #define QCE_CE_SHARED 0 |
| 370 | |
| 371 | static struct resource qcrypto_resources[] = { |
| 372 | [0] = { |
| 373 | .start = QCE_0_BASE, |
| 374 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 375 | .flags = IORESOURCE_MEM, |
| 376 | }, |
| 377 | [1] = { |
| 378 | .name = "crypto_channels", |
| 379 | .start = DMOV_CE_IN_CHAN, |
| 380 | .end = DMOV_CE_OUT_CHAN, |
| 381 | .flags = IORESOURCE_DMA, |
| 382 | }, |
| 383 | [2] = { |
| 384 | .name = "crypto_crci_in", |
| 385 | .start = DMOV_CE_IN_CRCI, |
| 386 | .end = DMOV_CE_IN_CRCI, |
| 387 | .flags = IORESOURCE_DMA, |
| 388 | }, |
| 389 | [3] = { |
| 390 | .name = "crypto_crci_out", |
| 391 | .start = DMOV_CE_OUT_CRCI, |
| 392 | .end = DMOV_CE_OUT_CRCI, |
| 393 | .flags = IORESOURCE_DMA, |
| 394 | }, |
| 395 | }; |
| 396 | |
| 397 | static struct resource qcedev_resources[] = { |
| 398 | [0] = { |
| 399 | .start = QCE_0_BASE, |
| 400 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 401 | .flags = IORESOURCE_MEM, |
| 402 | }, |
| 403 | [1] = { |
| 404 | .name = "crypto_channels", |
| 405 | .start = DMOV_CE_IN_CHAN, |
| 406 | .end = DMOV_CE_OUT_CHAN, |
| 407 | .flags = IORESOURCE_DMA, |
| 408 | }, |
| 409 | [2] = { |
| 410 | .name = "crypto_crci_in", |
| 411 | .start = DMOV_CE_IN_CRCI, |
| 412 | .end = DMOV_CE_IN_CRCI, |
| 413 | .flags = IORESOURCE_DMA, |
| 414 | }, |
| 415 | [3] = { |
| 416 | .name = "crypto_crci_out", |
| 417 | .start = DMOV_CE_OUT_CRCI, |
| 418 | .end = DMOV_CE_OUT_CRCI, |
| 419 | .flags = IORESOURCE_DMA, |
| 420 | }, |
| 421 | }; |
| 422 | |
| 423 | #endif |
| 424 | |
| 425 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 426 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 427 | |
| 428 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 429 | .ce_shared = QCE_CE_SHARED, |
| 430 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 431 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 432 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 433 | }; |
| 434 | |
| 435 | struct platform_device msm9615_qcrypto_device = { |
| 436 | .name = "qcrypto", |
| 437 | .id = 0, |
| 438 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 439 | .resource = qcrypto_resources, |
| 440 | .dev = { |
| 441 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 442 | .platform_data = &qcrypto_ce_hw_suppport, |
| 443 | }, |
| 444 | }; |
| 445 | #endif |
| 446 | |
| 447 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 448 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 449 | |
| 450 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 451 | .ce_shared = QCE_CE_SHARED, |
| 452 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 453 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 454 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
| 455 | }; |
| 456 | |
| 457 | struct platform_device msm9615_qcedev_device = { |
| 458 | .name = "qce", |
| 459 | .id = 0, |
| 460 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 461 | .resource = qcedev_resources, |
| 462 | .dev = { |
| 463 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 464 | .platform_data = &qcedev_ce_hw_suppport, |
| 465 | }, |
| 466 | }; |
| 467 | #endif |
| 468 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 469 | #define MSM_SDC1_BASE 0x12180000 |
| 470 | #define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800) |
| 471 | #define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000) |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 472 | #define MSM_SDC2_BASE 0x12140000 |
| 473 | #define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800) |
| 474 | #define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000) |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 475 | |
| 476 | static struct resource resources_sdc1[] = { |
| 477 | { |
| 478 | .name = "core_mem", |
| 479 | .flags = IORESOURCE_MEM, |
| 480 | .start = MSM_SDC1_BASE, |
| 481 | .end = MSM_SDC1_DML_BASE - 1, |
| 482 | }, |
| 483 | { |
| 484 | .name = "core_irq", |
| 485 | .flags = IORESOURCE_IRQ, |
| 486 | .start = SDC1_IRQ_0, |
| 487 | .end = SDC1_IRQ_0 |
| 488 | }, |
| 489 | #ifdef CONFIG_MMC_MSM_SPS_SUPPORT |
| 490 | { |
| 491 | .name = "sdcc_dml_addr", |
| 492 | .start = MSM_SDC1_DML_BASE, |
| 493 | .end = MSM_SDC1_BAM_BASE - 1, |
| 494 | .flags = IORESOURCE_MEM, |
| 495 | }, |
| 496 | { |
| 497 | .name = "sdcc_bam_addr", |
| 498 | .start = MSM_SDC1_BAM_BASE, |
| 499 | .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1, |
| 500 | .flags = IORESOURCE_MEM, |
| 501 | }, |
| 502 | { |
| 503 | .name = "sdcc_bam_irq", |
| 504 | .start = SDC1_BAM_IRQ, |
| 505 | .end = SDC1_BAM_IRQ, |
| 506 | .flags = IORESOURCE_IRQ, |
| 507 | }, |
| 508 | #endif |
| 509 | }; |
| 510 | |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 511 | static struct resource resources_sdc2[] = { |
| 512 | { |
| 513 | .name = "core_mem", |
| 514 | .flags = IORESOURCE_MEM, |
| 515 | .start = MSM_SDC2_BASE, |
| 516 | .end = MSM_SDC2_DML_BASE - 1, |
| 517 | }, |
| 518 | { |
| 519 | .name = "core_irq", |
| 520 | .flags = IORESOURCE_IRQ, |
| 521 | .start = SDC2_IRQ_0, |
| 522 | .end = SDC2_IRQ_0 |
| 523 | }, |
| 524 | #ifdef CONFIG_MMC_MSM_SPS_SUPPORT |
| 525 | { |
| 526 | .name = "sdcc_dml_addr", |
| 527 | .start = MSM_SDC2_DML_BASE, |
| 528 | .end = MSM_SDC2_BAM_BASE - 1, |
| 529 | .flags = IORESOURCE_MEM, |
| 530 | }, |
| 531 | { |
| 532 | .name = "sdcc_bam_addr", |
| 533 | .start = MSM_SDC2_BAM_BASE, |
| 534 | .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1, |
| 535 | .flags = IORESOURCE_MEM, |
| 536 | }, |
| 537 | { |
| 538 | .name = "sdcc_bam_irq", |
| 539 | .start = SDC2_BAM_IRQ, |
| 540 | .end = SDC2_BAM_IRQ, |
| 541 | .flags = IORESOURCE_IRQ, |
| 542 | }, |
| 543 | #endif |
| 544 | }; |
| 545 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 546 | struct platform_device msm_device_sdc1 = { |
| 547 | .name = "msm_sdcc", |
| 548 | .id = 1, |
| 549 | .num_resources = ARRAY_SIZE(resources_sdc1), |
| 550 | .resource = resources_sdc1, |
| 551 | .dev = { |
| 552 | .coherent_dma_mask = 0xffffffff, |
| 553 | }, |
| 554 | }; |
| 555 | |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 556 | struct platform_device msm_device_sdc2 = { |
| 557 | .name = "msm_sdcc", |
| 558 | .id = 2, |
| 559 | .num_resources = ARRAY_SIZE(resources_sdc2), |
| 560 | .resource = resources_sdc2, |
| 561 | .dev = { |
| 562 | .coherent_dma_mask = 0xffffffff, |
| 563 | }, |
| 564 | }; |
| 565 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 566 | static struct platform_device *msm_sdcc_devices[] __initdata = { |
| 567 | &msm_device_sdc1, |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 568 | &msm_device_sdc2, |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 569 | }; |
| 570 | |
| 571 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) |
| 572 | { |
| 573 | struct platform_device *pdev; |
| 574 | |
| 575 | if (controller < 1 || controller > 2) |
| 576 | return -EINVAL; |
| 577 | |
| 578 | pdev = msm_sdcc_devices[controller - 1]; |
| 579 | pdev->dev.platform_data = plat; |
| 580 | return platform_device_register(pdev); |
| 581 | } |
| 582 | |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 583 | #ifdef CONFIG_CACHE_L2X0 |
| 584 | static int __init l2x0_cache_init(void) |
| 585 | { |
| 586 | int aux_ctrl = 0; |
| 587 | |
| 588 | /* Way Size 010(0x2) 32KB */ |
| 589 | aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \ |
| 590 | (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \ |
| 591 | (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT); |
| 592 | |
| 593 | /* L2 Latency setting required by hardware. Default is 0x20 |
| 594 | which is no good. |
| 595 | */ |
| 596 | writel_relaxed(0x220, MSM_L2CC_BASE + L2X0_DATA_LATENCY_CTRL); |
| 597 | l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK); |
| 598 | |
| 599 | return 0; |
| 600 | } |
| 601 | #else |
| 602 | static int __init l2x0_cache_init(void){ return 0; } |
| 603 | #endif |
| 604 | |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 605 | struct msm_rpm_map_data rpm_map_data[] __initdata = { |
| 606 | MSM_RPM_MAP(TRIGGER_TIMED_TO, TRIGGER_TIMED, 1), |
| 607 | MSM_RPM_MAP(TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1), |
| 608 | |
| 609 | MSM_RPM_MAP(RPM_CTL, RPM_CTL, 1), |
| 610 | |
| 611 | MSM_RPM_MAP(CXO_CLK, CXO_CLK, 1), |
| 612 | MSM_RPM_MAP(SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1), |
| 613 | MSM_RPM_MAP(DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1), |
| 614 | MSM_RPM_MAP(SFPB_CLK, SFPB_CLK, 1), |
| 615 | MSM_RPM_MAP(CFPB_CLK, CFPB_CLK, 1), |
| 616 | MSM_RPM_MAP(EBI1_CLK, EBI1_CLK, 1), |
| 617 | |
| 618 | MSM_RPM_MAP(SYS_FABRIC_CFG_HALT_0, SYS_FABRIC_CFG_HALT, 2), |
| 619 | MSM_RPM_MAP(SYS_FABRIC_CFG_CLKMOD_0, SYS_FABRIC_CFG_CLKMOD, 3), |
| 620 | MSM_RPM_MAP(SYS_FABRIC_CFG_IOCTL, SYS_FABRIC_CFG_IOCTL, 1), |
| 621 | MSM_RPM_MAP(SYSTEM_FABRIC_ARB_0, SYSTEM_FABRIC_ARB, 27), |
| 622 | |
| 623 | MSM_RPM_MAP(PM8018_S1_0, PM8018_S1, 2), |
| 624 | MSM_RPM_MAP(PM8018_S2_0, PM8018_S2, 2), |
| 625 | MSM_RPM_MAP(PM8018_S3_0, PM8018_S3, 2), |
| 626 | MSM_RPM_MAP(PM8018_S4_0, PM8018_S4, 2), |
| 627 | MSM_RPM_MAP(PM8018_S5_0, PM8018_S5, 2), |
| 628 | MSM_RPM_MAP(PM8018_L1_0, PM8018_L1, 2), |
| 629 | MSM_RPM_MAP(PM8018_L2_0, PM8018_L2, 2), |
| 630 | MSM_RPM_MAP(PM8018_L3_0, PM8018_L3, 2), |
| 631 | MSM_RPM_MAP(PM8018_L4_0, PM8018_L4, 2), |
| 632 | MSM_RPM_MAP(PM8018_L5_0, PM8018_L5, 2), |
| 633 | MSM_RPM_MAP(PM8018_L6_0, PM8018_L6, 2), |
| 634 | MSM_RPM_MAP(PM8018_L7_0, PM8018_L7, 2), |
| 635 | MSM_RPM_MAP(PM8018_L8_0, PM8018_L8, 2), |
| 636 | MSM_RPM_MAP(PM8018_L9_0, PM8018_L9, 2), |
| 637 | MSM_RPM_MAP(PM8018_L10_0, PM8018_L10, 2), |
| 638 | MSM_RPM_MAP(PM8018_L11_0, PM8018_L11, 2), |
| 639 | MSM_RPM_MAP(PM8018_L12_0, PM8018_L12, 2), |
| 640 | MSM_RPM_MAP(PM8018_L13_0, PM8018_L13, 2), |
| 641 | MSM_RPM_MAP(PM8018_L14_0, PM8018_L14, 2), |
| 642 | MSM_RPM_MAP(PM8018_LVS1, PM8018_LVS1, 1), |
| 643 | MSM_RPM_MAP(NCP_0, NCP, 2), |
| 644 | MSM_RPM_MAP(CXO_BUFFERS, CXO_BUFFERS, 1), |
| 645 | MSM_RPM_MAP(USB_OTG_SWITCH, USB_OTG_SWITCH, 1), |
| 646 | MSM_RPM_MAP(HDMI_SWITCH, HDMI_SWITCH, 1), |
| 647 | }; |
| 648 | unsigned int rpm_map_data_size = ARRAY_SIZE(rpm_map_data); |
| 649 | |
| 650 | static struct msm_rpm_platform_data msm_rpm_data = { |
| 651 | .reg_base_addrs = { |
| 652 | [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, |
| 653 | [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, |
| 654 | [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, |
| 655 | [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, |
| 656 | }, |
| 657 | |
| 658 | .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 659 | .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ, |
| 660 | .irq_vmpm = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 661 | .msm_apps_ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008, |
| 662 | .msm_apps_ipc_rpm_val = 4, |
| 663 | }; |
| 664 | |
| 665 | struct platform_device msm_rpm_device = { |
| 666 | .name = "msm_rpm", |
| 667 | .id = -1, |
| 668 | }; |
| 669 | |
| 670 | static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] = { |
| 671 | [1] = MSM_GPIO_TO_INT(46), |
| 672 | [2] = MSM_GPIO_TO_INT(150), |
| 673 | [4] = MSM_GPIO_TO_INT(103), |
| 674 | [5] = MSM_GPIO_TO_INT(104), |
| 675 | [6] = MSM_GPIO_TO_INT(105), |
| 676 | [7] = MSM_GPIO_TO_INT(106), |
| 677 | [8] = MSM_GPIO_TO_INT(107), |
| 678 | [9] = MSM_GPIO_TO_INT(7), |
| 679 | [10] = MSM_GPIO_TO_INT(11), |
| 680 | [11] = MSM_GPIO_TO_INT(15), |
| 681 | [12] = MSM_GPIO_TO_INT(19), |
| 682 | [13] = MSM_GPIO_TO_INT(23), |
| 683 | [14] = MSM_GPIO_TO_INT(27), |
| 684 | [15] = MSM_GPIO_TO_INT(31), |
| 685 | [16] = MSM_GPIO_TO_INT(35), |
| 686 | [19] = MSM_GPIO_TO_INT(90), |
| 687 | [20] = MSM_GPIO_TO_INT(92), |
| 688 | [23] = MSM_GPIO_TO_INT(85), |
| 689 | [24] = MSM_GPIO_TO_INT(83), |
| 690 | [25] = USB1_HS_IRQ, |
| 691 | /*[27] = HDMI_IRQ,*/ |
| 692 | [29] = MSM_GPIO_TO_INT(10), |
| 693 | [30] = MSM_GPIO_TO_INT(102), |
| 694 | [31] = MSM_GPIO_TO_INT(81), |
| 695 | [32] = MSM_GPIO_TO_INT(78), |
| 696 | [33] = MSM_GPIO_TO_INT(94), |
| 697 | [34] = MSM_GPIO_TO_INT(72), |
| 698 | [35] = MSM_GPIO_TO_INT(39), |
| 699 | [36] = MSM_GPIO_TO_INT(43), |
| 700 | [37] = MSM_GPIO_TO_INT(61), |
| 701 | [38] = MSM_GPIO_TO_INT(50), |
| 702 | [39] = MSM_GPIO_TO_INT(42), |
| 703 | [41] = MSM_GPIO_TO_INT(62), |
| 704 | [42] = MSM_GPIO_TO_INT(76), |
| 705 | [43] = MSM_GPIO_TO_INT(75), |
| 706 | [44] = MSM_GPIO_TO_INT(70), |
| 707 | [45] = MSM_GPIO_TO_INT(69), |
| 708 | [46] = MSM_GPIO_TO_INT(67), |
| 709 | [47] = MSM_GPIO_TO_INT(65), |
| 710 | [48] = MSM_GPIO_TO_INT(58), |
| 711 | [49] = MSM_GPIO_TO_INT(54), |
| 712 | [50] = MSM_GPIO_TO_INT(52), |
| 713 | [51] = MSM_GPIO_TO_INT(49), |
| 714 | [52] = MSM_GPIO_TO_INT(40), |
| 715 | [53] = MSM_GPIO_TO_INT(37), |
| 716 | [54] = MSM_GPIO_TO_INT(24), |
| 717 | [55] = MSM_GPIO_TO_INT(14), |
| 718 | }; |
| 719 | |
| 720 | static uint16_t msm_mpm_bypassed_apps_irqs[] = { |
| 721 | TLMM_MSM_SUMMARY_IRQ, |
| 722 | RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 723 | RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 724 | RPM_APCC_CPU0_GP_LOW_IRQ, |
| 725 | RPM_APCC_CPU0_WAKE_UP_IRQ, |
| 726 | LPASS_SCSS_GP_LOW_IRQ, |
| 727 | LPASS_SCSS_GP_MEDIUM_IRQ, |
| 728 | LPASS_SCSS_GP_HIGH_IRQ, |
| 729 | SPS_MTI_31, |
| 730 | }; |
| 731 | |
| 732 | struct msm_mpm_device_data msm_mpm_dev_data = { |
| 733 | .irqs_m2a = msm_mpm_irqs_m2a, |
| 734 | .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a), |
| 735 | .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs, |
| 736 | .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs), |
| 737 | .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8, |
| 738 | .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8, |
| 739 | .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008, |
| 740 | .mpm_apps_ipc_val = BIT(1), |
| 741 | .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 742 | }; |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 743 | |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 744 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 745 | 0x00, 0x03, 0x00, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 746 | }; |
| 747 | |
| 748 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 749 | 0x34, 0x24, 0x14, 0x04, |
| 750 | 0x54, 0x03, 0x54, 0x04, |
| 751 | 0x14, 0x24, 0x3e, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 752 | }; |
| 753 | |
| 754 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 755 | 0x34, 0x24, 0x14, 0x04, |
| 756 | 0x54, 0x07, 0x54, 0x04, |
| 757 | 0x14, 0x24, 0x3e, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 758 | }; |
| 759 | |
| 760 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 761 | [0] = { |
| 762 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 763 | .notify_rpm = false, |
| 764 | .cmd = spm_wfi_cmd_sequence, |
| 765 | }, |
| 766 | [1] = { |
| 767 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 768 | .notify_rpm = false, |
| 769 | .cmd = spm_power_collapse_without_rpm, |
| 770 | }, |
| 771 | [2] = { |
| 772 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 773 | .notify_rpm = true, |
| 774 | .cmd = spm_power_collapse_with_rpm, |
| 775 | }, |
| 776 | }; |
| 777 | |
| 778 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 779 | [0] = { |
| 780 | .reg_base_addr = MSM_SAW0_BASE, |
| 781 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 782 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1001, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 783 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 784 | .modes = msm_spm_seq_list, |
| 785 | }, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 786 | }; |
| 787 | |
| 788 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 789 | { |
| 790 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 791 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 792 | true, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 793 | 100, 8000, 100000, 1, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 794 | }, |
| 795 | |
| 796 | { |
| 797 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 798 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 799 | true, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 800 | 2000, 5000, 60100000, 3000, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 801 | }, |
| 802 | { |
| 803 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 804 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 805 | false, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 806 | 6300, 5000, 60350000, 3500, |
| 807 | }, |
| 808 | { |
| 809 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 810 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 811 | false, |
| 812 | 13300, 2000, 71850000, 6800, |
| 813 | }, |
| 814 | { |
| 815 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 816 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 817 | false, |
| 818 | 28300, 0, 76350000, 9800, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 819 | }, |
| 820 | }; |
| 821 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 822 | void __init msm9615_device_init(void) |
| 823 | { |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 824 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 825 | BUG_ON(msm_rpm_init(&msm_rpm_data)); |
| 826 | BUG_ON(msm_rpmrs_levels_init(msm_rpmrs_levels, |
| 827 | ARRAY_SIZE(msm_rpmrs_levels))); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 828 | } |
| 829 | |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 830 | #define MSM_SHARED_RAM_PHYS 0x40000000 |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 831 | void __init msm9615_map_io(void) |
| 832 | { |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 833 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 834 | msm_map_msm9615_io(); |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 835 | l2x0_cache_init(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 836 | if (socinfo_init() < 0) |
| 837 | pr_err("socinfo_init() failed!\n"); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 838 | } |
| 839 | |
| 840 | void __init msm9615_init_irq(void) |
| 841 | { |
| 842 | unsigned int i; |
Rohit Vaswani | b2e42e1 | 2011-10-07 21:25:53 -0700 | [diff] [blame] | 843 | |
| 844 | msm_mpm_irq_extn_init(); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 845 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 846 | (void *)MSM_QGIC_CPU_BASE); |
| 847 | |
| 848 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 849 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| 850 | |
| 851 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 852 | mb(); |
| 853 | |
| 854 | /* |
| 855 | * FIXME: Not installing AVS_SVICINT and AVS_SVICINTSWDONE yet |
| 856 | * as they are configured as level, which does not play nice with |
| 857 | * handle_percpu_irq. |
| 858 | */ |
| 859 | for (i = GIC_PPI_START; i < GIC_SPI_START; i++) { |
| 860 | if (i != AVS_SVICINT && i != AVS_SVICINTSWDONE) |
| 861 | irq_set_handler(i, handle_percpu_irq); |
| 862 | } |
| 863 | } |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame^] | 864 | |
| 865 | struct platform_device msm_bus_9615_sys_fabric = { |
| 866 | .name = "msm_bus_fabric", |
| 867 | .id = MSM_BUS_FAB_SYSTEM, |
| 868 | }; |
| 869 | |
| 870 | struct platform_device msm_bus_def_fab = { |
| 871 | .name = "msm_bus_fabric", |
| 872 | .id = MSM_BUS_FAB_DEFAULT, |
| 873 | }; |