Manu Gautam | 5143b25 | 2012-01-05 19:25:23 -0800 | [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/io.h> |
| 16 | #include <linux/irq.h> |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 17 | #include <linux/i2c.h> |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 18 | #include <linux/slimbus/slimbus.h> |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 19 | #include <linux/mfd/wcd9310/core.h> |
| 20 | #include <linux/mfd/wcd9310/pdata.h> |
Kenneth Heitke | 36920d3 | 2011-07-20 16:44:30 -0600 | [diff] [blame] | 21 | #include <linux/msm_ssbi.h> |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 22 | #include <linux/spi/spi.h> |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 23 | #include <linux/dma-mapping.h> |
| 24 | #include <linux/platform_data/qcom_crypto_device.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 25 | #include <linux/ion.h> |
Jack Cheung | 46bfffa | 2012-01-19 15:26:24 -0800 | [diff] [blame] | 26 | #include <linux/memory.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | #include <asm/mach-types.h> |
| 28 | #include <asm/mach/arch.h> |
| 29 | #include <asm/hardware/gic.h> |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 30 | #include <asm/mach/mmc.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 31 | |
| 32 | #include <mach/board.h> |
| 33 | #include <mach/msm_iomap.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 34 | #include <mach/ion.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | #include <linux/usb/msm_hsusb.h> |
| 36 | #include <linux/usb/android.h> |
| 37 | #include <mach/socinfo.h> |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 38 | #include <mach/msm_spi.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 39 | #include "timer.h" |
| 40 | #include "devices.h" |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 41 | #include <mach/gpio.h> |
| 42 | #include <mach/gpiomux.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 43 | #include <mach/rpm.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 44 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 45 | #include <linux/android_pmem.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 46 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 47 | #include <mach/msm_memtypes.h> |
| 48 | #include <linux/bootmem.h> |
| 49 | #include <asm/setup.h> |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 50 | #include <mach/dma.h> |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 51 | #include <mach/msm_bus_board.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 52 | #include <mach/cpuidle.h> |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 53 | #include <mach/mdm2.h> |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 54 | |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 55 | #include "msm_watchdog.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 56 | #include "board-8064.h" |
Vikram Mulukutla | bc2e957 | 2011-11-04 03:41:38 -0700 | [diff] [blame] | 57 | #include "acpuclock.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 58 | #include "spm.h" |
| 59 | #include "mpm.h" |
| 60 | #include "rpm_resources.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 61 | #include "pm.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 62 | #include "pm-boot.h" |
Rajesh Sastrula | aee8af3 | 2012-01-20 11:46:31 -0800 | [diff] [blame] | 63 | #include "devices-msm8x60.h" |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 64 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 65 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Ben Romberger | 3ffcd81 | 2011-12-08 19:12:10 -0800 | [diff] [blame] | 66 | #define MSM_PMEM_AUDIO_SIZE 0x2B4000 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 67 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 68 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 69 | #else |
| 70 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
| 71 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 72 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 73 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Olav Haugan | edcf683 | 2012-01-24 08:35:41 -0800 | [diff] [blame] | 74 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x280000 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 75 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 76 | #define MSM_ION_MM_FW_SIZE 0x200000 /* (2MB) */ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 77 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
Olav Haugan | f45e214 | 2012-01-19 11:01:01 -0800 | [diff] [blame] | 78 | #define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */ |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 79 | #define MSM_ION_MFC_SIZE SZ_8K |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 80 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
| 81 | #define MSM_ION_HEAP_NUM 8 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 82 | #else |
| 83 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
| 84 | #define MSM_ION_HEAP_NUM 1 |
| 85 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 86 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 87 | #ifdef CONFIG_KERNEL_PMEM_EBI_REGION |
| 88 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 89 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 90 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 91 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 92 | return 0; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 93 | } |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 94 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 95 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 96 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 97 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 98 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 99 | static int __init pmem_size_setup(char *p) |
| 100 | { |
| 101 | pmem_size = memparse(p, NULL); |
| 102 | return 0; |
| 103 | } |
| 104 | early_param("pmem_size", pmem_size_setup); |
| 105 | |
| 106 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 107 | |
| 108 | static int __init pmem_adsp_size_setup(char *p) |
| 109 | { |
| 110 | pmem_adsp_size = memparse(p, NULL); |
| 111 | return 0; |
| 112 | } |
| 113 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 114 | |
| 115 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 116 | |
| 117 | static int __init pmem_audio_size_setup(char *p) |
| 118 | { |
| 119 | pmem_audio_size = memparse(p, NULL); |
| 120 | return 0; |
| 121 | } |
| 122 | early_param("pmem_audio_size", pmem_audio_size_setup); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 123 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 124 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 125 | #ifdef CONFIG_ANDROID_PMEM |
| 126 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 127 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 128 | .name = "pmem", |
| 129 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 130 | .cached = 1, |
| 131 | .memory_type = MEMTYPE_EBI1, |
| 132 | }; |
| 133 | |
| 134 | static struct platform_device android_pmem_device = { |
| 135 | .name = "android_pmem", |
| 136 | .id = 0, |
| 137 | .dev = {.platform_data = &android_pmem_pdata}, |
| 138 | }; |
| 139 | |
| 140 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 141 | .name = "pmem_adsp", |
| 142 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 143 | .cached = 0, |
| 144 | .memory_type = MEMTYPE_EBI1, |
| 145 | }; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 146 | static struct platform_device android_pmem_adsp_device = { |
| 147 | .name = "android_pmem", |
| 148 | .id = 2, |
| 149 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 150 | }; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 151 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 152 | |
| 153 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 154 | .name = "pmem_audio", |
| 155 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 156 | .cached = 0, |
| 157 | .memory_type = MEMTYPE_EBI1, |
| 158 | }; |
| 159 | |
| 160 | static struct platform_device android_pmem_audio_device = { |
| 161 | .name = "android_pmem", |
| 162 | .id = 4, |
| 163 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 164 | }; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 165 | #endif |
| 166 | |
| 167 | static struct memtype_reserve apq8064_reserve_table[] __initdata = { |
| 168 | [MEMTYPE_SMI] = { |
| 169 | }, |
| 170 | [MEMTYPE_EBI0] = { |
| 171 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 172 | }, |
| 173 | [MEMTYPE_EBI1] = { |
| 174 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 175 | }, |
| 176 | }; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 177 | |
| 178 | static void __init size_pmem_devices(void) |
| 179 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 180 | #ifdef CONFIG_ANDROID_PMEM |
| 181 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 182 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 183 | android_pmem_pdata.size = pmem_size; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 184 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 185 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 186 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 190 | { |
| 191 | apq8064_reserve_table[p->memory_type].size += p->size; |
| 192 | } |
| 193 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 194 | static void __init reserve_pmem_memory(void) |
| 195 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 196 | #ifdef CONFIG_ANDROID_PMEM |
| 197 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 198 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 199 | reserve_memory_for(&android_pmem_pdata); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 200 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 201 | reserve_memory_for(&android_pmem_audio_pdata); |
| 202 | apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 203 | #endif |
| 204 | } |
| 205 | |
| 206 | static int apq8064_paddr_to_memtype(unsigned int paddr) |
| 207 | { |
| 208 | return MEMTYPE_EBI1; |
| 209 | } |
| 210 | |
| 211 | #ifdef CONFIG_ION_MSM |
| 212 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 213 | static struct ion_cp_heap_pdata cp_mm_ion_pdata = { |
| 214 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 215 | .align = PAGE_SIZE, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | static struct ion_cp_heap_pdata cp_mfc_ion_pdata = { |
| 219 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 220 | .align = PAGE_SIZE, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 221 | }; |
| 222 | |
| 223 | static struct ion_co_heap_pdata co_ion_pdata = { |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 224 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 225 | .align = PAGE_SIZE, |
| 226 | }; |
| 227 | |
| 228 | static struct ion_co_heap_pdata fw_co_ion_pdata = { |
| 229 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 230 | .align = SZ_128K, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 231 | }; |
| 232 | #endif |
| 233 | static struct ion_platform_data ion_pdata = { |
| 234 | .nr = MSM_ION_HEAP_NUM, |
| 235 | .heaps = { |
| 236 | { |
| 237 | .id = ION_SYSTEM_HEAP_ID, |
| 238 | .type = ION_HEAP_TYPE_SYSTEM, |
| 239 | .name = ION_VMALLOC_HEAP_NAME, |
| 240 | }, |
| 241 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 242 | { |
| 243 | .id = ION_SF_HEAP_ID, |
| 244 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 245 | .name = ION_SF_HEAP_NAME, |
| 246 | .size = MSM_ION_SF_SIZE, |
| 247 | .memory_type = ION_EBI_TYPE, |
| 248 | .extra_data = (void *) &co_ion_pdata, |
| 249 | }, |
| 250 | { |
| 251 | .id = ION_CP_MM_HEAP_ID, |
| 252 | .type = ION_HEAP_TYPE_CP, |
| 253 | .name = ION_MM_HEAP_NAME, |
| 254 | .size = MSM_ION_MM_SIZE, |
| 255 | .memory_type = ION_EBI_TYPE, |
| 256 | .extra_data = (void *) &cp_mm_ion_pdata, |
| 257 | }, |
| 258 | { |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 259 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 260 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 261 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 262 | .size = MSM_ION_MM_FW_SIZE, |
| 263 | .memory_type = ION_EBI_TYPE, |
| 264 | .extra_data = (void *) &fw_co_ion_pdata, |
| 265 | }, |
| 266 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 267 | .id = ION_CP_MFC_HEAP_ID, |
| 268 | .type = ION_HEAP_TYPE_CP, |
| 269 | .name = ION_MFC_HEAP_NAME, |
| 270 | .size = MSM_ION_MFC_SIZE, |
| 271 | .memory_type = ION_EBI_TYPE, |
| 272 | .extra_data = (void *) &cp_mfc_ion_pdata, |
| 273 | }, |
| 274 | { |
| 275 | .id = ION_IOMMU_HEAP_ID, |
| 276 | .type = ION_HEAP_TYPE_IOMMU, |
| 277 | .name = ION_IOMMU_HEAP_NAME, |
| 278 | }, |
Olav Haugan | f45e214 | 2012-01-19 11:01:01 -0800 | [diff] [blame] | 279 | { |
| 280 | .id = ION_QSECOM_HEAP_ID, |
| 281 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 282 | .name = ION_QSECOM_HEAP_NAME, |
| 283 | .size = MSM_ION_QSECOM_SIZE, |
| 284 | .memory_type = ION_EBI_TYPE, |
| 285 | .extra_data = (void *) &co_ion_pdata, |
| 286 | }, |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 287 | { |
| 288 | .id = ION_AUDIO_HEAP_ID, |
| 289 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 290 | .name = ION_AUDIO_HEAP_NAME, |
| 291 | .size = MSM_ION_AUDIO_SIZE, |
| 292 | .memory_type = ION_EBI_TYPE, |
| 293 | .extra_data = (void *) &co_ion_pdata, |
| 294 | }, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 295 | #endif |
| 296 | } |
| 297 | }; |
| 298 | |
| 299 | static struct platform_device ion_dev = { |
| 300 | .name = "ion-msm", |
| 301 | .id = 1, |
| 302 | .dev = { .platform_data = &ion_pdata }, |
| 303 | }; |
| 304 | #endif |
| 305 | |
| 306 | static void reserve_ion_memory(void) |
| 307 | { |
| 308 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 309 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE; |
Olav Haugan | d3d2968 | 2012-01-19 10:57:07 -0800 | [diff] [blame] | 310 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 311 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE; |
| 312 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE; |
Olav Haugan | f45e214 | 2012-01-19 11:01:01 -0800 | [diff] [blame] | 313 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE; |
Olav Haugan | 2c43fac | 2012-01-19 11:06:37 -0800 | [diff] [blame] | 314 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 315 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 316 | } |
| 317 | |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 318 | static void __init reserve_mdp_memory(void) |
| 319 | { |
| 320 | apq8064_mdp_writeback(apq8064_reserve_table); |
| 321 | } |
| 322 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 323 | static void __init apq8064_calculate_reserve_sizes(void) |
| 324 | { |
| 325 | size_pmem_devices(); |
| 326 | reserve_pmem_memory(); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 327 | reserve_ion_memory(); |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 328 | reserve_mdp_memory(); |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | static struct reserve_info apq8064_reserve_info __initdata = { |
| 332 | .memtype_reserve_table = apq8064_reserve_table, |
| 333 | .calculate_reserve_sizes = apq8064_calculate_reserve_sizes, |
| 334 | .paddr_to_memtype = apq8064_paddr_to_memtype, |
| 335 | }; |
| 336 | |
| 337 | static int apq8064_memory_bank_size(void) |
| 338 | { |
| 339 | return 1<<29; |
| 340 | } |
| 341 | |
| 342 | static void __init locate_unstable_memory(void) |
| 343 | { |
| 344 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 345 | unsigned long bank_size; |
| 346 | unsigned long low, high; |
| 347 | |
| 348 | bank_size = apq8064_memory_bank_size(); |
| 349 | low = meminfo.bank[0].start; |
| 350 | high = mb->start + mb->size; |
Olav Haugan | d76e3a8 | 2012-01-16 16:55:07 -0800 | [diff] [blame] | 351 | |
| 352 | /* Check if 32 bit overflow occured */ |
| 353 | if (high < mb->start) |
| 354 | high = ~0UL; |
| 355 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 356 | low &= ~(bank_size - 1); |
| 357 | |
| 358 | if (high - low <= bank_size) |
| 359 | return; |
Jack Cheung | 46bfffa | 2012-01-19 15:26:24 -0800 | [diff] [blame] | 360 | apq8064_reserve_info.low_unstable_address = mb->start - |
| 361 | MIN_MEMORY_BLOCK_SIZE + mb->size; |
| 362 | apq8064_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
| 363 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 364 | apq8064_reserve_info.bank_size = bank_size; |
| 365 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 366 | apq8064_reserve_info.low_unstable_address, |
| 367 | apq8064_reserve_info.max_unstable_size, |
| 368 | apq8064_reserve_info.bank_size); |
| 369 | } |
| 370 | |
| 371 | static void __init apq8064_reserve(void) |
| 372 | { |
| 373 | reserve_info = &apq8064_reserve_info; |
| 374 | locate_unstable_memory(); |
| 375 | msm_reserve(); |
| 376 | } |
| 377 | |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame^] | 378 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 379 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 380 | .strobe = 88, |
| 381 | .data = 89, |
| 382 | }; |
| 383 | #else |
| 384 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
| 385 | #endif |
| 386 | |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 387 | static struct platform_device android_usb_device = { |
| 388 | .name = "android_usb", |
| 389 | .id = -1, |
| 390 | }; |
| 391 | |
| 392 | static struct msm_otg_platform_data msm_otg_pdata = { |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 393 | .mode = USB_OTG, |
| 394 | .otg_control = OTG_PMIC_CONTROL, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 395 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 396 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
| 397 | .power_budget = 750, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 398 | }; |
| 399 | |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 400 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 401 | |
| 402 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 403 | * 4 micbiases are used to power various analog and digital |
| 404 | * microphones operating at 1800 mV. Technically, all micbiases |
| 405 | * can source from single cfilter since all microphones operate |
| 406 | * at the same voltage level. The arrangement below is to make |
| 407 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 408 | * does not need to be as high as 2.85V. It is choosen for |
| 409 | * microphone sensitivity purpose. |
| 410 | */ |
| 411 | static struct tabla_pdata apq8064_tabla_platform_data = { |
| 412 | .slimbus_slave_device = { |
| 413 | .name = "tabla-slave", |
| 414 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 415 | }, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 416 | .irq = MSM_GPIO_TO_INT(42), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 417 | .irq_base = TABLA_INTERRUPT_BASE, |
| 418 | .num_irqs = NR_TABLA_IRQS, |
| 419 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 420 | .micbias = { |
| 421 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 422 | .cfilt1_mv = 1800, |
| 423 | .cfilt2_mv = 1800, |
| 424 | .cfilt3_mv = 1800, |
| 425 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 426 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 427 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 428 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 429 | } |
| 430 | }; |
| 431 | |
| 432 | static struct slim_device apq8064_slim_tabla = { |
| 433 | .name = "tabla-slim", |
| 434 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 435 | .dev = { |
| 436 | .platform_data = &apq8064_tabla_platform_data, |
| 437 | }, |
| 438 | }; |
| 439 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 440 | static struct tabla_pdata apq8064_tabla20_platform_data = { |
| 441 | .slimbus_slave_device = { |
| 442 | .name = "tabla-slave", |
| 443 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 444 | }, |
| 445 | .irq = MSM_GPIO_TO_INT(42), |
| 446 | .irq_base = TABLA_INTERRUPT_BASE, |
| 447 | .num_irqs = NR_TABLA_IRQS, |
| 448 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 449 | .micbias = { |
| 450 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 451 | .cfilt1_mv = 1800, |
| 452 | .cfilt2_mv = 1800, |
| 453 | .cfilt3_mv = 1800, |
| 454 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 455 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 456 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 457 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 458 | } |
| 459 | }; |
| 460 | |
| 461 | static struct slim_device apq8064_slim_tabla20 = { |
| 462 | .name = "tabla2x-slim", |
| 463 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 464 | .dev = { |
| 465 | .platform_data = &apq8064_tabla20_platform_data, |
| 466 | }, |
| 467 | }; |
| 468 | |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 469 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 470 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 471 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 472 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 473 | |
| 474 | #define QCE_SIZE 0x10000 |
| 475 | #define QCE_0_BASE 0x11000000 |
| 476 | |
| 477 | #define QCE_HW_KEY_SUPPORT 0 |
| 478 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 479 | #define QCE_SHARE_CE_RESOURCE 3 |
| 480 | #define QCE_CE_SHARED 0 |
| 481 | |
| 482 | static struct resource qcrypto_resources[] = { |
| 483 | [0] = { |
| 484 | .start = QCE_0_BASE, |
| 485 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 486 | .flags = IORESOURCE_MEM, |
| 487 | }, |
| 488 | [1] = { |
| 489 | .name = "crypto_channels", |
| 490 | .start = DMOV8064_CE_IN_CHAN, |
| 491 | .end = DMOV8064_CE_OUT_CHAN, |
| 492 | .flags = IORESOURCE_DMA, |
| 493 | }, |
| 494 | [2] = { |
| 495 | .name = "crypto_crci_in", |
| 496 | .start = DMOV8064_CE_IN_CRCI, |
| 497 | .end = DMOV8064_CE_IN_CRCI, |
| 498 | .flags = IORESOURCE_DMA, |
| 499 | }, |
| 500 | [3] = { |
| 501 | .name = "crypto_crci_out", |
| 502 | .start = DMOV8064_CE_OUT_CRCI, |
| 503 | .end = DMOV8064_CE_OUT_CRCI, |
| 504 | .flags = IORESOURCE_DMA, |
| 505 | }, |
| 506 | }; |
| 507 | |
| 508 | static struct resource qcedev_resources[] = { |
| 509 | [0] = { |
| 510 | .start = QCE_0_BASE, |
| 511 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 512 | .flags = IORESOURCE_MEM, |
| 513 | }, |
| 514 | [1] = { |
| 515 | .name = "crypto_channels", |
| 516 | .start = DMOV8064_CE_IN_CHAN, |
| 517 | .end = DMOV8064_CE_OUT_CHAN, |
| 518 | .flags = IORESOURCE_DMA, |
| 519 | }, |
| 520 | [2] = { |
| 521 | .name = "crypto_crci_in", |
| 522 | .start = DMOV8064_CE_IN_CRCI, |
| 523 | .end = DMOV8064_CE_IN_CRCI, |
| 524 | .flags = IORESOURCE_DMA, |
| 525 | }, |
| 526 | [3] = { |
| 527 | .name = "crypto_crci_out", |
| 528 | .start = DMOV8064_CE_OUT_CRCI, |
| 529 | .end = DMOV8064_CE_OUT_CRCI, |
| 530 | .flags = IORESOURCE_DMA, |
| 531 | }, |
| 532 | }; |
| 533 | |
| 534 | #endif |
| 535 | |
| 536 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 537 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 538 | |
| 539 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 540 | .ce_shared = QCE_CE_SHARED, |
| 541 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 542 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 543 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 544 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 545 | }; |
| 546 | |
| 547 | static struct platform_device qcrypto_device = { |
| 548 | .name = "qcrypto", |
| 549 | .id = 0, |
| 550 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 551 | .resource = qcrypto_resources, |
| 552 | .dev = { |
| 553 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 554 | .platform_data = &qcrypto_ce_hw_suppport, |
| 555 | }, |
| 556 | }; |
| 557 | #endif |
| 558 | |
| 559 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 560 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 561 | |
| 562 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 563 | .ce_shared = QCE_CE_SHARED, |
| 564 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 565 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 566 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 567 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 568 | }; |
| 569 | |
| 570 | static struct platform_device qcedev_device = { |
| 571 | .name = "qce", |
| 572 | .id = 0, |
| 573 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 574 | .resource = qcedev_resources, |
| 575 | .dev = { |
| 576 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 577 | .platform_data = &qcedev_ce_hw_suppport, |
| 578 | }, |
| 579 | }; |
| 580 | #endif |
| 581 | |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 582 | static struct mdm_platform_data mdm_platform_data = { |
| 583 | .mdm_version = "3.0", |
| 584 | .ramdump_delay_ms = 2000, |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame^] | 585 | .peripheral_platform_device = &apq8064_device_hsic_host, |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 586 | }; |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 587 | |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 588 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 589 | static void __init apq8064_map_io(void) |
| 590 | { |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 591 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 592 | msm_map_apq8064_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 593 | if (socinfo_init() < 0) |
| 594 | pr_err("socinfo_init() failed!\n"); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 595 | } |
| 596 | |
| 597 | static void __init apq8064_init_irq(void) |
| 598 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 599 | struct msm_mpm_device_data *data = NULL; |
| 600 | |
| 601 | #ifdef CONFIG_MSM_MPM |
| 602 | data = &apq8064_mpm_dev_data; |
| 603 | #endif |
| 604 | |
| 605 | msm_mpm_irq_extn_init(data); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 606 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 607 | (void *)MSM_QGIC_CPU_BASE); |
| 608 | |
| 609 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 610 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| 611 | |
| 612 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 613 | mb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 614 | } |
| 615 | |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 616 | static struct platform_device msm8064_device_saw_regulator_core0 = { |
| 617 | .name = "saw-regulator", |
| 618 | .id = 0, |
| 619 | .dev = { |
| 620 | .platform_data = &msm8064_saw_regulator_pdata_8921_s5, |
| 621 | }, |
| 622 | }; |
| 623 | |
| 624 | static struct platform_device msm8064_device_saw_regulator_core1 = { |
| 625 | .name = "saw-regulator", |
| 626 | .id = 1, |
| 627 | .dev = { |
| 628 | .platform_data = &msm8064_saw_regulator_pdata_8921_s6, |
| 629 | }, |
| 630 | }; |
| 631 | |
| 632 | static struct platform_device msm8064_device_saw_regulator_core2 = { |
| 633 | .name = "saw-regulator", |
| 634 | .id = 2, |
| 635 | .dev = { |
| 636 | .platform_data = &msm8064_saw_regulator_pdata_8821_s0, |
| 637 | }, |
| 638 | }; |
| 639 | |
| 640 | static struct platform_device msm8064_device_saw_regulator_core3 = { |
| 641 | .name = "saw-regulator", |
| 642 | .id = 3, |
| 643 | .dev = { |
| 644 | .platform_data = &msm8064_saw_regulator_pdata_8821_s1, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 645 | |
| 646 | }, |
| 647 | }; |
| 648 | |
| 649 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 650 | { |
| 651 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 652 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 653 | true, |
| 654 | 100, 8000, 100000, 1, |
| 655 | }, |
| 656 | |
| 657 | { |
| 658 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 659 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 660 | true, |
| 661 | 2000, 6000, 60100000, 3000, |
| 662 | }, |
| 663 | |
| 664 | { |
| 665 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 666 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 667 | false, |
| 668 | 4200, 5000, 60350000, 3500, |
| 669 | }, |
| 670 | |
| 671 | { |
| 672 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 673 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, MAX, ACTIVE), |
| 674 | false, |
| 675 | 6300, 4500, 65350000, 4800, |
| 676 | }, |
| 677 | |
| 678 | { |
| 679 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 680 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 681 | false, |
| 682 | 11700, 2500, 67850000, 5500, |
| 683 | }, |
| 684 | |
| 685 | { |
| 686 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 687 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 688 | false, |
| 689 | 13800, 2000, 71850000, 6800, |
| 690 | }, |
| 691 | |
| 692 | { |
| 693 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 694 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 695 | false, |
| 696 | 29700, 500, 75850000, 8800, |
| 697 | }, |
| 698 | |
| 699 | { |
| 700 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 701 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 702 | false, |
| 703 | 29700, 0, 76350000, 9800, |
| 704 | }, |
| 705 | }; |
| 706 | |
| 707 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 708 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 709 | }; |
| 710 | |
| 711 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 712 | .levels = &msm_rpmrs_levels[0], |
| 713 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 714 | .vdd_mem_levels = { |
| 715 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 716 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 717 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 718 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 719 | }, |
| 720 | .vdd_dig_levels = { |
| 721 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 722 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 723 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 724 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 725 | }, |
| 726 | .vdd_mask = 0x7FFFFF, |
| 727 | .rpmrs_target_id = { |
| 728 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 729 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 730 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0, |
| 731 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1, |
| 732 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0, |
| 733 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1, |
| 734 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 735 | }, |
| 736 | }; |
| 737 | |
| 738 | static struct msm_cpuidle_state msm_cstates[] __initdata = { |
| 739 | {0, 0, "C0", "WFI", |
| 740 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 741 | |
| 742 | {0, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 743 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 744 | |
| 745 | {0, 2, "C2", "POWER_COLLAPSE", |
| 746 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE}, |
| 747 | |
| 748 | {1, 0, "C0", "WFI", |
| 749 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 750 | |
| 751 | {1, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 752 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 753 | |
| 754 | {2, 0, "C0", "WFI", |
| 755 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 756 | |
| 757 | {2, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 758 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 759 | |
| 760 | {3, 0, "C0", "WFI", |
| 761 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT}, |
| 762 | |
| 763 | {3, 1, "C1", "STANDALONE_POWER_COLLAPSE", |
| 764 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE}, |
| 765 | }; |
| 766 | |
| 767 | static struct msm_pm_platform_data msm_pm_data[] = { |
| 768 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 769 | .idle_supported = 1, |
| 770 | .suspend_supported = 1, |
| 771 | .idle_enabled = 0, |
| 772 | .suspend_enabled = 0, |
| 773 | }, |
| 774 | |
| 775 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 776 | .idle_supported = 1, |
| 777 | .suspend_supported = 1, |
| 778 | .idle_enabled = 0, |
| 779 | .suspend_enabled = 0, |
| 780 | }, |
| 781 | |
| 782 | [MSM_PM_MODE(0, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 783 | .idle_supported = 1, |
| 784 | .suspend_supported = 1, |
| 785 | .idle_enabled = 1, |
| 786 | .suspend_enabled = 1, |
| 787 | }, |
| 788 | |
| 789 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 790 | .idle_supported = 0, |
| 791 | .suspend_supported = 1, |
| 792 | .idle_enabled = 0, |
| 793 | .suspend_enabled = 0, |
| 794 | }, |
| 795 | |
| 796 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 797 | .idle_supported = 1, |
| 798 | .suspend_supported = 1, |
| 799 | .idle_enabled = 0, |
| 800 | .suspend_enabled = 0, |
| 801 | }, |
| 802 | |
| 803 | [MSM_PM_MODE(1, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 804 | .idle_supported = 1, |
| 805 | .suspend_supported = 0, |
| 806 | .idle_enabled = 1, |
| 807 | .suspend_enabled = 0, |
| 808 | }, |
| 809 | |
| 810 | [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 811 | .idle_supported = 0, |
| 812 | .suspend_supported = 1, |
| 813 | .idle_enabled = 0, |
| 814 | .suspend_enabled = 0, |
| 815 | }, |
| 816 | |
| 817 | [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 818 | .idle_supported = 1, |
| 819 | .suspend_supported = 1, |
| 820 | .idle_enabled = 0, |
| 821 | .suspend_enabled = 0, |
| 822 | }, |
| 823 | |
| 824 | [MSM_PM_MODE(2, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 825 | .idle_supported = 1, |
| 826 | .suspend_supported = 0, |
| 827 | .idle_enabled = 1, |
| 828 | .suspend_enabled = 0, |
| 829 | }, |
| 830 | |
| 831 | [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE)] = { |
| 832 | .idle_supported = 0, |
| 833 | .suspend_supported = 1, |
| 834 | .idle_enabled = 0, |
| 835 | .suspend_enabled = 0, |
| 836 | }, |
| 837 | |
| 838 | [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE)] = { |
| 839 | .idle_supported = 1, |
| 840 | .suspend_supported = 1, |
| 841 | .idle_enabled = 0, |
| 842 | .suspend_enabled = 0, |
| 843 | }, |
| 844 | |
| 845 | [MSM_PM_MODE(3, MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT)] = { |
| 846 | .idle_supported = 1, |
| 847 | .suspend_supported = 0, |
| 848 | .idle_enabled = 1, |
| 849 | .suspend_enabled = 0, |
| 850 | }, |
| 851 | }; |
| 852 | |
| 853 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
| 854 | 0x03, 0x0f, |
| 855 | }; |
| 856 | |
| 857 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
| 858 | 0x00, 0x24, 0x54, 0x10, |
| 859 | 0x09, 0x03, 0x01, |
| 860 | 0x10, 0x54, 0x30, 0x0C, |
| 861 | 0x24, 0x30, 0x0f, |
| 862 | }; |
| 863 | |
| 864 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
| 865 | 0x00, 0x24, 0x54, 0x10, |
| 866 | 0x09, 0x07, 0x01, 0x0B, |
| 867 | 0x10, 0x54, 0x30, 0x0C, |
| 868 | 0x24, 0x30, 0x0f, |
| 869 | }; |
| 870 | |
| 871 | static struct msm_spm_seq_entry msm_spm_seq_list[] __initdata = { |
| 872 | [0] = { |
| 873 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 874 | .notify_rpm = false, |
| 875 | .cmd = spm_wfi_cmd_sequence, |
| 876 | }, |
| 877 | [1] = { |
| 878 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 879 | .notify_rpm = false, |
| 880 | .cmd = spm_power_collapse_without_rpm, |
| 881 | }, |
| 882 | [2] = { |
| 883 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 884 | .notify_rpm = true, |
| 885 | .cmd = spm_power_collapse_with_rpm, |
| 886 | }, |
| 887 | }; |
| 888 | |
| 889 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 890 | 0x00, 0x20, 0x03, 0x20, |
| 891 | 0x00, 0x0f, |
| 892 | }; |
| 893 | |
| 894 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 895 | 0x00, 0x20, 0x34, 0x64, |
| 896 | 0x48, 0x07, 0x48, 0x20, |
| 897 | 0x50, 0x64, 0x04, 0x34, |
| 898 | 0x50, 0x0f, |
| 899 | }; |
| 900 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 901 | 0x00, 0x10, 0x34, 0x64, |
| 902 | 0x48, 0x07, 0x48, 0x10, |
| 903 | 0x50, 0x64, 0x04, 0x34, |
| 904 | 0x50, 0x0F, |
| 905 | }; |
| 906 | |
| 907 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 908 | [0] = { |
| 909 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 910 | .notify_rpm = false, |
| 911 | .cmd = l2_spm_wfi_cmd_sequence, |
| 912 | }, |
| 913 | [1] = { |
| 914 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 915 | .notify_rpm = true, |
| 916 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 917 | }, |
| 918 | [2] = { |
| 919 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 920 | .notify_rpm = true, |
| 921 | .cmd = l2_spm_power_off_cmd_sequence, |
| 922 | }, |
| 923 | }; |
| 924 | |
| 925 | |
| 926 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 927 | [0] = { |
| 928 | .reg_base_addr = MSM_SAW_L2_BASE, |
| 929 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 930 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
| 931 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 932 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 933 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 934 | .modes = msm_spm_l2_seq_list, |
| 935 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 936 | }, |
| 937 | }; |
| 938 | |
| 939 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 940 | [0] = { |
| 941 | .reg_base_addr = MSM_SAW0_BASE, |
| 942 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 943 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 944 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 945 | #if defined(CONFIG_MSM_AVS_HW) |
| 946 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 947 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 948 | #endif |
| 949 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 950 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 951 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 952 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 953 | .vctl_timeout_us = 50, |
| 954 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 955 | .modes = msm_spm_seq_list, |
| 956 | }, |
| 957 | [1] = { |
| 958 | .reg_base_addr = MSM_SAW1_BASE, |
| 959 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 960 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 961 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 962 | #if defined(CONFIG_MSM_AVS_HW) |
| 963 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 964 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 965 | #endif |
| 966 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 967 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 968 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 969 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 970 | .vctl_timeout_us = 50, |
| 971 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 972 | .modes = msm_spm_seq_list, |
| 973 | }, |
| 974 | [2] = { |
| 975 | .reg_base_addr = MSM_SAW2_BASE, |
| 976 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 977 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 978 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 979 | #if defined(CONFIG_MSM_AVS_HW) |
| 980 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 981 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 982 | #endif |
| 983 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 984 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 985 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 986 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 987 | .vctl_timeout_us = 50, |
| 988 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 989 | .modes = msm_spm_seq_list, |
| 990 | }, |
| 991 | [3] = { |
| 992 | .reg_base_addr = MSM_SAW3_BASE, |
| 993 | .reg_init_values[MSM_SPM_REG_SAW2_SECURE] = 0x00, |
| 994 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
| 995 | .reg_init_values[MSM_SPM_REG_SAW2_VCTL] = 0x9C, |
| 996 | #if defined(CONFIG_MSM_AVS_HW) |
| 997 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 998 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 999 | #endif |
| 1000 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
| 1001 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020202, |
| 1002 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1003 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1004 | .vctl_timeout_us = 50, |
| 1005 | .num_modes = ARRAY_SIZE(msm_spm_seq_list), |
| 1006 | .modes = msm_spm_seq_list, |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 1007 | }, |
| 1008 | }; |
| 1009 | |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 1010 | static void __init apq8064_init_buses(void) |
| 1011 | { |
| 1012 | msm_bus_rpm_set_mt_mask(); |
| 1013 | msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1; |
| 1014 | msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1; |
| 1015 | msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1; |
| 1016 | msm_bus_8064_apps_fabric.dev.platform_data = |
| 1017 | &msm_bus_8064_apps_fabric_pdata; |
| 1018 | msm_bus_8064_sys_fabric.dev.platform_data = |
| 1019 | &msm_bus_8064_sys_fabric_pdata; |
| 1020 | msm_bus_8064_mm_fabric.dev.platform_data = |
| 1021 | &msm_bus_8064_mm_fabric_pdata; |
| 1022 | msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata; |
| 1023 | msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata; |
| 1024 | } |
| 1025 | |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 1026 | static struct platform_device apq8064_device_ext_5v_vreg __devinitdata = { |
| 1027 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1028 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 1029 | .dev = { |
| 1030 | .platform_data |
| 1031 | = &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 1032 | }, |
| 1033 | }; |
| 1034 | |
| 1035 | static struct platform_device apq8064_device_ext_3p3v_vreg __devinitdata = { |
| 1036 | .name = GPIO_REGULATOR_DEV_NAME, |
| 1037 | .id = APQ8064_EXT_3P3V_REG_EN_GPIO, |
| 1038 | .dev = { |
| 1039 | .platform_data = |
| 1040 | &apq8064_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 1041 | }, |
| 1042 | }; |
| 1043 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1044 | static struct platform_device *common_devices[] __initdata = { |
Jin Hong | 01f2dbb | 2011-11-03 22:13:51 -0700 | [diff] [blame] | 1045 | &apq8064_device_dmov, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 1046 | &apq8064_device_qup_i2c_gsbi4, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 1047 | &apq8064_device_qup_spi_gsbi5, |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 1048 | &apq8064_slim_ctrl, |
David Collins | f0d0073 | 2012-01-25 15:46:50 -0800 | [diff] [blame] | 1049 | &apq8064_device_ext_5v_vreg, |
| 1050 | &apq8064_device_ext_3p3v_vreg, |
Jay Chokshi | 9c25f07 | 2011-09-23 18:19:15 -0700 | [diff] [blame] | 1051 | &apq8064_device_ssbi_pmic1, |
| 1052 | &apq8064_device_ssbi_pmic2, |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 1053 | &msm_device_smd_apq8064, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 1054 | &apq8064_device_otg, |
| 1055 | &apq8064_device_gadget_peripheral, |
Hemant Kumar | d86c488 | 2012-01-24 19:39:37 -0800 | [diff] [blame] | 1056 | &apq8064_device_hsusb_host, |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame^] | 1057 | &apq8064_device_hsic_host, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 1058 | &android_usb_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 1059 | #ifdef CONFIG_ANDROID_PMEM |
| 1060 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 1061 | &android_pmem_device, |
| 1062 | &android_pmem_adsp_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 1063 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 1064 | &android_pmem_audio_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 1065 | #endif |
| 1066 | #ifdef CONFIG_ION_MSM |
| 1067 | &ion_dev, |
| 1068 | #endif |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 1069 | &msm8064_device_watchdog, |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 1070 | &msm8064_device_saw_regulator_core0, |
| 1071 | &msm8064_device_saw_regulator_core1, |
| 1072 | &msm8064_device_saw_regulator_core2, |
| 1073 | &msm8064_device_saw_regulator_core3, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 1074 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1075 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1076 | &qcrypto_device, |
| 1077 | #endif |
| 1078 | |
| 1079 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1080 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1081 | &qcedev_device, |
| 1082 | #endif |
Ramesh Masavarapu | f46be1b | 2011-11-03 11:13:41 -0700 | [diff] [blame] | 1083 | |
| 1084 | #ifdef CONFIG_HW_RANDOM_MSM |
| 1085 | &apq8064_device_rng, |
| 1086 | #endif |
Bharath Ramachandramurthy | b8e797f | 2011-11-30 12:08:42 -0800 | [diff] [blame] | 1087 | &apq_pcm, |
| 1088 | &apq_pcm_routing, |
| 1089 | &apq_cpudai0, |
| 1090 | &apq_cpudai1, |
| 1091 | &apq_cpudai_hdmi_rx, |
| 1092 | &apq_cpudai_bt_rx, |
| 1093 | &apq_cpudai_bt_tx, |
| 1094 | &apq_cpudai_fm_rx, |
| 1095 | &apq_cpudai_fm_tx, |
| 1096 | &apq_cpu_fe, |
| 1097 | &apq_stub_codec, |
| 1098 | &apq_voice, |
| 1099 | &apq_voip, |
| 1100 | &apq_lpa_pcm, |
| 1101 | &apq_pcm_hostless, |
| 1102 | &apq_cpudai_afe_01_rx, |
| 1103 | &apq_cpudai_afe_01_tx, |
| 1104 | &apq_cpudai_afe_02_rx, |
| 1105 | &apq_cpudai_afe_02_tx, |
| 1106 | &apq_pcm_afe, |
| 1107 | &apq_cpudai_auxpcm_rx, |
| 1108 | &apq_cpudai_auxpcm_tx, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1109 | &apq8064_rpm_device, |
| 1110 | &apq8064_rpm_log_device, |
| 1111 | &apq8064_rpm_stat_device, |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 1112 | &msm_bus_8064_apps_fabric, |
| 1113 | &msm_bus_8064_sys_fabric, |
| 1114 | &msm_bus_8064_mm_fabric, |
| 1115 | &msm_bus_8064_sys_fpb, |
| 1116 | &msm_bus_8064_cpss_fpb, |
Rajesh Sastrula | aee8af3 | 2012-01-20 11:46:31 -0800 | [diff] [blame] | 1117 | &msm_device_vidc, |
Matt Wagantall | ed83265 | 2012-02-02 19:23:17 -0800 | [diff] [blame] | 1118 | &msm_8960_riva, |
Matt Wagantall | b94b9a5 | 2012-02-02 21:59:54 -0800 | [diff] [blame] | 1119 | &msm_8960_q6_lpass, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 1120 | }; |
| 1121 | |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1122 | static struct platform_device *sim_devices[] __initdata = { |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 1123 | &apq8064_device_uart_gsbi3, |
Yan He | 06913ce | 2011-08-26 16:33:46 -0700 | [diff] [blame] | 1124 | &msm_device_sps_apq8064, |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 1125 | }; |
| 1126 | |
| 1127 | static struct platform_device *rumi3_devices[] __initdata = { |
| 1128 | &apq8064_device_uart_gsbi1, |
Yan He | 435ed61 | 2011-11-23 17:34:59 -0800 | [diff] [blame] | 1129 | &msm_device_sps_apq8064, |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1130 | #ifdef CONFIG_MSM_ROTATOR |
| 1131 | &msm_rotator_device, |
| 1132 | #endif |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1133 | }; |
| 1134 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 1135 | static struct platform_device *cdp_devices[] __initdata = { |
| 1136 | &apq8064_device_uart_gsbi1, |
| 1137 | &msm_device_sps_apq8064, |
| 1138 | }; |
| 1139 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 1140 | static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = { |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 1141 | .max_clock_speed = 1100000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1142 | }; |
| 1143 | |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 1144 | #define KS8851_IRQ_GPIO 43 |
| 1145 | |
| 1146 | static struct spi_board_info spi_board_info[] __initdata = { |
| 1147 | { |
| 1148 | .modalias = "ks8851", |
| 1149 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 1150 | .max_speed_hz = 19200000, |
| 1151 | .bus_num = 0, |
| 1152 | .chip_select = 2, |
| 1153 | .mode = SPI_MODE_0, |
| 1154 | }, |
| 1155 | }; |
| 1156 | |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 1157 | static struct slim_boardinfo apq8064_slim_devices[] = { |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 1158 | { |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 1159 | .bus_num = 1, |
| 1160 | .slim_slave = &apq8064_slim_tabla, |
| 1161 | }, |
| 1162 | { |
| 1163 | .bus_num = 1, |
| 1164 | .slim_slave = &apq8064_slim_tabla20, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 1165 | }, |
| 1166 | /* add more slimbus slaves as needed */ |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 1167 | }; |
| 1168 | |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 1169 | static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = { |
| 1170 | .clk_freq = 100000, |
| 1171 | .src_clk_rate = 24000000, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 1172 | }; |
| 1173 | |
| 1174 | static void __init apq8064_i2c_init(void) |
| 1175 | { |
| 1176 | apq8064_device_qup_i2c_gsbi4.dev.platform_data = |
| 1177 | &apq8064_i2c_qup_gsbi4_pdata; |
| 1178 | } |
| 1179 | |
Stepan Moskovchenko | c71c979 | 2012-01-31 18:12:44 -0800 | [diff] [blame] | 1180 | #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 1181 | static int ethernet_init(void) |
| 1182 | { |
| 1183 | int ret; |
| 1184 | ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq"); |
| 1185 | if (ret) { |
| 1186 | pr_err("ks8851 gpio_request failed: %d\n", ret); |
| 1187 | goto fail; |
| 1188 | } |
| 1189 | |
| 1190 | return 0; |
| 1191 | fail: |
| 1192 | return ret; |
| 1193 | } |
| 1194 | #else |
| 1195 | static int ethernet_init(void) |
| 1196 | { |
| 1197 | return 0; |
| 1198 | } |
| 1199 | #endif |
| 1200 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1201 | static void __init apq8064_clock_init(void) |
| 1202 | { |
Tianyi Gou | acb588d | 2012-01-27 18:24:05 -0800 | [diff] [blame] | 1203 | if (machine_is_apq8064_rumi3()) |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1204 | msm_clock_init(&apq8064_dummy_clock_init_data); |
Tianyi Gou | acb588d | 2012-01-27 18:24:05 -0800 | [diff] [blame] | 1205 | else |
| 1206 | msm_clock_init(&apq8064_clock_init_data); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1207 | } |
| 1208 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1209 | static void __init apq8064_common_init(void) |
| 1210 | { |
| 1211 | if (socinfo_init() < 0) |
| 1212 | pr_err("socinfo_init() failed!\n"); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1213 | BUG_ON(msm_rpm_init(&apq8064_rpm_data)); |
| 1214 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 1215 | apq8064_clock_init(); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 1216 | apq8064_init_gpiomux(); |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 1217 | apq8064_i2c_init(); |
Kenneth Heitke | 36920d3 | 2011-07-20 16:44:30 -0600 | [diff] [blame] | 1218 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 1219 | apq8064_device_qup_spi_gsbi5.dev.platform_data = |
| 1220 | &apq8064_qup_spi_gsbi5_pdata; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 1221 | apq8064_init_pmic(); |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1222 | apq8064_device_otg.dev.platform_data = &msm_otg_pdata; |
Hemant Kumar | a945b47 | 2012-01-25 15:08:06 -0800 | [diff] [blame^] | 1223 | apq8064_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame] | 1224 | apq8064_init_buses(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1225 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Jay Chokshi | e874128 | 2012-01-25 15:22:55 -0800 | [diff] [blame] | 1226 | apq8064_pm8xxx_gpio_mpp_init(); |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 1227 | apq8064_init_mmc(); |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 1228 | slim_register_board_info(apq8064_slim_devices, |
| 1229 | ARRAY_SIZE(apq8064_slim_devices)); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1230 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
Mahesh Sivasubramanian | cbce1ec | 2012-01-24 10:32:44 -0700 | [diff] [blame] | 1231 | acpuclk_init(&acpuclk_8064_soc_data); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1232 | msm_spm_l2_init(msm_spm_l2_data); |
| 1233 | msm_pm_set_platform_data(msm_pm_data, ARRAY_SIZE(msm_pm_data)); |
| 1234 | msm_pm_set_rpm_wakeup_irq(RPM_APCC_CPU0_WAKE_UP_IRQ); |
| 1235 | msm_cpuidle_set_states(msm_cstates, ARRAY_SIZE(msm_cstates), |
| 1236 | msm_pm_data); |
| 1237 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 1238 | |
Joel King | dacbc82 | 2012-01-25 13:30:57 -0800 | [diff] [blame] | 1239 | if (machine_is_apq8064_mtp()) { |
| 1240 | mdm_8064_device.dev.platform_data = &mdm_platform_data; |
| 1241 | platform_device_register(&mdm_8064_device); |
| 1242 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1243 | } |
| 1244 | |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1245 | static void __init apq8064_allocate_memory_regions(void) |
| 1246 | { |
| 1247 | apq8064_allocate_fb_region(); |
| 1248 | } |
| 1249 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1250 | static void __init apq8064_sim_init(void) |
| 1251 | { |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 1252 | struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *) |
| 1253 | &msm8064_device_watchdog.dev.platform_data; |
| 1254 | |
| 1255 | wdog_pdata->bark_time = 15000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1256 | apq8064_common_init(); |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1257 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); |
| 1258 | } |
| 1259 | |
| 1260 | static void __init apq8064_rumi3_init(void) |
| 1261 | { |
| 1262 | apq8064_common_init(); |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 1263 | ethernet_init(); |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 1264 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 1265 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1266 | apq8064_init_fb(); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 1267 | apq8064_init_gpu(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1268 | } |
| 1269 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 1270 | static void __init apq8064_cdp_init(void) |
| 1271 | { |
| 1272 | apq8064_common_init(); |
| 1273 | ethernet_init(); |
| 1274 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
| 1275 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Jordan Crouse | b3115fe | 2012-02-01 22:11:12 -0700 | [diff] [blame] | 1276 | apq8064_init_gpu(); |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 1277 | } |
| 1278 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1279 | MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR") |
| 1280 | .map_io = apq8064_map_io, |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 1281 | .reserve = apq8064_reserve, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1282 | .init_irq = apq8064_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 1283 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1284 | .timer = &msm_timer, |
| 1285 | .init_machine = apq8064_sim_init, |
| 1286 | MACHINE_END |
| 1287 | |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1288 | MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3") |
| 1289 | .map_io = apq8064_map_io, |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 1290 | .reserve = apq8064_reserve, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1291 | .init_irq = apq8064_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 1292 | .handle_irq = gic_handle_irq, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1293 | .timer = &msm_timer, |
| 1294 | .init_machine = apq8064_rumi3_init, |
Huaibin Yang | 4a084e3 | 2011-12-15 15:25:52 -0800 | [diff] [blame] | 1295 | .init_early = apq8064_allocate_memory_regions, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 1296 | MACHINE_END |
| 1297 | |
Joel King | 82b7e3f | 2012-01-05 10:03:27 -0800 | [diff] [blame] | 1298 | MACHINE_START(APQ8064_CDP, "QCT APQ8064 CDP") |
| 1299 | .map_io = apq8064_map_io, |
| 1300 | .reserve = apq8064_reserve, |
| 1301 | .init_irq = apq8064_init_irq, |
| 1302 | .handle_irq = gic_handle_irq, |
| 1303 | .timer = &msm_timer, |
| 1304 | .init_machine = apq8064_cdp_init, |
| 1305 | MACHINE_END |
| 1306 | |
| 1307 | MACHINE_START(APQ8064_MTP, "QCT APQ8064 MTP") |
| 1308 | .map_io = apq8064_map_io, |
| 1309 | .reserve = apq8064_reserve, |
| 1310 | .init_irq = apq8064_init_irq, |
| 1311 | .handle_irq = gic_handle_irq, |
| 1312 | .timer = &msm_timer, |
| 1313 | .init_machine = apq8064_cdp_init, |
| 1314 | MACHINE_END |
| 1315 | |
| 1316 | MACHINE_START(APQ8064_LIQUID, "QCT APQ8064 LIQUID") |
| 1317 | .map_io = apq8064_map_io, |
| 1318 | .reserve = apq8064_reserve, |
| 1319 | .init_irq = apq8064_init_irq, |
| 1320 | .handle_irq = gic_handle_irq, |
| 1321 | .timer = &msm_timer, |
| 1322 | .init_machine = apq8064_cdp_init, |
| 1323 | MACHINE_END |
| 1324 | |