Abhijeet Dharmapurikar | 4445166 | 2012-08-23 18:58:44 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [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> |
| 17 | #include <linux/i2c.h> |
| 18 | #include <linux/i2c/sx150x.h> |
| 19 | #include <linux/i2c/isl9519.h> |
| 20 | #include <linux/gpio.h> |
| 21 | #include <linux/msm_ssbi.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 22 | #include <linux/regulator/msm-gpio-regulator.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 23 | #include <linux/mfd/pm8xxx/pm8921.h> |
| 24 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
| 25 | #include <linux/regulator/consumer.h> |
| 26 | #include <linux/spi/spi.h> |
| 27 | #include <linux/slimbus/slimbus.h> |
| 28 | #include <linux/bootmem.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 29 | #ifdef CONFIG_ANDROID_PMEM |
| 30 | #include <linux/android_pmem.h> |
| 31 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 32 | #include <linux/dma-mapping.h> |
| 33 | #include <linux/platform_data/qcom_crypto_device.h> |
| 34 | #include <linux/platform_data/qcom_wcnss_device.h> |
| 35 | #include <linux/leds.h> |
| 36 | #include <linux/leds-pm8xxx.h> |
| 37 | #include <linux/i2c/atmel_mxt_ts.h> |
| 38 | #include <linux/msm_tsens.h> |
| 39 | #include <linux/ks8851.h> |
| 40 | #include <linux/i2c/isa1200.h> |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 41 | #include <linux/gpio_keys.h> |
Jack Cheung | 6ce8f68 | 2012-01-17 10:35:42 -0800 | [diff] [blame] | 42 | #include <linux/memory.h> |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 43 | #include <linux/memblock.h> |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 44 | #include <linux/msm_thermal.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 45 | |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 46 | #include <linux/slimbus/slimbus.h> |
| 47 | #include <linux/mfd/wcd9xxx/core.h> |
| 48 | #include <linux/mfd/wcd9xxx/pdata.h> |
| 49 | |
Wentao Xu | 114c015 | 2012-06-12 11:40:38 -0400 | [diff] [blame] | 50 | #ifdef CONFIG_STM_LIS3DH |
| 51 | #include <linux/input/lis3dh.h> |
| 52 | #endif |
| 53 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 54 | #include <asm/mach-types.h> |
| 55 | #include <asm/mach/arch.h> |
| 56 | #include <asm/setup.h> |
| 57 | #include <asm/hardware/gic.h> |
| 58 | #include <asm/mach/mmc.h> |
| 59 | |
| 60 | #include <mach/board.h> |
| 61 | #include <mach/msm_iomap.h> |
| 62 | #include <mach/msm_spi.h> |
| 63 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 64 | #include <mach/msm_hsusb.h> |
| 65 | #else |
| 66 | #include <linux/usb/msm_hsusb.h> |
| 67 | #endif |
| 68 | #include <linux/usb/android.h> |
| 69 | #include <mach/usbdiag.h> |
| 70 | #include <mach/socinfo.h> |
| 71 | #include <mach/rpm.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 72 | #include <mach/gpiomux.h> |
| 73 | #include <mach/msm_bus_board.h> |
| 74 | #include <mach/msm_memtypes.h> |
| 75 | #include <mach/dma.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 76 | #include <mach/msm_xo.h> |
| 77 | #include <mach/restart.h> |
| 78 | |
Mitchel Humpherys | b805552 | 2012-09-06 11:33:28 -0700 | [diff] [blame] | 79 | #include <linux/msm_ion.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 80 | #include <mach/ion.h> |
| 81 | #include <mach/mdm2.h> |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 82 | #include <mach/msm_rtb.h> |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 83 | #include <linux/fmem.h> |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 84 | #include <mach/msm_cache_dump.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 85 | |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 86 | #include <mach/kgsl.h> |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 87 | #ifdef CONFIG_INPUT_MPU3050 |
| 88 | #include <linux/input/mpu3050.h> |
| 89 | #endif |
| 90 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 91 | #include "timer.h" |
| 92 | #include "devices.h" |
| 93 | #include "devices-msm8x60.h" |
| 94 | #include "spm.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 95 | #include "pm.h" |
Abhijeet Dharmapurikar | efaca4f | 2011-12-27 16:24:07 -0800 | [diff] [blame] | 96 | #include <mach/cpuidle.h> |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 97 | #include "rpm_resources.h" |
Subhash Jadavani | 909e04f | 2012-04-12 10:52:50 +0530 | [diff] [blame] | 98 | #include <mach/mpm.h> |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 99 | #include "clock.h" |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 100 | #include "smd_private.h" |
| 101 | #include "pm-boot.h" |
| 102 | #include "msm_watchdog.h" |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 103 | #include "board-8930.h" |
Patrick Daly | c1227cb | 2012-08-28 13:39:17 -0700 | [diff] [blame] | 104 | #include "acpuclock-krait.h" |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 105 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 106 | static struct platform_device msm_fm_platform_init = { |
| 107 | .name = "iris_fm", |
| 108 | .id = -1, |
| 109 | }; |
| 110 | |
| 111 | #define KS8851_RST_GPIO 89 |
| 112 | #define KS8851_IRQ_GPIO 90 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 113 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 114 | |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 115 | #define HDMI_MHL_MUX_GPIO 73 |
| 116 | #define MHL_GPIO_INT 72 |
| 117 | #define MHL_GPIO_RESET 71 |
| 118 | #define MHL_GPIO_PWR_EN 5 |
| 119 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 120 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
| 121 | |
| 122 | struct sx150x_platform_data msm8930_sx150x_data[] = { |
| 123 | [SX150X_CAM] = { |
| 124 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 125 | .oscio_is_gpo = false, |
| 126 | .io_pullup_ena = 0x0, |
| 127 | .io_pulldn_ena = 0xc0, |
| 128 | .io_open_drain_ena = 0x0, |
| 129 | .irq_summary = -1, |
| 130 | }, |
| 131 | }; |
| 132 | |
| 133 | #endif |
| 134 | |
Olav Haugan | a21169d | 2012-01-04 09:17:06 -0800 | [diff] [blame] | 135 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Jay Wang | 01dbdcf | 2012-10-16 13:32:21 -0700 | [diff] [blame] | 136 | #define MSM_PMEM_AUDIO_SIZE 0x314000 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 137 | #ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY |
| 138 | #define MSM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
| 139 | #else |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 140 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 141 | #endif |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 142 | #define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 143 | |
| 144 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 145 | #define HOLE_SIZE 0x20000 |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 146 | #define MSM_CONTIG_MEM_SIZE 0x65000 |
Hanumant Singh | edfb046 | 2012-05-15 14:49:32 -0700 | [diff] [blame] | 147 | #ifdef CONFIG_MSM_IOMMU |
| 148 | #define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */ |
| 149 | #define MSM_ION_SF_SIZE 0x0 |
Olav Haugan | 494e4dc | 2012-05-15 15:14:31 -0700 | [diff] [blame] | 150 | #define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */ |
Hanumant Singh | edfb046 | 2012-05-15 14:49:32 -0700 | [diff] [blame] | 151 | #define MSM_ION_HEAP_NUM 7 |
| 152 | #else |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 153 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | b88eef1 | 2012-01-15 10:59:26 -0800 | [diff] [blame] | 154 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
Olav Haugan | 494e4dc | 2012-05-15 15:14:31 -0700 | [diff] [blame] | 155 | #define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */ |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 156 | #define MSM_ION_HEAP_NUM 8 |
Hanumant Singh | edfb046 | 2012-05-15 14:49:32 -0700 | [diff] [blame] | 157 | #endif |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 158 | #define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2MB - 128Kb */ |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 159 | #define MSM_ION_MFC_SIZE SZ_8K |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 160 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 161 | |
| 162 | #define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000) |
| 163 | #define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE |
| 164 | #define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE |
| 165 | |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 166 | #define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /*2MB -128Kb */ |
| 167 | #define MSM8930_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \ |
| 168 | HOLE_SIZE)) |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 169 | #define MAX_FIXED_AREA_SIZE 0x10000000 |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 170 | #define MSM8930_FW_START MSM8930_FIXED_AREA_START |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 171 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 172 | #else |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 173 | #define MSM_CONTIG_MEM_SIZE 0x110C000 |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 174 | #define MSM_ION_HEAP_NUM 1 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 175 | #endif |
| 176 | |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 177 | #ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION |
| 178 | static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE; |
| 179 | static int __init msm_contig_mem_size_setup(char *p) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 180 | { |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 181 | msm_contig_mem_size = memparse(p, NULL); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 182 | return 0; |
| 183 | } |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 184 | early_param("msm_contig_mem_size", msm_contig_mem_size_setup); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 185 | #endif |
| 186 | |
| 187 | #ifdef CONFIG_ANDROID_PMEM |
| 188 | static unsigned pmem_size = MSM_PMEM_SIZE; |
| 189 | static int __init pmem_size_setup(char *p) |
| 190 | { |
| 191 | pmem_size = memparse(p, NULL); |
| 192 | return 0; |
| 193 | } |
| 194 | early_param("pmem_size", pmem_size_setup); |
| 195 | |
| 196 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 197 | |
| 198 | static int __init pmem_adsp_size_setup(char *p) |
| 199 | { |
| 200 | pmem_adsp_size = memparse(p, NULL); |
| 201 | return 0; |
| 202 | } |
| 203 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 204 | |
| 205 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 206 | |
| 207 | static int __init pmem_audio_size_setup(char *p) |
| 208 | { |
| 209 | pmem_audio_size = memparse(p, NULL); |
| 210 | return 0; |
| 211 | } |
| 212 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 213 | #endif |
| 214 | |
| 215 | #ifdef CONFIG_ANDROID_PMEM |
| 216 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 217 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 218 | .name = "pmem", |
| 219 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 220 | .cached = 1, |
| 221 | .memory_type = MEMTYPE_EBI1, |
| 222 | }; |
| 223 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 224 | static struct platform_device msm8930_android_pmem_device = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 225 | .name = "android_pmem", |
| 226 | .id = 0, |
| 227 | .dev = {.platform_data = &android_pmem_pdata}, |
| 228 | }; |
| 229 | |
| 230 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 231 | .name = "pmem_adsp", |
| 232 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 233 | .cached = 0, |
| 234 | .memory_type = MEMTYPE_EBI1, |
| 235 | }; |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 236 | static struct platform_device msm8930_android_pmem_adsp_device = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 237 | .name = "android_pmem", |
| 238 | .id = 2, |
| 239 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 240 | }; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 241 | |
| 242 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 243 | .name = "pmem_audio", |
| 244 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 245 | .cached = 0, |
| 246 | .memory_type = MEMTYPE_EBI1, |
| 247 | }; |
| 248 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 249 | static struct platform_device msm8930_android_pmem_audio_device = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 250 | .name = "android_pmem", |
| 251 | .id = 4, |
| 252 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 253 | }; |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 254 | #endif /* CONFIG_MSM_MULTIMEDIA_USE_ION */ |
| 255 | #endif /* CONFIG_ANDROID_PMEM */ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 256 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 257 | struct fmem_platform_data msm8930_fmem_pdata = { |
| 258 | }; |
| 259 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 260 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 261 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 262 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 263 | |
| 264 | static struct resource resources_dspcrashd_8960[] = { |
| 265 | { |
| 266 | .name = "msm_dspcrashd", |
| 267 | .start = DSP_RAM_BASE_8960, |
| 268 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 269 | .flags = IORESOURCE_DMA, |
| 270 | }, |
| 271 | }; |
| 272 | |
| 273 | static struct platform_device msm_device_dspcrashd_8960 = { |
| 274 | .name = "msm_dspcrashd", |
| 275 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 276 | .resource = resources_dspcrashd_8960, |
| 277 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 278 | }; |
| 279 | |
| 280 | static struct memtype_reserve msm8930_reserve_table[] __initdata = { |
| 281 | [MEMTYPE_SMI] = { |
| 282 | }, |
| 283 | [MEMTYPE_EBI0] = { |
| 284 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 285 | }, |
| 286 | [MEMTYPE_EBI1] = { |
| 287 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 288 | }, |
| 289 | }; |
| 290 | |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 291 | |
| 292 | static void __init reserve_rtb_memory(void) |
| 293 | { |
| 294 | #if defined(CONFIG_MSM_RTB) |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 295 | msm8930_reserve_table[MEMTYPE_EBI1].size += msm8930_rtb_pdata.size; |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 296 | #endif |
| 297 | } |
| 298 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 299 | static void __init size_pmem_devices(void) |
| 300 | { |
| 301 | #ifdef CONFIG_ANDROID_PMEM |
| 302 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 303 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
| 304 | android_pmem_pdata.size = pmem_size; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 305 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 306 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 307 | #endif /*CONFIG_ANDROID_PMEM*/ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 308 | } |
| 309 | |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 310 | #ifdef CONFIG_ANDROID_PMEM |
| 311 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 312 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 313 | { |
| 314 | msm8930_reserve_table[p->memory_type].size += p->size; |
| 315 | } |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 316 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 317 | #endif /*CONFIG_ANDROID_PMEM*/ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 318 | |
| 319 | static void __init reserve_pmem_memory(void) |
| 320 | { |
| 321 | #ifdef CONFIG_ANDROID_PMEM |
| 322 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 323 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 324 | reserve_memory_for(&android_pmem_pdata); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 325 | reserve_memory_for(&android_pmem_audio_pdata); |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 326 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 327 | msm8930_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size; |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 328 | #endif /*CONFIG_ANDROID_PMEM*/ |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | static int msm8930_paddr_to_memtype(unsigned int paddr) |
| 332 | { |
| 333 | return MEMTYPE_EBI1; |
| 334 | } |
| 335 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 336 | #define FMEM_ENABLED 0 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 337 | #ifdef CONFIG_ION_MSM |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 338 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 339 | static struct ion_cp_heap_pdata cp_mm_msm8930_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 340 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 341 | .align = PAGE_SIZE, |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 342 | .reusable = FMEM_ENABLED, |
| 343 | .mem_is_fmem = FMEM_ENABLED, |
| 344 | .fixed_position = FIXED_MIDDLE, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 345 | }; |
| 346 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 347 | static struct ion_cp_heap_pdata cp_mfc_msm8930_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 348 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 349 | .align = PAGE_SIZE, |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 350 | .reusable = 0, |
| 351 | .mem_is_fmem = FMEM_ENABLED, |
| 352 | .fixed_position = FIXED_HIGH, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 353 | }; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 354 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 355 | static struct ion_co_heap_pdata co_msm8930_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 356 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 357 | .align = PAGE_SIZE, |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 358 | .mem_is_fmem = 0, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 359 | }; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 360 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 361 | static struct ion_co_heap_pdata fw_co_msm8930_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 362 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 363 | .align = SZ_128K, |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 364 | .mem_is_fmem = FMEM_ENABLED, |
| 365 | .fixed_position = FIXED_LOW, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 366 | }; |
| 367 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 368 | |
| 369 | /** |
| 370 | * These heaps are listed in the order they will be allocated. Due to |
| 371 | * video hardware restrictions and content protection the FW heap has to |
| 372 | * be allocated adjacent (below) the MM heap and the MFC heap has to be |
| 373 | * allocated after the MM heap to ensure MFC heap is not more than 256MB |
| 374 | * away from the base address of the FW heap. |
| 375 | * However, the order of FW heap and MM heap doesn't matter since these |
| 376 | * two heaps are taken care of by separate code to ensure they are adjacent |
| 377 | * to each other. |
| 378 | * Don't swap the order unless you know what you are doing! |
| 379 | */ |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 380 | static struct ion_platform_data msm8930_ion_pdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 381 | .nr = MSM_ION_HEAP_NUM, |
| 382 | .heaps = { |
| 383 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 384 | .id = ION_SYSTEM_HEAP_ID, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 385 | .type = ION_HEAP_TYPE_SYSTEM, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 386 | .name = ION_VMALLOC_HEAP_NAME, |
| 387 | }, |
| 388 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 389 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 390 | .id = ION_CP_MM_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 391 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 392 | .name = ION_MM_HEAP_NAME, |
| 393 | .size = MSM_ION_MM_SIZE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 394 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 395 | .extra_data = (void *) &cp_mm_msm8930_ion_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 396 | }, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 397 | { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 398 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 399 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 400 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 401 | .size = MSM_ION_MM_FW_SIZE, |
| 402 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 403 | .extra_data = (void *) &fw_co_msm8930_ion_pdata, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 404 | }, |
| 405 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 406 | .id = ION_CP_MFC_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 407 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 408 | .name = ION_MFC_HEAP_NAME, |
| 409 | .size = MSM_ION_MFC_SIZE, |
| 410 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 411 | .extra_data = (void *) &cp_mfc_msm8930_ion_pdata, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 412 | }, |
Hanumant Singh | edfb046 | 2012-05-15 14:49:32 -0700 | [diff] [blame] | 413 | #ifndef CONFIG_MSM_IOMMU |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 414 | { |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 415 | .id = ION_SF_HEAP_ID, |
| 416 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 417 | .name = ION_SF_HEAP_NAME, |
| 418 | .size = MSM_ION_SF_SIZE, |
| 419 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 420 | .extra_data = (void *) &co_msm8930_ion_pdata, |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 421 | }, |
Hanumant Singh | edfb046 | 2012-05-15 14:49:32 -0700 | [diff] [blame] | 422 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 423 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 424 | .id = ION_IOMMU_HEAP_ID, |
| 425 | .type = ION_HEAP_TYPE_IOMMU, |
| 426 | .name = ION_IOMMU_HEAP_NAME, |
| 427 | }, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 428 | { |
| 429 | .id = ION_QSECOM_HEAP_ID, |
| 430 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 431 | .name = ION_QSECOM_HEAP_NAME, |
| 432 | .size = MSM_ION_QSECOM_SIZE, |
| 433 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 434 | .extra_data = (void *) &co_msm8930_ion_pdata, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 435 | }, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 436 | { |
| 437 | .id = ION_AUDIO_HEAP_ID, |
| 438 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 439 | .name = ION_AUDIO_HEAP_NAME, |
| 440 | .size = MSM_ION_AUDIO_SIZE, |
| 441 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 442 | .extra_data = (void *) &co_msm8930_ion_pdata, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 443 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 444 | #endif |
| 445 | } |
| 446 | }; |
| 447 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 448 | static struct platform_device msm8930_ion_dev = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 449 | .name = "ion-msm", |
| 450 | .id = 1, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 451 | .dev = { .platform_data = &msm8930_ion_pdata }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 452 | }; |
| 453 | #endif |
| 454 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 455 | struct platform_device msm8930_fmem_device = { |
| 456 | .name = "fmem", |
| 457 | .id = 1, |
| 458 | .dev = { .platform_data = &msm8930_fmem_pdata }, |
| 459 | }; |
| 460 | |
| 461 | static void __init reserve_mem_for_ion(enum ion_memory_types mem_type, |
| 462 | unsigned long size) |
| 463 | { |
| 464 | msm8930_reserve_table[mem_type].size += size; |
| 465 | } |
| 466 | |
| 467 | static void __init msm8930_reserve_fixed_area(unsigned long fixed_area_size) |
| 468 | { |
| 469 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 470 | int ret; |
| 471 | |
| 472 | if (fixed_area_size > MAX_FIXED_AREA_SIZE) |
| 473 | panic("fixed area size is larger than %dM\n", |
| 474 | MAX_FIXED_AREA_SIZE >> 20); |
| 475 | |
| 476 | reserve_info->fixed_area_size = fixed_area_size; |
| 477 | reserve_info->fixed_area_start = MSM8930_FW_START; |
| 478 | |
| 479 | ret = memblock_remove(reserve_info->fixed_area_start, |
| 480 | reserve_info->fixed_area_size); |
| 481 | BUG_ON(ret); |
| 482 | #endif |
| 483 | } |
| 484 | |
| 485 | /** |
| 486 | * Reserve memory for ION and calculate amount of reusable memory for fmem. |
| 487 | * We only reserve memory for heaps that are not reusable. However, we only |
| 488 | * support one reusable heap at the moment so we ignore the reusable flag for |
| 489 | * other than the first heap with reusable flag set. Also handle special case |
| 490 | * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be |
| 491 | * at a higher address than FW in addition to not more than 256MB away from the |
| 492 | * base address of the firmware. This means that if MM is reusable the other |
| 493 | * two heaps must be allocated in the same region as FW. This is handled by the |
| 494 | * mem_is_fmem flag in the platform data. In addition the MM heap must be |
| 495 | * adjacent to the FW heap for content protection purposes. |
| 496 | */ |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 497 | static void __init reserve_ion_memory(void) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 498 | { |
| 499 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 500 | unsigned int i; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 501 | unsigned int fixed_size = 0; |
| 502 | unsigned int fixed_low_size, fixed_middle_size, fixed_high_size; |
| 503 | unsigned long fixed_low_start, fixed_middle_start, fixed_high_start; |
| 504 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 505 | fixed_low_size = 0; |
| 506 | fixed_middle_size = 0; |
| 507 | fixed_high_size = 0; |
| 508 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 509 | for (i = 0; i < msm8930_ion_pdata.nr; ++i) { |
| 510 | const struct ion_platform_heap *heap = |
| 511 | &(msm8930_ion_pdata.heaps[i]); |
| 512 | |
| 513 | if (heap->extra_data) { |
| 514 | int fixed_position = NOT_FIXED; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 515 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 516 | switch ((int) heap->type) { |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 517 | case ION_HEAP_TYPE_CP: |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 518 | fixed_position = ((struct ion_cp_heap_pdata *) |
| 519 | heap->extra_data)->fixed_position; |
| 520 | break; |
| 521 | case ION_HEAP_TYPE_CARVEOUT: |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 522 | fixed_position = ((struct ion_co_heap_pdata *) |
| 523 | heap->extra_data)->fixed_position; |
| 524 | break; |
| 525 | default: |
| 526 | break; |
| 527 | } |
| 528 | |
| 529 | if (fixed_position != NOT_FIXED) |
| 530 | fixed_size += heap->size; |
| 531 | else |
| 532 | reserve_mem_for_ion(MEMTYPE_EBI1, heap->size); |
| 533 | |
| 534 | if (fixed_position == FIXED_LOW) |
| 535 | fixed_low_size += heap->size; |
| 536 | else if (fixed_position == FIXED_MIDDLE) |
| 537 | fixed_middle_size += heap->size; |
| 538 | else if (fixed_position == FIXED_HIGH) |
| 539 | fixed_high_size += heap->size; |
| 540 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 541 | } |
| 542 | } |
| 543 | |
| 544 | if (!fixed_size) |
| 545 | return; |
| 546 | |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 547 | /* Since the fixed area may be carved out of lowmem, |
| 548 | * make sure the length is a multiple of 1M. |
| 549 | */ |
| 550 | fixed_size = (fixed_size + MSM_MM_FW_SIZE + SECTION_SIZE - 1) |
| 551 | & SECTION_MASK; |
| 552 | msm8930_reserve_fixed_area(fixed_size); |
| 553 | |
| 554 | fixed_low_start = MSM8930_FIXED_AREA_START; |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 555 | fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 556 | fixed_high_start = fixed_middle_start + fixed_middle_size; |
| 557 | |
| 558 | for (i = 0; i < msm8930_ion_pdata.nr; ++i) { |
| 559 | struct ion_platform_heap *heap = &(msm8930_ion_pdata.heaps[i]); |
| 560 | |
| 561 | if (heap->extra_data) { |
| 562 | int fixed_position = NOT_FIXED; |
Steve Muckle | 75c34ca | 2012-06-12 14:27:40 -0700 | [diff] [blame] | 563 | struct ion_cp_heap_pdata *pdata = NULL; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 564 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 565 | switch ((int) heap->type) { |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 566 | case ION_HEAP_TYPE_CP: |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 567 | pdata = |
| 568 | (struct ion_cp_heap_pdata *)heap->extra_data; |
| 569 | fixed_position = pdata->fixed_position; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 570 | break; |
| 571 | case ION_HEAP_TYPE_CARVEOUT: |
| 572 | fixed_position = ((struct ion_co_heap_pdata *) |
| 573 | heap->extra_data)->fixed_position; |
| 574 | break; |
| 575 | default: |
| 576 | break; |
| 577 | } |
| 578 | |
| 579 | switch (fixed_position) { |
| 580 | case FIXED_LOW: |
| 581 | heap->base = fixed_low_start; |
| 582 | break; |
| 583 | case FIXED_MIDDLE: |
| 584 | heap->base = fixed_middle_start; |
Deepak Kotur | 9830bf0 | 2012-06-01 15:04:29 -0700 | [diff] [blame] | 585 | pdata->secure_base = fixed_middle_start |
| 586 | - HOLE_SIZE; |
| 587 | pdata->secure_size = HOLE_SIZE + heap->size; |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 588 | break; |
| 589 | case FIXED_HIGH: |
| 590 | heap->base = fixed_high_start; |
| 591 | break; |
| 592 | default: |
| 593 | break; |
| 594 | } |
| 595 | } |
| 596 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 597 | #endif |
| 598 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 599 | |
| 600 | static void __init reserve_mdp_memory(void) |
| 601 | { |
| 602 | msm8930_mdp_writeback(msm8930_reserve_table); |
| 603 | } |
| 604 | |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 605 | #ifdef CONFIG_MSM_CACHE_DUMP |
| 606 | static void __init reserve_cache_dump_memory(void) |
| 607 | { |
| 608 | unsigned int total; |
| 609 | |
| 610 | total = msm8930_cache_dump_pdata.l1_size + |
| 611 | msm8930_cache_dump_pdata.l2_size; |
| 612 | msm8930_reserve_table[MEMTYPE_EBI1].size += total; |
| 613 | } |
| 614 | #else |
| 615 | static void __init reserve_cache_dump_memory(void) { } |
| 616 | #endif |
| 617 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 618 | static void __init msm8930_calculate_reserve_sizes(void) |
| 619 | { |
| 620 | size_pmem_devices(); |
| 621 | reserve_pmem_memory(); |
| 622 | reserve_ion_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 623 | reserve_mdp_memory(); |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 624 | reserve_rtb_memory(); |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 625 | reserve_cache_dump_memory(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 626 | } |
| 627 | |
| 628 | static struct reserve_info msm8930_reserve_info __initdata = { |
| 629 | .memtype_reserve_table = msm8930_reserve_table, |
| 630 | .calculate_reserve_sizes = msm8930_calculate_reserve_sizes, |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 631 | .reserve_fixed_area = msm8930_reserve_fixed_area, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 632 | .paddr_to_memtype = msm8930_paddr_to_memtype, |
| 633 | }; |
| 634 | |
| 635 | static int msm8930_memory_bank_size(void) |
| 636 | { |
| 637 | return 1<<29; |
| 638 | } |
| 639 | |
| 640 | static void __init locate_unstable_memory(void) |
| 641 | { |
| 642 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 643 | unsigned long bank_size; |
| 644 | unsigned long low, high; |
| 645 | |
| 646 | bank_size = msm8930_memory_bank_size(); |
| 647 | low = meminfo.bank[0].start; |
| 648 | high = mb->start + mb->size; |
| 649 | |
| 650 | /* Check if 32 bit overflow occured */ |
| 651 | if (high < mb->start) |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 652 | high -= PAGE_SIZE; |
| 653 | |
| 654 | if (high < MAX_FIXED_AREA_SIZE + MSM8930_FIXED_AREA_START) |
| 655 | panic("fixed area extends beyond end of memory\n"); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 656 | |
| 657 | low &= ~(bank_size - 1); |
| 658 | |
| 659 | if (high - low <= bank_size) |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 660 | goto no_dmm; |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 661 | |
| 662 | msm8930_reserve_info.bank_size = bank_size; |
| 663 | #ifdef CONFIG_ENABLE_DMM |
Jack Cheung | 6ce8f68 | 2012-01-17 10:35:42 -0800 | [diff] [blame] | 664 | msm8930_reserve_info.low_unstable_address = mb->start - |
| 665 | MIN_MEMORY_BLOCK_SIZE + mb->size; |
| 666 | msm8930_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 667 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 668 | msm8930_reserve_info.low_unstable_address, |
| 669 | msm8930_reserve_info.max_unstable_size, |
| 670 | msm8930_reserve_info.bank_size); |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 671 | return; |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 672 | #endif |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 673 | no_dmm: |
| 674 | msm8930_reserve_info.low_unstable_address = high; |
| 675 | msm8930_reserve_info.max_unstable_size = 0; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 676 | } |
| 677 | |
| 678 | static void __init place_movable_zone(void) |
| 679 | { |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 680 | #ifdef CONFIG_ENABLE_DMM |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 681 | movable_reserved_start = msm8930_reserve_info.low_unstable_address; |
| 682 | movable_reserved_size = msm8930_reserve_info.max_unstable_size; |
| 683 | pr_info("movable zone start %lx size %lx\n", |
| 684 | movable_reserved_start, movable_reserved_size); |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 685 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 686 | } |
| 687 | |
| 688 | static void __init msm8930_early_memory(void) |
| 689 | { |
| 690 | reserve_info = &msm8930_reserve_info; |
| 691 | locate_unstable_memory(); |
| 692 | place_movable_zone(); |
| 693 | } |
| 694 | |
Aravind Venkateswaran | 06a4635 | 2012-08-16 14:52:39 -0700 | [diff] [blame] | 695 | static char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 696 | static char ext_panel_name[PANEL_NAME_MAX_LEN]; |
| 697 | |
| 698 | static int __init prim_display_setup(char *param) |
| 699 | { |
| 700 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 701 | strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN); |
| 702 | return 0; |
| 703 | } |
| 704 | early_param("prim_display", prim_display_setup); |
| 705 | |
| 706 | static int __init ext_display_setup(char *param) |
| 707 | { |
| 708 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 709 | strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN); |
| 710 | return 0; |
| 711 | } |
| 712 | early_param("ext_display", ext_display_setup); |
| 713 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 714 | static void __init msm8930_reserve(void) |
| 715 | { |
Aravind Venkateswaran | 06a4635 | 2012-08-16 14:52:39 -0700 | [diff] [blame] | 716 | msm8930_set_display_params(prim_panel_name, ext_panel_name); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 717 | msm_reserve(); |
| 718 | } |
| 719 | |
| 720 | static int msm8930_change_memory_power(u64 start, u64 size, |
| 721 | int change_type) |
| 722 | { |
| 723 | return soc_change_memory_power(start, size, change_type); |
| 724 | } |
| 725 | |
| 726 | static void __init msm8930_allocate_memory_regions(void) |
| 727 | { |
| 728 | msm8930_allocate_fb_region(); |
| 729 | } |
| 730 | |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 731 | #ifdef CONFIG_WCD9304_CODEC |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 732 | |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 733 | #define SITAR_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 734 | |
| 735 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 736 | * 4 micbiases are used to power various analog and digital |
| 737 | * microphones operating at 1800 mV. Technically, all micbiases |
| 738 | * can source from single cfilter since all microphones operate |
| 739 | * at the same voltage level. The arrangement below is to make |
| 740 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 741 | * does not need to be as high as 2.85V. It is choosen for |
| 742 | * microphone sensitivity purpose. |
| 743 | */ |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 744 | static struct wcd9xxx_pdata sitar_platform_data = { |
| 745 | .slimbus_slave_device = { |
| 746 | .name = "sitar-slave", |
| 747 | .e_addr = {0, 0, 0x00, 0, 0x17, 2}, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 748 | }, |
| 749 | .irq = MSM_GPIO_TO_INT(62), |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 750 | .irq_base = SITAR_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 751 | .num_irqs = NR_WCD9XXX_IRQS, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 752 | .reset_gpio = 42, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 753 | .micbias = { |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 754 | .ldoh_v = SITAR_LDOH_2P85_V, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 755 | .cfilt1_mv = 1800, |
| 756 | .cfilt2_mv = 1800, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 757 | .bias1_cfilt_sel = SITAR_CFILT1_SEL, |
| 758 | .bias2_cfilt_sel = SITAR_CFILT2_SEL, |
Bhalchandra Gajare | 15dbeaa | 2012-06-26 12:53:07 -0700 | [diff] [blame] | 759 | .bias1_cap_mode = MICBIAS_EXT_BYP_CAP, |
| 760 | .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 761 | }, |
| 762 | .regulator = { |
| 763 | { |
| 764 | .name = "CDC_VDD_CP", |
Bhalchandra Gajare | e94bac2 | 2012-10-08 19:16:13 -0700 | [diff] [blame] | 765 | .min_uV = 2200000, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 766 | .max_uV = 2200000, |
| 767 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 768 | }, |
| 769 | { |
| 770 | .name = "CDC_VDDA_RX", |
| 771 | .min_uV = 1800000, |
| 772 | .max_uV = 1800000, |
| 773 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 774 | }, |
| 775 | { |
| 776 | .name = "CDC_VDDA_TX", |
| 777 | .min_uV = 1800000, |
| 778 | .max_uV = 1800000, |
| 779 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 780 | }, |
| 781 | { |
| 782 | .name = "VDDIO_CDC", |
| 783 | .min_uV = 1800000, |
| 784 | .max_uV = 1800000, |
| 785 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 786 | }, |
| 787 | { |
| 788 | .name = "VDDD_CDC_D", |
| 789 | .min_uV = 1200000, |
David Collins | 19e7881 | 2012-06-04 15:50:09 -0700 | [diff] [blame] | 790 | .max_uV = 1250000, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 791 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 792 | }, |
| 793 | { |
| 794 | .name = "CDC_VDDA_A_1P2V", |
| 795 | .min_uV = 1200000, |
David Collins | 19e7881 | 2012-06-04 15:50:09 -0700 | [diff] [blame] | 796 | .max_uV = 1250000, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 797 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 798 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 799 | }, |
| 800 | }; |
| 801 | |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 802 | static struct slim_device msm_slim_sitar = { |
| 803 | .name = "sitar-slim", |
| 804 | .e_addr = {0, 1, 0x00, 0, 0x17, 2}, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 805 | .dev = { |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 806 | .platform_data = &sitar_platform_data, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 807 | }, |
| 808 | }; |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 809 | |
| 810 | static struct wcd9xxx_pdata sitar1p1_platform_data = { |
| 811 | .slimbus_slave_device = { |
| 812 | .name = "sitar-slave", |
| 813 | .e_addr = {0, 0, 0x70, 0, 0x17, 2}, |
| 814 | }, |
| 815 | .irq = MSM_GPIO_TO_INT(62), |
| 816 | .irq_base = SITAR_INTERRUPT_BASE, |
| 817 | .num_irqs = NR_WCD9XXX_IRQS, |
| 818 | .reset_gpio = 42, |
| 819 | .micbias = { |
| 820 | .ldoh_v = SITAR_LDOH_2P85_V, |
| 821 | .cfilt1_mv = 1800, |
| 822 | .cfilt2_mv = 1800, |
| 823 | .bias1_cfilt_sel = SITAR_CFILT1_SEL, |
| 824 | .bias2_cfilt_sel = SITAR_CFILT2_SEL, |
Bhalchandra Gajare | 15dbeaa | 2012-06-26 12:53:07 -0700 | [diff] [blame] | 825 | .bias1_cap_mode = MICBIAS_EXT_BYP_CAP, |
| 826 | .bias2_cap_mode = MICBIAS_NO_EXT_BYP_CAP, |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 827 | }, |
| 828 | .regulator = { |
| 829 | { |
| 830 | .name = "CDC_VDD_CP", |
Bhalchandra Gajare | e94bac2 | 2012-10-08 19:16:13 -0700 | [diff] [blame] | 831 | .min_uV = 2200000, |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 832 | .max_uV = 2200000, |
| 833 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 834 | }, |
| 835 | { |
| 836 | .name = "CDC_VDDA_RX", |
| 837 | .min_uV = 1800000, |
| 838 | .max_uV = 1800000, |
| 839 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 840 | }, |
| 841 | { |
| 842 | .name = "CDC_VDDA_TX", |
| 843 | .min_uV = 1800000, |
| 844 | .max_uV = 1800000, |
| 845 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 846 | }, |
| 847 | { |
| 848 | .name = "VDDIO_CDC", |
| 849 | .min_uV = 1800000, |
| 850 | .max_uV = 1800000, |
| 851 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 852 | }, |
| 853 | { |
| 854 | .name = "VDDD_CDC_D", |
| 855 | .min_uV = 1200000, |
David Collins | 19e7881 | 2012-06-04 15:50:09 -0700 | [diff] [blame] | 856 | .max_uV = 1250000, |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 857 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 858 | }, |
| 859 | { |
| 860 | .name = "CDC_VDDA_A_1P2V", |
| 861 | .min_uV = 1200000, |
David Collins | 19e7881 | 2012-06-04 15:50:09 -0700 | [diff] [blame] | 862 | .max_uV = 1250000, |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 863 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 864 | }, |
| 865 | }, |
| 866 | }; |
| 867 | |
| 868 | static struct slim_device msm_slim_sitar1p1 = { |
| 869 | .name = "sitar1p1-slim", |
| 870 | .e_addr = {0, 1, 0x70, 0, 0x17, 2}, |
| 871 | .dev = { |
| 872 | .platform_data = &sitar1p1_platform_data, |
| 873 | }, |
| 874 | }; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 875 | #endif |
| 876 | |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 877 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 878 | static struct slim_boardinfo msm_slim_devices[] = { |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 879 | #ifdef CONFIG_WCD9304_CODEC |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 880 | { |
| 881 | .bus_num = 1, |
Asish Bhattacharya | b86c347 | 2012-02-15 08:31:52 +0530 | [diff] [blame] | 882 | .slim_slave = &msm_slim_sitar, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 883 | }, |
Bhalchandra Gajare | 83c81f6 | 2012-05-18 16:09:05 -0700 | [diff] [blame] | 884 | { |
| 885 | .bus_num = 1, |
| 886 | .slim_slave = &msm_slim_sitar1p1, |
| 887 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 888 | #endif |
| 889 | /* add more slimbus slaves as needed */ |
| 890 | }; |
| 891 | |
| 892 | #define MSM_WCNSS_PHYS 0x03000000 |
| 893 | #define MSM_WCNSS_SIZE 0x280000 |
| 894 | |
| 895 | static struct resource resources_wcnss_wlan[] = { |
| 896 | { |
| 897 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 898 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 899 | .name = "wcnss_wlanrx_irq", |
| 900 | .flags = IORESOURCE_IRQ, |
| 901 | }, |
| 902 | { |
| 903 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 904 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 905 | .name = "wcnss_wlantx_irq", |
| 906 | .flags = IORESOURCE_IRQ, |
| 907 | }, |
| 908 | { |
| 909 | .start = MSM_WCNSS_PHYS, |
| 910 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 911 | .name = "wcnss_mmio", |
| 912 | .flags = IORESOURCE_MEM, |
| 913 | }, |
| 914 | { |
| 915 | .start = 84, |
| 916 | .end = 88, |
| 917 | .name = "wcnss_gpios_5wire", |
| 918 | .flags = IORESOURCE_IO, |
| 919 | }, |
| 920 | }; |
| 921 | |
| 922 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 923 | .has_48mhz_xo = 1, |
| 924 | }; |
| 925 | |
| 926 | static struct platform_device msm_device_wcnss_wlan = { |
| 927 | .name = "wcnss_wlan", |
| 928 | .id = 0, |
| 929 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 930 | .resource = resources_wcnss_wlan, |
| 931 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
| 932 | }; |
| 933 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 934 | #ifdef CONFIG_QSEECOM |
| 935 | /* qseecom bus scaling */ |
| 936 | static struct msm_bus_vectors qseecom_clks_init_vectors[] = { |
| 937 | { |
| 938 | .src = MSM_BUS_MASTER_SPS, |
| 939 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 940 | .ib = 0, |
| 941 | .ab = 0, |
| 942 | }, |
| 943 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 944 | .src = MSM_BUS_MASTER_SPS, |
| 945 | .dst = MSM_BUS_SLAVE_SPS, |
| 946 | .ib = 0, |
| 947 | .ab = 0, |
| 948 | }, |
| 949 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 950 | .src = MSM_BUS_MASTER_SPDM, |
| 951 | .dst = MSM_BUS_SLAVE_SPDM, |
| 952 | .ib = 0, |
| 953 | .ab = 0, |
| 954 | }, |
| 955 | }; |
| 956 | |
| 957 | static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = { |
| 958 | { |
| 959 | .src = MSM_BUS_MASTER_SPS, |
| 960 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 961 | .ib = (492 * 8) * 1000000UL, |
| 962 | .ab = (492 * 8) * 100000UL, |
| 963 | }, |
| 964 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 965 | .src = MSM_BUS_MASTER_SPS, |
| 966 | .dst = MSM_BUS_SLAVE_SPS, |
| 967 | .ib = (492 * 8) * 1000000UL, |
| 968 | .ab = (492 * 8) * 100000UL, |
| 969 | }, |
| 970 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 971 | .src = MSM_BUS_MASTER_SPDM, |
| 972 | .dst = MSM_BUS_SLAVE_SPDM, |
| 973 | .ib = 0, |
| 974 | .ab = 0, |
| 975 | }, |
| 976 | }; |
| 977 | |
| 978 | static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = { |
| 979 | { |
| 980 | .src = MSM_BUS_MASTER_SPS, |
| 981 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 982 | .ib = 0, |
| 983 | .ab = 0, |
| 984 | }, |
| 985 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 986 | .src = MSM_BUS_MASTER_SPS, |
| 987 | .dst = MSM_BUS_SLAVE_SPS, |
| 988 | .ib = 0, |
| 989 | .ab = 0, |
| 990 | }, |
| 991 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 992 | .src = MSM_BUS_MASTER_SPDM, |
| 993 | .dst = MSM_BUS_SLAVE_SPDM, |
| 994 | .ib = (64 * 8) * 1000000UL, |
| 995 | .ab = (64 * 8) * 100000UL, |
| 996 | }, |
| 997 | }; |
| 998 | |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 999 | static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = { |
| 1000 | { |
| 1001 | .src = MSM_BUS_MASTER_SPS, |
| 1002 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1003 | .ib = (492 * 8) * 1000000UL, |
| 1004 | .ab = (492 * 8) * 100000UL, |
| 1005 | }, |
| 1006 | { |
| 1007 | .src = MSM_BUS_MASTER_SPS, |
| 1008 | .dst = MSM_BUS_SLAVE_SPS, |
| 1009 | .ib = (492 * 8) * 1000000UL, |
| 1010 | .ab = (492 * 8) * 100000UL, |
| 1011 | }, |
| 1012 | { |
| 1013 | .src = MSM_BUS_MASTER_SPDM, |
| 1014 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1015 | .ib = (64 * 8) * 1000000UL, |
| 1016 | .ab = (64 * 8) * 100000UL, |
| 1017 | }, |
| 1018 | }; |
| 1019 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1020 | static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = { |
| 1021 | { |
| 1022 | ARRAY_SIZE(qseecom_clks_init_vectors), |
| 1023 | qseecom_clks_init_vectors, |
| 1024 | }, |
| 1025 | { |
| 1026 | ARRAY_SIZE(qseecom_enable_dfab_vectors), |
| 1027 | qseecom_enable_sfpb_vectors, |
| 1028 | }, |
| 1029 | { |
| 1030 | ARRAY_SIZE(qseecom_enable_sfpb_vectors), |
| 1031 | qseecom_enable_sfpb_vectors, |
| 1032 | }, |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1033 | { |
| 1034 | ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors), |
| 1035 | qseecom_enable_dfab_sfpb_vectors, |
| 1036 | }, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1037 | }; |
| 1038 | |
| 1039 | static struct msm_bus_scale_pdata qseecom_bus_pdata = { |
| 1040 | qseecom_hw_bus_scale_usecases, |
| 1041 | ARRAY_SIZE(qseecom_hw_bus_scale_usecases), |
| 1042 | .name = "qsee", |
| 1043 | }; |
| 1044 | |
| 1045 | static struct platform_device qseecom_device = { |
| 1046 | .name = "qseecom", |
| 1047 | .id = 0, |
| 1048 | .dev = { |
| 1049 | .platform_data = &qseecom_bus_pdata, |
| 1050 | }, |
| 1051 | }; |
| 1052 | #endif |
| 1053 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1054 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1055 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 1056 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1057 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1058 | |
| 1059 | #define QCE_SIZE 0x10000 |
| 1060 | #define QCE_0_BASE 0x18500000 |
| 1061 | |
| 1062 | #define QCE_HW_KEY_SUPPORT 0 |
| 1063 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 1064 | #define QCE_SHARE_CE_RESOURCE 1 |
| 1065 | #define QCE_CE_SHARED 0 |
| 1066 | |
Ramesh Masavarapu | 992faf6 | 2012-06-15 20:21:39 -0700 | [diff] [blame] | 1067 | /* Begin Bus scaling definitions */ |
| 1068 | static struct msm_bus_vectors crypto_hw_init_vectors[] = { |
| 1069 | { |
| 1070 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1071 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1072 | .ab = 0, |
| 1073 | .ib = 0, |
| 1074 | }, |
| 1075 | { |
| 1076 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1077 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1078 | .ab = 0, |
| 1079 | .ib = 0, |
| 1080 | }, |
| 1081 | }; |
| 1082 | |
| 1083 | static struct msm_bus_vectors crypto_hw_active_vectors[] = { |
| 1084 | { |
| 1085 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1086 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1087 | .ab = 70000000UL, |
| 1088 | .ib = 70000000UL, |
| 1089 | }, |
| 1090 | { |
| 1091 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1092 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1093 | .ab = 2480000000UL, |
| 1094 | .ib = 2480000000UL, |
| 1095 | }, |
| 1096 | }; |
| 1097 | |
| 1098 | static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = { |
| 1099 | { |
| 1100 | ARRAY_SIZE(crypto_hw_init_vectors), |
| 1101 | crypto_hw_init_vectors, |
| 1102 | }, |
| 1103 | { |
| 1104 | ARRAY_SIZE(crypto_hw_active_vectors), |
| 1105 | crypto_hw_active_vectors, |
| 1106 | }, |
| 1107 | }; |
| 1108 | |
| 1109 | static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = { |
| 1110 | crypto_hw_bus_scale_usecases, |
| 1111 | ARRAY_SIZE(crypto_hw_bus_scale_usecases), |
| 1112 | .name = "cryptohw", |
| 1113 | }; |
| 1114 | /* End Bus Scaling Definitions*/ |
| 1115 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1116 | static struct resource qcrypto_resources[] = { |
| 1117 | [0] = { |
| 1118 | .start = QCE_0_BASE, |
| 1119 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1120 | .flags = IORESOURCE_MEM, |
| 1121 | }, |
| 1122 | [1] = { |
| 1123 | .name = "crypto_channels", |
| 1124 | .start = DMOV_CE_IN_CHAN, |
| 1125 | .end = DMOV_CE_OUT_CHAN, |
| 1126 | .flags = IORESOURCE_DMA, |
| 1127 | }, |
| 1128 | [2] = { |
| 1129 | .name = "crypto_crci_in", |
| 1130 | .start = DMOV_CE_IN_CRCI, |
| 1131 | .end = DMOV_CE_IN_CRCI, |
| 1132 | .flags = IORESOURCE_DMA, |
| 1133 | }, |
| 1134 | [3] = { |
| 1135 | .name = "crypto_crci_out", |
| 1136 | .start = DMOV_CE_OUT_CRCI, |
| 1137 | .end = DMOV_CE_OUT_CRCI, |
| 1138 | .flags = IORESOURCE_DMA, |
| 1139 | }, |
| 1140 | }; |
| 1141 | |
| 1142 | static struct resource qcedev_resources[] = { |
| 1143 | [0] = { |
| 1144 | .start = QCE_0_BASE, |
| 1145 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1146 | .flags = IORESOURCE_MEM, |
| 1147 | }, |
| 1148 | [1] = { |
| 1149 | .name = "crypto_channels", |
| 1150 | .start = DMOV_CE_IN_CHAN, |
| 1151 | .end = DMOV_CE_OUT_CHAN, |
| 1152 | .flags = IORESOURCE_DMA, |
| 1153 | }, |
| 1154 | [2] = { |
| 1155 | .name = "crypto_crci_in", |
| 1156 | .start = DMOV_CE_IN_CRCI, |
| 1157 | .end = DMOV_CE_IN_CRCI, |
| 1158 | .flags = IORESOURCE_DMA, |
| 1159 | }, |
| 1160 | [3] = { |
| 1161 | .name = "crypto_crci_out", |
| 1162 | .start = DMOV_CE_OUT_CRCI, |
| 1163 | .end = DMOV_CE_OUT_CRCI, |
| 1164 | .flags = IORESOURCE_DMA, |
| 1165 | }, |
| 1166 | }; |
| 1167 | |
| 1168 | #endif |
| 1169 | |
| 1170 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1171 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1172 | |
| 1173 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1174 | .ce_shared = QCE_CE_SHARED, |
| 1175 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1176 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1177 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 992faf6 | 2012-06-15 20:21:39 -0700 | [diff] [blame] | 1178 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1179 | }; |
| 1180 | |
| 1181 | static struct platform_device qcrypto_device = { |
| 1182 | .name = "qcrypto", |
| 1183 | .id = 0, |
| 1184 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1185 | .resource = qcrypto_resources, |
| 1186 | .dev = { |
| 1187 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1188 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1189 | }, |
| 1190 | }; |
| 1191 | #endif |
| 1192 | |
| 1193 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1194 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1195 | |
| 1196 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1197 | .ce_shared = QCE_CE_SHARED, |
| 1198 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1199 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1200 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 992faf6 | 2012-06-15 20:21:39 -0700 | [diff] [blame] | 1201 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1202 | }; |
| 1203 | |
| 1204 | static struct platform_device qcedev_device = { |
| 1205 | .name = "qce", |
| 1206 | .id = 0, |
| 1207 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1208 | .resource = qcedev_resources, |
| 1209 | .dev = { |
| 1210 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1211 | .platform_data = &qcedev_ce_hw_suppport, |
| 1212 | }, |
| 1213 | }; |
| 1214 | #endif |
| 1215 | |
| 1216 | #define MDM2AP_ERRFATAL 70 |
| 1217 | #define AP2MDM_ERRFATAL 95 |
| 1218 | #define MDM2AP_STATUS 69 |
| 1219 | #define AP2MDM_STATUS 94 |
| 1220 | #define AP2MDM_PMIC_RESET_N 80 |
| 1221 | #define AP2MDM_KPDPWR_N 81 |
| 1222 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1223 | static struct resource mdm_resources[] = { |
| 1224 | { |
| 1225 | .start = MDM2AP_ERRFATAL, |
| 1226 | .end = MDM2AP_ERRFATAL, |
| 1227 | .name = "MDM2AP_ERRFATAL", |
| 1228 | .flags = IORESOURCE_IO, |
| 1229 | }, |
| 1230 | { |
| 1231 | .start = AP2MDM_ERRFATAL, |
| 1232 | .end = AP2MDM_ERRFATAL, |
| 1233 | .name = "AP2MDM_ERRFATAL", |
| 1234 | .flags = IORESOURCE_IO, |
| 1235 | }, |
| 1236 | { |
| 1237 | .start = MDM2AP_STATUS, |
| 1238 | .end = MDM2AP_STATUS, |
| 1239 | .name = "MDM2AP_STATUS", |
| 1240 | .flags = IORESOURCE_IO, |
| 1241 | }, |
| 1242 | { |
| 1243 | .start = AP2MDM_STATUS, |
| 1244 | .end = AP2MDM_STATUS, |
| 1245 | .name = "AP2MDM_STATUS", |
| 1246 | .flags = IORESOURCE_IO, |
| 1247 | }, |
| 1248 | { |
| 1249 | .start = AP2MDM_PMIC_RESET_N, |
| 1250 | .end = AP2MDM_PMIC_RESET_N, |
| 1251 | .name = "AP2MDM_PMIC_RESET_N", |
| 1252 | .flags = IORESOURCE_IO, |
| 1253 | }, |
| 1254 | { |
| 1255 | .start = AP2MDM_KPDPWR_N, |
| 1256 | .end = AP2MDM_KPDPWR_N, |
| 1257 | .name = "AP2MDM_KPDPWR_N", |
| 1258 | .flags = IORESOURCE_IO, |
| 1259 | }, |
| 1260 | }; |
| 1261 | |
| 1262 | static struct mdm_platform_data mdm_platform_data = { |
| 1263 | .mdm_version = "2.5", |
| 1264 | }; |
| 1265 | |
| 1266 | static struct platform_device mdm_device = { |
| 1267 | .name = "mdm2_modem", |
| 1268 | .id = -1, |
| 1269 | .num_resources = ARRAY_SIZE(mdm_resources), |
| 1270 | .resource = mdm_resources, |
| 1271 | .dev = { |
| 1272 | .platform_data = &mdm_platform_data, |
| 1273 | }, |
| 1274 | }; |
| 1275 | |
| 1276 | static struct platform_device *mdm_devices[] __initdata = { |
| 1277 | &mdm_device, |
| 1278 | }; |
| 1279 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1280 | #ifdef CONFIG_MSM_MPM |
| 1281 | static uint16_t msm_mpm_irqs_m2a[MSM_MPM_NR_MPM_IRQS] __initdata = { |
| 1282 | [1] = MSM_GPIO_TO_INT(46), |
| 1283 | [2] = MSM_GPIO_TO_INT(150), |
| 1284 | [4] = MSM_GPIO_TO_INT(103), |
| 1285 | [5] = MSM_GPIO_TO_INT(104), |
| 1286 | [6] = MSM_GPIO_TO_INT(105), |
| 1287 | [7] = MSM_GPIO_TO_INT(106), |
| 1288 | [8] = MSM_GPIO_TO_INT(107), |
| 1289 | [9] = MSM_GPIO_TO_INT(7), |
| 1290 | [10] = MSM_GPIO_TO_INT(11), |
| 1291 | [11] = MSM_GPIO_TO_INT(15), |
| 1292 | [12] = MSM_GPIO_TO_INT(19), |
| 1293 | [13] = MSM_GPIO_TO_INT(23), |
| 1294 | [14] = MSM_GPIO_TO_INT(27), |
| 1295 | [15] = MSM_GPIO_TO_INT(31), |
| 1296 | [16] = MSM_GPIO_TO_INT(35), |
| 1297 | [19] = MSM_GPIO_TO_INT(90), |
| 1298 | [20] = MSM_GPIO_TO_INT(92), |
| 1299 | [23] = MSM_GPIO_TO_INT(85), |
| 1300 | [24] = MSM_GPIO_TO_INT(83), |
| 1301 | [25] = USB1_HS_IRQ, |
Mahesh Sivasubramanian | 47e38a8 | 2012-03-06 09:35:26 -0700 | [diff] [blame] | 1302 | [26] = MSM_GPIO_TO_INT(6), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1303 | [27] = HDMI_IRQ, |
| 1304 | [29] = MSM_GPIO_TO_INT(10), |
| 1305 | [30] = MSM_GPIO_TO_INT(102), |
| 1306 | [31] = MSM_GPIO_TO_INT(81), |
| 1307 | [32] = MSM_GPIO_TO_INT(78), |
| 1308 | [33] = MSM_GPIO_TO_INT(94), |
| 1309 | [34] = MSM_GPIO_TO_INT(72), |
| 1310 | [35] = MSM_GPIO_TO_INT(39), |
| 1311 | [36] = MSM_GPIO_TO_INT(43), |
| 1312 | [37] = MSM_GPIO_TO_INT(61), |
| 1313 | [38] = MSM_GPIO_TO_INT(50), |
| 1314 | [39] = MSM_GPIO_TO_INT(42), |
| 1315 | [41] = MSM_GPIO_TO_INT(62), |
Mahesh Sivasubramanian | 47e38a8 | 2012-03-06 09:35:26 -0700 | [diff] [blame] | 1316 | [42] = MSM_GPIO_TO_INT(8), |
| 1317 | [43] = MSM_GPIO_TO_INT(33), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1318 | [44] = MSM_GPIO_TO_INT(70), |
| 1319 | [45] = MSM_GPIO_TO_INT(69), |
| 1320 | [46] = MSM_GPIO_TO_INT(67), |
| 1321 | [47] = MSM_GPIO_TO_INT(65), |
Mahesh Sivasubramanian | 47e38a8 | 2012-03-06 09:35:26 -0700 | [diff] [blame] | 1322 | [48] = MSM_GPIO_TO_INT(55), |
| 1323 | [49] = MSM_GPIO_TO_INT(74), |
| 1324 | [50] = MSM_GPIO_TO_INT(98), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1325 | [51] = MSM_GPIO_TO_INT(49), |
| 1326 | [52] = MSM_GPIO_TO_INT(40), |
| 1327 | [53] = MSM_GPIO_TO_INT(37), |
| 1328 | [54] = MSM_GPIO_TO_INT(24), |
| 1329 | [55] = MSM_GPIO_TO_INT(14), |
| 1330 | }; |
| 1331 | |
| 1332 | static uint16_t msm_mpm_bypassed_apps_irqs[] __initdata = { |
| 1333 | TLMM_MSM_SUMMARY_IRQ, |
| 1334 | RPM_APCC_CPU0_GP_HIGH_IRQ, |
| 1335 | RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 1336 | RPM_APCC_CPU0_GP_LOW_IRQ, |
| 1337 | RPM_APCC_CPU0_WAKE_UP_IRQ, |
| 1338 | RPM_APCC_CPU1_GP_HIGH_IRQ, |
| 1339 | RPM_APCC_CPU1_GP_MEDIUM_IRQ, |
| 1340 | RPM_APCC_CPU1_GP_LOW_IRQ, |
| 1341 | RPM_APCC_CPU1_WAKE_UP_IRQ, |
| 1342 | MSS_TO_APPS_IRQ_0, |
| 1343 | MSS_TO_APPS_IRQ_1, |
| 1344 | MSS_TO_APPS_IRQ_2, |
| 1345 | MSS_TO_APPS_IRQ_3, |
| 1346 | MSS_TO_APPS_IRQ_4, |
| 1347 | MSS_TO_APPS_IRQ_5, |
| 1348 | MSS_TO_APPS_IRQ_6, |
| 1349 | MSS_TO_APPS_IRQ_7, |
| 1350 | MSS_TO_APPS_IRQ_8, |
| 1351 | MSS_TO_APPS_IRQ_9, |
| 1352 | LPASS_SCSS_GP_LOW_IRQ, |
| 1353 | LPASS_SCSS_GP_MEDIUM_IRQ, |
| 1354 | LPASS_SCSS_GP_HIGH_IRQ, |
| 1355 | SPS_MTI_30, |
| 1356 | SPS_MTI_31, |
| 1357 | RIVA_APSS_SPARE_IRQ, |
| 1358 | RIVA_APPS_WLAN_SMSM_IRQ, |
| 1359 | RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 1360 | RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 1361 | }; |
| 1362 | |
| 1363 | struct msm_mpm_device_data msm8930_mpm_dev_data __initdata = { |
| 1364 | .irqs_m2a = msm_mpm_irqs_m2a, |
| 1365 | .irqs_m2a_size = ARRAY_SIZE(msm_mpm_irqs_m2a), |
| 1366 | .bypassed_apps_irqs = msm_mpm_bypassed_apps_irqs, |
| 1367 | .bypassed_apps_irqs_size = ARRAY_SIZE(msm_mpm_bypassed_apps_irqs), |
| 1368 | .mpm_request_reg_base = MSM_RPM_BASE + 0x9d8, |
| 1369 | .mpm_status_reg_base = MSM_RPM_BASE + 0xdf8, |
| 1370 | .mpm_apps_ipc_reg = MSM_APCS_GCC_BASE + 0x008, |
| 1371 | .mpm_apps_ipc_val = BIT(1), |
| 1372 | .mpm_ipc_irq = RPM_APCC_CPU0_GP_MEDIUM_IRQ, |
| 1373 | |
| 1374 | }; |
| 1375 | #endif |
| 1376 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1377 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 1378 | |
| 1379 | static void __init msm8930_map_io(void) |
| 1380 | { |
| 1381 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
| 1382 | msm_map_msm8930_io(); |
| 1383 | |
| 1384 | if (socinfo_init() < 0) |
| 1385 | pr_err("socinfo_init() failed!\n"); |
| 1386 | } |
| 1387 | |
| 1388 | static void __init msm8930_init_irq(void) |
| 1389 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1390 | struct msm_mpm_device_data *data = NULL; |
| 1391 | #ifdef CONFIG_MSM_MPM |
| 1392 | data = &msm8930_mpm_dev_data; |
| 1393 | #endif |
| 1394 | |
| 1395 | msm_mpm_irq_extn_init(data); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1396 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
| 1397 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1398 | } |
| 1399 | |
| 1400 | static void __init msm8930_init_buses(void) |
| 1401 | { |
| 1402 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1403 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | cd5b327 | 2012-02-09 18:13:10 -0700 | [diff] [blame] | 1404 | msm_bus_8930_apps_fabric_pdata.rpm_enabled = 1; |
| 1405 | msm_bus_8930_sys_fabric_pdata.rpm_enabled = 1; |
| 1406 | msm_bus_8930_mm_fabric_pdata.rpm_enabled = 1; |
| 1407 | msm_bus_8930_apps_fabric.dev.platform_data = |
| 1408 | &msm_bus_8930_apps_fabric_pdata; |
| 1409 | msm_bus_8930_sys_fabric.dev.platform_data = |
| 1410 | &msm_bus_8930_sys_fabric_pdata; |
| 1411 | msm_bus_8930_mm_fabric.dev.platform_data = |
| 1412 | &msm_bus_8930_mm_fabric_pdata; |
| 1413 | msm_bus_8930_sys_fpb.dev.platform_data = &msm_bus_8930_sys_fpb_pdata; |
| 1414 | msm_bus_8930_cpss_fpb.dev.platform_data = &msm_bus_8930_cpss_fpb_pdata; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1415 | #endif |
| 1416 | } |
| 1417 | |
| 1418 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 1419 | .max_clock_speed = 15060000, |
| 1420 | }; |
| 1421 | |
| 1422 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 1423 | static struct msm_otg_platform_data msm_otg_pdata; |
| 1424 | #else |
Manu Gautam | 32ab946 | 2012-02-20 12:33:01 +0530 | [diff] [blame] | 1425 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1426 | /* Bandwidth requests (zero) if no vote placed */ |
| 1427 | static struct msm_bus_vectors usb_init_vectors[] = { |
| 1428 | { |
| 1429 | .src = MSM_BUS_MASTER_SPS, |
| 1430 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1431 | .ab = 0, |
| 1432 | .ib = 0, |
| 1433 | }, |
| 1434 | }; |
| 1435 | |
| 1436 | /* Bus bandwidth requests in Bytes/sec */ |
| 1437 | static struct msm_bus_vectors usb_max_vectors[] = { |
| 1438 | { |
| 1439 | .src = MSM_BUS_MASTER_SPS, |
| 1440 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1441 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 1442 | .ib = 960000000, /* MAX bursts rate */ |
| 1443 | }, |
| 1444 | }; |
| 1445 | |
| 1446 | static struct msm_bus_paths usb_bus_scale_usecases[] = { |
| 1447 | { |
| 1448 | ARRAY_SIZE(usb_init_vectors), |
| 1449 | usb_init_vectors, |
| 1450 | }, |
| 1451 | { |
| 1452 | ARRAY_SIZE(usb_max_vectors), |
| 1453 | usb_max_vectors, |
| 1454 | }, |
| 1455 | }; |
| 1456 | |
| 1457 | static struct msm_bus_scale_pdata usb_bus_scale_pdata = { |
| 1458 | usb_bus_scale_usecases, |
| 1459 | ARRAY_SIZE(usb_bus_scale_usecases), |
| 1460 | .name = "usb", |
| 1461 | }; |
| 1462 | #endif |
| 1463 | |
Mayank Rana | 2fe1aec | 2012-06-07 18:00:12 +0530 | [diff] [blame] | 1464 | static int hsusb_phy_init_seq[] = { |
| 1465 | 0x44, 0x80, /* set VBUS valid threshold |
| 1466 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1467 | 0x68, 0x81, /* update DC voltage level */ |
Mayank Rana | 2fe1aec | 2012-06-07 18:00:12 +0530 | [diff] [blame] | 1468 | 0x24, 0x82, /* set preemphasis and rise/fall time */ |
| 1469 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1470 | -1}; |
| 1471 | |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1472 | #define MSM_MPM_PIN_USB1_OTGSESSVLD 40 |
| 1473 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1474 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 1475 | .mode = USB_OTG, |
| 1476 | .otg_control = OTG_PMIC_CONTROL, |
| 1477 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 1478 | .pmic_id_irq = PM8038_USB_ID_IN_IRQ(PM8038_IRQ_BASE), |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1479 | .power_budget = 750, |
Manu Gautam | 32ab946 | 2012-02-20 12:33:01 +0530 | [diff] [blame] | 1480 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1481 | .bus_scale_table = &usb_bus_scale_pdata, |
| 1482 | #endif |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 1483 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 1484 | .mhl_dev_name = "sii8334", |
| 1485 | #endif |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1486 | .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1487 | }; |
| 1488 | #endif |
| 1489 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1490 | #define PID_MAGIC_ID 0x71432909 |
| 1491 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 1492 | #define SERIAL_NUMBER_LENGTH 127 |
| 1493 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 1494 | |
| 1495 | struct magic_num_struct { |
| 1496 | uint32_t pid; |
| 1497 | uint32_t serial_num; |
| 1498 | }; |
| 1499 | |
| 1500 | struct dload_struct { |
| 1501 | uint32_t reserved1; |
| 1502 | uint32_t reserved2; |
| 1503 | uint32_t reserved3; |
| 1504 | uint16_t reserved4; |
| 1505 | uint16_t pid; |
| 1506 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 1507 | uint16_t reserved5; |
| 1508 | struct magic_num_struct magic_struct; |
| 1509 | }; |
| 1510 | |
| 1511 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 1512 | { |
| 1513 | struct dload_struct __iomem *dload = 0; |
| 1514 | |
| 1515 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 1516 | if (!dload) { |
| 1517 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 1518 | __func__, DLOAD_USB_BASE_ADD); |
| 1519 | return -ENXIO; |
| 1520 | } |
| 1521 | |
| 1522 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 1523 | __func__, dload, pid, snum); |
| 1524 | /* update pid */ |
| 1525 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 1526 | dload->pid = pid; |
| 1527 | |
| 1528 | /* update serial number */ |
| 1529 | dload->magic_struct.serial_num = 0; |
| 1530 | if (!snum) { |
| 1531 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 1532 | goto out; |
| 1533 | } |
| 1534 | |
| 1535 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
| 1536 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
| 1537 | out: |
| 1538 | iounmap(dload); |
| 1539 | return 0; |
| 1540 | } |
| 1541 | |
| 1542 | static struct android_usb_platform_data android_usb_pdata = { |
| 1543 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1544 | }; |
| 1545 | |
| 1546 | static struct platform_device android_usb_device = { |
| 1547 | .name = "android_usb", |
| 1548 | .id = -1, |
| 1549 | .dev = { |
| 1550 | .platform_data = &android_usb_pdata, |
| 1551 | }, |
| 1552 | }; |
| 1553 | |
| 1554 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1555 | 0x03, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1556 | }; |
| 1557 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1558 | static uint8_t spm_retention_cmd_sequence[] __initdata = { |
| 1559 | 0x00, 0x05, 0x03, 0x0D, |
| 1560 | 0x0B, 0x00, 0x0f, |
| 1561 | }; |
| 1562 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1563 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1564 | 0x00, 0x24, 0x54, 0x10, |
| 1565 | 0x09, 0x03, 0x01, |
| 1566 | 0x10, 0x54, 0x30, 0x0C, |
| 1567 | 0x24, 0x30, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1568 | }; |
| 1569 | |
| 1570 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1571 | 0x00, 0x24, 0x54, 0x10, |
| 1572 | 0x09, 0x07, 0x01, 0x0B, |
| 1573 | 0x10, 0x54, 0x30, 0x0C, |
| 1574 | 0x24, 0x30, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1575 | }; |
| 1576 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1577 | static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = { |
| 1578 | [0] = { |
| 1579 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1580 | .notify_rpm = false, |
| 1581 | .cmd = spm_wfi_cmd_sequence, |
| 1582 | }, |
| 1583 | [1] = { |
| 1584 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 1585 | .notify_rpm = false, |
| 1586 | .cmd = spm_retention_cmd_sequence, |
| 1587 | }, |
| 1588 | [2] = { |
| 1589 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1590 | .notify_rpm = false, |
| 1591 | .cmd = spm_power_collapse_without_rpm, |
| 1592 | }, |
| 1593 | [3] = { |
| 1594 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1595 | .notify_rpm = true, |
| 1596 | .cmd = spm_power_collapse_with_rpm, |
| 1597 | }, |
| 1598 | }; |
| 1599 | |
| 1600 | static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1601 | [0] = { |
| 1602 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1603 | .notify_rpm = false, |
| 1604 | .cmd = spm_wfi_cmd_sequence, |
| 1605 | }, |
| 1606 | [1] = { |
| 1607 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1608 | .notify_rpm = false, |
| 1609 | .cmd = spm_power_collapse_without_rpm, |
| 1610 | }, |
| 1611 | [2] = { |
| 1612 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1613 | .notify_rpm = true, |
| 1614 | .cmd = spm_power_collapse_with_rpm, |
| 1615 | }, |
| 1616 | }; |
| 1617 | |
| 1618 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1619 | [0] = { |
| 1620 | .reg_base_addr = MSM_SAW0_BASE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1621 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1622 | #if defined(CONFIG_MSM_AVS_HW) |
| 1623 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1624 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1625 | #endif |
| 1626 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1627 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004, |
| 1628 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C, |
| 1629 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1630 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1631 | .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list), |
| 1632 | .modes = msm_spm_boot_cpu_seq_list, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1633 | }, |
| 1634 | [1] = { |
| 1635 | .reg_base_addr = MSM_SAW1_BASE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1636 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1637 | #if defined(CONFIG_MSM_AVS_HW) |
| 1638 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x00, |
| 1639 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00, |
| 1640 | #endif |
| 1641 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1642 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1643 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1644 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1645 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1646 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 1647 | .modes = msm_spm_nonboot_cpu_seq_list, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1648 | }, |
| 1649 | }; |
| 1650 | |
| 1651 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1652 | 0x00, 0x20, 0x03, 0x20, |
| 1653 | 0x00, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1654 | }; |
| 1655 | |
| 1656 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1657 | 0x00, 0x20, 0x34, 0x64, |
| 1658 | 0x48, 0x07, 0x48, 0x20, |
| 1659 | 0x50, 0x64, 0x04, 0x34, |
| 1660 | 0x50, 0x0f, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1661 | }; |
| 1662 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1663 | 0x00, 0x10, 0x34, 0x64, |
| 1664 | 0x48, 0x07, 0x48, 0x10, |
| 1665 | 0x50, 0x64, 0x04, 0x34, |
| 1666 | 0x50, 0x0F, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1667 | }; |
| 1668 | |
| 1669 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1670 | [0] = { |
| 1671 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1672 | .notify_rpm = false, |
| 1673 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1674 | }, |
| 1675 | [1] = { |
| 1676 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1677 | .notify_rpm = true, |
| 1678 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1679 | }, |
| 1680 | [2] = { |
| 1681 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1682 | .notify_rpm = true, |
| 1683 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1684 | }, |
| 1685 | }; |
| 1686 | |
| 1687 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1688 | [0] = { |
| 1689 | .reg_base_addr = MSM_SAW_L2_BASE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1690 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1691 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1692 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1693 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1694 | .modes = msm_spm_l2_seq_list, |
| 1695 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1696 | }, |
| 1697 | }; |
| 1698 | |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1699 | #define ISA1200_HAP_EN_GPIO 77 |
| 1700 | #define ISA1200_HAP_LEN_GPIO 78 |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1701 | #define ISA1200_HAP_CLK_PM8038 PM8038_GPIO_PM_TO_SYS(7) |
| 1702 | #define ISA1200_HAP_CLK_PM8917 PM8917_GPIO_PM_TO_SYS(38) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1703 | |
| 1704 | static int isa1200_power(int on) |
| 1705 | { |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1706 | unsigned int gpio = ISA1200_HAP_CLK_PM8038; |
| 1707 | enum pm8xxx_aux_clk_id clk_id = CLK_MP3_1; |
Amy Maloche | b20c105 | 2012-04-11 10:36:13 -0700 | [diff] [blame] | 1708 | int rc = 0; |
| 1709 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1710 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) { |
| 1711 | gpio = ISA1200_HAP_CLK_PM8917; |
| 1712 | clk_id = CLK_MP3_2; |
| 1713 | } |
| 1714 | |
| 1715 | gpio_set_value_cansleep(gpio, !!on); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1716 | |
Amy Maloche | b20c105 | 2012-04-11 10:36:13 -0700 | [diff] [blame] | 1717 | if (on) |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1718 | rc = pm8xxx_aux_clk_control(clk_id, XO_DIV_1, true); |
Amy Maloche | b20c105 | 2012-04-11 10:36:13 -0700 | [diff] [blame] | 1719 | else |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1720 | rc = pm8xxx_aux_clk_control(clk_id, XO_DIV_NONE, true); |
Amy Maloche | b20c105 | 2012-04-11 10:36:13 -0700 | [diff] [blame] | 1721 | |
| 1722 | if (rc) { |
| 1723 | pr_err("%s: unable to write aux clock register(%d)\n", |
| 1724 | __func__, rc); |
| 1725 | } |
| 1726 | |
| 1727 | return rc; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1728 | } |
| 1729 | |
| 1730 | static int isa1200_dev_setup(bool enable) |
| 1731 | { |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1732 | unsigned int gpio = ISA1200_HAP_CLK_PM8038; |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1733 | int rc = 0; |
| 1734 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1735 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 1736 | gpio = ISA1200_HAP_CLK_PM8917; |
| 1737 | |
Amy Maloche | b20c105 | 2012-04-11 10:36:13 -0700 | [diff] [blame] | 1738 | if (!enable) |
| 1739 | goto fail_gpio_dir; |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1740 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1741 | rc = gpio_request(gpio, "haptics_clk"); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1742 | if (rc) { |
| 1743 | pr_err("%s: gpio_request for %d gpio failed rc(%d)\n", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1744 | __func__, gpio, rc); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1745 | goto fail_gpio_req; |
| 1746 | } |
| 1747 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1748 | rc = gpio_direction_output(gpio, 0); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1749 | if (rc) { |
| 1750 | pr_err("%s: gpio_direction_output failed for %d gpio rc(%d)\n", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1751 | __func__, gpio, rc); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1752 | goto fail_gpio_dir; |
| 1753 | } |
| 1754 | |
| 1755 | return 0; |
| 1756 | |
| 1757 | fail_gpio_dir: |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1758 | gpio_free(gpio); |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1759 | fail_gpio_req: |
| 1760 | return rc; |
| 1761 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1762 | } |
| 1763 | |
| 1764 | static struct isa1200_regulator isa1200_reg_data[] = { |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1765 | { |
| 1766 | .name = "vddp", |
| 1767 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1768 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1769 | .load_uA = ISA_I2C_CURR_UA, |
| 1770 | }, |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 1771 | { |
| 1772 | .name = "vcc_i2c", |
| 1773 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 1774 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 1775 | .load_uA = ISA_I2C_CURR_UA, |
| 1776 | }, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1777 | }; |
| 1778 | |
| 1779 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 1780 | .name = "vibrator", |
| 1781 | .dev_setup = isa1200_dev_setup, |
| 1782 | .power_on = isa1200_power, |
Anirudh Ghayal | 8c15f7f | 2012-01-09 14:04:02 +0530 | [diff] [blame] | 1783 | .hap_en_gpio = ISA1200_HAP_EN_GPIO, |
| 1784 | .hap_len_gpio = ISA1200_HAP_LEN_GPIO, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1785 | .max_timeout = 15000, |
| 1786 | .mode_ctrl = PWM_GEN_MODE, |
| 1787 | .pwm_fd = { |
| 1788 | .pwm_div = 256, |
| 1789 | }, |
| 1790 | .is_erm = false, |
| 1791 | .smart_en = true, |
| 1792 | .ext_clk_en = true, |
| 1793 | .chip_en = 1, |
| 1794 | .regulator_info = isa1200_reg_data, |
| 1795 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 1796 | }; |
| 1797 | |
| 1798 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 1799 | { |
| 1800 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
| 1801 | .platform_data = &isa1200_1_pdata, |
| 1802 | }, |
| 1803 | }; |
| 1804 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1805 | #define MXT_TS_GPIO_IRQ 11 |
| 1806 | #define MXT_TS_RESET_GPIO 52 |
| 1807 | |
Mohan Pallaka | 204b6f7 | 2012-07-09 14:44:10 +0530 | [diff] [blame] | 1808 | static const u8 mxt_config_data_8930_v1[] = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1809 | /* T6 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1810 | 0, 0, 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1811 | /* T38 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1812 | 15, 3, 0, 15, 12, 11, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1813 | /* T7 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1814 | 32, 16, 50, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1815 | /* T8 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1816 | 30, 0, 5, 1, 0, 0, 8, 8, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1817 | /* T9 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1818 | 131, 0, 0, 19, 11, 0, 16, 43, 2, 3, |
| 1819 | 10, 7, 2, 0, 4, 5, 35, 10, 43, 4, |
| 1820 | 54, 2, 15, 32, 38, 38, 143, 40, 143, 80, |
| 1821 | 7, 9, 50, 50, 2, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1822 | /* T15 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1823 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1824 | 0, |
| 1825 | /* T18 Object */ |
| 1826 | 0, 0, |
| 1827 | /* T19 Object */ |
| 1828 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1829 | 0, 0, 0, 0, 0, 0, |
| 1830 | /* T23 Object */ |
| 1831 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1832 | 0, 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1833 | /* T25 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1834 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1835 | 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1836 | /* T40 Object */ |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1837 | 0, 0, 0, 0, 0, |
| 1838 | /* T42 Object */ |
| 1839 | 0, 0, 0, 0, 0, 0, 0, 0, |
| 1840 | /* T46 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1841 | 0, 3, 8, 16, 0, 0, 1, 0, 0, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1842 | /* T47 Object */ |
| 1843 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1844 | /* T48 Object */ |
Mohan Pallaka | 84f72513 | 2012-05-17 16:38:56 +0530 | [diff] [blame] | 1845 | 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, |
| 1846 | 0, 0, 0, 0, 0, 0, 0, 100, 4, 64, |
| 1847 | 0, 0, 5, 42, 0, 0, 0, 0, 0, 0, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1848 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1849 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1850 | 0, 0, 0, 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1851 | }; |
| 1852 | |
Mohan Pallaka | 204b6f7 | 2012-07-09 14:44:10 +0530 | [diff] [blame] | 1853 | static const u8 mxt_config_data_8930_v2[] = { |
| 1854 | /* T6 Object */ |
| 1855 | 0, 0, 0, 0, 0, 0, |
| 1856 | /* T38 Object */ |
| 1857 | 15, 4, 0, 9, 7, 12, 0, 0, |
| 1858 | /* T7 Object */ |
| 1859 | 32, 16, 50, |
| 1860 | /* T8 Object */ |
| 1861 | 30, 0, 5, 10, 0, 0, 10, 10, 0, 0, |
| 1862 | /* T9 Object */ |
| 1863 | 131, 0, 0, 19, 11, 0, 16, 50, 1, 3, |
| 1864 | 12, 7, 2, 0, 4, 5, 2, 10, 43, 4, |
| 1865 | 54, 2, -25, 29, 38, 18, 143, 40, 207, 80, |
| 1866 | 17, 5, 50, 50, 0, |
| 1867 | /* T18 Object */ |
| 1868 | 0, 0, |
| 1869 | /* T19 Object */ |
| 1870 | 0, 0, 0, 0, 0, 0, |
| 1871 | /* T25 Object */ |
| 1872 | 0, 0, 0, 0, 0, 0, |
| 1873 | /* T42 Object */ |
| 1874 | 3, 60, 20, 20, 150, 0, 0, 0, |
| 1875 | /* T46 Object */ |
| 1876 | 0, 3, 28, 28, 0, 0, 1, 0, 0, |
| 1877 | /* T47 Object */ |
| 1878 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1879 | /* T48 Object */ |
| 1880 | 1, 3, 82, 0, 0, 0, 0, 0, 0, 0, |
| 1881 | 16, 30, 0, 6, 6, 0, 0, 124, 4, 100, |
| 1882 | 0, 0, 0, 5, 0, 42, 0, 1, 0, 40, |
| 1883 | 52, 20, 0, 0, 0, 50, 1, 5, 2, 1, |
| 1884 | 4, 5, 3, -25, 29, 38, 18, 143, 40, 207, |
| 1885 | 80, 10, 5, 2, |
| 1886 | /* T55 Object */ |
| 1887 | 0, 0, 0, 0, |
| 1888 | }; |
| 1889 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1890 | static ssize_t mxt224e_vkeys_show(struct kobject *kobj, |
| 1891 | struct kobj_attribute *attr, char *buf) |
| 1892 | { |
| 1893 | return snprintf(buf, 200, |
Amy Maloche | f8130f9 | 2012-02-01 10:38:59 +0530 | [diff] [blame] | 1894 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":57:1030:90:90" |
| 1895 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":206:1030:90:90" |
| 1896 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":366:1030:90:90" |
| 1897 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":503:1030:90:90" |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1898 | "\n"); |
| 1899 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1900 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1901 | static struct kobj_attribute mxt224e_vkeys_attr = { |
| 1902 | .attr = { |
| 1903 | .mode = S_IRUGO, |
| 1904 | }, |
| 1905 | .show = &mxt224e_vkeys_show, |
| 1906 | }; |
| 1907 | |
| 1908 | static struct attribute *mxt224e_properties_attrs[] = { |
| 1909 | &mxt224e_vkeys_attr.attr, |
| 1910 | NULL |
| 1911 | }; |
| 1912 | |
| 1913 | static struct attribute_group mxt224e_properties_attr_group = { |
| 1914 | .attrs = mxt224e_properties_attrs, |
| 1915 | }; |
| 1916 | |
| 1917 | static void mxt_init_vkeys_8930(void) |
| 1918 | { |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 1919 | int rc = 0; |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1920 | static struct kobject *mxt224e_properties_kobj; |
| 1921 | |
| 1922 | mxt224e_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts"; |
| 1923 | mxt224e_properties_kobj = kobject_create_and_add("board_properties", |
| 1924 | NULL); |
| 1925 | if (mxt224e_properties_kobj) |
| 1926 | rc = sysfs_create_group(mxt224e_properties_kobj, |
| 1927 | &mxt224e_properties_attr_group); |
| 1928 | if (!mxt224e_properties_kobj || rc) |
| 1929 | pr_err("%s: failed to create board_properties\n", |
| 1930 | __func__); |
| 1931 | |
| 1932 | return; |
| 1933 | } |
| 1934 | |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1935 | static struct mxt_config_info mxt_config_array[] = { |
| 1936 | { |
Mohan Pallaka | 204b6f7 | 2012-07-09 14:44:10 +0530 | [diff] [blame] | 1937 | .config = mxt_config_data_8930_v1, |
| 1938 | .config_length = ARRAY_SIZE(mxt_config_data_8930_v1), |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1939 | .family_id = 0x81, |
| 1940 | .variant_id = 0x01, |
| 1941 | .version = 0x10, |
| 1942 | .build = 0xAA, |
Mohan Pallaka | 204b6f7 | 2012-07-09 14:44:10 +0530 | [diff] [blame] | 1943 | .bootldr_id = MXT_BOOTLOADER_ID_224E, |
| 1944 | .fw_name = "atmel_8930_fluid_v2_0_AB.hex", |
| 1945 | }, |
| 1946 | { |
| 1947 | .config = mxt_config_data_8930_v2, |
| 1948 | .config_length = ARRAY_SIZE(mxt_config_data_8930_v2), |
| 1949 | .family_id = 0x81, |
| 1950 | .variant_id = 0x15, |
| 1951 | .version = 0x11, |
| 1952 | .build = 0xAA, |
| 1953 | .bootldr_id = MXT_BOOTLOADER_ID_224E, |
| 1954 | .fw_name = "atmel_8930_fluid_v2_0_AB.hex", |
| 1955 | }, |
| 1956 | { |
| 1957 | .config = mxt_config_data_8930_v2, |
| 1958 | .config_length = ARRAY_SIZE(mxt_config_data_8930_v2), |
| 1959 | .family_id = 0x81, |
| 1960 | .variant_id = 0x01, |
| 1961 | .version = 0x20, |
| 1962 | .build = 0xAB, |
| 1963 | .bootldr_id = MXT_BOOTLOADER_ID_224E, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1964 | }, |
| 1965 | }; |
| 1966 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1967 | static struct mxt_platform_data mxt_platform_data_8930 = { |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 1968 | .config_array = mxt_config_array, |
| 1969 | .config_array_size = ARRAY_SIZE(mxt_config_array), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 1970 | .panel_minx = 0, |
| 1971 | .panel_maxx = 566, |
| 1972 | .panel_miny = 0, |
| 1973 | .panel_maxy = 1067, |
| 1974 | .disp_minx = 0, |
| 1975 | .disp_maxx = 540, |
| 1976 | .disp_miny = 0, |
| 1977 | .disp_maxy = 960, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1978 | .irqflags = IRQF_TRIGGER_FALLING, |
Anirudh Ghayal | d7ad84c | 2012-01-09 09:17:53 +0530 | [diff] [blame] | 1979 | #ifdef MSM8930_PHASE_2 |
| 1980 | .digital_pwr_regulator = true, |
| 1981 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1982 | .i2c_pull_up = true, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1983 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 1984 | .irq_gpio = MXT_TS_GPIO_IRQ, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1985 | }; |
| 1986 | |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1987 | static struct i2c_board_info mxt_device_info_8930[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1988 | { |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 1989 | I2C_BOARD_INFO("atmel_mxt_ts", 0x4a), |
| 1990 | .platform_data = &mxt_platform_data_8930, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 1991 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 1992 | }, |
| 1993 | }; |
| 1994 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 1995 | #define MHL_POWER_GPIO_PM8038 PM8038_GPIO_PM_TO_SYS(MHL_GPIO_PWR_EN) |
| 1996 | #define MHL_POWER_GPIO_PM8917 PM8917_GPIO_PM_TO_SYS(25) |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 1997 | static struct msm_mhl_platform_data mhl_platform_data = { |
| 1998 | .irq = MSM_GPIO_TO_INT(MHL_GPIO_INT), |
| 1999 | .gpio_mhl_int = MHL_GPIO_INT, |
| 2000 | .gpio_mhl_reset = MHL_GPIO_RESET, |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2001 | .gpio_mhl_power = MHL_POWER_GPIO_PM8038, |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 2002 | .gpio_hdmi_mhl_mux = HDMI_MHL_MUX_GPIO, |
| 2003 | }; |
| 2004 | |
| 2005 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 2006 | { |
| 2007 | /* |
| 2008 | * keeps SI 8334 as the default |
| 2009 | * MHL TX |
| 2010 | */ |
| 2011 | I2C_BOARD_INFO("sii8334", 0x39), |
| 2012 | .platform_data = &mhl_platform_data, |
| 2013 | .flags = I2C_CLIENT_WAKE, |
| 2014 | }, |
| 2015 | }; |
| 2016 | |
| 2017 | |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2018 | #ifdef MSM8930_PHASE_2 |
| 2019 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2020 | #define GPIO_VOLUME_UP_PM8038 PM8038_GPIO_PM_TO_SYS(3) |
| 2021 | #define GPIO_VOLUME_DOWN_PM8038 PM8038_GPIO_PM_TO_SYS(8) |
| 2022 | #define GPIO_CAMERA_SNAPSHOT_PM8038 PM8038_GPIO_PM_TO_SYS(10) |
| 2023 | #define GPIO_CAMERA_FOCUS_PM8038 PM8038_GPIO_PM_TO_SYS(11) |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2024 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2025 | #define GPIO_VOLUME_UP_PM8917 PM8917_GPIO_PM_TO_SYS(27) |
| 2026 | #define GPIO_VOLUME_DOWN_PM8917 PM8917_GPIO_PM_TO_SYS(28) |
| 2027 | #define GPIO_CAMERA_SNAPSHOT_PM8917 PM8917_GPIO_PM_TO_SYS(36) |
| 2028 | #define GPIO_CAMERA_FOCUS_PM8917 PM8917_GPIO_PM_TO_SYS(37) |
| 2029 | |
| 2030 | static struct gpio_keys_button keys_8930_pm8038[] = { |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2031 | { |
| 2032 | .code = KEY_VOLUMEUP, |
| 2033 | .type = EV_KEY, |
| 2034 | .desc = "volume_up", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2035 | .gpio = GPIO_VOLUME_UP_PM8038, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2036 | .wakeup = 1, |
| 2037 | .active_low = 1, |
Amy Maloche | ff31a97 | 2012-06-06 15:28:54 -0700 | [diff] [blame] | 2038 | .debounce_interval = 15, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2039 | }, |
| 2040 | { |
| 2041 | .code = KEY_VOLUMEDOWN, |
| 2042 | .type = EV_KEY, |
| 2043 | .desc = "volume_down", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2044 | .gpio = GPIO_VOLUME_DOWN_PM8038, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2045 | .wakeup = 1, |
| 2046 | .active_low = 1, |
Amy Maloche | ff31a97 | 2012-06-06 15:28:54 -0700 | [diff] [blame] | 2047 | .debounce_interval = 15, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2048 | }, |
| 2049 | { |
| 2050 | .code = KEY_CAMERA_FOCUS, |
| 2051 | .type = EV_KEY, |
| 2052 | .desc = "camera_focus", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2053 | .gpio = GPIO_CAMERA_FOCUS_PM8038, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2054 | .wakeup = 1, |
| 2055 | .active_low = 1, |
Amy Maloche | ff31a97 | 2012-06-06 15:28:54 -0700 | [diff] [blame] | 2056 | .debounce_interval = 15, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2057 | }, |
| 2058 | { |
| 2059 | .code = KEY_CAMERA_SNAPSHOT, |
| 2060 | .type = EV_KEY, |
| 2061 | .desc = "camera_snapshot", |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2062 | .gpio = GPIO_CAMERA_SNAPSHOT_PM8038, |
| 2063 | .wakeup = 1, |
| 2064 | .active_low = 1, |
| 2065 | .debounce_interval = 15, |
| 2066 | }, |
| 2067 | }; |
| 2068 | |
| 2069 | static struct gpio_keys_button keys_8930_pm8917[] = { |
| 2070 | { |
| 2071 | .code = KEY_VOLUMEUP, |
| 2072 | .type = EV_KEY, |
| 2073 | .desc = "volume_up", |
| 2074 | .gpio = GPIO_VOLUME_UP_PM8917, |
| 2075 | .wakeup = 1, |
| 2076 | .active_low = 1, |
| 2077 | .debounce_interval = 15, |
| 2078 | }, |
| 2079 | { |
| 2080 | .code = KEY_VOLUMEDOWN, |
| 2081 | .type = EV_KEY, |
| 2082 | .desc = "volume_down", |
| 2083 | .gpio = GPIO_VOLUME_DOWN_PM8917, |
| 2084 | .wakeup = 1, |
| 2085 | .active_low = 1, |
| 2086 | .debounce_interval = 15, |
| 2087 | }, |
| 2088 | { |
| 2089 | .code = KEY_CAMERA_FOCUS, |
| 2090 | .type = EV_KEY, |
| 2091 | .desc = "camera_focus", |
| 2092 | .gpio = GPIO_CAMERA_FOCUS_PM8917, |
| 2093 | .wakeup = 1, |
| 2094 | .active_low = 1, |
| 2095 | .debounce_interval = 15, |
| 2096 | }, |
| 2097 | { |
| 2098 | .code = KEY_CAMERA_SNAPSHOT, |
| 2099 | .type = EV_KEY, |
| 2100 | .desc = "camera_snapshot", |
| 2101 | .gpio = GPIO_CAMERA_SNAPSHOT_PM8917, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2102 | .wakeup = 1, |
| 2103 | .active_low = 1, |
Amy Maloche | ff31a97 | 2012-06-06 15:28:54 -0700 | [diff] [blame] | 2104 | .debounce_interval = 15, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2105 | }, |
| 2106 | }; |
| 2107 | |
| 2108 | /* Add GPIO keys for 8930 */ |
| 2109 | static struct gpio_keys_platform_data gpio_keys_8930_pdata = { |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2110 | .buttons = keys_8930_pm8038, |
| 2111 | .nbuttons = ARRAY_SIZE(keys_8930_pm8038), |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2112 | }; |
| 2113 | |
| 2114 | static struct platform_device gpio_keys_8930 = { |
| 2115 | .name = "gpio-keys", |
| 2116 | .id = -1, |
| 2117 | .dev = { |
| 2118 | .platform_data = &gpio_keys_8930_pdata, |
| 2119 | }, |
| 2120 | }; |
| 2121 | #endif /* MSM8930_PHASE_2 */ |
| 2122 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2123 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 2124 | .clk_freq = 100000, |
| 2125 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2126 | }; |
| 2127 | |
| 2128 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 2129 | .clk_freq = 100000, |
| 2130 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2131 | }; |
| 2132 | |
Harini Jayaraman | fe6ff416 | 2012-03-14 11:25:40 -0600 | [diff] [blame] | 2133 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi9_pdata = { |
| 2134 | .clk_freq = 100000, |
| 2135 | .src_clk_rate = 24000000, |
| 2136 | }; |
| 2137 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2138 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 2139 | .clk_freq = 100000, |
| 2140 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2141 | }; |
| 2142 | |
| 2143 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 2144 | .clk_freq = 100000, |
| 2145 | .src_clk_rate = 24000000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2146 | }; |
| 2147 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2148 | |
| 2149 | static struct ks8851_pdata spi_eth_pdata = { |
| 2150 | .irq_gpio = KS8851_IRQ_GPIO, |
| 2151 | .rst_gpio = KS8851_RST_GPIO, |
| 2152 | }; |
| 2153 | |
| 2154 | static struct spi_board_info spi_board_info[] __initdata = { |
| 2155 | { |
| 2156 | .modalias = "ks8851", |
| 2157 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2158 | .max_speed_hz = 19200000, |
| 2159 | .bus_num = 0, |
| 2160 | .chip_select = 0, |
| 2161 | .mode = SPI_MODE_0, |
| 2162 | .platform_data = &spi_eth_pdata |
| 2163 | }, |
| 2164 | { |
| 2165 | .modalias = "dsi_novatek_3d_panel_spi", |
| 2166 | .max_speed_hz = 10800000, |
| 2167 | .bus_num = 0, |
| 2168 | .chip_select = 1, |
| 2169 | .mode = SPI_MODE_0, |
| 2170 | }, |
| 2171 | }; |
| 2172 | |
| 2173 | static struct platform_device msm_device_saw_core0 = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2174 | .name = "saw-regulator", |
| 2175 | .id = 0, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2176 | .dev = { |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2177 | .platform_data = &msm8930_pm8038_saw_regulator_core0_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2178 | }, |
| 2179 | }; |
| 2180 | |
| 2181 | static struct platform_device msm_device_saw_core1 = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2182 | .name = "saw-regulator", |
| 2183 | .id = 1, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2184 | .dev = { |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2185 | .platform_data = &msm8930_pm8038_saw_regulator_core1_pdata, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2186 | }, |
| 2187 | }; |
| 2188 | |
| 2189 | static struct tsens_platform_data msm_tsens_pdata = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2190 | .tsens_factor = 1000, |
Siddartha Mohanadoss | 9742512 | 2012-03-09 12:06:54 -0800 | [diff] [blame] | 2191 | .hw_type = APQ_8064, |
Siddartha Mohanadoss | 892ee47 | 2012-05-03 10:35:20 -0700 | [diff] [blame] | 2192 | .tsens_num_sensor = 10, |
| 2193 | .slope = {1132, 1135, 1137, 1135, 1157, |
| 2194 | 1142, 1124, 1153, 1175, 1166}, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2195 | }; |
| 2196 | |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2197 | static struct platform_device msm_tsens_device = { |
| 2198 | .name = "tsens8960-tm", |
| 2199 | .id = -1, |
| 2200 | }; |
| 2201 | |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2202 | static struct msm_thermal_data msm_thermal_pdata = { |
| 2203 | .sensor_id = 9, |
Eugene Seah | 2ee4a5d | 2012-06-25 18:16:41 -0600 | [diff] [blame] | 2204 | .poll_ms = 250, |
| 2205 | .limit_temp_degC = 60, |
| 2206 | .temp_hysteresis_degC = 10, |
| 2207 | .freq_step = 2, |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2208 | }; |
| 2209 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2210 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2211 | static struct platform_device fish_battery_device = { |
| 2212 | .name = "fish_battery", |
| 2213 | }; |
| 2214 | #endif |
| 2215 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2216 | #ifndef MSM8930_PHASE_2 |
| 2217 | |
| 2218 | /* 8930 Phase 1 */ |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2219 | static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2220 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2221 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2222 | .dev = { |
| 2223 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2224 | }, |
| 2225 | }; |
| 2226 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2227 | static struct platform_device msm8930_device_ext_l2_vreg __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2228 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2229 | .id = 91, |
| 2230 | .dev = { |
| 2231 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 2232 | }, |
| 2233 | }; |
| 2234 | |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2235 | #else |
| 2236 | |
| 2237 | /* 8930 Phase 2 */ |
| 2238 | static struct platform_device msm8930_device_ext_5v_vreg __devinitdata = { |
| 2239 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2240 | .id = 63, |
| 2241 | .dev = { |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2242 | .platform_data = &msm8930_pm8038_gpio_regulator_pdata[ |
| 2243 | MSM8930_GPIO_VREG_ID_EXT_5V], |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2244 | }, |
| 2245 | }; |
| 2246 | |
| 2247 | static struct platform_device msm8930_device_ext_otg_sw_vreg __devinitdata = { |
| 2248 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2249 | .id = 97, |
| 2250 | .dev = { |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2251 | .platform_data = &msm8930_pm8038_gpio_regulator_pdata[ |
| 2252 | MSM8930_GPIO_VREG_ID_EXT_OTG_SW], |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2253 | }, |
| 2254 | }; |
| 2255 | |
| 2256 | #endif |
| 2257 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2258 | static struct platform_device msm8930_device_rpm_regulator __devinitdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2259 | .name = "rpm-regulator", |
| 2260 | .id = -1, |
| 2261 | .dev = { |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 2262 | #ifndef MSM8930_PHASE_2 |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2263 | .platform_data = &msm_rpm_regulator_pdata, |
David Collins | 8af872e | 2012-01-06 11:31:56 -0800 | [diff] [blame] | 2264 | #else |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2265 | .platform_data = &msm8930_pm8038_rpm_regulator_pdata, |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2266 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2267 | }, |
| 2268 | }; |
| 2269 | |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2270 | static struct platform_device *early_common_devices[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2271 | &msm8960_device_dmov, |
| 2272 | &msm_device_smd, |
| 2273 | &msm8960_device_uart_gsbi5, |
| 2274 | &msm_device_uart_dm6, |
| 2275 | &msm_device_saw_core0, |
| 2276 | &msm_device_saw_core1, |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2277 | }; |
| 2278 | |
| 2279 | /* ext_5v and ext_otg_sw are present when using PM8038 */ |
| 2280 | static struct platform_device *pmic_pm8038_devices[] __initdata = { |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2281 | &msm8930_device_ext_5v_vreg, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2282 | #ifndef MSM8930_PHASE_2 |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2283 | &msm8930_device_ext_l2_vreg, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2284 | #endif |
Jay Chokshi | 33c044a | 2011-12-07 13:05:40 -0800 | [diff] [blame] | 2285 | &msm8960_device_ssbi_pmic, |
David Collins | 1d4061b | 2011-12-06 15:36:40 -0800 | [diff] [blame] | 2286 | #ifdef MSM8930_PHASE_2 |
| 2287 | &msm8930_device_ext_otg_sw_vreg, |
| 2288 | #endif |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2289 | }; |
| 2290 | |
| 2291 | /* ext_5v and ext_otg_sw are not present when using PM8917 */ |
| 2292 | static struct platform_device *pmic_pm8917_devices[] __initdata = { |
| 2293 | &msm8960_device_ssbi_pmic, |
| 2294 | }; |
| 2295 | |
| 2296 | static struct platform_device *common_devices[] __initdata = { |
Stephen Boyd | 28d5495 | 2011-12-16 13:19:51 -0800 | [diff] [blame] | 2297 | &msm_8960_q6_lpass, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 2298 | &msm_8960_riva, |
Stephen Boyd | d89eebe | 2011-09-28 23:28:11 -0700 | [diff] [blame] | 2299 | &msm_pil_tzapps, |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 2300 | &msm_pil_vidc, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2301 | &msm8960_device_qup_spi_gsbi1, |
| 2302 | &msm8960_device_qup_i2c_gsbi3, |
| 2303 | &msm8960_device_qup_i2c_gsbi4, |
Harini Jayaraman | fe6ff416 | 2012-03-14 11:25:40 -0600 | [diff] [blame] | 2304 | &msm8960_device_qup_i2c_gsbi9, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2305 | &msm8960_device_qup_i2c_gsbi10, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2306 | &msm8960_device_qup_i2c_gsbi12, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2307 | &msm_slim_ctrl, |
| 2308 | &msm_device_wcnss_wlan, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 2309 | #if defined(CONFIG_QSEECOM) |
| 2310 | &qseecom_device, |
| 2311 | #endif |
| 2312 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2313 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2314 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2315 | &qcrypto_device, |
| 2316 | #endif |
| 2317 | |
| 2318 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2319 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2320 | &qcedev_device, |
| 2321 | #endif |
| 2322 | #ifdef CONFIG_MSM_ROTATOR |
| 2323 | &msm_rotator_device, |
| 2324 | #endif |
| 2325 | &msm_device_sps, |
| 2326 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2327 | &fish_battery_device, |
| 2328 | #endif |
| 2329 | #ifdef CONFIG_ANDROID_PMEM |
| 2330 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2331 | &msm8930_android_pmem_device, |
| 2332 | &msm8930_android_pmem_adsp_device, |
| 2333 | &msm8930_android_pmem_audio_device, |
Asish Bhattacharya | 5d63c4b | 2012-04-12 08:41:12 +0530 | [diff] [blame] | 2334 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 2335 | #endif /*CONFIG_ANDROID_PMEM*/ |
Hanumant Singh | eea6256 | 2012-05-14 11:32:45 -0700 | [diff] [blame] | 2336 | &msm8930_fmem_device, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2337 | &msm_device_bam_dmux, |
| 2338 | &msm_fm_platform_init, |
| 2339 | |
| 2340 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2341 | &msm_device_rng, |
| 2342 | #endif |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2343 | &msm8930_rpm_device, |
| 2344 | &msm8930_rpm_log_device, |
Girish Mahadevan | 898c56d | 2012-06-05 16:09:19 -0600 | [diff] [blame] | 2345 | &msm8930_rpm_rbcpr_device, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2346 | &msm8930_rpm_stat_device, |
Anji Jonnala | 9312992 | 2012-10-09 20:57:53 +0530 | [diff] [blame] | 2347 | &msm8930_rpm_master_stat_device, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2348 | #ifdef CONFIG_ION_MSM |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2349 | &msm8930_ion_dev, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2350 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2351 | &msm_device_tz_log, |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 2352 | &coresight_tpiu_device, |
| 2353 | &coresight_etb_device, |
| 2354 | &coresight_funnel_device, |
| 2355 | &coresight_etm0_device, |
| 2356 | &coresight_etm1_device, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2357 | &msm_device_dspcrashd_8960, |
| 2358 | &msm8960_device_watchdog, |
Anirudh Ghayal | eb3af97 | 2011-12-13 17:29:06 +0530 | [diff] [blame] | 2359 | #ifdef MSM8930_PHASE_2 |
| 2360 | &gpio_keys_8930, |
| 2361 | #endif |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2362 | &msm8930_rtb_device, |
Gagan Mac | cd5b327 | 2012-02-09 18:13:10 -0700 | [diff] [blame] | 2363 | &msm_bus_8930_apps_fabric, |
| 2364 | &msm_bus_8930_sys_fabric, |
| 2365 | &msm_bus_8930_mm_fabric, |
| 2366 | &msm_bus_8930_sys_fpb, |
| 2367 | &msm_bus_8930_cpss_fpb, |
Stepan Moskovchenko | 28662c5 | 2012-03-01 12:48:45 -0800 | [diff] [blame] | 2368 | &msm8960_device_cache_erp, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 2369 | &msm8930_iommu_domain_device, |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2370 | &msm_tsens_device, |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 2371 | &msm8930_cache_dump_device, |
Anji Jonnala | 6c2b685 | 2012-09-21 13:34:44 +0530 | [diff] [blame] | 2372 | &msm8930_pc_cntr, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2373 | }; |
| 2374 | |
| 2375 | static struct platform_device *cdp_devices[] __initdata = { |
| 2376 | &msm8960_device_otg, |
| 2377 | &msm8960_device_gadget_peripheral, |
| 2378 | &msm_device_hsusb_host, |
| 2379 | &android_usb_device, |
| 2380 | &msm_pcm, |
| 2381 | &msm_pcm_routing, |
| 2382 | &msm_cpudai0, |
| 2383 | &msm_cpudai1, |
| 2384 | &msm_cpudai_hdmi_rx, |
| 2385 | &msm_cpudai_bt_rx, |
| 2386 | &msm_cpudai_bt_tx, |
| 2387 | &msm_cpudai_fm_rx, |
| 2388 | &msm_cpudai_fm_tx, |
| 2389 | &msm_cpudai_auxpcm_rx, |
| 2390 | &msm_cpudai_auxpcm_tx, |
| 2391 | &msm_cpu_fe, |
| 2392 | &msm_stub_codec, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2393 | #ifdef CONFIG_MSM_GEMINI |
| 2394 | &msm8960_gemini_device, |
| 2395 | #endif |
| 2396 | &msm_voice, |
| 2397 | &msm_voip, |
| 2398 | &msm_lpa_pcm, |
| 2399 | &msm_cpudai_afe_01_rx, |
| 2400 | &msm_cpudai_afe_01_tx, |
| 2401 | &msm_cpudai_afe_02_rx, |
| 2402 | &msm_cpudai_afe_02_tx, |
| 2403 | &msm_pcm_afe, |
Ajay Dudani | 79e268c | 2011-12-28 13:14:44 -0800 | [diff] [blame] | 2404 | &msm_compr_dsp, |
| 2405 | &msm_cpudai_incall_music_rx, |
| 2406 | &msm_cpudai_incall_record_rx, |
| 2407 | &msm_cpudai_incall_record_tx, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2408 | &msm_pcm_hostless, |
Asish Bhattacharya | 705c673 | 2012-08-14 23:22:55 +0530 | [diff] [blame] | 2409 | &msm_multi_ch_pcm, |
Jayasena Sangaraboina | 99bf09c | 2012-07-17 12:03:08 -0700 | [diff] [blame] | 2410 | &msm_lowlatency_pcm, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2411 | }; |
| 2412 | |
| 2413 | static void __init msm8930_i2c_init(void) |
| 2414 | { |
| 2415 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 2416 | &msm8960_i2c_qup_gsbi4_pdata; |
| 2417 | |
| 2418 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 2419 | &msm8960_i2c_qup_gsbi3_pdata; |
| 2420 | |
Harini Jayaraman | fe6ff416 | 2012-03-14 11:25:40 -0600 | [diff] [blame] | 2421 | msm8960_device_qup_i2c_gsbi9.dev.platform_data = |
| 2422 | &msm8960_i2c_qup_gsbi9_pdata; |
| 2423 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2424 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 2425 | &msm8960_i2c_qup_gsbi10_pdata; |
| 2426 | |
| 2427 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 2428 | &msm8960_i2c_qup_gsbi12_pdata; |
| 2429 | } |
| 2430 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2431 | static struct msm_rpmrs_level msm_rpmrs_levels[] __initdata = { |
| 2432 | { |
| 2433 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 2434 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2435 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2436 | 1, 784, 180000, 100, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2437 | }, |
| 2438 | |
| 2439 | { |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2440 | MSM_PM_SLEEP_MODE_RETENTION, |
| 2441 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2442 | true, |
| 2443 | 415, 715, 340827, 475, |
| 2444 | }, |
| 2445 | |
| 2446 | { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2447 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 2448 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 2449 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2450 | 1300, 228, 1200000, 2000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2451 | }, |
| 2452 | |
| 2453 | { |
| 2454 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2455 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 2456 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2457 | 2000, 138, 1208400, 3200, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2458 | }, |
| 2459 | |
| 2460 | { |
| 2461 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2462 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2463 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2464 | 6000, 119, 1850300, 9000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2465 | }, |
| 2466 | |
| 2467 | { |
| 2468 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2469 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 2470 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2471 | 9200, 68, 2839200, 16400, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2472 | }, |
| 2473 | |
| 2474 | { |
| 2475 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2476 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 2477 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2478 | 10300, 63, 3128000, 18200, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2479 | }, |
| 2480 | |
| 2481 | { |
| 2482 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2483 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 2484 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2485 | 18000, 10, 4602600, 27000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2486 | }, |
| 2487 | |
| 2488 | { |
| 2489 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 2490 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 2491 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 2492 | 20000, 2, 5752000, 32000, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2493 | }, |
| 2494 | }; |
| 2495 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2496 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 2497 | .levels = &msm_rpmrs_levels[0], |
| 2498 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2499 | .vdd_mem_levels = { |
| 2500 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2501 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2502 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2503 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2504 | }, |
| 2505 | .vdd_dig_levels = { |
Mahesh Sivasubramanian | 745e16e | 2012-05-21 11:52:04 -0600 | [diff] [blame] | 2506 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 0, |
| 2507 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 0, |
| 2508 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 1, |
| 2509 | [MSM_RPMRS_VDD_DIG_MAX] = 3, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2510 | }, |
| 2511 | .vdd_mask = 0x7FFFFF, |
| 2512 | .rpmrs_target_id = { |
| 2513 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2514 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
Mahesh Sivasubramanian | 745e16e | 2012-05-21 11:52:04 -0600 | [diff] [blame] | 2515 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER, |
| 2516 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2517 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8038_L24_0, |
| 2518 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8038_L24_1, |
| 2519 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2520 | }, |
| 2521 | }; |
| 2522 | |
Praveen Chidambaram | 75b8c81 | 2012-08-10 16:26:37 -0600 | [diff] [blame] | 2523 | static struct msm_rpmrs_platform_data msm_rpmrs_data_pm8917 __initdata = { |
| 2524 | .levels = &msm_rpmrs_levels[0], |
| 2525 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 2526 | .vdd_mem_levels = { |
| 2527 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 2528 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 2529 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 2530 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 2531 | }, |
| 2532 | .vdd_dig_levels = { |
| 2533 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 0, |
| 2534 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 0, |
| 2535 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 1, |
| 2536 | [MSM_RPMRS_VDD_DIG_MAX] = 3, |
| 2537 | }, |
| 2538 | .vdd_mask = 0x7FFFFF, |
| 2539 | .rpmrs_target_id = { |
| 2540 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 2541 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 2542 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_VOLTAGE_CORNER, |
| 2543 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_LAST, |
| 2544 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8917_L24_0, |
| 2545 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8917_L24_1, |
| 2546 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 2547 | }, |
| 2548 | }; |
| 2549 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2550 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 2551 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 2552 | }; |
| 2553 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2554 | #ifdef CONFIG_I2C |
| 2555 | #define I2C_SURF 1 |
| 2556 | #define I2C_FFA (1 << 1) |
| 2557 | #define I2C_RUMI (1 << 2) |
| 2558 | #define I2C_SIM (1 << 3) |
| 2559 | #define I2C_FLUID (1 << 4) |
| 2560 | #define I2C_LIQUID (1 << 5) |
| 2561 | |
| 2562 | struct i2c_registry { |
| 2563 | u8 machs; |
| 2564 | int bus; |
| 2565 | struct i2c_board_info *info; |
| 2566 | int len; |
| 2567 | }; |
| 2568 | |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 2569 | #ifdef CONFIG_INPUT_MPU3050 |
| 2570 | #define MPU3050_INT_GPIO 69 |
| 2571 | |
| 2572 | static struct mpu3050_gyro_platform_data mpu3050_gyro = { |
| 2573 | .gpio_int = MPU3050_INT_GPIO, |
| 2574 | }; |
| 2575 | |
| 2576 | static struct i2c_board_info __initdata mpu3050_i2c_boardinfo[] = { |
| 2577 | { |
| 2578 | I2C_BOARD_INFO("mpu3050", 0x68), |
Wentao Xu | c7769c0 | 2012-08-03 15:06:41 -0400 | [diff] [blame] | 2579 | .irq = MSM_GPIO_TO_INT(MPU3050_INT_GPIO), |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 2580 | .platform_data = &mpu3050_gyro, |
| 2581 | }, |
| 2582 | }; |
| 2583 | #endif |
| 2584 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2585 | #ifdef CONFIG_ISL9519_CHARGER |
| 2586 | static struct isl_platform_data isl_data __initdata = { |
| 2587 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 2588 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 2589 | .max_system_voltage = 4200, |
| 2590 | .min_system_voltage = 3200, |
| 2591 | .chgcurrent = 1000, /* 1900, */ |
| 2592 | .term_current = 400, /* Need fine tuning */ |
| 2593 | .input_current = 2048, |
| 2594 | }; |
| 2595 | |
| 2596 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 2597 | { |
| 2598 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 2599 | .irq = 0, /* Not required when notify-by-pmic */ |
| 2600 | .platform_data = &isl_data, |
| 2601 | }, |
| 2602 | }; |
| 2603 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 2604 | |
Wentao Xu | 114c015 | 2012-06-12 11:40:38 -0400 | [diff] [blame] | 2605 | #ifdef CONFIG_STM_LIS3DH |
| 2606 | static struct lis3dh_acc_platform_data lis3dh_accel = { |
| 2607 | .poll_interval = 200, |
| 2608 | .min_interval = 10, |
| 2609 | .g_range = LIS3DH_ACC_G_2G, |
| 2610 | .axis_map_x = 1, |
| 2611 | .axis_map_y = 0, |
| 2612 | .axis_map_z = 2, |
| 2613 | .negate_x = 0, |
| 2614 | .negate_y = 0, |
| 2615 | .negate_z = 1, |
| 2616 | .init = NULL, |
| 2617 | .exit = NULL, |
| 2618 | .gpio_int1 = -EINVAL, |
| 2619 | .gpio_int2 = -EINVAL, |
| 2620 | }; |
| 2621 | |
| 2622 | static struct i2c_board_info __initdata lis3dh_i2c_boardinfo[] = { |
| 2623 | { |
| 2624 | I2C_BOARD_INFO(LIS3DH_ACC_DEV_NAME, 0x18), |
| 2625 | .platform_data = &lis3dh_accel, |
| 2626 | }, |
| 2627 | }; |
| 2628 | #endif /* CONFIG_STM_LIS3DH */ |
| 2629 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2630 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2631 | #ifdef CONFIG_ISL9519_CHARGER |
| 2632 | { |
| 2633 | I2C_LIQUID, |
| 2634 | MSM_8930_GSBI10_QUP_I2C_BUS_ID, |
| 2635 | isl_charger_i2c_info, |
| 2636 | ARRAY_SIZE(isl_charger_i2c_info), |
| 2637 | }, |
| 2638 | #endif /* CONFIG_ISL9519_CHARGER */ |
Wentao Xu | f59ce4e | 2012-05-22 17:30:13 -0400 | [diff] [blame] | 2639 | #ifdef CONFIG_INPUT_MPU3050 |
| 2640 | { |
| 2641 | I2C_FFA | I2C_FLUID, |
| 2642 | MSM_8930_GSBI12_QUP_I2C_BUS_ID, |
| 2643 | mpu3050_i2c_boardinfo, |
| 2644 | ARRAY_SIZE(mpu3050_i2c_boardinfo), |
| 2645 | }, |
| 2646 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2647 | { |
Amy Maloche | e8de95d | 2012-02-23 10:40:25 -0800 | [diff] [blame] | 2648 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 2649 | MSM_8930_GSBI9_QUP_I2C_BUS_ID, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2650 | msm_isa1200_board_info, |
| 2651 | ARRAY_SIZE(msm_isa1200_board_info), |
| 2652 | }, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 2653 | { |
Amy Maloche | 8eb9111 | 2012-03-30 10:22:37 -0700 | [diff] [blame] | 2654 | I2C_SURF | I2C_FFA | I2C_FLUID, |
Amy Maloche | f3c9db4 | 2011-12-08 15:17:35 -0800 | [diff] [blame] | 2655 | MSM_8930_GSBI3_QUP_I2C_BUS_ID, |
| 2656 | mxt_device_info_8930, |
| 2657 | ARRAY_SIZE(mxt_device_info_8930), |
| 2658 | }, |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 2659 | { |
| 2660 | I2C_SURF | I2C_FFA | I2C_LIQUID | I2C_FLUID, |
| 2661 | MSM_8930_GSBI9_QUP_I2C_BUS_ID, |
| 2662 | sii_device_info, |
| 2663 | ARRAY_SIZE(sii_device_info), |
| 2664 | }, |
Wentao Xu | 114c015 | 2012-06-12 11:40:38 -0400 | [diff] [blame] | 2665 | #ifdef CONFIG_STM_LIS3DH |
| 2666 | { |
| 2667 | I2C_FFA | I2C_FLUID, |
| 2668 | MSM_8930_GSBI12_QUP_I2C_BUS_ID, |
| 2669 | lis3dh_i2c_boardinfo, |
| 2670 | ARRAY_SIZE(lis3dh_i2c_boardinfo), |
| 2671 | }, |
| 2672 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2673 | }; |
| 2674 | #endif /* CONFIG_I2C */ |
| 2675 | |
| 2676 | static void __init register_i2c_devices(void) |
| 2677 | { |
| 2678 | #ifdef CONFIG_I2C |
| 2679 | u8 mach_mask = 0; |
| 2680 | int i; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2681 | #ifdef CONFIG_MSM_CAMERA |
| 2682 | struct i2c_registry msm8930_camera_i2c_devices = { |
| 2683 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
| 2684 | MSM_8930_GSBI4_QUP_I2C_BUS_ID, |
| 2685 | msm8930_camera_board_info.board_info, |
| 2686 | msm8930_camera_board_info.num_i2c_board_info, |
| 2687 | }; |
| 2688 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2689 | |
| 2690 | /* Build the matching 'supported_machs' bitmask */ |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2691 | if (machine_is_msm8930_cdp() || machine_is_msm8627_cdp()) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2692 | mach_mask = I2C_SURF; |
| 2693 | else if (machine_is_msm8930_fluid()) |
| 2694 | mach_mask = I2C_FLUID; |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2695 | else if (machine_is_msm8930_mtp() || machine_is_msm8627_mtp()) |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2696 | mach_mask = I2C_FFA; |
| 2697 | else |
| 2698 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 2699 | |
| 2700 | /* Run the array and install devices as appropriate */ |
| 2701 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 2702 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 2703 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 2704 | msm8960_i2c_devices[i].info, |
| 2705 | msm8960_i2c_devices[i].len); |
| 2706 | } |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 2707 | #ifdef CONFIG_MSM_CAMERA |
| 2708 | if (msm8930_camera_i2c_devices.machs & mach_mask) |
| 2709 | i2c_register_board_info(msm8930_camera_i2c_devices.bus, |
| 2710 | msm8930_camera_i2c_devices.info, |
| 2711 | msm8930_camera_i2c_devices.len); |
| 2712 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2713 | #endif |
| 2714 | } |
| 2715 | |
Bhalchandra Gajare | e94bac2 | 2012-10-08 19:16:13 -0700 | [diff] [blame] | 2716 | /*Modify the WCD9xxx platform data to support supplies from PM8917 */ |
| 2717 | static void __init msm8930_pm8917_wcd9xxx_pdata_fixup( |
| 2718 | struct wcd9xxx_pdata *cdc_pdata) |
| 2719 | { |
| 2720 | int i; |
| 2721 | |
| 2722 | for (i = 0; i < ARRAY_SIZE(cdc_pdata->regulator); i++) { |
| 2723 | |
| 2724 | if (cdc_pdata->regulator[i].name != NULL |
| 2725 | && strncmp(cdc_pdata->regulator[i].name, |
| 2726 | "CDC_VDD_CP", 10) == 0) { |
| 2727 | cdc_pdata->regulator[i].min_uV = |
| 2728 | cdc_pdata->regulator[i].max_uV = 1800000; |
| 2729 | pr_info("%s: CDC_VDD_CP forced to 1.8 volts for PM8917\n", |
| 2730 | __func__); |
| 2731 | return; |
| 2732 | } |
| 2733 | } |
| 2734 | } |
| 2735 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2736 | /* Modify platform data values to match requirements for PM8917. */ |
| 2737 | static void __init msm8930_pm8917_pdata_fixup(void) |
| 2738 | { |
Patrick Daly | c1227cb | 2012-08-28 13:39:17 -0700 | [diff] [blame] | 2739 | struct acpuclk_platform_data *pdata; |
| 2740 | |
Bhalchandra Gajare | e94bac2 | 2012-10-08 19:16:13 -0700 | [diff] [blame] | 2741 | msm8930_pm8917_wcd9xxx_pdata_fixup(&sitar_platform_data); |
| 2742 | msm8930_pm8917_wcd9xxx_pdata_fixup(&sitar1p1_platform_data); |
| 2743 | |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2744 | mhl_platform_data.gpio_mhl_power = MHL_POWER_GPIO_PM8917; |
| 2745 | |
| 2746 | gpio_keys_8930_pdata.buttons = keys_8930_pm8917; |
| 2747 | gpio_keys_8930_pdata.nbuttons = ARRAY_SIZE(keys_8930_pm8917); |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2748 | |
| 2749 | msm_device_saw_core0.dev.platform_data |
| 2750 | = &msm8930_pm8038_saw_regulator_core0_pdata; |
| 2751 | msm_device_saw_core1.dev.platform_data |
| 2752 | = &msm8930_pm8038_saw_regulator_core1_pdata; |
| 2753 | |
| 2754 | msm8930_device_rpm_regulator.dev.platform_data |
| 2755 | = &msm8930_pm8917_rpm_regulator_pdata; |
Patrick Daly | c1227cb | 2012-08-28 13:39:17 -0700 | [diff] [blame] | 2756 | |
| 2757 | pdata = msm8930_device_acpuclk.dev.platform_data; |
| 2758 | pdata->uses_pm8917 = true; |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame^] | 2759 | |
| 2760 | pdata = msm8930ab_device_acpuclk.dev.platform_data; |
| 2761 | pdata->uses_pm8917 = true; |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2762 | } |
| 2763 | |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2764 | static void __init msm8930_cdp_init(void) |
| 2765 | { |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2766 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 2767 | msm8930_pm8917_pdata_fixup(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2768 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 2769 | pr_err("meminfo_init() failed!\n"); |
| 2770 | |
Rohit Vaswani | b1cc493 | 2012-07-23 21:30:11 -0700 | [diff] [blame] | 2771 | platform_device_register(&msm_gpio_device); |
Siddartha Mohanadoss | fad0af1 | 2012-01-20 15:08:38 -0800 | [diff] [blame] | 2772 | msm_tsens_early_init(&msm_tsens_pdata); |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2773 | msm_thermal_init(&msm_thermal_pdata); |
Praveen Chidambaram | 75b8c81 | 2012-08-10 16:26:37 -0600 | [diff] [blame] | 2774 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) { |
| 2775 | BUG_ON(msm_rpm_init(&msm8930_rpm_data)); |
| 2776 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
| 2777 | } else { |
| 2778 | BUG_ON(msm_rpm_init(&msm8930_rpm_data_pm8917)); |
| 2779 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data_pm8917)); |
| 2780 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2781 | |
| 2782 | regulator_suppress_info_printing(); |
| 2783 | if (msm_xo_init()) |
| 2784 | pr_err("Failed to initialize XO votes\n"); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2785 | platform_device_register(&msm8930_device_rpm_regulator); |
Patrick Daly | 8fad60d | 2012-08-27 16:25:07 -0700 | [diff] [blame] | 2786 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 2787 | msm_clock_init(&msm8930_pm8917_clock_init_data); |
| 2788 | else |
| 2789 | msm_clock_init(&msm8930_clock_init_data); |
Mayank Rana | 2fe1aec | 2012-06-07 18:00:12 +0530 | [diff] [blame] | 2790 | msm_otg_pdata.phy_init_seq = hsusb_phy_init_seq; |
Aravind Venkateswaran | 06a4635 | 2012-08-16 14:52:39 -0700 | [diff] [blame] | 2791 | if (msm8930_mhl_display_enabled()) { |
| 2792 | mhl_platform_data.mhl_enabled = true; |
| 2793 | msm_otg_pdata.mhl_enable = true; |
| 2794 | } |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2795 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Mayank Rana | c64b639 | 2012-05-21 14:05:23 +0530 | [diff] [blame] | 2796 | android_usb_pdata.swfi_latency = |
| 2797 | msm_rpmrs_levels[0].latency_us; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 2798 | msm8930_init_gpiomux(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2799 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 2800 | &msm8960_qup_spi_gsbi1_pdata; |
| 2801 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
| 2802 | |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2803 | /* |
| 2804 | * TODO: When physical 8930/PM8038 hardware becomes |
| 2805 | * available, remove this block or add the config |
| 2806 | * option. |
| 2807 | */ |
| 2808 | #ifndef MSM8930_PHASE_2 |
| 2809 | msm8960_init_pmic(); |
| 2810 | #else |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2811 | msm8930_init_pmic(); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2812 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2813 | msm8930_i2c_init(); |
Sudhakara Rao Tentu | 8b5c8ed | 2012-03-05 14:48:41 +0530 | [diff] [blame] | 2814 | msm8930_init_gpu(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2815 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 2816 | msm_spm_l2_init(msm_spm_l2_data); |
| 2817 | msm8930_init_buses(); |
Aravind Venkateswaran | 896d2f9 | 2012-10-29 17:54:55 -0700 | [diff] [blame] | 2818 | if (cpu_is_msm8627()) { |
Tianyi Gou | 723843b | 2012-06-13 15:24:56 -0700 | [diff] [blame] | 2819 | platform_add_devices(msm8627_footswitch, |
| 2820 | msm8627_num_footswitch); |
Aravind Venkateswaran | 896d2f9 | 2012-10-29 17:54:55 -0700 | [diff] [blame] | 2821 | } else { |
| 2822 | if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917) |
| 2823 | platform_add_devices(msm8930_pm8917_footswitch, |
| 2824 | msm8930_pm8917_num_footswitch); |
| 2825 | else |
| 2826 | platform_add_devices(msm8930_footswitch, |
| 2827 | msm8930_num_footswitch); |
| 2828 | } |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 2829 | if (cpu_is_msm8627()) |
Matt Wagantall | ab730bd | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 2830 | platform_device_register(&msm8627_device_acpuclk); |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame] | 2831 | else if (cpu_is_msm8930()) |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 2832 | platform_device_register(&msm8930_device_acpuclk); |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame] | 2833 | else if (cpu_is_msm8930aa()) |
| 2834 | platform_device_register(&msm8930aa_device_acpuclk); |
Tianyi Gou | 2520b6e | 2012-10-29 19:13:53 -0700 | [diff] [blame^] | 2835 | else if (cpu_is_msm8930ab()) |
| 2836 | platform_device_register(&msm8930ab_device_acpuclk); |
David Collins | 4614cb9 | 2012-08-20 12:17:09 -0700 | [diff] [blame] | 2837 | platform_add_devices(early_common_devices, |
| 2838 | ARRAY_SIZE(early_common_devices)); |
| 2839 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) |
| 2840 | platform_add_devices(pmic_pm8038_devices, |
| 2841 | ARRAY_SIZE(pmic_pm8038_devices)); |
| 2842 | else |
| 2843 | platform_add_devices(pmic_pm8917_devices, |
| 2844 | ARRAY_SIZE(pmic_pm8917_devices)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2845 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 2846 | msm8930_add_vidc_device(); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2847 | /* |
| 2848 | * TODO: When physical 8930/PM8038 hardware becomes |
| 2849 | * available, remove this block or add the config |
| 2850 | * option. |
| 2851 | */ |
| 2852 | #ifndef MSM8930_PHASE_2 |
| 2853 | msm8960_pm8921_gpio_mpp_init(); |
| 2854 | #else |
David Collins | fd344aa | 2012-08-06 15:02:03 -0700 | [diff] [blame] | 2855 | if (socinfo_get_pmic_model() != PMIC_MODEL_PM8917) |
| 2856 | msm8930_pm8038_gpio_mpp_init(); |
| 2857 | else |
| 2858 | msm8930_pm8917_gpio_mpp_init(); |
Jay Chokshi | 06fa754 | 2011-12-07 13:09:17 -0800 | [diff] [blame] | 2859 | #endif |
Jin Hong | d2e2d3b | 2012-11-01 14:16:33 -0700 | [diff] [blame] | 2860 | /* Don't add modem devices on APQ targets */ |
| 2861 | if (socinfo_get_id() != 119 && socinfo_get_id() != 157 |
| 2862 | && socinfo_get_id() != 160) |
| 2863 | platform_device_register(&msm_8960_q6_mss); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2864 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 2865 | #ifdef CONFIG_MSM_CAMERA |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2866 | msm8930_init_cam(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 2867 | #endif |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2868 | msm8930_init_mmc(); |
Amy Maloche | 8eb9111 | 2012-03-30 10:22:37 -0700 | [diff] [blame] | 2869 | mxt_init_vkeys_8930(); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2870 | register_i2c_devices(); |
| 2871 | msm8930_init_fb(); |
| 2872 | slim_register_board_info(msm_slim_devices, |
| 2873 | ARRAY_SIZE(msm_slim_devices)); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2874 | change_memory_power = &msm8930_change_memory_power; |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 2875 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 2876 | msm_pm_set_tz_retention_flag(1); |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2877 | |
| 2878 | if (PLATFORM_IS_CHARM25()) |
| 2879 | platform_add_devices(mdm_devices, ARRAY_SIZE(mdm_devices)); |
| 2880 | } |
| 2881 | |
| 2882 | MACHINE_START(MSM8930_CDP, "QCT MSM8930 CDP") |
| 2883 | .map_io = msm8930_map_io, |
| 2884 | .reserve = msm8930_reserve, |
| 2885 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2886 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2887 | .timer = &msm_timer, |
| 2888 | .init_machine = msm8930_cdp_init, |
| 2889 | .init_early = msm8930_allocate_memory_regions, |
| 2890 | .init_very_early = msm8930_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 2891 | .restart = msm_restart, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2892 | MACHINE_END |
| 2893 | |
| 2894 | MACHINE_START(MSM8930_MTP, "QCT MSM8930 MTP") |
| 2895 | .map_io = msm8930_map_io, |
| 2896 | .reserve = msm8930_reserve, |
| 2897 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2898 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2899 | .timer = &msm_timer, |
| 2900 | .init_machine = msm8930_cdp_init, |
| 2901 | .init_early = msm8930_allocate_memory_regions, |
| 2902 | .init_very_early = msm8930_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 2903 | .restart = msm_restart, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2904 | MACHINE_END |
| 2905 | |
| 2906 | MACHINE_START(MSM8930_FLUID, "QCT MSM8930 FLUID") |
| 2907 | .map_io = msm8930_map_io, |
| 2908 | .reserve = msm8930_reserve, |
| 2909 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2910 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2911 | .timer = &msm_timer, |
| 2912 | .init_machine = msm8930_cdp_init, |
| 2913 | .init_early = msm8930_allocate_memory_regions, |
| 2914 | .init_very_early = msm8930_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 2915 | .restart = msm_restart, |
Stepan Moskovchenko | 39236d7 | 2011-11-30 17:42:23 -0800 | [diff] [blame] | 2916 | MACHINE_END |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2917 | |
| 2918 | MACHINE_START(MSM8627_CDP, "QCT MSM8627 CDP") |
| 2919 | .map_io = msm8930_map_io, |
| 2920 | .reserve = msm8930_reserve, |
| 2921 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2922 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2923 | .timer = &msm_timer, |
| 2924 | .init_machine = msm8930_cdp_init, |
| 2925 | .init_early = msm8930_allocate_memory_regions, |
| 2926 | .init_very_early = msm8930_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 2927 | .restart = msm_restart, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2928 | MACHINE_END |
| 2929 | |
| 2930 | MACHINE_START(MSM8627_MTP, "QCT MSM8627 MTP") |
| 2931 | .map_io = msm8930_map_io, |
| 2932 | .reserve = msm8930_reserve, |
| 2933 | .init_irq = msm8930_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 2934 | .handle_irq = gic_handle_irq, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2935 | .timer = &msm_timer, |
| 2936 | .init_machine = msm8930_cdp_init, |
| 2937 | .init_early = msm8930_allocate_memory_regions, |
| 2938 | .init_very_early = msm8930_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 2939 | .restart = msm_restart, |
Stepan Moskovchenko | 8768eff | 2011-12-01 18:55:07 -0800 | [diff] [blame] | 2940 | MACHINE_END |