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> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 26 | #include <asm/mach-types.h> |
| 27 | #include <asm/mach/arch.h> |
| 28 | #include <asm/hardware/gic.h> |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 29 | #include <asm/mach/mmc.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 30 | |
| 31 | #include <mach/board.h> |
| 32 | #include <mach/msm_iomap.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 33 | #include <mach/ion.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 34 | #include <linux/usb/msm_hsusb.h> |
| 35 | #include <linux/usb/android.h> |
| 36 | #include <mach/socinfo.h> |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 37 | #include <mach/msm_spi.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 38 | #include "timer.h" |
| 39 | #include "devices.h" |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 40 | #include <mach/gpio.h> |
| 41 | #include <mach/gpiomux.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 42 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 43 | #include <linux/android_pmem.h> |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 44 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 45 | #include <mach/msm_memtypes.h> |
| 46 | #include <linux/bootmem.h> |
| 47 | #include <asm/setup.h> |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 48 | #include <mach/dma.h> |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame^] | 49 | #include <mach/msm_bus_board.h> |
Joel King | 4ebccc6 | 2011-07-22 09:43:22 -0700 | [diff] [blame] | 50 | |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 51 | #include "msm_watchdog.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 52 | #include "board-8064.h" |
Jay Chokshi | ea67c62 | 2011-07-29 17:12:26 -0700 | [diff] [blame] | 53 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 54 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Ben Romberger | 3ffcd81 | 2011-12-08 19:12:10 -0800 | [diff] [blame] | 55 | #define MSM_PMEM_AUDIO_SIZE 0x2B4000 |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 56 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 57 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 58 | #else |
| 59 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
| 60 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 61 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 62 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 63 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0xB0C000 |
| 64 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
| 65 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
| 66 | #define MSM_ION_MFC_SIZE SZ_8K |
| 67 | #define MSM_ION_HEAP_NUM 5 |
| 68 | #else |
| 69 | #define MSM_PMEM_KERNEL_EBI1_SIZE 0x110C000 |
| 70 | #define MSM_ION_HEAP_NUM 1 |
| 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_KERNEL_PMEM_EBI_REGION |
| 74 | static unsigned pmem_kernel_ebi1_size = MSM_PMEM_KERNEL_EBI1_SIZE; |
| 75 | static int __init pmem_kernel_ebi1_size_setup(char *p) |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 76 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 77 | pmem_kernel_ebi1_size = memparse(p, NULL); |
| 78 | return 0; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 79 | } |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 80 | early_param("pmem_kernel_ebi1_size", pmem_kernel_ebi1_size_setup); |
| 81 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 82 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 83 | #ifdef CONFIG_ANDROID_PMEM |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 84 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 85 | static int __init pmem_size_setup(char *p) |
| 86 | { |
| 87 | pmem_size = memparse(p, NULL); |
| 88 | return 0; |
| 89 | } |
| 90 | early_param("pmem_size", pmem_size_setup); |
| 91 | |
| 92 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 93 | |
| 94 | static int __init pmem_adsp_size_setup(char *p) |
| 95 | { |
| 96 | pmem_adsp_size = memparse(p, NULL); |
| 97 | return 0; |
| 98 | } |
| 99 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 100 | |
| 101 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 102 | |
| 103 | static int __init pmem_audio_size_setup(char *p) |
| 104 | { |
| 105 | pmem_audio_size = memparse(p, NULL); |
| 106 | return 0; |
| 107 | } |
| 108 | early_param("pmem_audio_size", pmem_audio_size_setup); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 109 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 110 | |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 111 | #ifdef CONFIG_ANDROID_PMEM |
| 112 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 113 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 114 | .name = "pmem", |
| 115 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 116 | .cached = 1, |
| 117 | .memory_type = MEMTYPE_EBI1, |
| 118 | }; |
| 119 | |
| 120 | static struct platform_device android_pmem_device = { |
| 121 | .name = "android_pmem", |
| 122 | .id = 0, |
| 123 | .dev = {.platform_data = &android_pmem_pdata}, |
| 124 | }; |
| 125 | |
| 126 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 127 | .name = "pmem_adsp", |
| 128 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 129 | .cached = 0, |
| 130 | .memory_type = MEMTYPE_EBI1, |
| 131 | }; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 132 | static struct platform_device android_pmem_adsp_device = { |
| 133 | .name = "android_pmem", |
| 134 | .id = 2, |
| 135 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 136 | }; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 137 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 138 | |
| 139 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 140 | .name = "pmem_audio", |
| 141 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 142 | .cached = 0, |
| 143 | .memory_type = MEMTYPE_EBI1, |
| 144 | }; |
| 145 | |
| 146 | static struct platform_device android_pmem_audio_device = { |
| 147 | .name = "android_pmem", |
| 148 | .id = 4, |
| 149 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 150 | }; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 151 | #endif |
| 152 | |
| 153 | static struct memtype_reserve apq8064_reserve_table[] __initdata = { |
| 154 | [MEMTYPE_SMI] = { |
| 155 | }, |
| 156 | [MEMTYPE_EBI0] = { |
| 157 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 158 | }, |
| 159 | [MEMTYPE_EBI1] = { |
| 160 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 161 | }, |
| 162 | }; |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 163 | |
| 164 | static void __init size_pmem_devices(void) |
| 165 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 166 | #ifdef CONFIG_ANDROID_PMEM |
| 167 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 168 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 169 | android_pmem_pdata.size = pmem_size; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 170 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 171 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 172 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 176 | { |
| 177 | apq8064_reserve_table[p->memory_type].size += p->size; |
| 178 | } |
| 179 | |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 180 | static void __init reserve_pmem_memory(void) |
| 181 | { |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 182 | #ifdef CONFIG_ANDROID_PMEM |
| 183 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 184 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 185 | reserve_memory_for(&android_pmem_pdata); |
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 | reserve_memory_for(&android_pmem_audio_pdata); |
| 188 | apq8064_reserve_table[MEMTYPE_EBI1].size += pmem_kernel_ebi1_size; |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 189 | #endif |
| 190 | } |
| 191 | |
| 192 | static int apq8064_paddr_to_memtype(unsigned int paddr) |
| 193 | { |
| 194 | return MEMTYPE_EBI1; |
| 195 | } |
| 196 | |
| 197 | #ifdef CONFIG_ION_MSM |
| 198 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 199 | static struct ion_cp_heap_pdata cp_mm_ion_pdata = { |
| 200 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
| 201 | }; |
| 202 | |
| 203 | static struct ion_cp_heap_pdata cp_mfc_ion_pdata = { |
| 204 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
| 205 | }; |
| 206 | |
| 207 | static struct ion_co_heap_pdata co_ion_pdata = { |
| 208 | }; |
| 209 | #endif |
| 210 | static struct ion_platform_data ion_pdata = { |
| 211 | .nr = MSM_ION_HEAP_NUM, |
| 212 | .heaps = { |
| 213 | { |
| 214 | .id = ION_SYSTEM_HEAP_ID, |
| 215 | .type = ION_HEAP_TYPE_SYSTEM, |
| 216 | .name = ION_VMALLOC_HEAP_NAME, |
| 217 | }, |
| 218 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 219 | { |
| 220 | .id = ION_SF_HEAP_ID, |
| 221 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 222 | .name = ION_SF_HEAP_NAME, |
| 223 | .size = MSM_ION_SF_SIZE, |
| 224 | .memory_type = ION_EBI_TYPE, |
| 225 | .extra_data = (void *) &co_ion_pdata, |
| 226 | }, |
| 227 | { |
| 228 | .id = ION_CP_MM_HEAP_ID, |
| 229 | .type = ION_HEAP_TYPE_CP, |
| 230 | .name = ION_MM_HEAP_NAME, |
| 231 | .size = MSM_ION_MM_SIZE, |
| 232 | .memory_type = ION_EBI_TYPE, |
| 233 | .extra_data = (void *) &cp_mm_ion_pdata, |
| 234 | }, |
| 235 | { |
| 236 | .id = ION_CP_MFC_HEAP_ID, |
| 237 | .type = ION_HEAP_TYPE_CP, |
| 238 | .name = ION_MFC_HEAP_NAME, |
| 239 | .size = MSM_ION_MFC_SIZE, |
| 240 | .memory_type = ION_EBI_TYPE, |
| 241 | .extra_data = (void *) &cp_mfc_ion_pdata, |
| 242 | }, |
| 243 | { |
| 244 | .id = ION_IOMMU_HEAP_ID, |
| 245 | .type = ION_HEAP_TYPE_IOMMU, |
| 246 | .name = ION_IOMMU_HEAP_NAME, |
| 247 | }, |
| 248 | #endif |
| 249 | } |
| 250 | }; |
| 251 | |
| 252 | static struct platform_device ion_dev = { |
| 253 | .name = "ion-msm", |
| 254 | .id = 1, |
| 255 | .dev = { .platform_data = &ion_pdata }, |
| 256 | }; |
| 257 | #endif |
| 258 | |
| 259 | static void reserve_ion_memory(void) |
| 260 | { |
| 261 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 262 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE; |
| 263 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE; |
| 264 | apq8064_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE; |
| 265 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | static void __init apq8064_calculate_reserve_sizes(void) |
| 269 | { |
| 270 | size_pmem_devices(); |
| 271 | reserve_pmem_memory(); |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 272 | reserve_ion_memory(); |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | static struct reserve_info apq8064_reserve_info __initdata = { |
| 276 | .memtype_reserve_table = apq8064_reserve_table, |
| 277 | .calculate_reserve_sizes = apq8064_calculate_reserve_sizes, |
| 278 | .paddr_to_memtype = apq8064_paddr_to_memtype, |
| 279 | }; |
| 280 | |
| 281 | static int apq8064_memory_bank_size(void) |
| 282 | { |
| 283 | return 1<<29; |
| 284 | } |
| 285 | |
| 286 | static void __init locate_unstable_memory(void) |
| 287 | { |
| 288 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 289 | unsigned long bank_size; |
| 290 | unsigned long low, high; |
| 291 | |
| 292 | bank_size = apq8064_memory_bank_size(); |
| 293 | low = meminfo.bank[0].start; |
| 294 | high = mb->start + mb->size; |
| 295 | low &= ~(bank_size - 1); |
| 296 | |
| 297 | if (high - low <= bank_size) |
| 298 | return; |
| 299 | apq8064_reserve_info.low_unstable_address = low + bank_size; |
| 300 | apq8064_reserve_info.max_unstable_size = high - low - bank_size; |
| 301 | apq8064_reserve_info.bank_size = bank_size; |
| 302 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 303 | apq8064_reserve_info.low_unstable_address, |
| 304 | apq8064_reserve_info.max_unstable_size, |
| 305 | apq8064_reserve_info.bank_size); |
| 306 | } |
| 307 | |
| 308 | static void __init apq8064_reserve(void) |
| 309 | { |
| 310 | reserve_info = &apq8064_reserve_info; |
| 311 | locate_unstable_memory(); |
| 312 | msm_reserve(); |
| 313 | } |
| 314 | |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 315 | static struct platform_device android_usb_device = { |
| 316 | .name = "android_usb", |
| 317 | .id = -1, |
| 318 | }; |
| 319 | |
| 320 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 321 | .mode = USB_PERIPHERAL, |
| 322 | .otg_control = OTG_PHY_CONTROL, |
| 323 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 324 | }; |
| 325 | |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 326 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 327 | |
| 328 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 329 | * 4 micbiases are used to power various analog and digital |
| 330 | * microphones operating at 1800 mV. Technically, all micbiases |
| 331 | * can source from single cfilter since all microphones operate |
| 332 | * at the same voltage level. The arrangement below is to make |
| 333 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 334 | * does not need to be as high as 2.85V. It is choosen for |
| 335 | * microphone sensitivity purpose. |
| 336 | */ |
| 337 | static struct tabla_pdata apq8064_tabla_platform_data = { |
| 338 | .slimbus_slave_device = { |
| 339 | .name = "tabla-slave", |
| 340 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 341 | }, |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 342 | .irq = MSM_GPIO_TO_INT(42), |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 343 | .irq_base = TABLA_INTERRUPT_BASE, |
| 344 | .num_irqs = NR_TABLA_IRQS, |
| 345 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 346 | .micbias = { |
| 347 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 348 | .cfilt1_mv = 1800, |
| 349 | .cfilt2_mv = 1800, |
| 350 | .cfilt3_mv = 1800, |
| 351 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 352 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 353 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 354 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 355 | } |
| 356 | }; |
| 357 | |
| 358 | static struct slim_device apq8064_slim_tabla = { |
| 359 | .name = "tabla-slim", |
| 360 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 361 | .dev = { |
| 362 | .platform_data = &apq8064_tabla_platform_data, |
| 363 | }, |
| 364 | }; |
| 365 | |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 366 | static struct tabla_pdata apq8064_tabla20_platform_data = { |
| 367 | .slimbus_slave_device = { |
| 368 | .name = "tabla-slave", |
| 369 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 370 | }, |
| 371 | .irq = MSM_GPIO_TO_INT(42), |
| 372 | .irq_base = TABLA_INTERRUPT_BASE, |
| 373 | .num_irqs = NR_TABLA_IRQS, |
| 374 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 375 | .micbias = { |
| 376 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 377 | .cfilt1_mv = 1800, |
| 378 | .cfilt2_mv = 1800, |
| 379 | .cfilt3_mv = 1800, |
| 380 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 381 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 382 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 383 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
| 384 | } |
| 385 | }; |
| 386 | |
| 387 | static struct slim_device apq8064_slim_tabla20 = { |
| 388 | .name = "tabla2x-slim", |
| 389 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 390 | .dev = { |
| 391 | .platform_data = &apq8064_tabla20_platform_data, |
| 392 | }, |
| 393 | }; |
| 394 | |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 395 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 396 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 397 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 398 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 399 | |
| 400 | #define QCE_SIZE 0x10000 |
| 401 | #define QCE_0_BASE 0x11000000 |
| 402 | |
| 403 | #define QCE_HW_KEY_SUPPORT 0 |
| 404 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 405 | #define QCE_SHARE_CE_RESOURCE 3 |
| 406 | #define QCE_CE_SHARED 0 |
| 407 | |
| 408 | static struct resource qcrypto_resources[] = { |
| 409 | [0] = { |
| 410 | .start = QCE_0_BASE, |
| 411 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 412 | .flags = IORESOURCE_MEM, |
| 413 | }, |
| 414 | [1] = { |
| 415 | .name = "crypto_channels", |
| 416 | .start = DMOV8064_CE_IN_CHAN, |
| 417 | .end = DMOV8064_CE_OUT_CHAN, |
| 418 | .flags = IORESOURCE_DMA, |
| 419 | }, |
| 420 | [2] = { |
| 421 | .name = "crypto_crci_in", |
| 422 | .start = DMOV8064_CE_IN_CRCI, |
| 423 | .end = DMOV8064_CE_IN_CRCI, |
| 424 | .flags = IORESOURCE_DMA, |
| 425 | }, |
| 426 | [3] = { |
| 427 | .name = "crypto_crci_out", |
| 428 | .start = DMOV8064_CE_OUT_CRCI, |
| 429 | .end = DMOV8064_CE_OUT_CRCI, |
| 430 | .flags = IORESOURCE_DMA, |
| 431 | }, |
| 432 | }; |
| 433 | |
| 434 | static struct resource qcedev_resources[] = { |
| 435 | [0] = { |
| 436 | .start = QCE_0_BASE, |
| 437 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 438 | .flags = IORESOURCE_MEM, |
| 439 | }, |
| 440 | [1] = { |
| 441 | .name = "crypto_channels", |
| 442 | .start = DMOV8064_CE_IN_CHAN, |
| 443 | .end = DMOV8064_CE_OUT_CHAN, |
| 444 | .flags = IORESOURCE_DMA, |
| 445 | }, |
| 446 | [2] = { |
| 447 | .name = "crypto_crci_in", |
| 448 | .start = DMOV8064_CE_IN_CRCI, |
| 449 | .end = DMOV8064_CE_IN_CRCI, |
| 450 | .flags = IORESOURCE_DMA, |
| 451 | }, |
| 452 | [3] = { |
| 453 | .name = "crypto_crci_out", |
| 454 | .start = DMOV8064_CE_OUT_CRCI, |
| 455 | .end = DMOV8064_CE_OUT_CRCI, |
| 456 | .flags = IORESOURCE_DMA, |
| 457 | }, |
| 458 | }; |
| 459 | |
| 460 | #endif |
| 461 | |
| 462 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 463 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 464 | |
| 465 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 466 | .ce_shared = QCE_CE_SHARED, |
| 467 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 468 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 469 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 470 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 471 | }; |
| 472 | |
| 473 | static struct platform_device qcrypto_device = { |
| 474 | .name = "qcrypto", |
| 475 | .id = 0, |
| 476 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 477 | .resource = qcrypto_resources, |
| 478 | .dev = { |
| 479 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 480 | .platform_data = &qcrypto_ce_hw_suppport, |
| 481 | }, |
| 482 | }; |
| 483 | #endif |
| 484 | |
| 485 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 486 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 487 | |
| 488 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 489 | .ce_shared = QCE_CE_SHARED, |
| 490 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 491 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 492 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 493 | .bus_scale_table = NULL, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 494 | }; |
| 495 | |
| 496 | static struct platform_device qcedev_device = { |
| 497 | .name = "qce", |
| 498 | .id = 0, |
| 499 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 500 | .resource = qcedev_resources, |
| 501 | .dev = { |
| 502 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 503 | .platform_data = &qcedev_ce_hw_suppport, |
| 504 | }, |
| 505 | }; |
| 506 | #endif |
| 507 | |
| 508 | |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 509 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 510 | static void __init apq8064_map_io(void) |
| 511 | { |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 512 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 513 | msm_map_apq8064_io(); |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 514 | if (socinfo_init() < 0) |
| 515 | pr_err("socinfo_init() failed!\n"); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 516 | } |
| 517 | |
| 518 | static void __init apq8064_init_irq(void) |
| 519 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 520 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 521 | (void *)MSM_QGIC_CPU_BASE); |
| 522 | |
| 523 | /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ |
| 524 | writel_relaxed(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); |
| 525 | |
| 526 | writel_relaxed(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET); |
| 527 | mb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 528 | } |
| 529 | |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 530 | static struct platform_device msm8064_device_saw_regulator_core0 = { |
| 531 | .name = "saw-regulator", |
| 532 | .id = 0, |
| 533 | .dev = { |
| 534 | .platform_data = &msm8064_saw_regulator_pdata_8921_s5, |
| 535 | }, |
| 536 | }; |
| 537 | |
| 538 | static struct platform_device msm8064_device_saw_regulator_core1 = { |
| 539 | .name = "saw-regulator", |
| 540 | .id = 1, |
| 541 | .dev = { |
| 542 | .platform_data = &msm8064_saw_regulator_pdata_8921_s6, |
| 543 | }, |
| 544 | }; |
| 545 | |
| 546 | static struct platform_device msm8064_device_saw_regulator_core2 = { |
| 547 | .name = "saw-regulator", |
| 548 | .id = 2, |
| 549 | .dev = { |
| 550 | .platform_data = &msm8064_saw_regulator_pdata_8821_s0, |
| 551 | }, |
| 552 | }; |
| 553 | |
| 554 | static struct platform_device msm8064_device_saw_regulator_core3 = { |
| 555 | .name = "saw-regulator", |
| 556 | .id = 3, |
| 557 | .dev = { |
| 558 | .platform_data = &msm8064_saw_regulator_pdata_8821_s1, |
| 559 | }, |
| 560 | }; |
| 561 | |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame^] | 562 | static void __init apq8064_init_buses(void) |
| 563 | { |
| 564 | msm_bus_rpm_set_mt_mask(); |
| 565 | msm_bus_8064_apps_fabric_pdata.rpm_enabled = 1; |
| 566 | msm_bus_8064_sys_fabric_pdata.rpm_enabled = 1; |
| 567 | msm_bus_8064_mm_fabric_pdata.rpm_enabled = 1; |
| 568 | msm_bus_8064_apps_fabric.dev.platform_data = |
| 569 | &msm_bus_8064_apps_fabric_pdata; |
| 570 | msm_bus_8064_sys_fabric.dev.platform_data = |
| 571 | &msm_bus_8064_sys_fabric_pdata; |
| 572 | msm_bus_8064_mm_fabric.dev.platform_data = |
| 573 | &msm_bus_8064_mm_fabric_pdata; |
| 574 | msm_bus_8064_sys_fpb.dev.platform_data = &msm_bus_8064_sys_fpb_pdata; |
| 575 | msm_bus_8064_cpss_fpb.dev.platform_data = &msm_bus_8064_cpss_fpb_pdata; |
| 576 | } |
| 577 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 578 | static struct platform_device *common_devices[] __initdata = { |
Jin Hong | 01f2dbb | 2011-11-03 22:13:51 -0700 | [diff] [blame] | 579 | &apq8064_device_dmov, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 580 | &apq8064_device_qup_i2c_gsbi4, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 581 | &apq8064_device_qup_spi_gsbi5, |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 582 | &apq8064_slim_ctrl, |
Jay Chokshi | 9c25f07 | 2011-09-23 18:19:15 -0700 | [diff] [blame] | 583 | &apq8064_device_ssbi_pmic1, |
| 584 | &apq8064_device_ssbi_pmic2, |
Jeff Hugo | 0c0f5e9 | 2011-09-28 13:55:45 -0600 | [diff] [blame] | 585 | &msm_device_smd_apq8064, |
Hemant Kumar | 4933b07 | 2011-10-17 23:43:11 -0700 | [diff] [blame] | 586 | &apq8064_device_otg, |
| 587 | &apq8064_device_gadget_peripheral, |
| 588 | &android_usb_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 589 | #ifdef CONFIG_ANDROID_PMEM |
| 590 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 591 | &android_pmem_device, |
| 592 | &android_pmem_adsp_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 593 | #endif |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 594 | &android_pmem_audio_device, |
Olav Haugan | 7c6aa74 | 2012-01-16 16:47:37 -0800 | [diff] [blame] | 595 | #endif |
| 596 | #ifdef CONFIG_ION_MSM |
| 597 | &ion_dev, |
| 598 | #endif |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 599 | &msm8064_device_watchdog, |
Jay Chokshi | 7805b5a | 2011-11-07 15:55:30 -0800 | [diff] [blame] | 600 | &msm8064_device_saw_regulator_core0, |
| 601 | &msm8064_device_saw_regulator_core1, |
| 602 | &msm8064_device_saw_regulator_core2, |
| 603 | &msm8064_device_saw_regulator_core3, |
Ramesh Masavarapu | 2831191 | 2011-10-27 11:04:12 -0700 | [diff] [blame] | 604 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 605 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 606 | &qcrypto_device, |
| 607 | #endif |
| 608 | |
| 609 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 610 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 611 | &qcedev_device, |
| 612 | #endif |
Ramesh Masavarapu | f46be1b | 2011-11-03 11:13:41 -0700 | [diff] [blame] | 613 | |
| 614 | #ifdef CONFIG_HW_RANDOM_MSM |
| 615 | &apq8064_device_rng, |
| 616 | #endif |
Bharath Ramachandramurthy | b8e797f | 2011-11-30 12:08:42 -0800 | [diff] [blame] | 617 | &apq_pcm, |
| 618 | &apq_pcm_routing, |
| 619 | &apq_cpudai0, |
| 620 | &apq_cpudai1, |
| 621 | &apq_cpudai_hdmi_rx, |
| 622 | &apq_cpudai_bt_rx, |
| 623 | &apq_cpudai_bt_tx, |
| 624 | &apq_cpudai_fm_rx, |
| 625 | &apq_cpudai_fm_tx, |
| 626 | &apq_cpu_fe, |
| 627 | &apq_stub_codec, |
| 628 | &apq_voice, |
| 629 | &apq_voip, |
| 630 | &apq_lpa_pcm, |
| 631 | &apq_pcm_hostless, |
| 632 | &apq_cpudai_afe_01_rx, |
| 633 | &apq_cpudai_afe_01_tx, |
| 634 | &apq_cpudai_afe_02_rx, |
| 635 | &apq_cpudai_afe_02_tx, |
| 636 | &apq_pcm_afe, |
| 637 | &apq_cpudai_auxpcm_rx, |
| 638 | &apq_cpudai_auxpcm_tx, |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame^] | 639 | &msm_bus_8064_apps_fabric, |
| 640 | &msm_bus_8064_sys_fabric, |
| 641 | &msm_bus_8064_mm_fabric, |
| 642 | &msm_bus_8064_sys_fpb, |
| 643 | &msm_bus_8064_cpss_fpb, |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 644 | }; |
| 645 | |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 646 | static struct platform_device *sim_devices[] __initdata = { |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 647 | &apq8064_device_uart_gsbi3, |
Yan He | 06913ce | 2011-08-26 16:33:46 -0700 | [diff] [blame] | 648 | &msm_device_sps_apq8064, |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 649 | }; |
| 650 | |
| 651 | static struct platform_device *rumi3_devices[] __initdata = { |
| 652 | &apq8064_device_uart_gsbi1, |
Yan He | 435ed61 | 2011-11-23 17:34:59 -0800 | [diff] [blame] | 653 | &msm_device_sps_apq8064, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 654 | }; |
| 655 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 656 | static struct msm_spi_platform_data apq8064_qup_spi_gsbi5_pdata = { |
Harini Jayaraman | 60ee14c | 2011-11-09 18:53:27 -0700 | [diff] [blame] | 657 | .max_clock_speed = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 658 | }; |
| 659 | |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 660 | #define KS8851_IRQ_GPIO 43 |
| 661 | |
| 662 | static struct spi_board_info spi_board_info[] __initdata = { |
| 663 | { |
| 664 | .modalias = "ks8851", |
| 665 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 666 | .max_speed_hz = 19200000, |
| 667 | .bus_num = 0, |
| 668 | .chip_select = 2, |
| 669 | .mode = SPI_MODE_0, |
| 670 | }, |
| 671 | }; |
| 672 | |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 673 | static struct slim_boardinfo apq8064_slim_devices[] = { |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 674 | { |
Swaminathan Sathappan | cef966d | 2011-12-15 17:27:04 -0800 | [diff] [blame] | 675 | .bus_num = 1, |
| 676 | .slim_slave = &apq8064_slim_tabla, |
| 677 | }, |
| 678 | { |
| 679 | .bus_num = 1, |
| 680 | .slim_slave = &apq8064_slim_tabla20, |
Swaminathan Sathappan | 2f51a75 | 2011-12-05 12:51:19 -0800 | [diff] [blame] | 681 | }, |
| 682 | /* add more slimbus slaves as needed */ |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 683 | }; |
| 684 | |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 685 | static struct msm_i2c_platform_data apq8064_i2c_qup_gsbi4_pdata = { |
| 686 | .clk_freq = 100000, |
| 687 | .src_clk_rate = 24000000, |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 688 | }; |
| 689 | |
| 690 | static void __init apq8064_i2c_init(void) |
| 691 | { |
| 692 | apq8064_device_qup_i2c_gsbi4.dev.platform_data = |
| 693 | &apq8064_i2c_qup_gsbi4_pdata; |
| 694 | } |
| 695 | |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 696 | #ifdef CONFIG_KS8851 |
| 697 | static int ethernet_init(void) |
| 698 | { |
| 699 | int ret; |
| 700 | ret = gpio_request(KS8851_IRQ_GPIO, "ks8851_irq"); |
| 701 | if (ret) { |
| 702 | pr_err("ks8851 gpio_request failed: %d\n", ret); |
| 703 | goto fail; |
| 704 | } |
| 705 | |
| 706 | return 0; |
| 707 | fail: |
| 708 | return ret; |
| 709 | } |
| 710 | #else |
| 711 | static int ethernet_init(void) |
| 712 | { |
| 713 | return 0; |
| 714 | } |
| 715 | #endif |
| 716 | |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 717 | static void __init apq8064_clock_init(void) |
| 718 | { |
| 719 | if (machine_is_apq8064_sim()) |
| 720 | msm_clock_init(&apq8064_clock_init_data); |
| 721 | else |
| 722 | msm_clock_init(&apq8064_dummy_clock_init_data); |
| 723 | } |
| 724 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 725 | static void __init apq8064_common_init(void) |
| 726 | { |
| 727 | if (socinfo_init() < 0) |
| 728 | pr_err("socinfo_init() failed!\n"); |
Tianyi Gou | 41515e2 | 2011-09-01 19:37:43 -0700 | [diff] [blame] | 729 | apq8064_clock_init(); |
Stepan Moskovchenko | 2327a95 | 2011-12-14 16:31:28 -0800 | [diff] [blame] | 730 | apq8064_init_gpiomux(); |
Kenneth Heitke | 748593a | 2011-07-15 15:45:11 -0600 | [diff] [blame] | 731 | apq8064_i2c_init(); |
Kenneth Heitke | 36920d3 | 2011-07-20 16:44:30 -0600 | [diff] [blame] | 732 | |
Harini Jayaraman | c4c5869 | 2011-07-19 14:50:10 -0600 | [diff] [blame] | 733 | apq8064_device_qup_spi_gsbi5.dev.platform_data = |
| 734 | &apq8064_qup_spi_gsbi5_pdata; |
Stepan Moskovchenko | c1074f0 | 2011-12-14 17:51:57 -0800 | [diff] [blame] | 735 | apq8064_init_pmic(); |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 736 | apq8064_device_otg.dev.platform_data = &msm_otg_pdata; |
Gagan Mac | 8a7a5d3 | 2011-11-11 16:43:06 -0700 | [diff] [blame^] | 737 | apq8064_init_buses(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 738 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Sahitya Tummala | 3586ed9 | 2011-08-03 09:13:23 +0530 | [diff] [blame] | 739 | apq8064_init_mmc(); |
Sagar Dharia | 8bdcdaf | 2011-09-16 16:01:15 -0600 | [diff] [blame] | 740 | slim_register_board_info(apq8064_slim_devices, |
| 741 | ARRAY_SIZE(apq8064_slim_devices)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 742 | } |
| 743 | |
| 744 | static void __init apq8064_sim_init(void) |
| 745 | { |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 746 | struct msm_watchdog_pdata *wdog_pdata = (struct msm_watchdog_pdata *) |
| 747 | &msm8064_device_watchdog.dev.platform_data; |
| 748 | |
| 749 | wdog_pdata->bark_time = 15000; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 750 | apq8064_common_init(); |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 751 | platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices)); |
| 752 | } |
| 753 | |
| 754 | static void __init apq8064_rumi3_init(void) |
| 755 | { |
| 756 | apq8064_common_init(); |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 757 | ethernet_init(); |
Stepan Moskovchenko | 2701a44 | 2011-08-19 13:47:22 -0700 | [diff] [blame] | 758 | platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices)); |
Stepan Moskovchenko | eed82a5 | 2011-09-02 13:19:23 -0700 | [diff] [blame] | 759 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 760 | } |
| 761 | |
| 762 | MACHINE_START(APQ8064_SIM, "QCT APQ8064 SIMULATOR") |
| 763 | .map_io = apq8064_map_io, |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 764 | .reserve = apq8064_reserve, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 765 | .init_irq = apq8064_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 766 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 767 | .timer = &msm_timer, |
| 768 | .init_machine = apq8064_sim_init, |
| 769 | MACHINE_END |
| 770 | |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 771 | MACHINE_START(APQ8064_RUMI3, "QCT APQ8064 RUMI3") |
| 772 | .map_io = apq8064_map_io, |
Kevin Chan | 13be4e2 | 2011-10-20 11:30:32 -0700 | [diff] [blame] | 773 | .reserve = apq8064_reserve, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 774 | .init_irq = apq8064_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 775 | .handle_irq = gic_handle_irq, |
Joel King | 4e7ad22 | 2011-08-17 15:47:38 -0700 | [diff] [blame] | 776 | .timer = &msm_timer, |
| 777 | .init_machine = apq8064_rumi3_init, |
| 778 | MACHINE_END |
| 779 | |