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