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