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