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