Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -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 | #include <linux/kernel.h> |
| 14 | #include <linux/platform_device.h> |
| 15 | #include <linux/dma-mapping.h> |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 16 | #include <mach/kgsl.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 17 | #include <linux/regulator/machine.h> |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 18 | #include <linux/init.h> |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 19 | #include <linux/irq.h> |
Taniya Das | 9d0c3c5 | 2012-05-04 14:40:55 +0530 | [diff] [blame] | 20 | #include <linux/notifier.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | #include <mach/irqs.h> |
| 22 | #include <mach/msm_iomap.h> |
| 23 | #include <mach/board.h> |
| 24 | #include <mach/dma.h> |
| 25 | #include <mach/dal_axi.h> |
| 26 | #include <asm/mach/flash.h> |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 27 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 28 | #include <asm/hardware/cache-l2x0.h> |
| 29 | #include <asm/mach/mmc.h> |
Taniya Das | 9d0c3c5 | 2012-05-04 14:40:55 +0530 | [diff] [blame] | 30 | #include <asm/cacheflush.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 31 | #include <mach/rpc_hsusb.h> |
| 32 | #include <mach/socinfo.h> |
| 33 | |
| 34 | #include "devices.h" |
| 35 | #include "devices-msm7x2xa.h" |
| 36 | #include "footswitch.h" |
Matt Wagantall | 6d9ebee | 2011-08-26 12:15:24 -0700 | [diff] [blame] | 37 | #include "acpuclock.h" |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 38 | #include "spm.h" |
Taniya Das | fcb3500 | 2012-03-09 15:28:12 +0530 | [diff] [blame] | 39 | #include "mpm-8625.h" |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 40 | #include "irq.h" |
| 41 | #include "pm.h" |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 42 | #include "msm_cpr.h" |
| 43 | #include "msm_smem_iface.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 44 | |
| 45 | /* Address of GSBI blocks */ |
| 46 | #define MSM_GSBI0_PHYS 0xA1200000 |
| 47 | #define MSM_GSBI1_PHYS 0xA1300000 |
| 48 | |
| 49 | /* GSBI QUPe devices */ |
| 50 | #define MSM_GSBI0_QUP_PHYS (MSM_GSBI0_PHYS + 0x80000) |
| 51 | #define MSM_GSBI1_QUP_PHYS (MSM_GSBI1_PHYS + 0x80000) |
| 52 | |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 53 | #define A11S_TEST_BUS_SEL_ADDR (MSM_CSR_BASE + 0x518) |
| 54 | #define RBCPR_CLK_MUX_SEL (1 << 13) |
| 55 | |
| 56 | /* Reset Address of RBCPR (Active Low)*/ |
| 57 | #define RBCPR_SW_RESET_N (MSM_CSR_BASE + 0x64) |
| 58 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 59 | static struct resource gsbi0_qup_i2c_resources[] = { |
| 60 | { |
| 61 | .name = "qup_phys_addr", |
| 62 | .start = MSM_GSBI0_QUP_PHYS, |
| 63 | .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1, |
| 64 | .flags = IORESOURCE_MEM, |
| 65 | }, |
| 66 | { |
| 67 | .name = "gsbi_qup_i2c_addr", |
| 68 | .start = MSM_GSBI0_PHYS, |
| 69 | .end = MSM_GSBI0_PHYS + SZ_4K - 1, |
| 70 | .flags = IORESOURCE_MEM, |
| 71 | }, |
| 72 | { |
| 73 | .name = "qup_err_intr", |
| 74 | .start = INT_PWB_I2C, |
| 75 | .end = INT_PWB_I2C, |
| 76 | .flags = IORESOURCE_IRQ, |
| 77 | }, |
| 78 | }; |
| 79 | |
| 80 | /* Use GSBI0 QUP for /dev/i2c-0 */ |
| 81 | struct platform_device msm_gsbi0_qup_i2c_device = { |
| 82 | .name = "qup_i2c", |
| 83 | .id = MSM_GSBI0_QUP_I2C_BUS_ID, |
| 84 | .num_resources = ARRAY_SIZE(gsbi0_qup_i2c_resources), |
| 85 | .resource = gsbi0_qup_i2c_resources, |
| 86 | }; |
| 87 | |
| 88 | static struct resource gsbi1_qup_i2c_resources[] = { |
| 89 | { |
| 90 | .name = "qup_phys_addr", |
| 91 | .start = MSM_GSBI1_QUP_PHYS, |
| 92 | .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1, |
| 93 | .flags = IORESOURCE_MEM, |
| 94 | }, |
| 95 | { |
| 96 | .name = "gsbi_qup_i2c_addr", |
| 97 | .start = MSM_GSBI1_PHYS, |
| 98 | .end = MSM_GSBI1_PHYS + SZ_4K - 1, |
| 99 | .flags = IORESOURCE_MEM, |
| 100 | }, |
| 101 | { |
| 102 | .name = "qup_err_intr", |
| 103 | .start = INT_ARM11_DMA, |
| 104 | .end = INT_ARM11_DMA, |
| 105 | .flags = IORESOURCE_IRQ, |
| 106 | }, |
| 107 | }; |
| 108 | |
| 109 | /* Use GSBI1 QUP for /dev/i2c-1 */ |
| 110 | struct platform_device msm_gsbi1_qup_i2c_device = { |
| 111 | .name = "qup_i2c", |
| 112 | .id = MSM_GSBI1_QUP_I2C_BUS_ID, |
| 113 | .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources), |
| 114 | .resource = gsbi1_qup_i2c_resources, |
| 115 | }; |
| 116 | |
| 117 | #define MSM_HSUSB_PHYS 0xA0800000 |
| 118 | static struct resource resources_hsusb_otg[] = { |
| 119 | { |
| 120 | .start = MSM_HSUSB_PHYS, |
| 121 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 122 | .flags = IORESOURCE_MEM, |
| 123 | }, |
| 124 | { |
| 125 | .start = INT_USB_HS, |
| 126 | .end = INT_USB_HS, |
| 127 | .flags = IORESOURCE_IRQ, |
| 128 | }, |
| 129 | }; |
| 130 | |
| 131 | static u64 dma_mask = 0xffffffffULL; |
| 132 | struct platform_device msm_device_otg = { |
| 133 | .name = "msm_otg", |
| 134 | .id = -1, |
| 135 | .num_resources = ARRAY_SIZE(resources_hsusb_otg), |
| 136 | .resource = resources_hsusb_otg, |
| 137 | .dev = { |
| 138 | .dma_mask = &dma_mask, |
| 139 | .coherent_dma_mask = 0xffffffffULL, |
| 140 | }, |
| 141 | }; |
| 142 | |
| 143 | static struct resource resources_gadget_peripheral[] = { |
| 144 | { |
| 145 | .start = MSM_HSUSB_PHYS, |
| 146 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 147 | .flags = IORESOURCE_MEM, |
| 148 | }, |
| 149 | { |
| 150 | .start = INT_USB_HS, |
| 151 | .end = INT_USB_HS, |
| 152 | .flags = IORESOURCE_IRQ, |
| 153 | }, |
| 154 | }; |
| 155 | |
| 156 | struct platform_device msm_device_gadget_peripheral = { |
| 157 | .name = "msm_hsusb", |
| 158 | .id = -1, |
| 159 | .num_resources = ARRAY_SIZE(resources_gadget_peripheral), |
| 160 | .resource = resources_gadget_peripheral, |
| 161 | .dev = { |
| 162 | .dma_mask = &dma_mask, |
| 163 | .coherent_dma_mask = 0xffffffffULL, |
| 164 | }, |
| 165 | }; |
| 166 | |
| 167 | static struct resource resources_hsusb_host[] = { |
| 168 | { |
| 169 | .start = MSM_HSUSB_PHYS, |
| 170 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 171 | .flags = IORESOURCE_MEM, |
| 172 | }, |
| 173 | { |
| 174 | .start = INT_USB_HS, |
| 175 | .end = INT_USB_HS, |
| 176 | .flags = IORESOURCE_IRQ, |
| 177 | }, |
| 178 | }; |
| 179 | |
| 180 | struct platform_device msm_device_hsusb_host = { |
| 181 | .name = "msm_hsusb_host", |
| 182 | .id = 0, |
| 183 | .num_resources = ARRAY_SIZE(resources_hsusb_host), |
| 184 | .resource = resources_hsusb_host, |
| 185 | .dev = { |
| 186 | .dma_mask = &dma_mask, |
| 187 | .coherent_dma_mask = 0xffffffffULL, |
| 188 | }, |
| 189 | }; |
| 190 | |
| 191 | static struct platform_device *msm_host_devices[] = { |
| 192 | &msm_device_hsusb_host, |
| 193 | }; |
| 194 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 195 | static struct resource msm_dmov_resource[] = { |
| 196 | { |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 197 | .start = INT_ADM_AARM, |
| 198 | .flags = IORESOURCE_IRQ, |
| 199 | }, |
| 200 | { |
| 201 | .start = 0xA9700000, |
| 202 | .end = 0xA9700000 + SZ_4K - 1, |
| 203 | .flags = IORESOURCE_MEM, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 204 | }, |
| 205 | }; |
| 206 | |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 207 | static struct msm_dmov_pdata msm_dmov_pdata = { |
| 208 | .sd = 3, |
| 209 | .sd_size = 0x400, |
| 210 | }; |
| 211 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 212 | struct platform_device msm_device_dmov = { |
Jeff Ohlstein | 905f1ce | 2011-09-07 18:50:18 -0700 | [diff] [blame] | 213 | .name = "msm_dmov", |
| 214 | .id = -1, |
| 215 | .resource = msm_dmov_resource, |
| 216 | .num_resources = ARRAY_SIZE(msm_dmov_resource), |
| 217 | .dev = { |
| 218 | .platform_data = &msm_dmov_pdata, |
| 219 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 220 | }; |
| 221 | |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 222 | static struct acpuclk_pdata msm7x27a_acpuclk_pdata = { |
| 223 | .max_speed_delta_khz = 400000, |
| 224 | }; |
| 225 | |
| 226 | struct platform_device msm7x27a_device_acpuclk = { |
| 227 | .name = "acpuclk-7627", |
| 228 | .id = -1, |
| 229 | .dev.platform_data = &msm7x27a_acpuclk_pdata, |
| 230 | }; |
| 231 | |
| 232 | static struct acpuclk_pdata msm7x27aa_acpuclk_pdata = { |
| 233 | .max_speed_delta_khz = 504000, |
| 234 | }; |
| 235 | |
| 236 | struct platform_device msm7x27aa_device_acpuclk = { |
| 237 | .name = "acpuclk-7627", |
| 238 | .id = -1, |
| 239 | .dev.platform_data = &msm7x27aa_acpuclk_pdata, |
| 240 | }; |
| 241 | |
| 242 | static struct acpuclk_pdata msm8625_acpuclk_pdata = { |
| 243 | /* TODO: Need to update speed delta from H/w Team */ |
| 244 | .max_speed_delta_khz = 604800, |
| 245 | }; |
| 246 | |
Kaushal Kumar | 86473f0 | 2012-06-28 19:35:58 +0530 | [diff] [blame] | 247 | static struct acpuclk_pdata msm8625ab_acpuclk_pdata = { |
| 248 | .max_speed_delta_khz = 801600, |
| 249 | }; |
| 250 | |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 251 | struct platform_device msm8625_device_acpuclk = { |
| 252 | .name = "acpuclk-7627", |
| 253 | .id = -1, |
| 254 | .dev.platform_data = &msm8625_acpuclk_pdata, |
| 255 | }; |
| 256 | |
Kaushal Kumar | 86473f0 | 2012-06-28 19:35:58 +0530 | [diff] [blame] | 257 | struct platform_device msm8625ab_device_acpuclk = { |
| 258 | .name = "acpuclk-7627", |
| 259 | .id = -1, |
| 260 | .dev.platform_data = &msm8625ab_acpuclk_pdata, |
| 261 | }; |
| 262 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 263 | struct platform_device msm_device_smd = { |
| 264 | .name = "msm_smd", |
| 265 | .id = -1, |
| 266 | }; |
| 267 | |
Angshuman Sarkar | fb1cce9 | 2012-02-21 15:20:43 +0530 | [diff] [blame] | 268 | static struct resource smd_8625_resource[] = { |
| 269 | { |
| 270 | .name = "a9_m2a_0", |
| 271 | .start = MSM8625_INT_A9_M2A_0, |
| 272 | .flags = IORESOURCE_IRQ, |
| 273 | }, |
| 274 | { |
| 275 | .name = "a9_m2a_5", |
| 276 | .start = MSM8625_INT_A9_M2A_5, |
| 277 | .flags = IORESOURCE_IRQ, |
| 278 | }, |
| 279 | }; |
| 280 | |
| 281 | static struct smd_subsystem_config smd_8625_config_list[] = { |
| 282 | { |
| 283 | .irq_config_id = SMD_MODEM, |
| 284 | .subsys_name = "modem", |
| 285 | .edge = SMD_APPS_MODEM, |
| 286 | |
| 287 | .smd_int.irq_name = "a9_m2a_0", |
| 288 | .smd_int.flags = IRQF_TRIGGER_RISING, |
| 289 | .smd_int.irq_id = -1, |
| 290 | .smd_int.device_name = "smd_dev", |
| 291 | .smd_int.dev_id = 0, |
| 292 | |
| 293 | .smd_int.out_bit_pos = 1, |
| 294 | .smd_int.out_base = (void __iomem *)MSM_CSR_BASE, |
| 295 | .smd_int.out_offset = 0x400 + (0) * 4, |
| 296 | |
| 297 | .smsm_int.irq_name = "a9_m2a_5", |
| 298 | .smsm_int.flags = IRQF_TRIGGER_RISING, |
| 299 | .smsm_int.irq_id = -1, |
| 300 | .smsm_int.device_name = "smsm_dev", |
| 301 | .smsm_int.dev_id = 0, |
| 302 | |
| 303 | .smsm_int.out_bit_pos = 1, |
| 304 | .smsm_int.out_base = (void __iomem *)MSM_CSR_BASE, |
| 305 | .smsm_int.out_offset = 0x400 + (5) * 4, |
| 306 | |
| 307 | } |
| 308 | }; |
| 309 | |
| 310 | static struct smd_platform smd_8625_platform_data = { |
| 311 | .num_ss_configs = ARRAY_SIZE(smd_8625_config_list), |
| 312 | .smd_ss_configs = smd_8625_config_list, |
| 313 | }; |
| 314 | |
| 315 | struct platform_device msm8625_device_smd = { |
| 316 | .name = "msm_smd", |
| 317 | .id = -1, |
| 318 | .resource = smd_8625_resource, |
| 319 | .num_resources = ARRAY_SIZE(smd_8625_resource), |
| 320 | .dev = { |
| 321 | .platform_data = &smd_8625_platform_data, |
| 322 | } |
| 323 | }; |
| 324 | |
Laxminath Kasam | 5faa1ca | 2012-02-15 12:06:45 +0530 | [diff] [blame] | 325 | static struct resource resources_adsp[] = { |
| 326 | { |
| 327 | .start = INT_ADSP_A9_A11, |
| 328 | .end = INT_ADSP_A9_A11, |
| 329 | .flags = IORESOURCE_IRQ, |
| 330 | }, |
| 331 | }; |
| 332 | |
| 333 | struct platform_device msm_adsp_device = { |
| 334 | .name = "msm_adsp", |
| 335 | .id = -1, |
| 336 | .num_resources = ARRAY_SIZE(resources_adsp), |
| 337 | .resource = resources_adsp, |
| 338 | }; |
| 339 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 340 | static struct resource resources_uart1[] = { |
| 341 | { |
| 342 | .start = INT_UART1, |
| 343 | .end = INT_UART1, |
| 344 | .flags = IORESOURCE_IRQ, |
| 345 | }, |
| 346 | { |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 347 | .start = MSM7XXX_UART1_PHYS, |
| 348 | .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 349 | .flags = IORESOURCE_MEM, |
| 350 | }, |
| 351 | }; |
| 352 | |
| 353 | struct platform_device msm_device_uart1 = { |
| 354 | .name = "msm_serial", |
| 355 | .id = 0, |
| 356 | .num_resources = ARRAY_SIZE(resources_uart1), |
| 357 | .resource = resources_uart1, |
| 358 | }; |
| 359 | |
| 360 | #define MSM_UART1DM_PHYS 0xA0200000 |
| 361 | static struct resource msm_uart1_dm_resources[] = { |
| 362 | { |
| 363 | .start = MSM_UART1DM_PHYS, |
| 364 | .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1, |
| 365 | .flags = IORESOURCE_MEM, |
| 366 | }, |
| 367 | { |
| 368 | .start = INT_UART1DM_IRQ, |
| 369 | .end = INT_UART1DM_IRQ, |
| 370 | .flags = IORESOURCE_IRQ, |
| 371 | }, |
| 372 | { |
| 373 | .start = INT_UART1DM_RX, |
| 374 | .end = INT_UART1DM_RX, |
| 375 | .flags = IORESOURCE_IRQ, |
| 376 | }, |
| 377 | { |
| 378 | .start = DMOV_HSUART1_TX_CHAN, |
| 379 | .end = DMOV_HSUART1_RX_CHAN, |
| 380 | .name = "uartdm_channels", |
| 381 | .flags = IORESOURCE_DMA, |
| 382 | }, |
| 383 | { |
| 384 | .start = DMOV_HSUART1_TX_CRCI, |
| 385 | .end = DMOV_HSUART1_RX_CRCI, |
| 386 | .name = "uartdm_crci", |
| 387 | .flags = IORESOURCE_DMA, |
| 388 | }, |
| 389 | }; |
| 390 | |
| 391 | static u64 msm_uart_dm1_dma_mask = DMA_BIT_MASK(32); |
| 392 | struct platform_device msm_device_uart_dm1 = { |
| 393 | .name = "msm_serial_hs", |
| 394 | .id = 0, |
| 395 | .num_resources = ARRAY_SIZE(msm_uart1_dm_resources), |
| 396 | .resource = msm_uart1_dm_resources, |
| 397 | .dev = { |
| 398 | .dma_mask = &msm_uart_dm1_dma_mask, |
| 399 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 400 | }, |
| 401 | }; |
| 402 | |
| 403 | #define MSM_UART2DM_PHYS 0xA0300000 |
| 404 | static struct resource msm_uart2dm_resources[] = { |
| 405 | { |
| 406 | .start = MSM_UART2DM_PHYS, |
| 407 | .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, |
| 408 | .name = "uartdm_resource", |
| 409 | .flags = IORESOURCE_MEM, |
| 410 | }, |
| 411 | { |
| 412 | .start = INT_UART2DM_IRQ, |
| 413 | .end = INT_UART2DM_IRQ, |
| 414 | .flags = IORESOURCE_IRQ, |
| 415 | }, |
| 416 | }; |
| 417 | |
| 418 | struct platform_device msm_device_uart_dm2 = { |
| 419 | .name = "msm_serial_hsl", |
| 420 | .id = 0, |
| 421 | .num_resources = ARRAY_SIZE(msm_uart2dm_resources), |
| 422 | .resource = msm_uart2dm_resources, |
| 423 | }; |
| 424 | |
| 425 | #define MSM_NAND_PHYS 0xA0A00000 |
| 426 | #define MSM_NANDC01_PHYS 0xA0A40000 |
| 427 | #define MSM_NANDC10_PHYS 0xA0A80000 |
| 428 | #define MSM_NANDC11_PHYS 0xA0AC0000 |
| 429 | #define EBI2_REG_BASE 0xA0D00000 |
| 430 | static struct resource resources_nand[] = { |
| 431 | [0] = { |
| 432 | .name = "msm_nand_dmac", |
| 433 | .start = DMOV_NAND_CHAN, |
| 434 | .end = DMOV_NAND_CHAN, |
| 435 | .flags = IORESOURCE_DMA, |
| 436 | }, |
| 437 | [1] = { |
| 438 | .name = "msm_nand_phys", |
| 439 | .start = MSM_NAND_PHYS, |
| 440 | .end = MSM_NAND_PHYS + 0x7FF, |
| 441 | .flags = IORESOURCE_MEM, |
| 442 | }, |
| 443 | [2] = { |
| 444 | .name = "msm_nandc01_phys", |
| 445 | .start = MSM_NANDC01_PHYS, |
| 446 | .end = MSM_NANDC01_PHYS + 0x7FF, |
| 447 | .flags = IORESOURCE_MEM, |
| 448 | }, |
| 449 | [3] = { |
| 450 | .name = "msm_nandc10_phys", |
| 451 | .start = MSM_NANDC10_PHYS, |
| 452 | .end = MSM_NANDC10_PHYS + 0x7FF, |
| 453 | .flags = IORESOURCE_MEM, |
| 454 | }, |
| 455 | [4] = { |
| 456 | .name = "msm_nandc11_phys", |
| 457 | .start = MSM_NANDC11_PHYS, |
| 458 | .end = MSM_NANDC11_PHYS + 0x7FF, |
| 459 | .flags = IORESOURCE_MEM, |
| 460 | }, |
| 461 | [5] = { |
| 462 | .name = "ebi2_reg_base", |
| 463 | .start = EBI2_REG_BASE, |
| 464 | .end = EBI2_REG_BASE + 0x60, |
| 465 | .flags = IORESOURCE_MEM, |
| 466 | }, |
| 467 | }; |
| 468 | |
Sujit Reddy Thumma | ec9b325 | 2012-04-23 15:53:45 +0530 | [diff] [blame] | 469 | struct flash_platform_data msm_nand_data = { |
| 470 | .version = VERSION_2, |
| 471 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 472 | |
| 473 | struct platform_device msm_device_nand = { |
| 474 | .name = "msm_nand", |
| 475 | .id = -1, |
| 476 | .num_resources = ARRAY_SIZE(resources_nand), |
| 477 | .resource = resources_nand, |
| 478 | .dev = { |
| 479 | .platform_data = &msm_nand_data, |
| 480 | }, |
| 481 | }; |
| 482 | |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 483 | static struct msm_pm_irq_calls msm7x27a_pm_irq_calls = { |
| 484 | .irq_pending = msm_irq_pending, |
| 485 | .idle_sleep_allowed = msm_irq_idle_sleep_allowed, |
| 486 | .enter_sleep1 = msm_irq_enter_sleep1, |
| 487 | .enter_sleep2 = msm_irq_enter_sleep2, |
| 488 | .exit_sleep1 = msm_irq_exit_sleep1, |
| 489 | .exit_sleep2 = msm_irq_exit_sleep2, |
| 490 | .exit_sleep3 = msm_irq_exit_sleep3, |
| 491 | }; |
| 492 | |
| 493 | static struct msm_pm_irq_calls msm8625_pm_irq_calls = { |
| 494 | .irq_pending = msm_gic_spi_ppi_pending, |
| 495 | .idle_sleep_allowed = msm_gic_irq_idle_sleep_allowed, |
| 496 | .enter_sleep1 = msm_gic_irq_enter_sleep1, |
| 497 | .enter_sleep2 = msm_gic_irq_enter_sleep2, |
| 498 | .exit_sleep1 = msm_gic_irq_exit_sleep1, |
| 499 | .exit_sleep2 = msm_gic_irq_exit_sleep2, |
| 500 | .exit_sleep3 = msm_gic_irq_exit_sleep3, |
| 501 | }; |
| 502 | |
Stephen Boyd | 986c963 | 2012-04-24 16:31:45 -0700 | [diff] [blame] | 503 | void __init msm_pm_register_irqs(void) |
Murali Nalajala | 2a0bbda | 2012-03-28 12:12:54 +0530 | [diff] [blame] | 504 | { |
| 505 | if (cpu_is_msm8625()) |
| 506 | msm_pm_set_irq_extns(&msm8625_pm_irq_calls); |
| 507 | else |
| 508 | msm_pm_set_irq_extns(&msm7x27a_pm_irq_calls); |
| 509 | |
| 510 | } |
| 511 | |
Murali Nalajala | ff723ec | 2012-07-13 16:54:40 +0530 | [diff] [blame] | 512 | static struct msm_pm_cpr_ops msm8625_pm_cpr_ops = { |
| 513 | .cpr_suspend = msm_cpr_pm_suspend, |
| 514 | .cpr_resume = msm_cpr_pm_resume, |
| 515 | }; |
| 516 | |
| 517 | void __init msm_pm_register_cpr_ops(void) |
| 518 | { |
| 519 | /* CPR presents on revision >= v2.0 chipsets */ |
| 520 | if (cpu_is_msm8625() && |
| 521 | SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) |
| 522 | msm_pm_set_cpr_ops(&msm8625_pm_cpr_ops); |
| 523 | } |
| 524 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 525 | #define MSM_SDC1_BASE 0xA0400000 |
| 526 | #define MSM_SDC2_BASE 0xA0500000 |
| 527 | #define MSM_SDC3_BASE 0xA0600000 |
| 528 | #define MSM_SDC4_BASE 0xA0700000 |
| 529 | static struct resource resources_sdc1[] = { |
| 530 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 531 | .name = "core_mem", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 532 | .start = MSM_SDC1_BASE, |
| 533 | .end = MSM_SDC1_BASE + SZ_4K - 1, |
| 534 | .flags = IORESOURCE_MEM, |
| 535 | }, |
| 536 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 537 | .name = "core_irq", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 538 | .start = INT_SDC1_0, |
| 539 | .end = INT_SDC1_1, |
| 540 | .flags = IORESOURCE_IRQ, |
| 541 | }, |
| 542 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 543 | .name = "dma_chnl", |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 544 | .start = DMOV_SDC1_CHAN, |
| 545 | .end = DMOV_SDC1_CHAN, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 546 | .flags = IORESOURCE_DMA, |
| 547 | }, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 548 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 549 | .name = "dma_crci", |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 550 | .start = DMOV_SDC1_CRCI, |
| 551 | .end = DMOV_SDC1_CRCI, |
| 552 | .flags = IORESOURCE_DMA, |
| 553 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 554 | }; |
| 555 | |
| 556 | static struct resource resources_sdc2[] = { |
| 557 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 558 | .name = "core_mem", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 559 | .start = MSM_SDC2_BASE, |
| 560 | .end = MSM_SDC2_BASE + SZ_4K - 1, |
| 561 | .flags = IORESOURCE_MEM, |
| 562 | }, |
| 563 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 564 | .name = "core_irq", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 565 | .start = INT_SDC2_0, |
| 566 | .end = INT_SDC2_1, |
| 567 | .flags = IORESOURCE_IRQ, |
| 568 | }, |
| 569 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 570 | .name = "dma_chnl", |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 571 | .start = DMOV_SDC2_CHAN, |
| 572 | .end = DMOV_SDC2_CHAN, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 573 | .flags = IORESOURCE_DMA, |
| 574 | }, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 575 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 576 | .name = "dma_crci", |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 577 | .start = DMOV_SDC2_CRCI, |
| 578 | .end = DMOV_SDC2_CRCI, |
| 579 | .flags = IORESOURCE_DMA, |
| 580 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 581 | }; |
| 582 | |
| 583 | static struct resource resources_sdc3[] = { |
| 584 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 585 | .name = "core_mem", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 586 | .start = MSM_SDC3_BASE, |
| 587 | .end = MSM_SDC3_BASE + SZ_4K - 1, |
| 588 | .flags = IORESOURCE_MEM, |
| 589 | }, |
| 590 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 591 | .name = "core_irq", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 592 | .start = INT_SDC3_0, |
| 593 | .end = INT_SDC3_1, |
| 594 | .flags = IORESOURCE_IRQ, |
| 595 | }, |
| 596 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 597 | .name = "dma_chnl", |
Subhash Jadavani | f29aefd | 2012-06-21 00:43:15 +0530 | [diff] [blame] | 598 | .start = DMOV_NAND_CHAN, |
| 599 | .end = DMOV_NAND_CHAN, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 600 | .flags = IORESOURCE_DMA, |
| 601 | }, |
| 602 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 603 | .name = "dma_crci", |
Sujit Reddy Thumma | 119bfbb | 2011-10-12 11:52:21 +0530 | [diff] [blame] | 604 | .start = DMOV_SDC3_CRCI, |
| 605 | .end = DMOV_SDC3_CRCI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 606 | .flags = IORESOURCE_DMA, |
| 607 | }, |
| 608 | }; |
| 609 | |
| 610 | static struct resource resources_sdc4[] = { |
| 611 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 612 | .name = "core_mem", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 613 | .start = MSM_SDC4_BASE, |
| 614 | .end = MSM_SDC4_BASE + SZ_4K - 1, |
| 615 | .flags = IORESOURCE_MEM, |
| 616 | }, |
| 617 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 618 | .name = "core_irq", |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 619 | .start = INT_SDC4_0, |
| 620 | .end = INT_SDC4_1, |
| 621 | .flags = IORESOURCE_IRQ, |
| 622 | }, |
| 623 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 624 | .name = "dma_chnl", |
Sujit Reddy Thumma | 119bfbb | 2011-10-12 11:52:21 +0530 | [diff] [blame] | 625 | .start = DMOV_SDC4_CHAN, |
| 626 | .end = DMOV_SDC4_CHAN, |
Krishna Konda | 25786ec | 2011-07-25 16:21:36 -0700 | [diff] [blame] | 627 | .flags = IORESOURCE_DMA, |
| 628 | }, |
| 629 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 630 | .name = "dma_crci", |
Sujit Reddy Thumma | 119bfbb | 2011-10-12 11:52:21 +0530 | [diff] [blame] | 631 | .start = DMOV_SDC4_CRCI, |
| 632 | .end = DMOV_SDC4_CRCI, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 633 | .flags = IORESOURCE_DMA, |
| 634 | }, |
| 635 | }; |
| 636 | |
| 637 | struct platform_device msm_device_sdc1 = { |
| 638 | .name = "msm_sdcc", |
| 639 | .id = 1, |
| 640 | .num_resources = ARRAY_SIZE(resources_sdc1), |
| 641 | .resource = resources_sdc1, |
| 642 | .dev = { |
| 643 | .coherent_dma_mask = 0xffffffff, |
| 644 | }, |
| 645 | }; |
| 646 | |
| 647 | struct platform_device msm_device_sdc2 = { |
| 648 | .name = "msm_sdcc", |
| 649 | .id = 2, |
| 650 | .num_resources = ARRAY_SIZE(resources_sdc2), |
| 651 | .resource = resources_sdc2, |
| 652 | .dev = { |
| 653 | .coherent_dma_mask = 0xffffffff, |
| 654 | }, |
| 655 | }; |
| 656 | |
| 657 | struct platform_device msm_device_sdc3 = { |
| 658 | .name = "msm_sdcc", |
| 659 | .id = 3, |
| 660 | .num_resources = ARRAY_SIZE(resources_sdc3), |
| 661 | .resource = resources_sdc3, |
| 662 | .dev = { |
| 663 | .coherent_dma_mask = 0xffffffff, |
| 664 | }, |
| 665 | }; |
| 666 | |
| 667 | struct platform_device msm_device_sdc4 = { |
| 668 | .name = "msm_sdcc", |
| 669 | .id = 4, |
| 670 | .num_resources = ARRAY_SIZE(resources_sdc4), |
| 671 | .resource = resources_sdc4, |
| 672 | .dev = { |
| 673 | .coherent_dma_mask = 0xffffffff, |
| 674 | }, |
| 675 | }; |
| 676 | |
| 677 | static struct platform_device *msm_sdcc_devices[] __initdata = { |
| 678 | &msm_device_sdc1, |
| 679 | &msm_device_sdc2, |
| 680 | &msm_device_sdc3, |
| 681 | &msm_device_sdc4, |
| 682 | }; |
| 683 | |
Suresh Vankadara | 20cd3be7 | 2012-01-18 00:34:06 +0530 | [diff] [blame] | 684 | #ifdef CONFIG_MSM_CAMERA_V4L2 |
Suresh Vankadara | 6050cef5 | 2012-04-16 21:44:59 +0530 | [diff] [blame] | 685 | static int apps_reset; |
Suresh Vankadara | 20cd3be7 | 2012-01-18 00:34:06 +0530 | [diff] [blame] | 686 | static struct resource msm_csic0_resources[] = { |
| 687 | { |
| 688 | .name = "csic", |
| 689 | .start = 0xA0F00000, |
| 690 | .end = 0xA0F00000 + 0x00100000 - 1, |
| 691 | .flags = IORESOURCE_MEM, |
| 692 | }, |
| 693 | { |
| 694 | .name = "csic", |
| 695 | .start = INT_CSI_IRQ_0, |
| 696 | .end = INT_CSI_IRQ_0, |
| 697 | .flags = IORESOURCE_IRQ, |
| 698 | }, |
| 699 | }; |
| 700 | |
| 701 | static struct resource msm_csic1_resources[] = { |
| 702 | { |
| 703 | .name = "csic", |
| 704 | .start = 0xA1000000, |
| 705 | .end = 0xA1000000 + 0x00100000 - 1, |
| 706 | .flags = IORESOURCE_MEM, |
| 707 | }, |
| 708 | { |
| 709 | .name = "csic", |
| 710 | .start = INT_CSI_IRQ_1, |
| 711 | .end = INT_CSI_IRQ_1, |
| 712 | .flags = IORESOURCE_IRQ, |
| 713 | }, |
| 714 | }; |
| 715 | |
| 716 | struct platform_device msm7x27a_device_csic0 = { |
| 717 | .name = "msm_csic", |
| 718 | .id = 0, |
| 719 | .resource = msm_csic0_resources, |
| 720 | .num_resources = ARRAY_SIZE(msm_csic0_resources), |
| 721 | }; |
| 722 | |
| 723 | struct platform_device msm7x27a_device_csic1 = { |
| 724 | .name = "msm_csic", |
| 725 | .id = 1, |
| 726 | .resource = msm_csic1_resources, |
| 727 | .num_resources = ARRAY_SIZE(msm_csic1_resources), |
| 728 | }; |
| 729 | |
| 730 | static struct resource msm_clkctl_resources[] = { |
| 731 | { |
| 732 | .name = "clk_ctl", |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 733 | .start = MSM7XXX_CLK_CTL_PHYS, |
| 734 | .end = MSM7XXX_CLK_CTL_PHYS + MSM7XXX_CLK_CTL_SIZE - 1, |
Suresh Vankadara | 20cd3be7 | 2012-01-18 00:34:06 +0530 | [diff] [blame] | 735 | .flags = IORESOURCE_MEM, |
| 736 | }, |
| 737 | }; |
| 738 | struct platform_device msm7x27a_device_clkctl = { |
| 739 | .name = "msm_clk_ctl", |
| 740 | .id = 0, |
| 741 | .resource = msm_clkctl_resources, |
| 742 | .num_resources = ARRAY_SIZE(msm_clkctl_resources), |
Suresh Vankadara | 6050cef5 | 2012-04-16 21:44:59 +0530 | [diff] [blame] | 743 | .dev = { |
| 744 | .platform_data = &apps_reset, |
| 745 | }, |
Suresh Vankadara | 20cd3be7 | 2012-01-18 00:34:06 +0530 | [diff] [blame] | 746 | }; |
| 747 | |
| 748 | struct platform_device msm7x27a_device_vfe = { |
| 749 | .name = "msm_vfe", |
| 750 | .id = 0, |
| 751 | }; |
| 752 | |
| 753 | #endif |
| 754 | |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 755 | /* Command sequence for simple WFI */ |
| 756 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Murali Nalajala | 2250a27 | 2012-03-13 15:56:59 +0530 | [diff] [blame] | 757 | 0x04, 0x03, 0x04, 0x0f, |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 758 | }; |
| 759 | |
| 760 | /* Command sequence for GDFS, this won't send any interrupt to the modem */ |
| 761 | static uint8_t spm_pc_without_modem[] __initdata = { |
| 762 | 0x20, 0x00, 0x30, 0x10, |
Murali Nalajala | 2250a27 | 2012-03-13 15:56:59 +0530 | [diff] [blame] | 763 | 0x03, 0x1e, 0x0e, 0x3e, |
| 764 | 0x4e, 0x4e, 0x4e, 0x4e, |
| 765 | 0x4e, 0x4e, 0x4e, 0x4e, |
| 766 | 0x4e, 0x4e, 0x4e, 0x4e, |
| 767 | 0x4e, 0x4e, 0x4e, 0x4e, |
| 768 | 0x2E, 0x0f, |
Murali Nalajala | 41786ab | 2012-03-06 10:47:32 +0530 | [diff] [blame] | 769 | }; |
| 770 | |
| 771 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 772 | [0] = { |
| 773 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 774 | .notify_rpm = false, |
| 775 | .cmd = spm_wfi_cmd_sequence, |
| 776 | }, |
| 777 | [1] = { |
| 778 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 779 | .notify_rpm = false, |
| 780 | .cmd = spm_pc_without_modem, |
| 781 | }, |
| 782 | }; |
| 783 | |
| 784 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 785 | [0] = { |
| 786 | .reg_base_addr = MSM_SAW0_BASE, |
| 787 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0, |
| 788 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 789 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 790 | .modes = msm_spm_seq_list, |
| 791 | }, |
| 792 | [1] = { |
| 793 | .reg_base_addr = MSM_SAW1_BASE, |
| 794 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x0, |
| 795 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 796 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 797 | .modes = msm_spm_seq_list, |
| 798 | }, |
| 799 | }; |
| 800 | |
| 801 | void __init msm8x25_spm_device_init(void) |
| 802 | { |
| 803 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 804 | } |
| 805 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 806 | #define MDP_BASE 0xAA200000 |
| 807 | #define MIPI_DSI_HW_BASE 0xA1100000 |
| 808 | |
| 809 | static struct resource msm_mipi_dsi_resources[] = { |
| 810 | { |
| 811 | .name = "mipi_dsi", |
| 812 | .start = MIPI_DSI_HW_BASE, |
| 813 | .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1, |
| 814 | .flags = IORESOURCE_MEM, |
| 815 | }, |
| 816 | { |
| 817 | .start = INT_DSI_IRQ, |
| 818 | .end = INT_DSI_IRQ, |
| 819 | .flags = IORESOURCE_IRQ, |
| 820 | }, |
| 821 | }; |
| 822 | |
| 823 | static struct platform_device msm_mipi_dsi_device = { |
| 824 | .name = "mipi_dsi", |
| 825 | .id = 1, |
| 826 | .num_resources = ARRAY_SIZE(msm_mipi_dsi_resources), |
| 827 | .resource = msm_mipi_dsi_resources, |
| 828 | }; |
| 829 | |
| 830 | static struct resource msm_mdp_resources[] = { |
| 831 | { |
| 832 | .name = "mdp", |
| 833 | .start = MDP_BASE, |
| 834 | .end = MDP_BASE + 0x000F1008 - 1, |
| 835 | .flags = IORESOURCE_MEM, |
| 836 | }, |
| 837 | { |
| 838 | .start = INT_MDP, |
| 839 | .end = INT_MDP, |
| 840 | .flags = IORESOURCE_IRQ, |
| 841 | }, |
| 842 | }; |
| 843 | |
| 844 | static struct platform_device msm_mdp_device = { |
| 845 | .name = "mdp", |
| 846 | .id = 0, |
| 847 | .num_resources = ARRAY_SIZE(msm_mdp_resources), |
| 848 | .resource = msm_mdp_resources, |
| 849 | }; |
| 850 | |
Padmanabhan Komanduru | e77bcf5 | 2012-07-26 12:43:39 +0530 | [diff] [blame] | 851 | struct platform_device msm_lcdc_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 852 | .name = "lcdc", |
| 853 | .id = 0, |
| 854 | }; |
| 855 | |
| 856 | static struct resource kgsl_3d0_resources[] = { |
| 857 | { |
| 858 | .name = KGSL_3D0_REG_MEMORY, |
| 859 | .start = 0xA0000000, |
| 860 | .end = 0xA001ffff, |
| 861 | .flags = IORESOURCE_MEM, |
| 862 | }, |
| 863 | { |
| 864 | .name = KGSL_3D0_IRQ, |
| 865 | .start = INT_GRAPHICS, |
| 866 | .end = INT_GRAPHICS, |
| 867 | .flags = IORESOURCE_IRQ, |
| 868 | }, |
| 869 | }; |
| 870 | |
| 871 | static struct kgsl_device_platform_data kgsl_3d0_pdata = { |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 872 | .pwrlevel = { |
| 873 | { |
| 874 | .gpu_freq = 245760000, |
| 875 | .bus_freq = 200000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 876 | }, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 877 | { |
Lynus Vaz | eaf0aac | 2012-01-05 12:28:47 +0530 | [diff] [blame] | 878 | .gpu_freq = 192000000, |
| 879 | .bus_freq = 160000000, |
| 880 | }, |
| 881 | { |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 882 | .gpu_freq = 133330000, |
| 883 | .bus_freq = 0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 884 | }, |
| 885 | }, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 886 | .init_level = 0, |
Lynus Vaz | eaf0aac | 2012-01-05 12:28:47 +0530 | [diff] [blame] | 887 | .num_levels = 3, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 888 | .set_grp_async = set_grp_xbar_async, |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 889 | .idle_timeout = HZ, |
Lynus Vaz | fe4bede | 2012-04-06 11:53:30 -0700 | [diff] [blame] | 890 | .strtstp_sleepwake = true, |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 891 | .nap_allowed = false, |
| 892 | .clk_map = KGSL_CLK_CORE | KGSL_CLK_IFACE | KGSL_CLK_MEM, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 893 | }; |
| 894 | |
| 895 | struct platform_device msm_kgsl_3d0 = { |
| 896 | .name = "kgsl-3d0", |
| 897 | .id = 0, |
| 898 | .num_resources = ARRAY_SIZE(kgsl_3d0_resources), |
| 899 | .resource = kgsl_3d0_resources, |
| 900 | .dev = { |
| 901 | .platform_data = &kgsl_3d0_pdata, |
| 902 | }, |
| 903 | }; |
| 904 | |
| 905 | void __init msm7x25a_kgsl_3d0_init(void) |
| 906 | { |
Pankaj Kumar | fee56a8 | 2012-04-17 14:26:49 +0530 | [diff] [blame] | 907 | if (cpu_is_msm7x25a() || cpu_is_msm7x25aa() || cpu_is_msm7x25ab()) { |
Lynus Vaz | 971610e | 2012-01-06 11:00:32 +0530 | [diff] [blame] | 908 | kgsl_3d0_pdata.num_levels = 2; |
Lucille Sylvester | dce84cd | 2011-10-12 14:15:37 -0600 | [diff] [blame] | 909 | kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 133330000; |
| 910 | kgsl_3d0_pdata.pwrlevel[0].bus_freq = 160000000; |
| 911 | kgsl_3d0_pdata.pwrlevel[1].gpu_freq = 96000000; |
| 912 | kgsl_3d0_pdata.pwrlevel[1].bus_freq = 0; |
Rajesh Kemisetti | df6e62f | 2012-03-12 14:02:30 +0530 | [diff] [blame] | 913 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 914 | } |
| 915 | |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 916 | void __init msm8x25_kgsl_3d0_init(void) |
| 917 | { |
Lynus Vaz | fe4bede | 2012-04-06 11:53:30 -0700 | [diff] [blame] | 918 | if (cpu_is_msm8625()) { |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 919 | kgsl_3d0_pdata.idle_timeout = HZ/5; |
Lynus Vaz | fe4bede | 2012-04-06 11:53:30 -0700 | [diff] [blame] | 920 | kgsl_3d0_pdata.strtstp_sleepwake = false; |
Ranjhith Kalisamy | 5fb30ef | 2012-08-12 16:26:36 +0530 | [diff] [blame] | 921 | |
| 922 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) |
| 923 | /* 8x25 v2.0 & above supports a higher GPU frequency */ |
| 924 | kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 320000000; |
| 925 | else |
| 926 | kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 300000000; |
| 927 | |
Ranjhith Kalisamy | 2469632 | 2012-04-11 22:09:17 +0530 | [diff] [blame] | 928 | kgsl_3d0_pdata.pwrlevel[0].bus_freq = 200000000; |
Lynus Vaz | fe4bede | 2012-04-06 11:53:30 -0700 | [diff] [blame] | 929 | } |
Sudhakara Rao Tentu | 38ad6e1 | 2012-03-30 15:25:18 -0700 | [diff] [blame] | 930 | } |
| 931 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 932 | static void __init msm_register_device(struct platform_device *pdev, void *data) |
| 933 | { |
| 934 | int ret; |
| 935 | |
| 936 | pdev->dev.platform_data = data; |
| 937 | |
| 938 | ret = platform_device_register(pdev); |
| 939 | |
| 940 | if (ret) |
| 941 | dev_err(&pdev->dev, |
| 942 | "%s: platform_device_register() failed = %d\n", |
| 943 | __func__, ret); |
| 944 | } |
| 945 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 946 | |
| 947 | #define PERPH_WEB_BLOCK_ADDR (0xA9D00040) |
| 948 | #define PDM0_CTL_OFFSET (0x04) |
| 949 | #define SIZE_8B (0x08) |
| 950 | |
| 951 | static struct resource resources_led[] = { |
| 952 | { |
| 953 | .start = PERPH_WEB_BLOCK_ADDR, |
| 954 | .end = PERPH_WEB_BLOCK_ADDR + (SIZE_8B) - 1, |
| 955 | .name = "led-gpio-pdm", |
| 956 | .flags = IORESOURCE_MEM, |
| 957 | }, |
| 958 | }; |
| 959 | |
| 960 | static struct led_info msm_kpbl_pdm_led_pdata = { |
| 961 | .name = "keyboard-backlight", |
| 962 | }; |
| 963 | |
| 964 | struct platform_device led_pdev = { |
| 965 | .name = "leds-msm-pdm", |
| 966 | /* use pdev id to represent pdm id */ |
| 967 | .id = 0, |
| 968 | .num_resources = ARRAY_SIZE(resources_led), |
| 969 | .resource = resources_led, |
| 970 | .dev = { |
| 971 | .platform_data = &msm_kpbl_pdm_led_pdata, |
| 972 | }, |
| 973 | }; |
| 974 | |
Manish Dewangan | 3a26099 | 2011-06-24 18:01:34 +0530 | [diff] [blame] | 975 | struct platform_device asoc_msm_pcm = { |
| 976 | .name = "msm-dsp-audio", |
| 977 | .id = 0, |
| 978 | }; |
| 979 | |
| 980 | struct platform_device asoc_msm_dai0 = { |
| 981 | .name = "msm-codec-dai", |
| 982 | .id = 0, |
| 983 | }; |
| 984 | |
| 985 | struct platform_device asoc_msm_dai1 = { |
| 986 | .name = "msm-cpu-dai", |
| 987 | .id = 0, |
| 988 | }; |
| 989 | |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 990 | static struct resource gpio_resources[] = { |
| 991 | { |
| 992 | .start = INT_GPIO_GROUP1, |
| 993 | .flags = IORESOURCE_IRQ, |
| 994 | }, |
| 995 | { |
| 996 | .start = INT_GPIO_GROUP2, |
| 997 | .flags = IORESOURCE_IRQ, |
| 998 | }, |
| 999 | }; |
| 1000 | |
| 1001 | static struct platform_device msm_device_gpio = { |
| 1002 | .name = "msmgpio", |
| 1003 | .id = -1, |
| 1004 | .resource = gpio_resources, |
| 1005 | .num_resources = ARRAY_SIZE(gpio_resources), |
| 1006 | }; |
| 1007 | |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1008 | struct platform_device *msm_footswitch_devices[] = { |
Matt Wagantall | d6fbf23 | 2012-05-03 20:09:28 -0700 | [diff] [blame] | 1009 | FS_PCOM(FS_GFX3D, "vdd", "kgsl-3d0.0"), |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1010 | }; |
| 1011 | unsigned msm_num_footswitch_devices = ARRAY_SIZE(msm_footswitch_devices); |
| 1012 | |
| 1013 | /* MSM8625 Devices */ |
| 1014 | |
| 1015 | static struct resource msm8625_resources_uart1[] = { |
| 1016 | { |
| 1017 | .start = MSM8625_INT_UART1, |
| 1018 | .end = MSM8625_INT_UART1, |
| 1019 | .flags = IORESOURCE_IRQ, |
| 1020 | }, |
| 1021 | { |
Taniya Das | 13b811a | 2011-12-09 18:33:45 +0530 | [diff] [blame] | 1022 | .start = MSM7XXX_UART1_PHYS, |
| 1023 | .end = MSM7XXX_UART1_PHYS + MSM7XXX_UART1_SIZE - 1, |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1024 | .flags = IORESOURCE_MEM, |
| 1025 | }, |
| 1026 | }; |
| 1027 | |
| 1028 | struct platform_device msm8625_device_uart1 = { |
| 1029 | .name = "msm_serial", |
| 1030 | .id = 0, |
| 1031 | .num_resources = ARRAY_SIZE(msm8625_resources_uart1), |
| 1032 | .resource = msm8625_resources_uart1, |
| 1033 | }; |
| 1034 | |
Trilok Soni | 269fff4 | 2012-02-13 20:35:30 +0530 | [diff] [blame] | 1035 | static struct resource msm8625_uart1_dm_resources[] = { |
| 1036 | { |
| 1037 | .start = MSM_UART1DM_PHYS, |
| 1038 | .end = MSM_UART1DM_PHYS + PAGE_SIZE - 1, |
| 1039 | .flags = IORESOURCE_MEM, |
| 1040 | }, |
| 1041 | { |
| 1042 | .start = MSM8625_INT_UART1DM_IRQ, |
| 1043 | .end = MSM8625_INT_UART1DM_IRQ, |
| 1044 | .flags = IORESOURCE_IRQ, |
| 1045 | }, |
| 1046 | { |
| 1047 | .start = MSM8625_INT_UART1DM_RX, |
| 1048 | .end = MSM8625_INT_UART1DM_RX, |
| 1049 | .flags = IORESOURCE_IRQ, |
| 1050 | }, |
| 1051 | { |
| 1052 | .start = DMOV_HSUART1_TX_CHAN, |
| 1053 | .end = DMOV_HSUART1_RX_CHAN, |
| 1054 | .name = "uartdm_channels", |
| 1055 | .flags = IORESOURCE_DMA, |
| 1056 | }, |
| 1057 | { |
| 1058 | .start = DMOV_HSUART1_TX_CRCI, |
| 1059 | .end = DMOV_HSUART1_RX_CRCI, |
| 1060 | .name = "uartdm_crci", |
| 1061 | .flags = IORESOURCE_DMA, |
| 1062 | }, |
| 1063 | }; |
| 1064 | |
| 1065 | struct platform_device msm8625_device_uart_dm1 = { |
| 1066 | .name = "msm_serial_hs", |
| 1067 | .id = 0, |
| 1068 | .num_resources = ARRAY_SIZE(msm8625_uart1_dm_resources), |
| 1069 | .resource = msm8625_uart1_dm_resources, |
| 1070 | .dev = { |
| 1071 | .dma_mask = &msm_uart_dm1_dma_mask, |
| 1072 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1073 | }, |
| 1074 | }; |
| 1075 | |
| 1076 | static struct resource msm8625_uart2dm_resources[] = { |
| 1077 | { |
| 1078 | .start = MSM_UART2DM_PHYS, |
| 1079 | .end = MSM_UART2DM_PHYS + PAGE_SIZE - 1, |
| 1080 | .name = "uartdm_resource", |
| 1081 | .flags = IORESOURCE_MEM, |
| 1082 | }, |
| 1083 | { |
| 1084 | .start = MSM8625_INT_UART2DM_IRQ, |
| 1085 | .end = MSM8625_INT_UART2DM_IRQ, |
| 1086 | .flags = IORESOURCE_IRQ, |
| 1087 | }, |
| 1088 | }; |
| 1089 | |
| 1090 | struct platform_device msm8625_device_uart_dm2 = { |
| 1091 | .name = "msm_serial_hsl", |
| 1092 | .id = 0, |
| 1093 | .num_resources = ARRAY_SIZE(msm8625_uart2dm_resources), |
| 1094 | .resource = msm8625_uart2dm_resources, |
| 1095 | }; |
| 1096 | |
Laxminath Kasam | 5faa1ca | 2012-02-15 12:06:45 +0530 | [diff] [blame] | 1097 | static struct resource msm8625_resources_adsp[] = { |
| 1098 | { |
| 1099 | .start = MSM8625_INT_ADSP_A9_A11, |
| 1100 | .end = MSM8625_INT_ADSP_A9_A11, |
| 1101 | .flags = IORESOURCE_IRQ, |
| 1102 | }, |
| 1103 | }; |
| 1104 | |
| 1105 | struct platform_device msm8625_device_adsp = { |
| 1106 | .name = "msm_adsp", |
| 1107 | .id = -1, |
| 1108 | .num_resources = ARRAY_SIZE(msm8625_resources_adsp), |
| 1109 | .resource = msm8625_resources_adsp, |
| 1110 | }; |
| 1111 | |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1112 | static struct resource msm8625_dmov_resource[] = { |
| 1113 | { |
| 1114 | .start = MSM8625_INT_ADM_AARM, |
| 1115 | .flags = IORESOURCE_IRQ, |
| 1116 | }, |
| 1117 | { |
| 1118 | .start = 0xA9700000, |
| 1119 | .end = 0xA9700000 + SZ_4K - 1, |
| 1120 | .flags = IORESOURCE_MEM, |
| 1121 | }, |
| 1122 | }; |
| 1123 | |
| 1124 | struct platform_device msm8625_device_dmov = { |
| 1125 | .name = "msm_dmov", |
| 1126 | .id = -1, |
| 1127 | .resource = msm8625_dmov_resource, |
| 1128 | .num_resources = ARRAY_SIZE(msm8625_dmov_resource), |
| 1129 | .dev = { |
| 1130 | .platform_data = &msm_dmov_pdata, |
| 1131 | }, |
| 1132 | }; |
Taniya Das | 2e94819 | 2011-12-20 11:15:13 +0530 | [diff] [blame] | 1133 | |
Taniya Das | 9d18714 | 2011-12-02 15:53:25 +0530 | [diff] [blame] | 1134 | static struct resource gsbi0_msm8625_qup_resources[] = { |
| 1135 | { |
| 1136 | .name = "qup_phys_addr", |
| 1137 | .start = MSM_GSBI0_QUP_PHYS, |
| 1138 | .end = MSM_GSBI0_QUP_PHYS + SZ_4K - 1, |
| 1139 | .flags = IORESOURCE_MEM, |
| 1140 | }, |
| 1141 | { |
| 1142 | .name = "gsbi_qup_i2c_addr", |
| 1143 | .start = MSM_GSBI0_PHYS, |
| 1144 | .end = MSM_GSBI0_PHYS + SZ_4K - 1, |
| 1145 | .flags = IORESOURCE_MEM, |
| 1146 | }, |
| 1147 | { |
| 1148 | .name = "qup_err_intr", |
| 1149 | .start = MSM8625_INT_PWB_I2C, |
| 1150 | .end = MSM8625_INT_PWB_I2C, |
| 1151 | .flags = IORESOURCE_IRQ, |
| 1152 | }, |
| 1153 | }; |
| 1154 | |
| 1155 | /* Use GSBI0 QUP for /dev/i2c-0 */ |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1156 | struct platform_device msm8625_gsbi0_qup_i2c_device = { |
Taniya Das | 9d18714 | 2011-12-02 15:53:25 +0530 | [diff] [blame] | 1157 | .name = "qup_i2c", |
| 1158 | .id = MSM_GSBI0_QUP_I2C_BUS_ID, |
| 1159 | .num_resources = ARRAY_SIZE(gsbi0_msm8625_qup_resources), |
| 1160 | .resource = gsbi0_msm8625_qup_resources, |
| 1161 | }; |
| 1162 | |
Trilok Soni | 633e59c | 2012-02-13 20:28:30 +0530 | [diff] [blame] | 1163 | static struct resource gsbi1_msm8625_qup_i2c_resources[] = { |
| 1164 | { |
| 1165 | .name = "qup_phys_addr", |
| 1166 | .start = MSM_GSBI1_QUP_PHYS, |
| 1167 | .end = MSM_GSBI1_QUP_PHYS + SZ_4K - 1, |
| 1168 | .flags = IORESOURCE_MEM, |
| 1169 | }, |
| 1170 | { |
| 1171 | .name = "gsbi_qup_i2c_addr", |
| 1172 | .start = MSM_GSBI1_PHYS, |
| 1173 | .end = MSM_GSBI1_PHYS + SZ_4K - 1, |
| 1174 | .flags = IORESOURCE_MEM, |
| 1175 | }, |
| 1176 | { |
| 1177 | .name = "qup_err_intr", |
| 1178 | .start = MSM8625_INT_ARM11_DMA, |
| 1179 | .end = MSM8625_INT_ARM11_DMA, |
| 1180 | .flags = IORESOURCE_IRQ, |
| 1181 | }, |
| 1182 | }; |
| 1183 | |
| 1184 | /* Use GSBI1 QUP for /dev/i2c-1 */ |
Taniya Das | e3027e2 | 2012-02-27 16:32:27 +0530 | [diff] [blame] | 1185 | struct platform_device msm8625_gsbi1_qup_i2c_device = { |
Trilok Soni | 633e59c | 2012-02-13 20:28:30 +0530 | [diff] [blame] | 1186 | .name = "qup_i2c", |
| 1187 | .id = MSM_GSBI1_QUP_I2C_BUS_ID, |
| 1188 | .num_resources = ARRAY_SIZE(gsbi1_qup_i2c_resources), |
| 1189 | .resource = gsbi1_msm8625_qup_i2c_resources, |
| 1190 | }; |
| 1191 | |
Taniya Das | 6684d62 | 2012-01-12 10:29:09 +0530 | [diff] [blame] | 1192 | static struct resource msm8625_gpio_resources[] = { |
| 1193 | { |
| 1194 | .start = MSM8625_INT_GPIO_GROUP1, |
| 1195 | .flags = IORESOURCE_IRQ, |
| 1196 | }, |
| 1197 | { |
| 1198 | .start = MSM8625_INT_GPIO_GROUP2, |
| 1199 | .flags = IORESOURCE_IRQ, |
| 1200 | }, |
| 1201 | }; |
| 1202 | |
| 1203 | static struct platform_device msm8625_device_gpio = { |
| 1204 | .name = "msmgpio", |
| 1205 | .id = -1, |
| 1206 | .resource = msm8625_gpio_resources, |
| 1207 | .num_resources = ARRAY_SIZE(msm8625_gpio_resources), |
| 1208 | }; |
| 1209 | |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1210 | static struct resource msm8625_resources_sdc1[] = { |
| 1211 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1212 | .name = "core_mem", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1213 | .start = MSM_SDC1_BASE, |
| 1214 | .end = MSM_SDC1_BASE + SZ_4K - 1, |
| 1215 | .flags = IORESOURCE_MEM, |
| 1216 | }, |
| 1217 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1218 | .name = "core_irq", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1219 | .start = MSM8625_INT_SDC1_0, |
| 1220 | .end = MSM8625_INT_SDC1_1, |
| 1221 | .flags = IORESOURCE_IRQ, |
| 1222 | }, |
| 1223 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1224 | .name = "dma_chnl", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1225 | .start = DMOV_SDC1_CHAN, |
| 1226 | .end = DMOV_SDC1_CHAN, |
| 1227 | .flags = IORESOURCE_DMA, |
| 1228 | }, |
| 1229 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1230 | .name = "dma_crci", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1231 | .start = DMOV_SDC1_CRCI, |
| 1232 | .end = DMOV_SDC1_CRCI, |
| 1233 | .flags = IORESOURCE_DMA, |
| 1234 | } |
| 1235 | }; |
| 1236 | |
| 1237 | static struct resource msm8625_resources_sdc2[] = { |
| 1238 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1239 | .name = "core_mem", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1240 | .start = MSM_SDC2_BASE, |
| 1241 | .end = MSM_SDC2_BASE + SZ_4K - 1, |
| 1242 | .flags = IORESOURCE_MEM, |
| 1243 | }, |
| 1244 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1245 | .name = "core_irq", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1246 | .start = MSM8625_INT_SDC2_0, |
| 1247 | .end = MSM8625_INT_SDC2_1, |
| 1248 | .flags = IORESOURCE_IRQ, |
| 1249 | }, |
| 1250 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1251 | .name = "dma_chnl", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1252 | .start = DMOV_SDC2_CHAN, |
| 1253 | .end = DMOV_SDC2_CHAN, |
| 1254 | .flags = IORESOURCE_DMA, |
| 1255 | }, |
| 1256 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1257 | .name = "dma_crci", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1258 | .start = DMOV_SDC2_CRCI, |
| 1259 | .end = DMOV_SDC2_CRCI, |
| 1260 | .flags = IORESOURCE_DMA, |
| 1261 | } |
| 1262 | }; |
| 1263 | |
| 1264 | static struct resource msm8625_resources_sdc3[] = { |
| 1265 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1266 | .name = "core_mem", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1267 | .start = MSM_SDC3_BASE, |
| 1268 | .end = MSM_SDC3_BASE + SZ_4K - 1, |
| 1269 | .flags = IORESOURCE_MEM, |
| 1270 | }, |
| 1271 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1272 | .name = "core_irq", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1273 | .start = MSM8625_INT_SDC3_0, |
| 1274 | .end = MSM8625_INT_SDC3_1, |
| 1275 | .flags = IORESOURCE_IRQ, |
| 1276 | }, |
| 1277 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1278 | .name = "dma_chnl", |
Pratibhasagar V | c483d20 | 2012-08-21 14:37:17 +0530 | [diff] [blame] | 1279 | .start = DMOV_NAND_CHAN, |
| 1280 | .end = DMOV_NAND_CHAN, |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1281 | .flags = IORESOURCE_DMA, |
| 1282 | }, |
| 1283 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1284 | .name = "dma_crci", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1285 | .start = DMOV_SDC3_CRCI, |
| 1286 | .end = DMOV_SDC3_CRCI, |
| 1287 | .flags = IORESOURCE_DMA, |
| 1288 | }, |
| 1289 | }; |
| 1290 | |
| 1291 | static struct resource msm8625_resources_sdc4[] = { |
| 1292 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1293 | .name = "core_mem", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1294 | .start = MSM_SDC4_BASE, |
| 1295 | .end = MSM_SDC4_BASE + SZ_4K - 1, |
| 1296 | .flags = IORESOURCE_MEM, |
| 1297 | }, |
| 1298 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1299 | .name = "core_irq", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1300 | .start = MSM8625_INT_SDC4_0, |
| 1301 | .end = MSM8625_INT_SDC4_1, |
| 1302 | .flags = IORESOURCE_IRQ, |
| 1303 | }, |
| 1304 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1305 | .name = "dma_chnl", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1306 | .start = DMOV_SDC4_CHAN, |
| 1307 | .end = DMOV_SDC4_CHAN, |
| 1308 | .flags = IORESOURCE_DMA, |
| 1309 | }, |
| 1310 | { |
Sujit Reddy Thumma | 1dfac2c | 2012-07-30 10:15:39 +0530 | [diff] [blame] | 1311 | .name = "dma_crci", |
Trilok Soni | ee75f6c | 2012-02-13 20:45:07 +0530 | [diff] [blame] | 1312 | .start = DMOV_SDC4_CRCI, |
| 1313 | .end = DMOV_SDC4_CRCI, |
| 1314 | .flags = IORESOURCE_DMA, |
| 1315 | }, |
| 1316 | }; |
| 1317 | |
| 1318 | struct platform_device msm8625_device_sdc1 = { |
| 1319 | .name = "msm_sdcc", |
| 1320 | .id = 1, |
| 1321 | .num_resources = ARRAY_SIZE(msm8625_resources_sdc1), |
| 1322 | .resource = msm8625_resources_sdc1, |
| 1323 | .dev = { |
| 1324 | .coherent_dma_mask = 0xffffffff, |
| 1325 | }, |
| 1326 | }; |
| 1327 | |
| 1328 | struct platform_device msm8625_device_sdc2 = { |
| 1329 | .name = "msm_sdcc", |
| 1330 | .id = 2, |
| 1331 | .num_resources = ARRAY_SIZE(msm8625_resources_sdc2), |
| 1332 | .resource = msm8625_resources_sdc2, |
| 1333 | .dev = { |
| 1334 | .coherent_dma_mask = 0xffffffff, |
| 1335 | }, |
| 1336 | }; |
| 1337 | |
| 1338 | struct platform_device msm8625_device_sdc3 = { |
| 1339 | .name = "msm_sdcc", |
| 1340 | .id = 3, |
| 1341 | .num_resources = ARRAY_SIZE(msm8625_resources_sdc3), |
| 1342 | .resource = msm8625_resources_sdc3, |
| 1343 | .dev = { |
| 1344 | .coherent_dma_mask = 0xffffffff, |
| 1345 | }, |
| 1346 | }; |
| 1347 | |
| 1348 | struct platform_device msm8625_device_sdc4 = { |
| 1349 | .name = "msm_sdcc", |
| 1350 | .id = 4, |
| 1351 | .num_resources = ARRAY_SIZE(msm8625_resources_sdc4), |
| 1352 | .resource = msm8625_resources_sdc4, |
| 1353 | .dev = { |
| 1354 | .coherent_dma_mask = 0xffffffff, |
| 1355 | }, |
| 1356 | }; |
| 1357 | |
| 1358 | static struct platform_device *msm8625_sdcc_devices[] __initdata = { |
| 1359 | &msm8625_device_sdc1, |
| 1360 | &msm8625_device_sdc2, |
| 1361 | &msm8625_device_sdc3, |
| 1362 | &msm8625_device_sdc4, |
| 1363 | }; |
| 1364 | |
| 1365 | int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat) |
| 1366 | { |
| 1367 | struct platform_device *pdev; |
| 1368 | |
| 1369 | if (controller < 1 || controller > 4) |
| 1370 | return -EINVAL; |
| 1371 | |
| 1372 | if (cpu_is_msm8625()) |
| 1373 | pdev = msm8625_sdcc_devices[controller-1]; |
| 1374 | else |
| 1375 | pdev = msm_sdcc_devices[controller-1]; |
| 1376 | |
| 1377 | pdev->dev.platform_data = plat; |
| 1378 | return platform_device_register(pdev); |
| 1379 | } |
| 1380 | |
Trilok Soni | da63a8b | 2012-02-13 20:50:03 +0530 | [diff] [blame] | 1381 | static struct resource msm8625_resources_hsusb_otg[] = { |
| 1382 | { |
| 1383 | .start = MSM_HSUSB_PHYS, |
| 1384 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 1385 | .flags = IORESOURCE_MEM, |
| 1386 | }, |
| 1387 | { |
| 1388 | .start = MSM8625_INT_USB_HS, |
| 1389 | .end = MSM8625_INT_USB_HS, |
| 1390 | .flags = IORESOURCE_IRQ, |
| 1391 | }, |
| 1392 | }; |
| 1393 | |
| 1394 | struct platform_device msm8625_device_otg = { |
| 1395 | .name = "msm_otg", |
| 1396 | .id = -1, |
| 1397 | .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_otg), |
| 1398 | .resource = msm8625_resources_hsusb_otg, |
| 1399 | .dev = { |
| 1400 | .dma_mask = &dma_mask, |
| 1401 | .coherent_dma_mask = 0xffffffffULL, |
| 1402 | }, |
| 1403 | }; |
| 1404 | |
| 1405 | static struct resource msm8625_resources_gadget_peripheral[] = { |
| 1406 | { |
| 1407 | .start = MSM_HSUSB_PHYS, |
| 1408 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 1409 | .flags = IORESOURCE_MEM, |
| 1410 | }, |
| 1411 | { |
| 1412 | .start = MSM8625_INT_USB_HS, |
| 1413 | .end = MSM8625_INT_USB_HS, |
| 1414 | .flags = IORESOURCE_IRQ, |
| 1415 | }, |
| 1416 | }; |
| 1417 | |
| 1418 | struct platform_device msm8625_device_gadget_peripheral = { |
| 1419 | .name = "msm_hsusb", |
| 1420 | .id = -1, |
| 1421 | .num_resources = ARRAY_SIZE(msm8625_resources_gadget_peripheral), |
| 1422 | .resource = msm8625_resources_gadget_peripheral, |
| 1423 | .dev = { |
| 1424 | .dma_mask = &dma_mask, |
| 1425 | .coherent_dma_mask = 0xffffffffULL, |
| 1426 | }, |
| 1427 | }; |
| 1428 | |
| 1429 | static struct resource msm8625_resources_hsusb_host[] = { |
| 1430 | { |
| 1431 | .start = MSM_HSUSB_PHYS, |
| 1432 | .end = MSM_HSUSB_PHYS + SZ_1K - 1, |
| 1433 | .flags = IORESOURCE_MEM, |
| 1434 | }, |
| 1435 | { |
| 1436 | .start = MSM8625_INT_USB_HS, |
| 1437 | .end = MSM8625_INT_USB_HS, |
| 1438 | .flags = IORESOURCE_IRQ, |
| 1439 | }, |
| 1440 | }; |
| 1441 | |
| 1442 | struct platform_device msm8625_device_hsusb_host = { |
| 1443 | .name = "msm_hsusb_host", |
| 1444 | .id = 0, |
| 1445 | .num_resources = ARRAY_SIZE(msm8625_resources_hsusb_host), |
| 1446 | .resource = msm8625_resources_hsusb_host, |
| 1447 | .dev = { |
| 1448 | .dma_mask = &dma_mask, |
| 1449 | .coherent_dma_mask = 0xffffffffULL, |
| 1450 | }, |
| 1451 | }; |
| 1452 | |
| 1453 | static struct platform_device *msm8625_host_devices[] = { |
| 1454 | &msm8625_device_hsusb_host, |
| 1455 | }; |
| 1456 | |
| 1457 | int msm_add_host(unsigned int host, struct msm_usb_host_platform_data *plat) |
| 1458 | { |
| 1459 | struct platform_device *pdev; |
| 1460 | |
| 1461 | if (cpu_is_msm8625()) |
| 1462 | pdev = msm8625_host_devices[host]; |
| 1463 | else |
| 1464 | pdev = msm_host_devices[host]; |
| 1465 | if (!pdev) |
| 1466 | return -ENODEV; |
| 1467 | pdev->dev.platform_data = plat; |
| 1468 | return platform_device_register(pdev); |
| 1469 | } |
| 1470 | |
Trilok Soni | 88da255 | 2012-02-13 21:01:24 +0530 | [diff] [blame] | 1471 | #ifdef CONFIG_MSM_CAMERA_V4L2 |
| 1472 | static struct resource msm8625_csic0_resources[] = { |
| 1473 | { |
| 1474 | .name = "csic", |
| 1475 | .start = 0xA0F00000, |
| 1476 | .end = 0xA0F00000 + 0x00100000 - 1, |
| 1477 | .flags = IORESOURCE_MEM, |
| 1478 | }, |
| 1479 | { |
| 1480 | .name = "csic", |
| 1481 | .start = MSM8625_INT_CSI_IRQ_0, |
| 1482 | .end = MSM8625_INT_CSI_IRQ_0, |
| 1483 | .flags = IORESOURCE_IRQ, |
| 1484 | }, |
| 1485 | }; |
| 1486 | |
| 1487 | static struct resource msm8625_csic1_resources[] = { |
| 1488 | { |
| 1489 | .name = "csic", |
| 1490 | .start = 0xA1000000, |
| 1491 | .end = 0xA1000000 + 0x00100000 - 1, |
| 1492 | .flags = IORESOURCE_MEM, |
| 1493 | }, |
| 1494 | { |
| 1495 | .name = "csic", |
| 1496 | .start = MSM8625_INT_CSI_IRQ_1, |
| 1497 | .end = MSM8625_INT_CSI_IRQ_1, |
| 1498 | .flags = IORESOURCE_IRQ, |
| 1499 | }, |
| 1500 | }; |
| 1501 | |
| 1502 | struct platform_device msm8625_device_csic0 = { |
| 1503 | .name = "msm_csic", |
| 1504 | .id = 0, |
| 1505 | .resource = msm8625_csic0_resources, |
| 1506 | .num_resources = ARRAY_SIZE(msm8625_csic0_resources), |
| 1507 | }; |
| 1508 | |
| 1509 | struct platform_device msm8625_device_csic1 = { |
| 1510 | .name = "msm_csic", |
| 1511 | .id = 1, |
| 1512 | .resource = msm8625_csic1_resources, |
| 1513 | .num_resources = ARRAY_SIZE(msm8625_csic1_resources), |
| 1514 | }; |
| 1515 | #endif |
| 1516 | |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1517 | static struct resource msm8625_mipi_dsi_resources[] = { |
| 1518 | { |
| 1519 | .name = "mipi_dsi", |
| 1520 | .start = MIPI_DSI_HW_BASE, |
| 1521 | .end = MIPI_DSI_HW_BASE + 0x000F0000 - 1, |
| 1522 | .flags = IORESOURCE_MEM, |
| 1523 | }, |
| 1524 | { |
| 1525 | .start = MSM8625_INT_DSI_IRQ, |
| 1526 | .end = MSM8625_INT_DSI_IRQ, |
| 1527 | .flags = IORESOURCE_IRQ, |
| 1528 | }, |
| 1529 | }; |
| 1530 | |
Padmanabhan Komanduru | 0b9517b | 2012-07-02 18:31:23 +0530 | [diff] [blame] | 1531 | static struct platform_device msm8625_mipi_dsi_device = { |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1532 | .name = "mipi_dsi", |
| 1533 | .id = 1, |
| 1534 | .num_resources = ARRAY_SIZE(msm8625_mipi_dsi_resources), |
| 1535 | .resource = msm8625_mipi_dsi_resources, |
| 1536 | }; |
| 1537 | |
| 1538 | static struct resource msm8625_mdp_resources[] = { |
| 1539 | { |
| 1540 | .name = "mdp", |
| 1541 | .start = MDP_BASE, |
| 1542 | .end = MDP_BASE + 0x000F1008 - 1, |
| 1543 | .flags = IORESOURCE_MEM, |
| 1544 | }, |
| 1545 | { |
| 1546 | .start = MSM8625_INT_MDP, |
| 1547 | .end = MSM8625_INT_MDP, |
| 1548 | .flags = IORESOURCE_IRQ, |
| 1549 | }, |
| 1550 | }; |
| 1551 | |
| 1552 | static struct platform_device msm8625_mdp_device = { |
| 1553 | .name = "mdp", |
| 1554 | .id = 0, |
| 1555 | .num_resources = ARRAY_SIZE(msm8625_mdp_resources), |
| 1556 | .resource = msm8625_mdp_resources, |
| 1557 | }; |
| 1558 | |
Padmanabhan Komanduru | 0b9517b | 2012-07-02 18:31:23 +0530 | [diff] [blame] | 1559 | struct platform_device mipi_dsi_device; |
| 1560 | |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1561 | void __init msm_fb_register_device(char *name, void *data) |
| 1562 | { |
| 1563 | if (!strncmp(name, "mdp", 3)) { |
| 1564 | if (cpu_is_msm8625()) |
| 1565 | msm_register_device(&msm8625_mdp_device, data); |
| 1566 | else |
| 1567 | msm_register_device(&msm_mdp_device, data); |
| 1568 | } else if (!strncmp(name, "mipi_dsi", 8)) { |
Padmanabhan Komanduru | 0b9517b | 2012-07-02 18:31:23 +0530 | [diff] [blame] | 1569 | if (cpu_is_msm8625()) { |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1570 | msm_register_device(&msm8625_mipi_dsi_device, data); |
Padmanabhan Komanduru | 0b9517b | 2012-07-02 18:31:23 +0530 | [diff] [blame] | 1571 | mipi_dsi_device = msm8625_mipi_dsi_device; |
| 1572 | } else { |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1573 | msm_register_device(&msm_mipi_dsi_device, data); |
Padmanabhan Komanduru | 0b9517b | 2012-07-02 18:31:23 +0530 | [diff] [blame] | 1574 | mipi_dsi_device = msm_mipi_dsi_device; |
| 1575 | } |
Trilok Soni | ae4633d | 2012-02-13 21:08:32 +0530 | [diff] [blame] | 1576 | } else if (!strncmp(name, "lcdc", 4)) { |
| 1577 | msm_register_device(&msm_lcdc_device, data); |
| 1578 | } else { |
| 1579 | printk(KERN_ERR "%s: unknown device! %s\n", __func__, name); |
| 1580 | } |
| 1581 | } |
| 1582 | |
Trilok Soni | 664b95d | 2012-02-13 21:13:15 +0530 | [diff] [blame] | 1583 | static struct resource msm8625_kgsl_3d0_resources[] = { |
| 1584 | { |
| 1585 | .name = KGSL_3D0_REG_MEMORY, |
| 1586 | .start = 0xA0000000, |
| 1587 | .end = 0xA001ffff, |
| 1588 | .flags = IORESOURCE_MEM, |
| 1589 | }, |
| 1590 | { |
| 1591 | .name = KGSL_3D0_IRQ, |
| 1592 | .start = MSM8625_INT_GRAPHICS, |
| 1593 | .end = MSM8625_INT_GRAPHICS, |
| 1594 | .flags = IORESOURCE_IRQ, |
| 1595 | }, |
| 1596 | }; |
| 1597 | |
| 1598 | struct platform_device msm8625_kgsl_3d0 = { |
| 1599 | .name = "kgsl-3d0", |
| 1600 | .id = 0, |
| 1601 | .num_resources = ARRAY_SIZE(msm8625_kgsl_3d0_resources), |
| 1602 | .resource = msm8625_kgsl_3d0_resources, |
| 1603 | .dev = { |
| 1604 | .platform_data = &kgsl_3d0_pdata, |
| 1605 | }, |
| 1606 | }; |
| 1607 | |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1608 | enum { |
| 1609 | MSM8625, |
| 1610 | MSM8625A, |
| 1611 | MSM8625AB, |
| 1612 | }; |
| 1613 | |
| 1614 | static int __init msm8625_cpu_id(void) |
| 1615 | { |
| 1616 | int raw_id, cpu; |
| 1617 | |
| 1618 | raw_id = socinfo_get_raw_id(); |
| 1619 | switch (raw_id) { |
| 1620 | /* Part number for 1GHz part */ |
| 1621 | case 0x770: |
| 1622 | case 0x771: |
| 1623 | case 0x77C: |
| 1624 | case 0x780: |
| 1625 | case 0x8D0: |
| 1626 | cpu = MSM8625; |
| 1627 | break; |
| 1628 | /* Part number for 1.2GHz part */ |
| 1629 | case 0x773: |
| 1630 | case 0x774: |
| 1631 | case 0x781: |
| 1632 | case 0x8D1: |
| 1633 | cpu = MSM8625A; |
| 1634 | break; |
| 1635 | case 0x775: |
| 1636 | case 0x776: |
Kaushal Kumar | 5b700f3 | 2012-09-05 16:50:19 +0530 | [diff] [blame] | 1637 | case 0x779: |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1638 | case 0x77D: |
| 1639 | case 0x782: |
| 1640 | case 0x8D2: |
| 1641 | cpu = MSM8625AB; |
| 1642 | break; |
| 1643 | default: |
| 1644 | pr_err("Invalid Raw ID\n"); |
| 1645 | return -ENODEV; |
| 1646 | } |
| 1647 | return cpu; |
| 1648 | } |
| 1649 | |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1650 | static struct resource cpr_resources[] = { |
| 1651 | { |
| 1652 | .start = MSM8625_INT_CPR_IRQ0, |
| 1653 | .flags = IORESOURCE_IRQ, |
| 1654 | }, |
| 1655 | { |
| 1656 | .start = MSM8625_CPR_PHYS, |
| 1657 | .end = MSM8625_CPR_PHYS + SZ_4K - 1, |
| 1658 | .flags = IORESOURCE_MEM, |
| 1659 | }, |
| 1660 | }; |
| 1661 | |
| 1662 | /** |
| 1663 | * These are various Vdd levels supported by PMIC |
| 1664 | */ |
| 1665 | static uint32_t msm_c2_pmic_mv[] __initdata = { |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1666 | 1300000, 1287500, 1275000, 1262500, 1250000, |
| 1667 | 1237500, 1225000, 1212500, 1200000, 1187500, |
| 1668 | 1175000, 1162500, 1150000, 1137500, 1125000, |
| 1669 | 1112500, 1100000, 1087500, 1075000, 1062500, |
| 1670 | 1050000, 1037500, 1025000, 1012500, 0, 0, 0, |
| 1671 | 0, 0, 0, 0, 1000, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1672 | }; |
| 1673 | |
| 1674 | /** |
| 1675 | * This data will be based on CPR mode of operation |
| 1676 | */ |
| 1677 | static struct msm_cpr_mode msm_cpr_mode_data[] = { |
| 1678 | [NORMAL_MODE] = { |
| 1679 | .ring_osc_data = { |
| 1680 | {0, }, |
| 1681 | {0, }, |
| 1682 | {0, }, |
| 1683 | {0, }, |
| 1684 | {0, }, |
| 1685 | {0, }, |
| 1686 | {0, }, |
| 1687 | {0, }, |
| 1688 | }, |
| 1689 | .ring_osc = 0, |
| 1690 | .step_quot = ~0, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1691 | .tgt_volt_offset = 0, |
Trilok Soni | db64ae9 | 2012-09-02 02:09:04 +0530 | [diff] [blame] | 1692 | .nom_Vmax = 1350000, |
| 1693 | .nom_Vmin = 1250000, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1694 | .calibrated_uV = 1100000, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1695 | }, |
| 1696 | [TURBO_MODE] = { |
| 1697 | .ring_osc_data = { |
| 1698 | {0, }, |
| 1699 | {0, }, |
| 1700 | {0, }, |
| 1701 | {0, }, |
| 1702 | {0, }, |
| 1703 | {0, }, |
| 1704 | {0, }, |
| 1705 | {0, }, |
| 1706 | }, |
| 1707 | .ring_osc = 0, |
| 1708 | .step_quot = ~0, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1709 | .tgt_volt_offset = 0, |
Trilok Soni | db64ae9 | 2012-09-02 02:09:04 +0530 | [diff] [blame] | 1710 | .turbo_Vmax = 1350000, |
Kaushal Kumar | ddd521c | 2012-09-18 19:50:53 +0530 | [diff] [blame^] | 1711 | .turbo_Vmin = 1200000, |
Trilok Soni | db64ae9 | 2012-09-02 02:09:04 +0530 | [diff] [blame] | 1712 | .nom_Vmax = 1350000, |
Kaushal Kumar | ddd521c | 2012-09-18 19:50:53 +0530 | [diff] [blame^] | 1713 | .nom_Vmin = 1050000, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1714 | .calibrated_uV = 1300000, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1715 | }, |
| 1716 | }; |
| 1717 | |
| 1718 | struct msm_cpr_vp_data vp_data = { |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1719 | .min_volt = 1000000, |
| 1720 | .max_volt = 1350000, |
| 1721 | .default_volt = 1300000, |
| 1722 | .step_size = 12500, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1723 | }; |
| 1724 | |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1725 | static uint32_t |
| 1726 | msm_cpr_get_quot(uint32_t max_quot, uint32_t max_freq, uint32_t new_freq) |
| 1727 | { |
| 1728 | uint32_t quot; |
| 1729 | |
| 1730 | /* This formula is as per chip characterization data */ |
Kaushal Kumar | ddd521c | 2012-09-18 19:50:53 +0530 | [diff] [blame^] | 1731 | quot = max_quot - (((max_freq - new_freq) * 7) / 10); |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1732 | |
| 1733 | return quot; |
| 1734 | } |
| 1735 | |
| 1736 | static void msm_cpr_clk_enable(void) |
| 1737 | { |
| 1738 | uint32_t reg_val; |
| 1739 | |
| 1740 | /* Select TCXO (19.2MHz) as clock source */ |
| 1741 | reg_val = readl_relaxed(A11S_TEST_BUS_SEL_ADDR); |
| 1742 | reg_val |= RBCPR_CLK_MUX_SEL; |
| 1743 | writel_relaxed(reg_val, A11S_TEST_BUS_SEL_ADDR); |
| 1744 | |
| 1745 | /* Get CPR out of reset */ |
| 1746 | writel_relaxed(0x1, RBCPR_SW_RESET_N); |
| 1747 | } |
| 1748 | |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1749 | static struct msm_cpr_config msm_cpr_pdata = { |
| 1750 | .ref_clk_khz = 19200, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1751 | .delay_us = 25000, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1752 | .irq_line = 0, |
| 1753 | .cpr_mode_data = msm_cpr_mode_data, |
| 1754 | .tgt_count_div_N = 1, |
| 1755 | .floor = 0, |
| 1756 | .ceiling = 40, |
| 1757 | .sw_vlevel = 20, |
| 1758 | .up_threshold = 1, |
Kaushal Kumar | 210c2f3 | 2012-09-18 19:42:05 +0530 | [diff] [blame] | 1759 | .dn_threshold = 3, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1760 | .up_margin = 0, |
| 1761 | .dn_margin = 0, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1762 | .max_nom_freq = 700800, |
| 1763 | .max_freq = 1401600, |
| 1764 | .max_quot = 0, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1765 | .vp_data = &vp_data, |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1766 | .get_quot = msm_cpr_get_quot, |
| 1767 | .clk_enable = msm_cpr_clk_enable, |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1768 | }; |
| 1769 | |
| 1770 | static struct platform_device msm8625_device_cpr = { |
| 1771 | .name = "msm-cpr", |
| 1772 | .id = -1, |
| 1773 | .num_resources = ARRAY_SIZE(cpr_resources), |
| 1774 | .resource = cpr_resources, |
| 1775 | .dev = { |
| 1776 | .platform_data = &msm_cpr_pdata, |
| 1777 | }, |
| 1778 | }; |
| 1779 | |
| 1780 | static struct platform_device msm8625_vp_device = { |
| 1781 | .name = "vp-regulator", |
| 1782 | .id = -1, |
| 1783 | }; |
| 1784 | |
| 1785 | static void __init msm_cpr_init(void) |
| 1786 | { |
| 1787 | struct cpr_info_type *cpr_info = NULL; |
| 1788 | uint8_t ring_osc = 0; |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1789 | |
| 1790 | cpr_info = kzalloc(sizeof(struct cpr_info_type), GFP_KERNEL); |
| 1791 | if (!cpr_info) { |
| 1792 | pr_err("%s: Out of memory %d\n", __func__, -ENOMEM); |
| 1793 | return; |
| 1794 | } |
| 1795 | |
| 1796 | msm_smem_get_cpr_info(cpr_info); |
| 1797 | |
| 1798 | /** |
| 1799 | * Set the ring_osc based on efuse BIT(0) |
| 1800 | * CPR_fuse[0] = 0 selects 2nd RO (010) |
| 1801 | * CPR_fuse[0] = 1 select 3rd RO (011) |
| 1802 | */ |
| 1803 | if (cpr_info->ring_osc == 0x0) |
| 1804 | ring_osc = 0x2; |
| 1805 | else if (cpr_info->ring_osc == 0x1) |
| 1806 | ring_osc = 0x3; |
| 1807 | |
| 1808 | msm_cpr_mode_data[TURBO_MODE].ring_osc = ring_osc; |
| 1809 | msm_cpr_mode_data[NORMAL_MODE].ring_osc = ring_osc; |
| 1810 | |
| 1811 | /* GCNT = 1000 nsec/52nsec (@TCX0=19.2Mhz) = 19.2 */ |
| 1812 | msm_cpr_mode_data[TURBO_MODE].ring_osc_data[ring_osc].gcnt = 19; |
| 1813 | msm_cpr_mode_data[NORMAL_MODE].ring_osc_data[ring_osc].gcnt = 19; |
| 1814 | |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1815 | /** |
| 1816 | * The scaling factor and offset are as per chip characterization data |
| 1817 | * This formula is used since available fuse bits in the chip are not |
| 1818 | * enough to represent the value of maximum quot |
| 1819 | */ |
Trilok Soni | 7f31117 | 2012-09-02 15:15:33 +0530 | [diff] [blame] | 1820 | msm_cpr_pdata.max_quot = cpr_info->turbo_quot * 10 + 600; |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1821 | |
| 1822 | /** |
| 1823 | * Bits 4:0 of pvs_fuse provide mapping to the safe boot up voltage. |
| 1824 | * Boot up mode is by default Turbo. |
| 1825 | */ |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1826 | msm_cpr_mode_data[TURBO_MODE].calibrated_uV = |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1827 | msm_c2_pmic_mv[cpr_info->pvs_fuse & 0x1F]; |
| 1828 | |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1829 | pr_debug("%s: cpr: ring_osc: 0x%x\n", __func__, |
| 1830 | msm_cpr_mode_data[TURBO_MODE].ring_osc); |
| 1831 | pr_debug("%s: cpr: turbo_quot: 0x%x\n", __func__, cpr_info->turbo_quot); |
| 1832 | pr_debug("%s: cpr: pvs_fuse: 0x%x\n", __func__, cpr_info->pvs_fuse); |
| 1833 | kfree(cpr_info); |
| 1834 | |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1835 | if (msm8625_cpu_id() == MSM8625A) |
| 1836 | msm_cpr_pdata.max_freq = 1209600; |
| 1837 | else if (msm8625_cpu_id() == MSM8625) |
| 1838 | msm_cpr_pdata.max_freq = 1008000; |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1839 | |
Kaushal Kumar | d0e4c81 | 2012-08-22 16:30:09 +0530 | [diff] [blame] | 1840 | msm_cpr_clk_enable(); |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1841 | |
| 1842 | platform_device_register(&msm8625_vp_device); |
| 1843 | platform_device_register(&msm8625_device_cpr); |
| 1844 | } |
| 1845 | |
Taniya Das | 7c9f051 | 2011-12-02 14:26:46 +0530 | [diff] [blame] | 1846 | static struct clk_lookup msm_clock_8625_dummy[] = { |
| 1847 | CLK_DUMMY("core_clk", adm_clk.c, "msm_dmov", 0), |
| 1848 | CLK_DUMMY("adsp_clk", adsp_clk.c, NULL, 0), |
| 1849 | CLK_DUMMY("ahb_m_clk", ahb_m_clk.c, NULL, 0), |
| 1850 | CLK_DUMMY("ahb_s_clk", ahb_s_clk.c, NULL, 0), |
| 1851 | CLK_DUMMY("cam_m_clk", cam_m_clk.c, NULL, 0), |
| 1852 | CLK_DUMMY("csi_clk", csi1_clk.c, NULL, 0), |
| 1853 | CLK_DUMMY("csi_pclk", csi1_p_clk.c, NULL, 0), |
| 1854 | CLK_DUMMY("csi_vfe_clk", csi1_vfe_clk.c, NULL, 0), |
| 1855 | CLK_DUMMY("dsi_byte_clk", dsi_byte_clk.c, NULL, 0), |
| 1856 | CLK_DUMMY("dsi_clk", dsi_clk.c, NULL, 0), |
| 1857 | CLK_DUMMY("dsi_esc_clk", dsi_esc_clk.c, NULL, 0), |
| 1858 | CLK_DUMMY("dsi_pixel_clk", dsi_pixel_clk.c, NULL, 0), |
| 1859 | CLK_DUMMY("dsi_ref_clk", dsi_ref_clk.c, NULL, 0), |
| 1860 | CLK_DUMMY("ebi1_clk", ebi1_clk.c, NULL, 0), |
| 1861 | CLK_DUMMY("ebi2_clk", ebi2_clk.c, NULL, 0), |
| 1862 | CLK_DUMMY("ecodec_clk", ecodec_clk.c, NULL, 0), |
| 1863 | CLK_DUMMY("gp_clk", gp_clk.c, NULL, 0), |
| 1864 | CLK_DUMMY("core_clk", gsbi1_qup_clk.c, "qup_i2c.0", 0), |
| 1865 | CLK_DUMMY("core_clk", gsbi2_qup_clk.c, "qup_i2c.1", 0), |
| 1866 | CLK_DUMMY("iface_clk", gsbi1_qup_p_clk.c, "qup_i2c.0", 0), |
| 1867 | CLK_DUMMY("iface_clk", gsbi2_qup_p_clk.c, "qup_i2c.1", 0), |
| 1868 | CLK_DUMMY("icodec_rx_clk", icodec_rx_clk.c, NULL, 0), |
| 1869 | CLK_DUMMY("icodec_tx_clk", icodec_tx_clk.c, NULL, 0), |
| 1870 | CLK_DUMMY("mem_clk", imem_clk.c, NULL, 0), |
| 1871 | CLK_DUMMY("mddi_clk", pmdh_clk.c, NULL, 0), |
| 1872 | CLK_DUMMY("mdp_clk", mdp_clk.c, NULL, 0), |
| 1873 | CLK_DUMMY("mdp_lcdc_pclk_clk", mdp_lcdc_pclk_clk.c, NULL, 0), |
| 1874 | CLK_DUMMY("mdp_lcdc_pad_pclk_clk", mdp_lcdc_pad_pclk_clk.c, NULL, 0), |
| 1875 | CLK_DUMMY("mdp_vsync_clk", mdp_vsync_clk.c, NULL, 0), |
| 1876 | CLK_DUMMY("mdp_dsi_pclk", mdp_dsi_p_clk.c, NULL, 0), |
| 1877 | CLK_DUMMY("pbus_clk", pbus_clk.c, NULL, 0), |
| 1878 | CLK_DUMMY("pcm_clk", pcm_clk.c, NULL, 0), |
| 1879 | CLK_DUMMY("sdac_clk", sdac_clk.c, NULL, 0), |
| 1880 | CLK_DUMMY("core_clk", sdc1_clk.c, "msm_sdcc.1", 0), |
| 1881 | CLK_DUMMY("iface_clk", sdc1_p_clk.c, "msm_sdcc.1", 0), |
| 1882 | CLK_DUMMY("core_clk", sdc2_clk.c, "msm_sdcc.2", 0), |
| 1883 | CLK_DUMMY("iface_clk", sdc2_p_clk.c, "msm_sdcc.2", 0), |
| 1884 | CLK_DUMMY("core_clk", sdc3_clk.c, "msm_sdcc.3", 0), |
| 1885 | CLK_DUMMY("iface_clk", sdc3_p_clk.c, "msm_sdcc.3", 0), |
| 1886 | CLK_DUMMY("core_clk", sdc4_clk.c, "msm_sdcc.4", 0), |
| 1887 | CLK_DUMMY("iface_clk", sdc4_p_clk.c, "msm_sdcc.4", 0), |
| 1888 | CLK_DUMMY("ref_clk", tsif_ref_clk.c, "msm_tsif.0", 0), |
| 1889 | CLK_DUMMY("iface_clk", tsif_p_clk.c, "msm_tsif.0", 0), |
| 1890 | CLK_DUMMY("core_clk", uart1_clk.c, "msm_serial.0", 0), |
| 1891 | CLK_DUMMY("core_clk", uart2_clk.c, "msm_serial.1", 0), |
| 1892 | CLK_DUMMY("core_clk", uart1dm_clk.c, "msm_serial_hs.0", 0), |
| 1893 | CLK_DUMMY("core_clk", uart2dm_clk.c, "msm_serial_hsl.0", 0), |
| 1894 | CLK_DUMMY("usb_hs_core_clk", usb_hs_core_clk.c, NULL, 0), |
| 1895 | CLK_DUMMY("usb_hs2_clk", usb_hs2_clk.c, NULL, 0), |
| 1896 | CLK_DUMMY("usb_hs_clk", usb_hs_clk.c, NULL, 0), |
| 1897 | CLK_DUMMY("usb_hs_pclk", usb_hs_p_clk.c, NULL, 0), |
| 1898 | CLK_DUMMY("usb_phy_clk", usb_phy_clk.c, NULL, 0), |
| 1899 | CLK_DUMMY("vdc_clk", vdc_clk.c, NULL, 0), |
| 1900 | CLK_DUMMY("ebi1_acpu_clk", ebi_acpu_clk.c, NULL, 0), |
| 1901 | CLK_DUMMY("ebi1_lcdc_clk", ebi_lcdc_clk.c, NULL, 0), |
| 1902 | CLK_DUMMY("ebi1_mddi_clk", ebi_mddi_clk.c, NULL, 0), |
| 1903 | CLK_DUMMY("ebi1_usb_clk", ebi_usb_clk.c, NULL, 0), |
| 1904 | CLK_DUMMY("ebi1_vfe_clk", ebi_vfe_clk.c, NULL, 0), |
| 1905 | CLK_DUMMY("mem_clk", ebi_adm_clk.c, "msm_dmov", 0), |
| 1906 | }; |
| 1907 | |
| 1908 | struct clock_init_data msm8625_dummy_clock_init_data __initdata = { |
| 1909 | .table = msm_clock_8625_dummy, |
| 1910 | .size = ARRAY_SIZE(msm_clock_8625_dummy), |
| 1911 | }; |
Pankaj Kumar | 50c705c | 2012-01-10 12:02:07 +0530 | [diff] [blame] | 1912 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1913 | int __init msm7x2x_misc_init(void) |
| 1914 | { |
Taniya Das | 7c9f051 | 2011-12-02 14:26:46 +0530 | [diff] [blame] | 1915 | if (machine_is_msm8625_rumi3()) { |
| 1916 | msm_clock_init(&msm8625_dummy_clock_init_data); |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1917 | msm_cpr_init(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1918 | return 0; |
Taniya Das | 7c9f051 | 2011-12-02 14:26:46 +0530 | [diff] [blame] | 1919 | } |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1920 | |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 1921 | msm_clock_init(&msm7x27a_clock_init_data); |
Pankaj Kumar | fee56a8 | 2012-04-17 14:26:49 +0530 | [diff] [blame] | 1922 | if (cpu_is_msm7x27aa() || cpu_is_msm7x25ab()) |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 1923 | platform_device_register(&msm7x27aa_device_acpuclk); |
Pankaj Kumar | 50c705c | 2012-01-10 12:02:07 +0530 | [diff] [blame] | 1924 | else if (cpu_is_msm8625()) { |
| 1925 | if (msm8625_cpu_id() == MSM8625) |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 1926 | platform_device_register(&msm7x27aa_device_acpuclk); |
Pankaj Kumar | 50c705c | 2012-01-10 12:02:07 +0530 | [diff] [blame] | 1927 | else if (msm8625_cpu_id() == MSM8625A) |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 1928 | platform_device_register(&msm8625_device_acpuclk); |
Kaushal Kumar | 86473f0 | 2012-06-28 19:35:58 +0530 | [diff] [blame] | 1929 | else if (msm8625_cpu_id() == MSM8625AB) |
| 1930 | platform_device_register(&msm8625ab_device_acpuclk); |
Matt Wagantall | bf430eb | 2012-03-22 11:45:49 -0700 | [diff] [blame] | 1931 | } else { |
| 1932 | platform_device_register(&msm7x27a_device_acpuclk); |
| 1933 | } |
Kaushal Kumar | c0e5d67 | 2012-07-31 16:07:49 +0530 | [diff] [blame] | 1934 | |
| 1935 | if (cpu_is_msm8625() && |
| 1936 | (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2)) |
| 1937 | msm_cpr_init(); |
| 1938 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1939 | return 0; |
| 1940 | } |
| 1941 | |
| 1942 | #ifdef CONFIG_CACHE_L2X0 |
| 1943 | static int __init msm7x27x_cache_init(void) |
| 1944 | { |
| 1945 | int aux_ctrl = 0; |
Prachee Ramsinghani | 86b1f65 | 2012-04-03 16:01:30 +0530 | [diff] [blame] | 1946 | int pctrl = 0; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1947 | |
| 1948 | /* Way Size 010(0x2) 32KB */ |
| 1949 | aux_ctrl = (0x1 << L2X0_AUX_CTRL_SHARE_OVERRIDE_SHIFT) | \ |
| 1950 | (0x2 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \ |
| 1951 | (0x1 << L2X0_AUX_CTRL_EVNT_MON_BUS_EN_SHIFT); |
| 1952 | |
Taniya Das | 379b568 | 2011-12-02 14:53:46 +0530 | [diff] [blame] | 1953 | if (cpu_is_msm8625()) { |
| 1954 | /* Way Size 011(0x3) 64KB */ |
| 1955 | aux_ctrl |= (0x3 << L2X0_AUX_CTRL_WAY_SIZE_SHIFT) | \ |
| 1956 | (0x1 << L2X0_AUX_CTRL_DATA_PREFETCH_SHIFT) | \ |
Prachee Ramsinghani | 86b1f65 | 2012-04-03 16:01:30 +0530 | [diff] [blame] | 1957 | (0X1 << L2X0_AUX_CTRL_INSTR_PREFETCH_SHIFT) | \ |
| 1958 | (0x1 << L2X0_AUX_CTRL_L2_FORCE_NWA_SHIFT); |
| 1959 | |
| 1960 | /* Write Prefetch Control settings */ |
| 1961 | pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL); |
| 1962 | pctrl |= (0x3 << L2X0_PREFETCH_CTRL_OFFSET_SHIFT) | \ |
| 1963 | (0x1 << L2X0_PREFETCH_CTRL_WRAP8_INC_SHIFT) | \ |
| 1964 | (0x1 << L2X0_PREFETCH_CTRL_WRAP8_SHIFT); |
| 1965 | writel_relaxed(pctrl , MSM_L2CC_BASE + L2X0_PREFETCH_CTRL); |
Taniya Das | 379b568 | 2011-12-02 14:53:46 +0530 | [diff] [blame] | 1966 | } |
| 1967 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1968 | l2x0_init(MSM_L2CC_BASE, aux_ctrl, L2X0_AUX_CTRL_MASK); |
Prachee Ramsinghani | 86b1f65 | 2012-04-03 16:01:30 +0530 | [diff] [blame] | 1969 | if (cpu_is_msm8625()) { |
| 1970 | pctrl = readl_relaxed(MSM_L2CC_BASE + L2X0_PREFETCH_CTRL); |
| 1971 | pr_info("Prfetch Ctrl: 0x%08x\n", pctrl); |
| 1972 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1973 | |
| 1974 | return 0; |
| 1975 | } |
| 1976 | #else |
pankaj kumar | 80d7cb6 | 2011-08-23 13:37:55 +0530 | [diff] [blame] | 1977 | static int __init msm7x27x_cache_init(void){ return 0; } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1978 | #endif |
| 1979 | |
| 1980 | void __init msm_common_io_init(void) |
| 1981 | { |
| 1982 | msm_map_common_io(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1983 | if (socinfo_init() < 0) |
| 1984 | pr_err("%s: socinfo_init() failed!\n", __func__); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1985 | msm7x27x_cache_init(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1986 | } |
| 1987 | |
| 1988 | void __init msm8625_init_irq(void) |
| 1989 | { |
Trilok Soni | 1a9fdee | 2012-05-28 19:54:11 +0530 | [diff] [blame] | 1990 | msm_gic_irq_extn_init(); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1991 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 1992 | (void *)MSM_QGIC_CPU_BASE); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 1993 | } |
| 1994 | |
| 1995 | void __init msm8625_map_io(void) |
| 1996 | { |
| 1997 | msm_map_msm8625_io(); |
| 1998 | |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1999 | if (socinfo_init() < 0) |
| 2000 | pr_err("%s: socinfo_init() failed!\n", __func__); |
Taniya Das | 379b568 | 2011-12-02 14:53:46 +0530 | [diff] [blame] | 2001 | msm7x27x_cache_init(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2002 | } |
| 2003 | |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 2004 | static int msm7627a_init_gpio(void) |
| 2005 | { |
Taniya Das | 6684d62 | 2012-01-12 10:29:09 +0530 | [diff] [blame] | 2006 | if (cpu_is_msm8625()) |
| 2007 | platform_device_register(&msm8625_device_gpio); |
| 2008 | else |
| 2009 | platform_device_register(&msm_device_gpio); |
Taniya Das | 43bcdd6 | 2011-12-02 17:33:27 +0530 | [diff] [blame] | 2010 | return 0; |
| 2011 | } |
| 2012 | postcore_initcall(msm7627a_init_gpio); |
Taniya Das | 9d0c3c5 | 2012-05-04 14:40:55 +0530 | [diff] [blame] | 2013 | |
| 2014 | static int msm7627a_panic_handler(struct notifier_block *this, |
| 2015 | unsigned long event, void *ptr) |
| 2016 | { |
| 2017 | flush_cache_all(); |
| 2018 | outer_flush_all(); |
| 2019 | return NOTIFY_DONE; |
| 2020 | } |
| 2021 | |
| 2022 | static struct notifier_block panic_handler = { |
| 2023 | .notifier_call = msm7627a_panic_handler, |
| 2024 | }; |
| 2025 | |
| 2026 | static int __init panic_register(void) |
| 2027 | { |
| 2028 | atomic_notifier_chain_register(&panic_notifier_list, |
| 2029 | &panic_handler); |
| 2030 | return 0; |
| 2031 | } |
| 2032 | module_init(panic_register); |