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> |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 18 | #include <linux/platform_data/qcom_crypto_device.h> |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 19 | #include <linux/dma-mapping.h> |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 20 | #include <sound/msm-dai-q6.h> |
| 21 | #include <sound/apr_audio.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 22 | #include <asm/hardware/gic.h> |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 23 | #include <asm/mach/flash.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 24 | #include <mach/board.h> |
| 25 | #include <mach/msm_iomap.h> |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 26 | #include <mach/msm_hsusb.h> |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 27 | #include <mach/irqs.h> |
| 28 | #include <mach/socinfo.h> |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 29 | #include <mach/rpm.h> |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 30 | #include <mach/msm_bus_board.h> |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 31 | #include <asm/hardware/cache-l2x0.h> |
Yan He | 092b727 | 2011-09-21 15:25:03 -0700 | [diff] [blame] | 32 | #include <mach/msm_sps.h> |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 33 | #include <mach/dma.h> |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 34 | #include "pm.h" |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 35 | #include "devices.h" |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 36 | #include "mpm.h" |
| 37 | #include "spm.h" |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 38 | #include "rpm_resources.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 39 | #include "msm_watchdog.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 40 | #include "rpm_stats.h" |
| 41 | #include "rpm_log.h" |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 42 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 43 | /* Address of GSBI blocks */ |
| 44 | #define MSM_GSBI1_PHYS 0x16000000 |
| 45 | #define MSM_GSBI2_PHYS 0x16100000 |
| 46 | #define MSM_GSBI3_PHYS 0x16200000 |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 47 | #define MSM_GSBI4_PHYS 0x16300000 |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 48 | #define MSM_GSBI5_PHYS 0x16400000 |
| 49 | |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 50 | #define MSM_UART4DM_PHYS (MSM_GSBI4_PHYS + 0x40000) |
| 51 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 52 | /* GSBI QUP devices */ |
| 53 | #define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000) |
| 54 | #define MSM_GSBI2_QUP_PHYS (MSM_GSBI2_PHYS + 0x80000) |
| 55 | #define MSM_GSBI3_QUP_PHYS (MSM_GSBI3_PHYS + 0x80000) |
| 56 | #define MSM_GSBI4_QUP_PHYS (MSM_GSBI4_PHYS + 0x80000) |
| 57 | #define MSM_GSBI5_QUP_PHYS (MSM_GSBI5_PHYS + 0x80000) |
| 58 | #define MSM_QUP_SIZE SZ_4K |
| 59 | |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 60 | /* Address of SSBI CMD */ |
| 61 | #define MSM_PMIC1_SSBI_CMD_PHYS 0x00500000 |
| 62 | #define MSM_PMIC_SSBI_SIZE SZ_4K |
| 63 | |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 64 | static struct msm_watchdog_pdata msm_watchdog_pdata = { |
| 65 | .pet_time = 10000, |
| 66 | .bark_time = 11000, |
Rohit Vaswani | ead426f | 2012-01-05 20:24:52 -0800 | [diff] [blame] | 67 | .has_secure = false, |
| 68 | .use_kernel_fiq = true, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
| 71 | struct platform_device msm9615_device_watchdog = { |
| 72 | .name = "msm_watchdog", |
| 73 | .id = -1, |
| 74 | .dev = { |
| 75 | .platform_data = &msm_watchdog_pdata, |
| 76 | }, |
| 77 | }; |
| 78 | |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 79 | static struct resource msm_dmov_resource[] = { |
| 80 | { |
| 81 | .start = ADM_0_SCSS_1_IRQ, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 82 | .flags = IORESOURCE_IRQ, |
| 83 | }, |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 84 | { |
| 85 | .start = 0x18320000, |
| 86 | .end = 0x18320000 + SZ_1M - 1, |
| 87 | .flags = IORESOURCE_MEM, |
| 88 | }, |
| 89 | }; |
| 90 | |
| 91 | static struct msm_dmov_pdata msm_dmov_pdata = { |
| 92 | .sd = 1, |
| 93 | .sd_size = 0x800, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 94 | }; |
| 95 | |
| 96 | struct platform_device msm9615_device_dmov = { |
| 97 | .name = "msm_dmov", |
| 98 | .id = -1, |
| 99 | .resource = msm_dmov_resource, |
| 100 | .num_resources = ARRAY_SIZE(msm_dmov_resource), |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 101 | .dev = { |
| 102 | .platform_data = &msm_dmov_pdata, |
| 103 | }, |
Jeff Ohlstein | d19bf44 | 2011-09-09 12:48:18 -0700 | [diff] [blame] | 104 | }; |
| 105 | |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 106 | #define MSM_USB_BAM_BASE 0x12502000 |
Ofir Cohen | 010009b | 2012-01-26 16:49:17 +0200 | [diff] [blame] | 107 | #define MSM_USB_BAM_SIZE SZ_16K |
| 108 | #define MSM_HSIC_BAM_BASE 0x12542000 |
| 109 | #define MSM_HSIC_BAM_SIZE SZ_16K |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 110 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 111 | static struct resource resources_otg[] = { |
| 112 | { |
| 113 | .start = MSM9615_HSUSB_PHYS, |
| 114 | .end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1, |
| 115 | .flags = IORESOURCE_MEM, |
| 116 | }, |
| 117 | { |
| 118 | .start = USB1_HS_IRQ, |
| 119 | .end = USB1_HS_IRQ, |
| 120 | .flags = IORESOURCE_IRQ, |
| 121 | }, |
| 122 | }; |
| 123 | |
| 124 | struct platform_device msm_device_otg = { |
| 125 | .name = "msm_otg", |
| 126 | .id = -1, |
| 127 | .num_resources = ARRAY_SIZE(resources_otg), |
| 128 | .resource = resources_otg, |
| 129 | .dev = { |
| 130 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 131 | }, |
| 132 | }; |
| 133 | |
| 134 | static struct resource resources_hsusb[] = { |
| 135 | { |
| 136 | .start = MSM9615_HSUSB_PHYS, |
| 137 | .end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_SIZE - 1, |
| 138 | .flags = IORESOURCE_MEM, |
| 139 | }, |
| 140 | { |
| 141 | .start = USB1_HS_IRQ, |
| 142 | .end = USB1_HS_IRQ, |
| 143 | .flags = IORESOURCE_IRQ, |
| 144 | }, |
| 145 | }; |
| 146 | |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 147 | static struct resource resources_usb_bam[] = { |
| 148 | { |
| 149 | .name = "usb_bam_addr", |
| 150 | .start = MSM_USB_BAM_BASE, |
Ofir Cohen | 010009b | 2012-01-26 16:49:17 +0200 | [diff] [blame] | 151 | .end = MSM_USB_BAM_BASE + MSM_USB_BAM_SIZE - 1, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 152 | .flags = IORESOURCE_MEM, |
| 153 | }, |
| 154 | { |
| 155 | .name = "usb_bam_irq", |
| 156 | .start = USB1_HS_BAM_IRQ, |
| 157 | .end = USB1_HS_BAM_IRQ, |
| 158 | .flags = IORESOURCE_IRQ, |
| 159 | }, |
Ofir Cohen | 010009b | 2012-01-26 16:49:17 +0200 | [diff] [blame] | 160 | { |
| 161 | .name = "hsic_bam_addr", |
| 162 | .start = MSM_HSIC_BAM_BASE, |
| 163 | .end = MSM_HSIC_BAM_BASE + MSM_HSIC_BAM_SIZE - 1, |
| 164 | .flags = IORESOURCE_MEM, |
| 165 | }, |
| 166 | { |
| 167 | .name = "hsic_bam_irq", |
| 168 | .start = USB_HSIC_BAM_IRQ, |
| 169 | .end = USB_HSIC_BAM_IRQ, |
| 170 | .flags = IORESOURCE_IRQ, |
| 171 | }, |
Ofir Cohen | 40a4e86 | 2011-12-08 15:17:52 +0200 | [diff] [blame] | 172 | }; |
| 173 | |
| 174 | struct platform_device msm_device_usb_bam = { |
| 175 | .name = "usb_bam", |
| 176 | .id = -1, |
| 177 | .num_resources = ARRAY_SIZE(resources_usb_bam), |
| 178 | .resource = resources_usb_bam, |
| 179 | }; |
| 180 | |
Amit Blay | 5e4ec19 | 2011-10-20 09:16:54 +0200 | [diff] [blame] | 181 | struct platform_device msm_device_gadget_peripheral = { |
| 182 | .name = "msm_hsusb", |
| 183 | .id = -1, |
| 184 | .num_resources = ARRAY_SIZE(resources_hsusb), |
| 185 | .resource = resources_hsusb, |
| 186 | .dev = { |
| 187 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 188 | }, |
| 189 | }; |
| 190 | |
Ofir Cohen | 06789f1 | 2012-01-16 09:43:13 +0200 | [diff] [blame] | 191 | static struct resource resources_hsic_peripheral[] = { |
| 192 | { |
| 193 | .start = MSM9615_HSIC_PHYS, |
| 194 | .end = MSM9615_HSIC_PHYS + MSM9615_HSIC_SIZE - 1, |
| 195 | .flags = IORESOURCE_MEM, |
| 196 | }, |
| 197 | { |
| 198 | .start = USB_HSIC_IRQ, |
| 199 | .end = USB_HSIC_IRQ, |
| 200 | .flags = IORESOURCE_IRQ, |
| 201 | }, |
| 202 | }; |
| 203 | |
| 204 | struct platform_device msm_device_hsic_peripheral = { |
| 205 | .name = "msm_hsic_peripheral", |
| 206 | .id = -1, |
| 207 | .num_resources = ARRAY_SIZE(resources_hsic_peripheral), |
| 208 | .resource = resources_hsic_peripheral, |
| 209 | .dev = { |
| 210 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 211 | }, |
| 212 | }; |
| 213 | |
Amit Blay | 6a8d4f3 | 2011-11-21 10:36:25 +0200 | [diff] [blame] | 214 | static struct resource resources_hsusb_host[] = { |
| 215 | { |
| 216 | .start = MSM9615_HSUSB_PHYS, |
| 217 | .end = MSM9615_HSUSB_PHYS + MSM9615_HSUSB_PHYS - 1, |
| 218 | .flags = IORESOURCE_MEM, |
| 219 | }, |
| 220 | { |
| 221 | .start = USB1_HS_IRQ, |
| 222 | .end = USB1_HS_IRQ, |
| 223 | .flags = IORESOURCE_IRQ, |
| 224 | }, |
| 225 | }; |
| 226 | |
| 227 | static u64 dma_mask = DMA_BIT_MASK(32); |
| 228 | struct platform_device msm_device_hsusb_host = { |
| 229 | .name = "msm_hsusb_host", |
| 230 | .id = -1, |
| 231 | .num_resources = ARRAY_SIZE(resources_hsusb_host), |
| 232 | .resource = resources_hsusb_host, |
| 233 | .dev = { |
| 234 | .dma_mask = &dma_mask, |
| 235 | .coherent_dma_mask = 0xffffffff, |
| 236 | }, |
| 237 | }; |
| 238 | |
Lena Salman | 65bcf37 | 2012-02-14 15:33:32 +0200 | [diff] [blame] | 239 | static struct resource resources_hsic_host[] = { |
| 240 | { |
| 241 | .start = MSM9615_HSIC_PHYS, |
| 242 | .end = MSM9615_HSIC_PHYS + MSM9615_HSIC_SIZE - 1, |
| 243 | .flags = IORESOURCE_MEM, |
| 244 | }, |
| 245 | { |
| 246 | .start = USB_HSIC_IRQ, |
| 247 | .end = USB_HSIC_IRQ, |
| 248 | .flags = IORESOURCE_IRQ, |
| 249 | }, |
| 250 | }; |
| 251 | |
| 252 | struct platform_device msm_device_hsic_host = { |
| 253 | .name = "msm_hsic_host", |
| 254 | .id = -1, |
| 255 | .num_resources = ARRAY_SIZE(resources_hsic_host), |
| 256 | .resource = resources_hsic_host, |
| 257 | .dev = { |
| 258 | .dma_mask = &dma_mask, |
| 259 | .coherent_dma_mask = 0xffffffff, |
| 260 | }, |
| 261 | }; |
| 262 | |
Rohit Vaswani | 0966687 | 2011-08-23 17:41:54 -0700 | [diff] [blame] | 263 | static struct resource resources_uart_gsbi4[] = { |
| 264 | { |
| 265 | .start = GSBI4_UARTDM_IRQ, |
| 266 | .end = GSBI4_UARTDM_IRQ, |
| 267 | .flags = IORESOURCE_IRQ, |
| 268 | }, |
| 269 | { |
| 270 | .start = MSM_UART4DM_PHYS, |
| 271 | .end = MSM_UART4DM_PHYS + PAGE_SIZE - 1, |
| 272 | .name = "uartdm_resource", |
| 273 | .flags = IORESOURCE_MEM, |
| 274 | }, |
| 275 | { |
| 276 | .start = MSM_GSBI4_PHYS, |
| 277 | .end = MSM_GSBI4_PHYS + PAGE_SIZE - 1, |
| 278 | .name = "gsbi_resource", |
| 279 | .flags = IORESOURCE_MEM, |
| 280 | }, |
| 281 | }; |
| 282 | |
| 283 | struct platform_device msm9615_device_uart_gsbi4 = { |
| 284 | .name = "msm_serial_hsl", |
| 285 | .id = 0, |
| 286 | .num_resources = ARRAY_SIZE(resources_uart_gsbi4), |
| 287 | .resource = resources_uart_gsbi4, |
| 288 | }; |
| 289 | |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 290 | static struct resource resources_qup_i2c_gsbi5[] = { |
| 291 | { |
| 292 | .name = "gsbi_qup_i2c_addr", |
| 293 | .start = MSM_GSBI5_PHYS, |
Harini Jayaraman | 7a60bc1 | 2011-09-15 14:58:54 -0600 | [diff] [blame] | 294 | .end = MSM_GSBI5_PHYS + 4 - 1, |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 295 | .flags = IORESOURCE_MEM, |
| 296 | }, |
| 297 | { |
| 298 | .name = "qup_phys_addr", |
| 299 | .start = MSM_GSBI5_QUP_PHYS, |
Harini Jayaraman | 7a60bc1 | 2011-09-15 14:58:54 -0600 | [diff] [blame] | 300 | .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1, |
Harini Jayaraman | eba5267 | 2011-09-08 15:13:00 -0600 | [diff] [blame] | 301 | .flags = IORESOURCE_MEM, |
| 302 | }, |
| 303 | { |
| 304 | .name = "qup_err_intr", |
| 305 | .start = GSBI5_QUP_IRQ, |
| 306 | .end = GSBI5_QUP_IRQ, |
| 307 | .flags = IORESOURCE_IRQ, |
| 308 | }, |
| 309 | }; |
| 310 | |
| 311 | struct platform_device msm9615_device_qup_i2c_gsbi5 = { |
| 312 | .name = "qup_i2c", |
| 313 | .id = 0, |
| 314 | .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5), |
| 315 | .resource = resources_qup_i2c_gsbi5, |
| 316 | }; |
| 317 | |
Harini Jayaraman | 738c931 | 2011-09-08 15:22:38 -0600 | [diff] [blame] | 318 | static struct resource resources_qup_spi_gsbi3[] = { |
| 319 | { |
| 320 | .name = "spi_base", |
| 321 | .start = MSM_GSBI3_QUP_PHYS, |
| 322 | .end = MSM_GSBI3_QUP_PHYS + SZ_4K - 1, |
| 323 | .flags = IORESOURCE_MEM, |
| 324 | }, |
| 325 | { |
| 326 | .name = "gsbi_base", |
| 327 | .start = MSM_GSBI3_PHYS, |
| 328 | .end = MSM_GSBI3_PHYS + 4 - 1, |
| 329 | .flags = IORESOURCE_MEM, |
| 330 | }, |
| 331 | { |
| 332 | .name = "spi_irq_in", |
| 333 | .start = GSBI3_QUP_IRQ, |
| 334 | .end = GSBI3_QUP_IRQ, |
| 335 | .flags = IORESOURCE_IRQ, |
| 336 | }, |
| 337 | }; |
| 338 | |
| 339 | struct platform_device msm9615_device_qup_spi_gsbi3 = { |
| 340 | .name = "spi_qsd", |
| 341 | .id = 0, |
| 342 | .num_resources = ARRAY_SIZE(resources_qup_spi_gsbi3), |
| 343 | .resource = resources_qup_spi_gsbi3, |
| 344 | }; |
| 345 | |
Sagar Dharia | 2a5378d | 2011-12-01 20:00:11 -0700 | [diff] [blame] | 346 | #define LPASS_SLIMBUS_PHYS 0x28080000 |
| 347 | #define LPASS_SLIMBUS_BAM_PHYS 0x28084000 |
| 348 | #define LPASS_SLIMBUS_SLEW (MSM9615_TLMM_PHYS + 0x207C) |
| 349 | /* Board info for the slimbus slave device */ |
| 350 | static struct resource slimbus_res[] = { |
| 351 | { |
| 352 | .start = LPASS_SLIMBUS_PHYS, |
| 353 | .end = LPASS_SLIMBUS_PHYS + 8191, |
| 354 | .flags = IORESOURCE_MEM, |
| 355 | .name = "slimbus_physical", |
| 356 | }, |
| 357 | { |
| 358 | .start = LPASS_SLIMBUS_BAM_PHYS, |
| 359 | .end = LPASS_SLIMBUS_BAM_PHYS + 8191, |
| 360 | .flags = IORESOURCE_MEM, |
| 361 | .name = "slimbus_bam_physical", |
| 362 | }, |
| 363 | { |
| 364 | .start = LPASS_SLIMBUS_SLEW, |
| 365 | .end = LPASS_SLIMBUS_SLEW + 4 - 1, |
| 366 | .flags = IORESOURCE_MEM, |
| 367 | .name = "slimbus_slew_reg", |
| 368 | }, |
| 369 | { |
| 370 | .start = SLIMBUS0_CORE_EE1_IRQ, |
| 371 | .end = SLIMBUS0_CORE_EE1_IRQ, |
| 372 | .flags = IORESOURCE_IRQ, |
| 373 | .name = "slimbus_irq", |
| 374 | }, |
| 375 | { |
| 376 | .start = SLIMBUS0_BAM_EE1_IRQ, |
| 377 | .end = SLIMBUS0_BAM_EE1_IRQ, |
| 378 | .flags = IORESOURCE_IRQ, |
| 379 | .name = "slimbus_bam_irq", |
| 380 | }, |
| 381 | }; |
| 382 | |
| 383 | struct platform_device msm9615_slim_ctrl = { |
| 384 | .name = "msm_slim_ctrl", |
| 385 | .id = 1, |
| 386 | .num_resources = ARRAY_SIZE(slimbus_res), |
| 387 | .resource = slimbus_res, |
| 388 | .dev = { |
| 389 | .coherent_dma_mask = 0xffffffffULL, |
| 390 | }, |
| 391 | }; |
| 392 | |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 393 | struct platform_device msm_pcm = { |
| 394 | .name = "msm-pcm-dsp", |
| 395 | .id = -1, |
| 396 | }; |
| 397 | |
| 398 | struct platform_device msm_multi_ch_pcm = { |
| 399 | .name = "msm-multi-ch-pcm-dsp", |
| 400 | .id = -1, |
| 401 | }; |
| 402 | |
| 403 | struct platform_device msm_pcm_routing = { |
| 404 | .name = "msm-pcm-routing", |
| 405 | .id = -1, |
| 406 | }; |
| 407 | |
| 408 | struct platform_device msm_cpudai0 = { |
| 409 | .name = "msm-dai-q6", |
| 410 | .id = 0x4000, |
| 411 | }; |
| 412 | |
| 413 | struct platform_device msm_cpudai1 = { |
| 414 | .name = "msm-dai-q6", |
| 415 | .id = 0x4001, |
| 416 | }; |
| 417 | |
| 418 | struct platform_device msm_cpudai_bt_rx = { |
| 419 | .name = "msm-dai-q6", |
| 420 | .id = 0x3000, |
| 421 | }; |
| 422 | |
| 423 | struct platform_device msm_cpudai_bt_tx = { |
| 424 | .name = "msm-dai-q6", |
| 425 | .id = 0x3001, |
| 426 | }; |
| 427 | |
| 428 | /* |
| 429 | * Machine specific data for AUX PCM Interface |
| 430 | * which the driver will be unware of. |
| 431 | */ |
Shiv Maliyappanahalli | 19e86e2 | 2012-03-28 17:27:26 -0700 | [diff] [blame] | 432 | struct msm_dai_auxpcm_pdata auxpcm_pdata = { |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 433 | .clk = "pcm_clk", |
| 434 | .mode = AFE_PCM_CFG_MODE_PCM, |
| 435 | .sync = AFE_PCM_CFG_SYNC_INT, |
| 436 | .frame = AFE_PCM_CFG_FRM_256BPF, |
| 437 | .quant = AFE_PCM_CFG_QUANT_LINEAR_NOPAD, |
| 438 | .slot = 0, |
| 439 | .data = AFE_PCM_CFG_CDATAOE_MASTER, |
| 440 | .pcm_clk_rate = 2048000, |
| 441 | }; |
| 442 | |
| 443 | struct platform_device msm_cpudai_auxpcm_rx = { |
| 444 | .name = "msm-dai-q6", |
| 445 | .id = 2, |
| 446 | .dev = { |
Shiv Maliyappanahalli | 19e86e2 | 2012-03-28 17:27:26 -0700 | [diff] [blame] | 447 | .platform_data = &auxpcm_pdata, |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 448 | }, |
| 449 | }; |
| 450 | |
| 451 | struct platform_device msm_cpudai_auxpcm_tx = { |
| 452 | .name = "msm-dai-q6", |
| 453 | .id = 3, |
Shiv Maliyappanahalli | 19e86e2 | 2012-03-28 17:27:26 -0700 | [diff] [blame] | 454 | .dev = { |
| 455 | .platform_data = &auxpcm_pdata, |
| 456 | }, |
Shiv Maliyappanahalli | 9ec55e9 | 2012-01-09 14:44:59 -0800 | [diff] [blame] | 457 | }; |
| 458 | |
| 459 | struct platform_device msm_cpu_fe = { |
| 460 | .name = "msm-dai-fe", |
| 461 | .id = -1, |
| 462 | }; |
| 463 | |
| 464 | struct platform_device msm_stub_codec = { |
| 465 | .name = "msm-stub-codec", |
| 466 | .id = 1, |
| 467 | }; |
| 468 | |
| 469 | struct platform_device msm_voice = { |
| 470 | .name = "msm-pcm-voice", |
| 471 | .id = -1, |
| 472 | }; |
| 473 | |
| 474 | struct platform_device msm_voip = { |
| 475 | .name = "msm-voip-dsp", |
| 476 | .id = -1, |
| 477 | }; |
| 478 | |
| 479 | struct platform_device msm_compr_dsp = { |
| 480 | .name = "msm-compr-dsp", |
| 481 | .id = -1, |
| 482 | }; |
| 483 | |
| 484 | struct platform_device msm_pcm_hostless = { |
| 485 | .name = "msm-pcm-hostless", |
| 486 | .id = -1, |
| 487 | }; |
| 488 | |
| 489 | struct platform_device msm_cpudai_afe_01_rx = { |
| 490 | .name = "msm-dai-q6", |
| 491 | .id = 0xE0, |
| 492 | }; |
| 493 | |
| 494 | struct platform_device msm_cpudai_afe_01_tx = { |
| 495 | .name = "msm-dai-q6", |
| 496 | .id = 0xF0, |
| 497 | }; |
| 498 | |
| 499 | struct platform_device msm_cpudai_afe_02_rx = { |
| 500 | .name = "msm-dai-q6", |
| 501 | .id = 0xF1, |
| 502 | }; |
| 503 | |
| 504 | struct platform_device msm_cpudai_afe_02_tx = { |
| 505 | .name = "msm-dai-q6", |
| 506 | .id = 0xE1, |
| 507 | }; |
| 508 | |
| 509 | struct platform_device msm_pcm_afe = { |
| 510 | .name = "msm-pcm-afe", |
| 511 | .id = -1, |
| 512 | }; |
| 513 | |
Kenneth Heitke | af3d3cf | 2011-09-08 11:45:31 -0700 | [diff] [blame] | 514 | static struct resource resources_ssbi_pmic1[] = { |
| 515 | { |
| 516 | .start = MSM_PMIC1_SSBI_CMD_PHYS, |
| 517 | .end = MSM_PMIC1_SSBI_CMD_PHYS + MSM_PMIC_SSBI_SIZE - 1, |
| 518 | .flags = IORESOURCE_MEM, |
| 519 | }, |
| 520 | }; |
| 521 | |
| 522 | struct platform_device msm9615_device_ssbi_pmic1 = { |
| 523 | .name = "msm_ssbi", |
| 524 | .id = 0, |
| 525 | .resource = resources_ssbi_pmic1, |
| 526 | .num_resources = ARRAY_SIZE(resources_ssbi_pmic1), |
| 527 | }; |
| 528 | |
Yan He | 092b727 | 2011-09-21 15:25:03 -0700 | [diff] [blame] | 529 | static struct resource resources_sps[] = { |
| 530 | { |
| 531 | .name = "pipe_mem", |
| 532 | .start = 0x12800000, |
| 533 | .end = 0x12800000 + 0x4000 - 1, |
| 534 | .flags = IORESOURCE_MEM, |
| 535 | }, |
| 536 | { |
| 537 | .name = "bamdma_dma", |
| 538 | .start = 0x12240000, |
| 539 | .end = 0x12240000 + 0x1000 - 1, |
| 540 | .flags = IORESOURCE_MEM, |
| 541 | }, |
| 542 | { |
| 543 | .name = "bamdma_bam", |
| 544 | .start = 0x12244000, |
| 545 | .end = 0x12244000 + 0x4000 - 1, |
| 546 | .flags = IORESOURCE_MEM, |
| 547 | }, |
| 548 | { |
| 549 | .name = "bamdma_irq", |
| 550 | .start = SPS_BAM_DMA_IRQ, |
| 551 | .end = SPS_BAM_DMA_IRQ, |
| 552 | .flags = IORESOURCE_IRQ, |
| 553 | }, |
| 554 | }; |
| 555 | |
| 556 | struct msm_sps_platform_data msm_sps_pdata = { |
| 557 | .bamdma_restricted_pipes = 0x06, |
| 558 | }; |
| 559 | |
| 560 | struct platform_device msm_device_sps = { |
| 561 | .name = "msm_sps", |
| 562 | .id = -1, |
| 563 | .num_resources = ARRAY_SIZE(resources_sps), |
| 564 | .resource = resources_sps, |
| 565 | .dev.platform_data = &msm_sps_pdata, |
| 566 | }; |
| 567 | |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 568 | #define MSM_NAND_PHYS 0x1B400000 |
| 569 | static struct resource resources_nand[] = { |
| 570 | [0] = { |
| 571 | .name = "msm_nand_dmac", |
| 572 | .start = DMOV_NAND_CHAN, |
| 573 | .end = DMOV_NAND_CHAN, |
| 574 | .flags = IORESOURCE_DMA, |
| 575 | }, |
| 576 | [1] = { |
| 577 | .name = "msm_nand_phys", |
| 578 | .start = MSM_NAND_PHYS, |
| 579 | .end = MSM_NAND_PHYS + 0x7FF, |
| 580 | .flags = IORESOURCE_MEM, |
| 581 | }, |
| 582 | }; |
| 583 | |
| 584 | struct flash_platform_data msm_nand_data = { |
| 585 | .parts = NULL, |
| 586 | .nr_parts = 0, |
| 587 | }; |
| 588 | |
| 589 | struct platform_device msm_device_nand = { |
| 590 | .name = "msm_nand", |
| 591 | .id = -1, |
| 592 | .num_resources = ARRAY_SIZE(resources_nand), |
| 593 | .resource = resources_nand, |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 594 | .dev = { |
Sahitya Tummala | 3829543 | 2011-09-29 10:08:45 +0530 | [diff] [blame] | 595 | .platform_data = &msm_nand_data, |
Siddartha Mohanadoss | 5d49cec | 2011-09-21 10:26:15 -0700 | [diff] [blame] | 596 | }, |
| 597 | }; |
| 598 | |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 599 | struct platform_device msm_device_smd = { |
| 600 | .name = "msm_smd", |
| 601 | .id = -1, |
| 602 | }; |
| 603 | |
Eric Holmberg | 0c96e70 | 2011-11-08 18:04:31 -0700 | [diff] [blame] | 604 | struct platform_device msm_device_bam_dmux = { |
| 605 | .name = "BAM_RMNT", |
| 606 | .id = -1, |
| 607 | }; |
| 608 | |
Ramesh Masavarapu | 5ad3739 | 2011-10-10 10:44:10 -0700 | [diff] [blame] | 609 | #ifdef CONFIG_HW_RANDOM_MSM |
| 610 | /* PRNG device */ |
| 611 | #define MSM_PRNG_PHYS 0x1A500000 |
| 612 | static struct resource rng_resources = { |
| 613 | .flags = IORESOURCE_MEM, |
| 614 | .start = MSM_PRNG_PHYS, |
| 615 | .end = MSM_PRNG_PHYS + SZ_512 - 1, |
| 616 | }; |
| 617 | |
| 618 | struct platform_device msm_device_rng = { |
| 619 | .name = "msm_rng", |
| 620 | .id = 0, |
| 621 | .num_resources = 1, |
| 622 | .resource = &rng_resources, |
| 623 | }; |
| 624 | #endif |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 625 | |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 626 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 627 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 628 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 629 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 630 | |
| 631 | #define QCE_SIZE 0x10000 |
| 632 | #define QCE_0_BASE 0x18500000 |
| 633 | |
| 634 | #define QCE_HW_KEY_SUPPORT 0 |
| 635 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 636 | #define QCE_SHARE_CE_RESOURCE 1 |
| 637 | #define QCE_CE_SHARED 0 |
| 638 | |
| 639 | static struct resource qcrypto_resources[] = { |
| 640 | [0] = { |
| 641 | .start = QCE_0_BASE, |
| 642 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 643 | .flags = IORESOURCE_MEM, |
| 644 | }, |
| 645 | [1] = { |
| 646 | .name = "crypto_channels", |
| 647 | .start = DMOV_CE_IN_CHAN, |
| 648 | .end = DMOV_CE_OUT_CHAN, |
| 649 | .flags = IORESOURCE_DMA, |
| 650 | }, |
| 651 | [2] = { |
| 652 | .name = "crypto_crci_in", |
| 653 | .start = DMOV_CE_IN_CRCI, |
| 654 | .end = DMOV_CE_IN_CRCI, |
| 655 | .flags = IORESOURCE_DMA, |
| 656 | }, |
| 657 | [3] = { |
| 658 | .name = "crypto_crci_out", |
| 659 | .start = DMOV_CE_OUT_CRCI, |
| 660 | .end = DMOV_CE_OUT_CRCI, |
| 661 | .flags = IORESOURCE_DMA, |
| 662 | }, |
| 663 | }; |
| 664 | |
| 665 | static struct resource qcedev_resources[] = { |
| 666 | [0] = { |
| 667 | .start = QCE_0_BASE, |
| 668 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 669 | .flags = IORESOURCE_MEM, |
| 670 | }, |
| 671 | [1] = { |
| 672 | .name = "crypto_channels", |
| 673 | .start = DMOV_CE_IN_CHAN, |
| 674 | .end = DMOV_CE_OUT_CHAN, |
| 675 | .flags = IORESOURCE_DMA, |
| 676 | }, |
| 677 | [2] = { |
| 678 | .name = "crypto_crci_in", |
| 679 | .start = DMOV_CE_IN_CRCI, |
| 680 | .end = DMOV_CE_IN_CRCI, |
| 681 | .flags = IORESOURCE_DMA, |
| 682 | }, |
| 683 | [3] = { |
| 684 | .name = "crypto_crci_out", |
| 685 | .start = DMOV_CE_OUT_CRCI, |
| 686 | .end = DMOV_CE_OUT_CRCI, |
| 687 | .flags = IORESOURCE_DMA, |
| 688 | }, |
| 689 | }; |
| 690 | |
| 691 | #endif |
| 692 | |
| 693 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 694 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 695 | |
| 696 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 697 | .ce_shared = QCE_CE_SHARED, |
| 698 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 699 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 700 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 701 | .bus_scale_table = NULL, |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 702 | }; |
| 703 | |
| 704 | struct platform_device msm9615_qcrypto_device = { |
| 705 | .name = "qcrypto", |
| 706 | .id = 0, |
| 707 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 708 | .resource = qcrypto_resources, |
| 709 | .dev = { |
| 710 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 711 | .platform_data = &qcrypto_ce_hw_suppport, |
| 712 | }, |
| 713 | }; |
| 714 | #endif |
| 715 | |
| 716 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 717 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 718 | |
| 719 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 720 | .ce_shared = QCE_CE_SHARED, |
| 721 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 722 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 723 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 724 | .bus_scale_table = NULL, |
Ramesh Masavarapu | aa28b5b | 2011-10-21 10:26:03 -0700 | [diff] [blame] | 725 | }; |
| 726 | |
| 727 | struct platform_device msm9615_qcedev_device = { |
| 728 | .name = "qce", |
| 729 | .id = 0, |
| 730 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 731 | .resource = qcedev_resources, |
| 732 | .dev = { |
| 733 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 734 | .platform_data = &qcedev_ce_hw_suppport, |
| 735 | }, |
| 736 | }; |
| 737 | #endif |
| 738 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 739 | #define MSM_SDC1_BASE 0x12180000 |
| 740 | #define MSM_SDC1_DML_BASE (MSM_SDC1_BASE + 0x800) |
| 741 | #define MSM_SDC1_BAM_BASE (MSM_SDC1_BASE + 0x2000) |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 742 | #define MSM_SDC2_BASE 0x12140000 |
| 743 | #define MSM_SDC2_DML_BASE (MSM_SDC2_BASE + 0x800) |
| 744 | #define MSM_SDC2_BAM_BASE (MSM_SDC2_BASE + 0x2000) |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 745 | |
| 746 | static struct resource resources_sdc1[] = { |
| 747 | { |
| 748 | .name = "core_mem", |
| 749 | .flags = IORESOURCE_MEM, |
| 750 | .start = MSM_SDC1_BASE, |
| 751 | .end = MSM_SDC1_DML_BASE - 1, |
| 752 | }, |
| 753 | { |
| 754 | .name = "core_irq", |
| 755 | .flags = IORESOURCE_IRQ, |
| 756 | .start = SDC1_IRQ_0, |
| 757 | .end = SDC1_IRQ_0 |
| 758 | }, |
| 759 | #ifdef CONFIG_MMC_MSM_SPS_SUPPORT |
| 760 | { |
| 761 | .name = "sdcc_dml_addr", |
| 762 | .start = MSM_SDC1_DML_BASE, |
| 763 | .end = MSM_SDC1_BAM_BASE - 1, |
| 764 | .flags = IORESOURCE_MEM, |
| 765 | }, |
| 766 | { |
| 767 | .name = "sdcc_bam_addr", |
| 768 | .start = MSM_SDC1_BAM_BASE, |
| 769 | .end = MSM_SDC1_BAM_BASE + (2 * SZ_4K) - 1, |
| 770 | .flags = IORESOURCE_MEM, |
| 771 | }, |
| 772 | { |
| 773 | .name = "sdcc_bam_irq", |
| 774 | .start = SDC1_BAM_IRQ, |
| 775 | .end = SDC1_BAM_IRQ, |
| 776 | .flags = IORESOURCE_IRQ, |
| 777 | }, |
| 778 | #endif |
| 779 | }; |
| 780 | |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 781 | static struct resource resources_sdc2[] = { |
| 782 | { |
| 783 | .name = "core_mem", |
| 784 | .flags = IORESOURCE_MEM, |
| 785 | .start = MSM_SDC2_BASE, |
| 786 | .end = MSM_SDC2_DML_BASE - 1, |
| 787 | }, |
| 788 | { |
| 789 | .name = "core_irq", |
| 790 | .flags = IORESOURCE_IRQ, |
| 791 | .start = SDC2_IRQ_0, |
| 792 | .end = SDC2_IRQ_0 |
| 793 | }, |
| 794 | #ifdef CONFIG_MMC_MSM_SPS_SUPPORT |
| 795 | { |
| 796 | .name = "sdcc_dml_addr", |
| 797 | .start = MSM_SDC2_DML_BASE, |
| 798 | .end = MSM_SDC2_BAM_BASE - 1, |
| 799 | .flags = IORESOURCE_MEM, |
| 800 | }, |
| 801 | { |
| 802 | .name = "sdcc_bam_addr", |
| 803 | .start = MSM_SDC2_BAM_BASE, |
| 804 | .end = MSM_SDC2_BAM_BASE + (2 * SZ_4K) - 1, |
| 805 | .flags = IORESOURCE_MEM, |
| 806 | }, |
| 807 | { |
| 808 | .name = "sdcc_bam_irq", |
| 809 | .start = SDC2_BAM_IRQ, |
| 810 | .end = SDC2_BAM_IRQ, |
| 811 | .flags = IORESOURCE_IRQ, |
| 812 | }, |
| 813 | #endif |
| 814 | }; |
| 815 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 816 | struct platform_device msm_device_sdc1 = { |
| 817 | .name = "msm_sdcc", |
| 818 | .id = 1, |
| 819 | .num_resources = ARRAY_SIZE(resources_sdc1), |
| 820 | .resource = resources_sdc1, |
| 821 | .dev = { |
| 822 | .coherent_dma_mask = 0xffffffff, |
| 823 | }, |
| 824 | }; |
| 825 | |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 826 | struct platform_device msm_device_sdc2 = { |
| 827 | .name = "msm_sdcc", |
| 828 | .id = 2, |
| 829 | .num_resources = ARRAY_SIZE(resources_sdc2), |
| 830 | .resource = resources_sdc2, |
| 831 | .dev = { |
| 832 | .coherent_dma_mask = 0xffffffff, |
| 833 | }, |
| 834 | }; |
| 835 | |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 836 | static struct platform_device *msm_sdcc_devices[] __initdata = { |
| 837 | &msm_device_sdc1, |
Krishna Konda | 71aef18 | 2011-10-01 02:27:51 -0700 | [diff] [blame] | 838 | &msm_device_sdc2, |
Krishna Konda | dd79446 | 2011-10-01 00:19:29 -0700 | [diff] [blame] | 839 | }; |
| 840 | |
| 841 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) |
| 842 | { |
| 843 | struct platform_device *pdev; |
| 844 | |
| 845 | if (controller < 1 || controller > 2) |
| 846 | return -EINVAL; |
| 847 | |
| 848 | pdev = msm_sdcc_devices[controller - 1]; |
| 849 | pdev->dev.platform_data = plat; |
| 850 | return platform_device_register(pdev); |
| 851 | } |
| 852 | |
Zhang Chang Ken | c2f2bcc | 2012-03-30 18:32:02 -0400 | [diff] [blame] | 853 | #ifdef CONFIG_FB_MSM_EBI2 |
| 854 | static struct resource msm_ebi2_lcdc_resources[] = { |
| 855 | { |
| 856 | .name = "base", |
| 857 | .start = 0x1B300000, |
| 858 | .end = 0x1B300000 + PAGE_SIZE - 1, |
| 859 | .flags = IORESOURCE_MEM, |
| 860 | }, |
| 861 | { |
| 862 | .name = "lcd01", |
| 863 | .start = 0x1FC00000, |
| 864 | .end = 0x1FC00000 + 0x80000 - 1, |
| 865 | .flags = IORESOURCE_MEM, |
| 866 | }, |
| 867 | }; |
| 868 | |
| 869 | struct platform_device msm_ebi2_lcdc_device = { |
| 870 | .name = "ebi2_lcd", |
| 871 | .id = 0, |
| 872 | .num_resources = ARRAY_SIZE(msm_ebi2_lcdc_resources), |
| 873 | .resource = msm_ebi2_lcdc_resources, |
| 874 | }; |
| 875 | #endif |
| 876 | |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 877 | #ifdef CONFIG_CACHE_L2X0 |
| 878 | static int __init l2x0_cache_init(void) |
| 879 | { |
| 880 | int aux_ctrl = 0; |
| 881 | |
| 882 | /* Way Size 010(0x2) 32KB */ |
| 883 | aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \ |
| 884 | (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \ |
| 885 | (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT); |
| 886 | |
| 887 | /* L2 Latency setting required by hardware. Default is 0x20 |
| 888 | which is no good. |
| 889 | */ |
| 890 | writel_relaxed(0x220, MSM_L2CC_BASE + L2X0_DATA_LATENCY_CTRL); |
| 891 | l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK); |
| 892 | |
| 893 | return 0; |
| 894 | } |
| 895 | #else |
| 896 | static int __init l2x0_cache_init(void){ return 0; } |
| 897 | #endif |
| 898 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 899 | struct msm_rpm_platform_data msm9615_rpm_data __initdata = { |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 900 | .reg_base_addrs = { |
| 901 | [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, |
| 902 | [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, |
| 903 | [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, |
| 904 | [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, |
| 905 | }, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 906 | .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ, |
Stephen Boyd | f61255e | 2012-02-24 14:31:09 -0800 | [diff] [blame] | 907 | .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 908 | .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008, |
| 909 | .ipc_rpm_val = 4, |
| 910 | .target_id = { |
| 911 | MSM_RPM_MAP(9615, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4), |
| 912 | MSM_RPM_MAP(9615, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4), |
| 913 | MSM_RPM_MAP(9615, INVALIDATE_0, INVALIDATE, 8), |
| 914 | MSM_RPM_MAP(9615, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1), |
| 915 | MSM_RPM_MAP(9615, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1), |
| 916 | MSM_RPM_MAP(9615, RPM_CTL, RPM_CTL, 1), |
| 917 | MSM_RPM_MAP(9615, CXO_CLK, CXO_CLK, 1), |
| 918 | MSM_RPM_MAP(9615, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1), |
| 919 | MSM_RPM_MAP(9615, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1), |
| 920 | MSM_RPM_MAP(9615, SFPB_CLK, SFPB_CLK, 1), |
| 921 | MSM_RPM_MAP(9615, CFPB_CLK, CFPB_CLK, 1), |
| 922 | MSM_RPM_MAP(9615, EBI1_CLK, EBI1_CLK, 1), |
| 923 | MSM_RPM_MAP(9615, SYS_FABRIC_CFG_HALT_0, |
| 924 | SYS_FABRIC_CFG_HALT, 2), |
| 925 | MSM_RPM_MAP(9615, SYS_FABRIC_CFG_CLKMOD_0, |
| 926 | SYS_FABRIC_CFG_CLKMOD, 3), |
| 927 | MSM_RPM_MAP(9615, SYS_FABRIC_CFG_IOCTL, |
| 928 | SYS_FABRIC_CFG_IOCTL, 1), |
| 929 | MSM_RPM_MAP(9615, SYSTEM_FABRIC_ARB_0, |
| 930 | SYSTEM_FABRIC_ARB, 27), |
| 931 | MSM_RPM_MAP(9615, PM8018_S1_0, PM8018_S1, 2), |
| 932 | MSM_RPM_MAP(9615, PM8018_S2_0, PM8018_S2, 2), |
| 933 | MSM_RPM_MAP(9615, PM8018_S3_0, PM8018_S3, 2), |
| 934 | MSM_RPM_MAP(9615, PM8018_S4_0, PM8018_S4, 2), |
| 935 | MSM_RPM_MAP(9615, PM8018_S5_0, PM8018_S5, 2), |
| 936 | MSM_RPM_MAP(9615, PM8018_L1_0, PM8018_L1, 2), |
| 937 | MSM_RPM_MAP(9615, PM8018_L2_0, PM8018_L2, 2), |
| 938 | MSM_RPM_MAP(9615, PM8018_L3_0, PM8018_L3, 2), |
| 939 | MSM_RPM_MAP(9615, PM8018_L4_0, PM8018_L4, 2), |
| 940 | MSM_RPM_MAP(9615, PM8018_L5_0, PM8018_L5, 2), |
| 941 | MSM_RPM_MAP(9615, PM8018_L6_0, PM8018_L6, 2), |
| 942 | MSM_RPM_MAP(9615, PM8018_L7_0, PM8018_L7, 2), |
| 943 | MSM_RPM_MAP(9615, PM8018_L8_0, PM8018_L8, 2), |
| 944 | MSM_RPM_MAP(9615, PM8018_L9_0, PM8018_L9, 2), |
| 945 | MSM_RPM_MAP(9615, PM8018_L10_0, PM8018_L10, 2), |
| 946 | MSM_RPM_MAP(9615, PM8018_L11_0, PM8018_L11, 2), |
| 947 | MSM_RPM_MAP(9615, PM8018_L12_0, PM8018_L12, 2), |
| 948 | MSM_RPM_MAP(9615, PM8018_L13_0, PM8018_L13, 2), |
| 949 | MSM_RPM_MAP(9615, PM8018_L14_0, PM8018_L14, 2), |
| 950 | MSM_RPM_MAP(9615, PM8018_LVS1, PM8018_LVS1, 1), |
| 951 | MSM_RPM_MAP(9615, NCP_0, NCP, 2), |
| 952 | MSM_RPM_MAP(9615, CXO_BUFFERS, CXO_BUFFERS, 1), |
| 953 | MSM_RPM_MAP(9615, USB_OTG_SWITCH, USB_OTG_SWITCH, 1), |
| 954 | MSM_RPM_MAP(9615, HDMI_SWITCH, HDMI_SWITCH, 1), |
| 955 | }, |
| 956 | .target_status = { |
| 957 | MSM_RPM_STATUS_ID_MAP(9615, VERSION_MAJOR), |
| 958 | MSM_RPM_STATUS_ID_MAP(9615, VERSION_MINOR), |
| 959 | MSM_RPM_STATUS_ID_MAP(9615, VERSION_BUILD), |
| 960 | MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_0), |
| 961 | MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_1), |
| 962 | MSM_RPM_STATUS_ID_MAP(9615, SUPPORTED_RESOURCES_2), |
| 963 | MSM_RPM_STATUS_ID_MAP(9615, RESERVED_SUPPORTED_RESOURCES_0), |
| 964 | MSM_RPM_STATUS_ID_MAP(9615, SEQUENCE), |
| 965 | MSM_RPM_STATUS_ID_MAP(9615, RPM_CTL), |
| 966 | MSM_RPM_STATUS_ID_MAP(9615, CXO_CLK), |
| 967 | MSM_RPM_STATUS_ID_MAP(9615, SYSTEM_FABRIC_CLK), |
| 968 | MSM_RPM_STATUS_ID_MAP(9615, DAYTONA_FABRIC_CLK), |
| 969 | MSM_RPM_STATUS_ID_MAP(9615, SFPB_CLK), |
| 970 | MSM_RPM_STATUS_ID_MAP(9615, CFPB_CLK), |
| 971 | MSM_RPM_STATUS_ID_MAP(9615, EBI1_CLK), |
| 972 | MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_HALT), |
| 973 | MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_CLKMOD), |
| 974 | MSM_RPM_STATUS_ID_MAP(9615, SYS_FABRIC_CFG_IOCTL), |
| 975 | MSM_RPM_STATUS_ID_MAP(9615, SYSTEM_FABRIC_ARB), |
| 976 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S1_0), |
| 977 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S1_1), |
| 978 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S2_0), |
| 979 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S2_1), |
| 980 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S3_0), |
| 981 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S3_1), |
| 982 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S4_0), |
| 983 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S4_1), |
| 984 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S5_0), |
| 985 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_S5_1), |
| 986 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L1_0), |
| 987 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L1_1), |
| 988 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L2_0), |
| 989 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L2_1), |
| 990 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L3_0), |
| 991 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L3_1), |
| 992 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L4_0), |
| 993 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L4_1), |
| 994 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L5_0), |
| 995 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L5_1), |
| 996 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L6_0), |
| 997 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L6_1), |
| 998 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L7_0), |
| 999 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L7_1), |
| 1000 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L8_0), |
| 1001 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L8_1), |
| 1002 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L9_0), |
| 1003 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L9_1), |
| 1004 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L10_0), |
| 1005 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L10_1), |
| 1006 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L11_0), |
| 1007 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L11_1), |
| 1008 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L12_0), |
| 1009 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L12_1), |
| 1010 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L13_0), |
| 1011 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L13_1), |
| 1012 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L14_0), |
| 1013 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_L14_1), |
| 1014 | MSM_RPM_STATUS_ID_MAP(9615, PM8018_LVS1), |
| 1015 | MSM_RPM_STATUS_ID_MAP(9615, NCP_0), |
| 1016 | MSM_RPM_STATUS_ID_MAP(9615, NCP_1), |
| 1017 | MSM_RPM_STATUS_ID_MAP(9615, CXO_BUFFERS), |
| 1018 | MSM_RPM_STATUS_ID_MAP(9615, USB_OTG_SWITCH), |
| 1019 | MSM_RPM_STATUS_ID_MAP(9615, HDMI_SWITCH), |
| 1020 | }, |
| 1021 | .target_ctrl_id = { |
| 1022 | MSM_RPM_CTRL_MAP(9615, VERSION_MAJOR), |
| 1023 | MSM_RPM_CTRL_MAP(9615, VERSION_MINOR), |
| 1024 | MSM_RPM_CTRL_MAP(9615, VERSION_BUILD), |
| 1025 | MSM_RPM_CTRL_MAP(9615, REQ_CTX_0), |
| 1026 | MSM_RPM_CTRL_MAP(9615, REQ_SEL_0), |
| 1027 | MSM_RPM_CTRL_MAP(9615, ACK_CTX_0), |
| 1028 | MSM_RPM_CTRL_MAP(9615, ACK_SEL_0), |
| 1029 | }, |
| 1030 | .sel_invalidate = MSM_RPM_9615_SEL_INVALIDATE, |
| 1031 | .sel_notification = MSM_RPM_9615_SEL_NOTIFICATION, |
| 1032 | .sel_last = MSM_RPM_9615_SEL_LAST, |
| 1033 | .ver = {3, 0, 0}, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1034 | }; |
| 1035 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1036 | struct platform_device msm9615_rpm_device = { |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1037 | .name = "msm_rpm", |
| 1038 | .id = -1, |
| 1039 | }; |
| 1040 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1041 | static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = { |
Maheshkumar Sivasubramanian | 9745083 | 2011-10-31 12:27:25 -0600 | [diff] [blame] | 1042 | [4] = MSM_GPIO_TO_INT(30), |
| 1043 | [5] = MSM_GPIO_TO_INT(59), |
| 1044 | [6] = MSM_GPIO_TO_INT(81), |
| 1045 | [7] = MSM_GPIO_TO_INT(87), |
| 1046 | [8] = MSM_GPIO_TO_INT(86), |
| 1047 | [9] = MSM_GPIO_TO_INT(2), |
| 1048 | [10] = MSM_GPIO_TO_INT(6), |
| 1049 | [11] = MSM_GPIO_TO_INT(10), |
| 1050 | [12] = MSM_GPIO_TO_INT(14), |
| 1051 | [13] = MSM_GPIO_TO_INT(18), |
| 1052 | [14] = MSM_GPIO_TO_INT(7), |
| 1053 | [15] = MSM_GPIO_TO_INT(11), |
| 1054 | [16] = MSM_GPIO_TO_INT(15), |
| 1055 | [19] = MSM_GPIO_TO_INT(26), |
| 1056 | [20] = MSM_GPIO_TO_INT(28), |
Ofir Cohen | dca06cb | 2012-03-08 16:37:45 +0200 | [diff] [blame] | 1057 | [22] = USB_HSIC_IRQ, |
Maheshkumar Sivasubramanian | 9745083 | 2011-10-31 12:27:25 -0600 | [diff] [blame] | 1058 | [23] = MSM_GPIO_TO_INT(19), |
| 1059 | [24] = MSM_GPIO_TO_INT(23), |
Maheshkumar Sivasubramanian | 9745083 | 2011-10-31 12:27:25 -0600 | [diff] [blame] | 1060 | [26] = MSM_GPIO_TO_INT(3), |
| 1061 | [27] = MSM_GPIO_TO_INT(68), |
| 1062 | [29] = MSM_GPIO_TO_INT(78), |
| 1063 | [31] = MSM_GPIO_TO_INT(0), |
| 1064 | [32] = MSM_GPIO_TO_INT(4), |
| 1065 | [33] = MSM_GPIO_TO_INT(22), |
| 1066 | [34] = MSM_GPIO_TO_INT(17), |
| 1067 | [37] = MSM_GPIO_TO_INT(20), |
| 1068 | [39] = MSM_GPIO_TO_INT(84), |
Mahesh Sivasubramanian | 4ce8218 | 2012-01-04 14:34:42 -0700 | [diff] [blame] | 1069 | [40] = USB1_HS_IRQ, |
Maheshkumar Sivasubramanian | 9745083 | 2011-10-31 12:27:25 -0600 | [diff] [blame] | 1070 | [42] = MSM_GPIO_TO_INT(24), |
| 1071 | [43] = MSM_GPIO_TO_INT(79), |
| 1072 | [44] = MSM_GPIO_TO_INT(80), |
| 1073 | [45] = MSM_GPIO_TO_INT(82), |
| 1074 | [46] = MSM_GPIO_TO_INT(85), |
| 1075 | [47] = MSM_GPIO_TO_INT(45), |
| 1076 | [48] = MSM_GPIO_TO_INT(50), |
| 1077 | [49] = MSM_GPIO_TO_INT(51), |
| 1078 | [50] = MSM_GPIO_TO_INT(69), |
| 1079 | [51] = MSM_GPIO_TO_INT(77), |
| 1080 | [52] = MSM_GPIO_TO_INT(1), |
| 1081 | [53] = MSM_GPIO_TO_INT(5), |
| 1082 | [54] = MSM_GPIO_TO_INT(40), |
| 1083 | [55] = MSM_GPIO_TO_INT(27), |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1084 | }; |
| 1085 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1086 | static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = { |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1087 | TLMM_MSM_SUMMARY_IRQ, |
| 1088 | RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 1089 | RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 1090 | RPM_APCC_CPU0_GP_LOW_IRQ, |
| 1091 | RPM_APCC_CPU0_WAKE_UP_IRQ, |
Mahesh Sivasubramanian | dbf2bb6 | 2011-12-12 16:03:40 -0700 | [diff] [blame] | 1092 | MSS_TO_APPS_IRQ_0, |
| 1093 | MSS_TO_APPS_IRQ_1, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1094 | LPASS_SCSS_GP_LOW_IRQ, |
| 1095 | LPASS_SCSS_GP_MEDIUM_IRQ, |
| 1096 | LPASS_SCSS_GP_HIGH_IRQ, |
| 1097 | SPS_MTI_31, |
Mahesh Sivasubramanian | dbf2bb6 | 2011-12-12 16:03:40 -0700 | [diff] [blame] | 1098 | A2_BAM_IRQ, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1099 | }; |
| 1100 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1101 | struct msm_mpm_device_data msm9615_mpm_dev_data __initdata = { |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1102 | .irqs_m2a = msm_mpm_irqs_m2a, |
| 1103 | .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a), |
| 1104 | .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs, |
| 1105 | .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs), |
| 1106 | .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8, |
| 1107 | .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8, |
| 1108 | .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008, |
| 1109 | .mpm_apps_ipc_val = BIT(1), |
| 1110 | .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1111 | }; |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1112 | |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1113 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 1114 | 0x00, 0x03, 0x00, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1115 | }; |
| 1116 | |
| 1117 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 1118 | 0x34, 0x24, 0x14, 0x04, |
| 1119 | 0x54, 0x03, 0x54, 0x04, |
| 1120 | 0x14, 0x24, 0x3e, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1121 | }; |
| 1122 | |
| 1123 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 1124 | 0x34, 0x24, 0x14, 0x04, |
| 1125 | 0x54, 0x07, 0x54, 0x04, |
| 1126 | 0x14, 0x24, 0x3e, 0x0f, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1127 | }; |
| 1128 | |
| 1129 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 1130 | [0] = { |
| 1131 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1132 | .notify_rpm = false, |
| 1133 | .cmd = spm_wfi_cmd_sequence, |
| 1134 | }, |
| 1135 | [1] = { |
| 1136 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1137 | .notify_rpm = false, |
| 1138 | .cmd = spm_power_collapse_without_rpm, |
| 1139 | }, |
| 1140 | [2] = { |
| 1141 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1142 | .notify_rpm = true, |
| 1143 | .cmd = spm_power_collapse_with_rpm, |
| 1144 | }, |
| 1145 | }; |
| 1146 | |
| 1147 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1148 | [0] = { |
| 1149 | .reg_base_addr = MSM_SAW0_BASE, |
| 1150 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Maheshkumar Sivasubramanian | 343c991 | 2011-10-17 11:00:33 -0600 | [diff] [blame] | 1151 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1001, |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1152 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1153 | .modes = msm_spm_seq_list, |
| 1154 | }, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1155 | }; |
| 1156 | |
| 1157 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 1158 | { |
| 1159 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 1160 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1161 | true, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 1162 | 100, 8000, 100000, 1, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1163 | }, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1164 | { |
| 1165 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 1166 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1167 | true, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 1168 | 2000, 5000, 60100000, 3000, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1169 | }, |
| 1170 | { |
| 1171 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1172 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 1173 | false, |
Maheshkumar Sivasubramanian | 634e4f6 | 2011-10-17 15:49:11 -0600 | [diff] [blame] | 1174 | 6300, 5000, 60350000, 3500, |
| 1175 | }, |
| 1176 | { |
| 1177 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1178 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 1179 | false, |
| 1180 | 13300, 2000, 71850000, 6800, |
| 1181 | }, |
| 1182 | { |
| 1183 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 1184 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 1185 | false, |
| 1186 | 28300, 0, 76350000, 9800, |
Praveen Chidambaram | ab3b1c4 | 2011-08-25 08:44:05 -0600 | [diff] [blame] | 1187 | }, |
| 1188 | }; |
| 1189 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1190 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 1191 | .levels = &msm_rpmrs_levels[0], |
| 1192 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 1193 | .vdd_mem_levels = { |
| 1194 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 1195 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 1196 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 1197 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 1198 | }, |
| 1199 | .vdd_dig_levels = { |
| 1200 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 1201 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 1202 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 1203 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 1204 | }, |
| 1205 | .vdd_mask = 0x7FFFFF, |
| 1206 | .rpmrs_target_id = { |
| 1207 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_CXO_CLK, |
| 1208 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 1209 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8018_S1_0, |
| 1210 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8018_S1_1, |
| 1211 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8018_L9_0, |
| 1212 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8018_L9_1, |
| 1213 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 1214 | }, |
| 1215 | }; |
| 1216 | |
| 1217 | static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = { |
| 1218 | .phys_addr_base = 0x0010D204, |
| 1219 | .phys_size = SZ_8K, |
| 1220 | }; |
| 1221 | |
| 1222 | struct platform_device msm9615_rpm_stat_device = { |
| 1223 | .name = "msm_rpm_stat", |
| 1224 | .id = -1, |
| 1225 | .dev = { |
| 1226 | .platform_data = &msm_rpm_stat_pdata, |
| 1227 | }, |
| 1228 | }; |
| 1229 | |
| 1230 | static struct msm_rpm_log_platform_data msm_rpm_log_pdata = { |
| 1231 | .phys_addr_base = 0x0010AC00, |
| 1232 | .reg_offsets = { |
| 1233 | [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080, |
| 1234 | [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0, |
| 1235 | }, |
| 1236 | .phys_size = SZ_8K, |
| 1237 | .log_len = 4096, /* log's buffer length in bytes */ |
| 1238 | .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */ |
| 1239 | }; |
| 1240 | |
| 1241 | struct platform_device msm9615_rpm_log_device = { |
| 1242 | .name = "msm_rpm_log", |
| 1243 | .id = -1, |
| 1244 | .dev = { |
| 1245 | .platform_data = &msm_rpm_log_pdata, |
| 1246 | }, |
| 1247 | }; |
| 1248 | |
Krishna Konda | 39f5b2c | 2012-03-14 12:55:22 -0700 | [diff] [blame] | 1249 | uint32_t __init msm9615_rpm_get_swfi_latency(void) |
| 1250 | { |
| 1251 | int i; |
| 1252 | |
| 1253 | for (i = 0; i < ARRAY_SIZE(msm_rpmrs_levels); i++) { |
| 1254 | if (msm_rpmrs_levels[i].sleep_mode == |
| 1255 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT) |
| 1256 | return msm_rpmrs_levels[i].latency_us; |
| 1257 | } |
| 1258 | return 0; |
| 1259 | } |
| 1260 | |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1261 | void __init msm9615_device_init(void) |
| 1262 | { |
Maheshkumar Sivasubramanian | f07bd0b | 2011-09-06 17:33:17 -0600 | [diff] [blame] | 1263 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1264 | BUG_ON(msm_rpm_init(&msm9615_rpm_data)); |
| 1265 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1266 | } |
| 1267 | |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 1268 | #define MSM_SHARED_RAM_PHYS 0x40000000 |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1269 | void __init msm9615_map_io(void) |
| 1270 | { |
Jeff Hugo | 56b933a | 2011-09-28 14:42:05 -0600 | [diff] [blame] | 1271 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1272 | msm_map_msm9615_io(); |
Rohit Vaswani | f0ce9ae | 2011-08-23 22:18:38 -0700 | [diff] [blame] | 1273 | l2x0_cache_init(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1274 | if (socinfo_init() < 0) |
| 1275 | pr_err("socinfo_init() failed!\n"); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1276 | } |
| 1277 | |
| 1278 | void __init msm9615_init_irq(void) |
| 1279 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1280 | struct msm_mpm_device_data *data = NULL; |
| 1281 | |
| 1282 | #ifdef CONFIG_MSM_MPM |
| 1283 | data = &msm9615_mpm_dev_data; |
| 1284 | #endif |
| 1285 | |
| 1286 | msm_mpm_irq_extn_init(data); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1287 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 1288 | (void *)MSM_QGIC_CPU_BASE); |
Rohit Vaswani | ced9b3b | 2011-08-23 17:21:49 -0700 | [diff] [blame] | 1289 | } |
Gagan Mac | 7a82764 | 2011-09-22 19:42:21 -0600 | [diff] [blame] | 1290 | |
| 1291 | struct platform_device msm_bus_9615_sys_fabric = { |
| 1292 | .name = "msm_bus_fabric", |
| 1293 | .id = MSM_BUS_FAB_SYSTEM, |
| 1294 | }; |
| 1295 | |
| 1296 | struct platform_device msm_bus_def_fab = { |
| 1297 | .name = "msm_bus_fabric", |
| 1298 | .id = MSM_BUS_FAB_DEFAULT, |
| 1299 | }; |
Zhang Chang Ken | c2f2bcc | 2012-03-30 18:32:02 -0400 | [diff] [blame] | 1300 | |
| 1301 | #ifdef CONFIG_FB_MSM_EBI2 |
| 1302 | static void __init msm_register_device(struct platform_device *pdev, void *data) |
| 1303 | { |
| 1304 | int ret; |
| 1305 | |
| 1306 | pdev->dev.platform_data = data; |
| 1307 | |
| 1308 | ret = platform_device_register(pdev); |
| 1309 | if (ret) |
| 1310 | dev_err(&pdev->dev, |
| 1311 | "%s: platform_device_register() failed = %d\n", |
| 1312 | __func__, ret); |
| 1313 | } |
| 1314 | |
| 1315 | void __init msm_fb_register_device(char *name, void *data) |
| 1316 | { |
| 1317 | if (!strncmp(name, "ebi2", 4)) |
| 1318 | msm_register_device(&msm_ebi2_lcdc_device, data); |
| 1319 | else |
| 1320 | pr_err("%s: unknown device! %s\n", __func__, name); |
| 1321 | } |
| 1322 | #endif |