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