Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -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 | * |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 12 | */ |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 13 | #include <linux/err.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/io.h> |
| 17 | #include <linux/irq.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 18 | #include <linux/i2c.h> |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 19 | #include <linux/i2c/sx150x.h> |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 20 | #include <linux/i2c/isl9519.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | #include <linux/gpio.h> |
| 22 | #include <linux/msm_ssbi.h> |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 23 | #include <linux/regulator/msm-gpio-regulator.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 24 | #include <linux/mfd/pm8xxx/pm8921.h> |
Siddartha Mohanadoss | af91d90 | 2011-10-20 10:23:34 -0700 | [diff] [blame] | 25 | #include <linux/mfd/pm8xxx/pm8xxx-adc.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 26 | #include <linux/regulator/consumer.h> |
| 27 | #include <linux/spi/spi.h> |
| 28 | #include <linux/slimbus/slimbus.h> |
| 29 | #include <linux/bootmem.h> |
| 30 | #ifdef CONFIG_ANDROID_PMEM |
| 31 | #include <linux/android_pmem.h> |
| 32 | #endif |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 33 | #include <linux/cyttsp-qc.h> |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 34 | #include <linux/dma-contiguous.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | #include <linux/dma-mapping.h> |
| 36 | #include <linux/platform_data/qcom_crypto_device.h> |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 37 | #include <linux/platform_data/qcom_wcnss_device.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 38 | #include <linux/leds.h> |
| 39 | #include <linux/leds-pm8xxx.h> |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 40 | #include <linux/i2c/atmel_mxt_ts.h> |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 41 | #include <linux/msm_tsens.h> |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 42 | #include <linux/ks8851.h> |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 43 | #include <linux/i2c/isa1200.h> |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 44 | #include <linux/memory.h> |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 45 | #include <linux/memblock.h> |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 46 | #include <linux/msm_thermal.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 47 | |
| 48 | #include <asm/mach-types.h> |
| 49 | #include <asm/mach/arch.h> |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 50 | #include <asm/setup.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 51 | #include <asm/hardware/gic.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 52 | #include <asm/mach/mmc.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 53 | |
| 54 | #include <mach/board.h> |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 55 | #include <mach/msm_tspp.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 56 | #include <mach/msm_iomap.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 57 | #include <mach/msm_spi.h> |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 58 | #include <mach/msm_serial_hs.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 59 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 60 | #include <mach/msm_hsusb.h> |
| 61 | #else |
| 62 | #include <linux/usb/msm_hsusb.h> |
| 63 | #endif |
| 64 | #include <linux/usb/android.h> |
| 65 | #include <mach/usbdiag.h> |
| 66 | #include <mach/socinfo.h> |
| 67 | #include <mach/rpm.h> |
Rohit Vaswani | a513aa8d | 2011-07-18 15:14:28 -0700 | [diff] [blame] | 68 | #include <mach/gpiomux.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 69 | #include <mach/msm_bus_board.h> |
| 70 | #include <mach/msm_memtypes.h> |
| 71 | #include <mach/dma.h> |
| 72 | #include <mach/msm_dsps.h> |
| 73 | #include <mach/msm_xo.h> |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 74 | #include <mach/restart.h> |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 75 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 76 | #ifdef CONFIG_WCD9310_CODEC |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 77 | #include <linux/mfd/wcd9xxx/core.h> |
| 78 | #include <linux/mfd/wcd9xxx/pdata.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 79 | #endif |
| 80 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 81 | #include <linux/smsc3503.h> |
Mitchel Humpherys | cfa31af | 2012-09-06 11:34:03 -0700 | [diff] [blame] | 82 | #include <linux/msm_ion.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 83 | #include <mach/ion.h> |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 84 | #include <mach/mdm2.h> |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 85 | #include <mach/mdm-peripheral.h> |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 86 | #include <mach/msm_rtb.h> |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 87 | #include <mach/msm_cache_dump.h> |
| 88 | #include <mach/scm.h> |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 89 | #include <mach/iommu_domains.h> |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 90 | |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 91 | #include <mach/kgsl.h> |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 92 | #include <linux/fmem.h> |
| 93 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 94 | #include "timer.h" |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 95 | #include "devices.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 96 | #include "devices-msm8x60.h" |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 97 | #include "spm.h" |
Stepan Moskovchenko | 5a83dba | 2011-12-05 17:30:17 -0800 | [diff] [blame] | 98 | #include "board-8960.h" |
Matt Wagantall | 7cca464 | 2012-02-01 16:43:24 -0800 | [diff] [blame] | 99 | #include "pm.h" |
Abhijeet Dharmapurikar | efaca4f | 2011-12-27 16:24:07 -0800 | [diff] [blame] | 100 | #include <mach/cpuidle.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | #include "rpm_resources.h" |
Subhash Jadavani | 909e04f | 2012-04-12 10:52:50 +0530 | [diff] [blame] | 102 | #include <mach/mpm.h> |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 103 | #include "clock.h" |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 104 | #include "smd_private.h" |
Maheshkumar Sivasubramanian | 8ccc16e | 2011-10-25 15:59:57 -0600 | [diff] [blame] | 105 | #include "pm-boot.h" |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 106 | #include "msm_watchdog.h" |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 107 | #include "platsmp.h" |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 108 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 109 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
| 110 | #include <linux/wlan_plat.h> |
| 111 | #include <linux/mutex.h> |
| 112 | #endif |
| 113 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 114 | static struct platform_device msm_fm_platform_init = { |
| 115 | .name = "iris_fm", |
| 116 | .id = -1, |
| 117 | }; |
| 118 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 119 | #define KS8851_RST_GPIO 89 |
| 120 | #define KS8851_IRQ_GPIO 90 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 121 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 122 | #define MHL_GPIO_INT 4 |
| 123 | #define MHL_GPIO_RESET 15 |
| 124 | |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 125 | #if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE) |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 126 | |
Stepan Moskovchenko | c6ada42 | 2011-11-28 19:31:16 -0800 | [diff] [blame] | 127 | struct sx150x_platform_data msm8960_sx150x_data[] = { |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 128 | [SX150X_CAM] = { |
| 129 | .gpio_base = GPIO_CAM_EXPANDER_BASE, |
| 130 | .oscio_is_gpo = false, |
| 131 | .io_pullup_ena = 0x0, |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 132 | .io_pulldn_ena = 0xc0, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 133 | .io_open_drain_ena = 0x0, |
| 134 | .irq_summary = -1, |
| 135 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 136 | [SX150X_LIQUID] = { |
| 137 | .gpio_base = GPIO_LIQUID_EXPANDER_BASE, |
| 138 | .oscio_is_gpo = false, |
| 139 | .io_pullup_ena = 0x0c08, |
| 140 | .io_pulldn_ena = 0x4060, |
| 141 | .io_open_drain_ena = 0x000c, |
| 142 | .io_polarity = 0, |
| 143 | .irq_summary = -1, |
| 144 | }, |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 145 | }; |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 146 | |
| 147 | #endif |
| 148 | |
Olav Haugan | a21169d | 2012-01-04 09:17:06 -0800 | [diff] [blame] | 149 | #define MSM_PMEM_ADSP_SIZE 0x7800000 |
Bharath Ramachandramurthy | 2fd017a | 2012-03-13 10:21:09 -0700 | [diff] [blame] | 150 | #define MSM_PMEM_AUDIO_SIZE 0x4CF000 |
Mathew Karimpanal | 15fa5c4 | 2011-12-14 21:28:10 -0800 | [diff] [blame] | 151 | #define MSM_PMEM_SIZE 0x2800000 /* 40 Mbytes */ |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 152 | #define MSM_LIQUID_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 153 | #define MSM_HDMI_PRIM_PMEM_SIZE 0x4000000 /* 64 Mbytes */ |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 154 | |
| 155 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 156 | #define HOLE_SIZE 0x20000 |
Rajeshwar Kurapaty | c3e190a | 2012-12-04 19:28:05 +0530 | [diff] [blame] | 157 | #define MSM_ION_MFC_META_SIZE 0x40000 /* 256 Kbytes */ |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 158 | #define MSM_CONTIG_MEM_SIZE 0x65000 |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 159 | #ifdef CONFIG_MSM_IOMMU |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 160 | #define MSM_ION_MM_SIZE 0x3800000 /* Need to be multiple of 64K */ |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 161 | #define MSM_ION_SF_SIZE 0x0 |
Olav Haugan | fbbf05b | 2012-04-05 14:33:41 -0700 | [diff] [blame] | 162 | #define MSM_ION_QSECOM_SIZE 0x780000 /* (7.5MB) */ |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 163 | #define MSM_ION_HEAP_NUM 7 |
| 164 | #else |
| 165 | #define MSM_ION_MM_SIZE MSM_PMEM_ADSP_SIZE |
| 166 | #define MSM_ION_SF_SIZE MSM_PMEM_SIZE |
Olav Haugan | fbbf05b | 2012-04-05 14:33:41 -0700 | [diff] [blame] | 167 | #define MSM_ION_QSECOM_SIZE 0x600000 /* (6MB) */ |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 168 | #define MSM_ION_HEAP_NUM 8 |
| 169 | #endif |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 170 | #define MSM_ION_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 128kb */ |
Rajeshwar Kurapaty | c3e190a | 2012-12-04 19:28:05 +0530 | [diff] [blame] | 171 | #define MSM_ION_MFC_SIZE (SZ_8K + MSM_ION_MFC_META_SIZE) |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 172 | #define MSM_ION_AUDIO_SIZE MSM_PMEM_AUDIO_SIZE |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 173 | |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 174 | #define MSM_LIQUID_ION_MM_SIZE (MSM_ION_MM_SIZE + 0x600000) |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 175 | #define MSM_LIQUID_ION_SF_SIZE MSM_LIQUID_PMEM_SIZE |
| 176 | #define MSM_HDMI_PRIM_ION_SF_SIZE MSM_HDMI_PRIM_PMEM_SIZE |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 177 | |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 178 | #define MSM_MM_FW_SIZE (0x200000 - HOLE_SIZE) /* 2mb -128kb*/ |
| 179 | #define MSM8960_FIXED_AREA_START (0xa0000000 - (MSM_ION_MM_FW_SIZE + \ |
| 180 | HOLE_SIZE)) |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 181 | #define MAX_FIXED_AREA_SIZE 0x10000000 |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 182 | #define MSM8960_FW_START MSM8960_FIXED_AREA_START |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 183 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 184 | static unsigned msm_ion_sf_size = MSM_ION_SF_SIZE; |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 185 | #else |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 186 | #define MSM_CONTIG_MEM_SIZE 0x110C000 |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 187 | #define MSM_ION_HEAP_NUM 1 |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 188 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 189 | |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 190 | #ifdef CONFIG_KERNEL_MSM_CONTIG_MEM_REGION |
| 191 | static unsigned msm_contig_mem_size = MSM_CONTIG_MEM_SIZE; |
| 192 | static int __init msm_contig_mem_size_setup(char *p) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 193 | { |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 194 | msm_contig_mem_size = memparse(p, NULL); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 195 | return 0; |
| 196 | } |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 197 | early_param("msm_contig_mem_size", msm_contig_mem_size_setup); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 198 | #endif |
| 199 | |
| 200 | #ifdef CONFIG_ANDROID_PMEM |
| 201 | static unsigned pmem_size = MSM_PMEM_SIZE; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 202 | static unsigned pmem_param_set; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 203 | static int __init pmem_size_setup(char *p) |
| 204 | { |
| 205 | pmem_size = memparse(p, NULL); |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 206 | pmem_param_set = 1; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 207 | return 0; |
| 208 | } |
| 209 | early_param("pmem_size", pmem_size_setup); |
| 210 | |
| 211 | static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE; |
| 212 | |
| 213 | static int __init pmem_adsp_size_setup(char *p) |
| 214 | { |
| 215 | pmem_adsp_size = memparse(p, NULL); |
| 216 | return 0; |
| 217 | } |
| 218 | early_param("pmem_adsp_size", pmem_adsp_size_setup); |
| 219 | |
| 220 | static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE; |
| 221 | |
| 222 | static int __init pmem_audio_size_setup(char *p) |
| 223 | { |
| 224 | pmem_audio_size = memparse(p, NULL); |
| 225 | return 0; |
| 226 | } |
| 227 | early_param("pmem_audio_size", pmem_audio_size_setup); |
| 228 | #endif |
| 229 | |
| 230 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 231 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 232 | static struct android_pmem_platform_data android_pmem_pdata = { |
| 233 | .name = "pmem", |
| 234 | .allocator_type = PMEM_ALLOCATORTYPE_ALLORNOTHING, |
| 235 | .cached = 1, |
| 236 | .memory_type = MEMTYPE_EBI1, |
| 237 | }; |
| 238 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 239 | static struct platform_device msm8960_android_pmem_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 240 | .name = "android_pmem", |
| 241 | .id = 0, |
| 242 | .dev = {.platform_data = &android_pmem_pdata}, |
| 243 | }; |
| 244 | |
| 245 | static struct android_pmem_platform_data android_pmem_adsp_pdata = { |
| 246 | .name = "pmem_adsp", |
| 247 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 248 | .cached = 0, |
| 249 | .memory_type = MEMTYPE_EBI1, |
| 250 | }; |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 251 | static struct platform_device msm8960_android_pmem_adsp_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 252 | .name = "android_pmem", |
| 253 | .id = 2, |
| 254 | .dev = { .platform_data = &android_pmem_adsp_pdata }, |
| 255 | }; |
| 256 | |
| 257 | static struct android_pmem_platform_data android_pmem_audio_pdata = { |
| 258 | .name = "pmem_audio", |
| 259 | .allocator_type = PMEM_ALLOCATORTYPE_BITMAP, |
| 260 | .cached = 0, |
| 261 | .memory_type = MEMTYPE_EBI1, |
| 262 | }; |
| 263 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 264 | static struct platform_device msm8960_android_pmem_audio_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 265 | .name = "android_pmem", |
| 266 | .id = 4, |
| 267 | .dev = { .platform_data = &android_pmem_audio_pdata }, |
| 268 | }; |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 269 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 270 | #endif /*CONFIG_ANDROID_PMEM*/ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 271 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 272 | struct fmem_platform_data msm8960_fmem_pdata = { |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 273 | }; |
| 274 | |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 275 | #define DSP_RAM_BASE_8960 0x8da00000 |
| 276 | #define DSP_RAM_SIZE_8960 0x1800000 |
| 277 | static int dspcrashd_pdata_8960 = 0xDEADDEAD; |
| 278 | |
| 279 | static struct resource resources_dspcrashd_8960[] = { |
| 280 | { |
| 281 | .name = "msm_dspcrashd", |
| 282 | .start = DSP_RAM_BASE_8960, |
| 283 | .end = DSP_RAM_BASE_8960 + DSP_RAM_SIZE_8960, |
| 284 | .flags = IORESOURCE_DMA, |
| 285 | }, |
| 286 | }; |
| 287 | |
Stepan Moskovchenko | fc70d90 | 2011-11-30 12:39:36 -0800 | [diff] [blame] | 288 | static struct platform_device msm_device_dspcrashd_8960 = { |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 289 | .name = "msm_dspcrashd", |
| 290 | .num_resources = ARRAY_SIZE(resources_dspcrashd_8960), |
| 291 | .resource = resources_dspcrashd_8960, |
| 292 | .dev = { .platform_data = &dspcrashd_pdata_8960 }, |
| 293 | }; |
| 294 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 295 | static struct memtype_reserve msm8960_reserve_table[] __initdata = { |
| 296 | [MEMTYPE_SMI] = { |
| 297 | }, |
| 298 | [MEMTYPE_EBI0] = { |
| 299 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 300 | }, |
| 301 | [MEMTYPE_EBI1] = { |
| 302 | .flags = MEMTYPE_FLAGS_1M_ALIGN, |
| 303 | }, |
| 304 | }; |
| 305 | |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 306 | static void __init reserve_rtb_memory(void) |
| 307 | { |
| 308 | #if defined(CONFIG_MSM_RTB) |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 309 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm8960_rtb_pdata.size; |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 310 | #endif |
| 311 | } |
| 312 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 313 | static void __init size_pmem_devices(void) |
| 314 | { |
| 315 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 316 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 317 | android_pmem_adsp_pdata.size = pmem_adsp_size; |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 318 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 319 | if (!pmem_param_set) { |
| 320 | if (machine_is_msm8960_liquid()) |
| 321 | pmem_size = MSM_LIQUID_PMEM_SIZE; |
Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 322 | if (msm8960_hdmi_as_primary_selected()) |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 323 | pmem_size = MSM_HDMI_PRIM_PMEM_SIZE; |
| 324 | } |
| 325 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 326 | android_pmem_pdata.size = pmem_size; |
| 327 | android_pmem_audio_pdata.size = MSM_PMEM_AUDIO_SIZE; |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 328 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 329 | #endif /*CONFIG_ANDROID_PMEM*/ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 330 | } |
| 331 | |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 332 | #ifdef CONFIG_ANDROID_PMEM |
| 333 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 334 | static void __init reserve_memory_for(struct android_pmem_platform_data *p) |
| 335 | { |
| 336 | msm8960_reserve_table[p->memory_type].size += p->size; |
| 337 | } |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 338 | #endif /*CONFIG_MSM_MULTIMEDIA_USE_ION*/ |
| 339 | #endif /*CONFIG_ANDROID_PMEM*/ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 340 | |
| 341 | static void __init reserve_pmem_memory(void) |
| 342 | { |
| 343 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 344 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 345 | reserve_memory_for(&android_pmem_adsp_pdata); |
| 346 | reserve_memory_for(&android_pmem_pdata); |
| 347 | reserve_memory_for(&android_pmem_audio_pdata); |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 348 | #endif |
Mitchel Humpherys | 05e5881 | 2012-08-13 14:24:13 -0700 | [diff] [blame] | 349 | msm8960_reserve_table[MEMTYPE_EBI1].size += msm_contig_mem_size; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 350 | #endif |
| 351 | } |
| 352 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 353 | static int msm8960_paddr_to_memtype(unsigned int paddr) |
| 354 | { |
| 355 | return MEMTYPE_EBI1; |
| 356 | } |
| 357 | |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 358 | #define FMEM_ENABLED 0 |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 359 | |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 360 | #ifdef CONFIG_ION_MSM |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 361 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 362 | static struct ion_cp_heap_pdata cp_mm_msm8960_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 363 | .permission_type = IPT_TYPE_MM_CARVEOUT, |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 364 | .align = SZ_64K, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 365 | .reusable = FMEM_ENABLED, |
| 366 | .mem_is_fmem = FMEM_ENABLED, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 367 | .fixed_position = FIXED_MIDDLE, |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 368 | .iommu_map_all = 1, |
| 369 | .iommu_2x_map_domain = VIDEO_DOMAIN, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 370 | }; |
| 371 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 372 | static struct ion_cp_heap_pdata cp_mfc_msm8960_ion_pdata = { |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 373 | .permission_type = IPT_TYPE_MFC_SHAREDMEM, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 374 | .align = PAGE_SIZE, |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 375 | .reusable = 0, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 376 | .mem_is_fmem = FMEM_ENABLED, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 377 | .fixed_position = FIXED_HIGH, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 378 | }; |
| 379 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 380 | static struct ion_co_heap_pdata co_msm8960_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 381 | .adjacent_mem_id = INVALID_HEAP_ID, |
| 382 | .align = PAGE_SIZE, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 383 | .mem_is_fmem = 0, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 384 | }; |
| 385 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 386 | static struct ion_co_heap_pdata fw_co_msm8960_ion_pdata = { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 387 | .adjacent_mem_id = ION_CP_MM_HEAP_ID, |
| 388 | .align = SZ_128K, |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 389 | .mem_is_fmem = FMEM_ENABLED, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 390 | .fixed_position = FIXED_LOW, |
Olav Haugan | 0703dbf | 2011-12-19 17:53:38 -0800 | [diff] [blame] | 391 | }; |
| 392 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 393 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 394 | static u64 msm_dmamask = DMA_BIT_MASK(32); |
| 395 | |
| 396 | static struct platform_device ion_mm_heap_device = { |
| 397 | .name = "ion-mm-heap-device", |
| 398 | .id = -1, |
| 399 | .dev = { |
| 400 | .dma_mask = &msm_dmamask, |
| 401 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 402 | } |
| 403 | }; |
| 404 | |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 405 | /** |
| 406 | * These heaps are listed in the order they will be allocated. Due to |
| 407 | * video hardware restrictions and content protection the FW heap has to |
| 408 | * be allocated adjacent (below) the MM heap and the MFC heap has to be |
| 409 | * allocated after the MM heap to ensure MFC heap is not more than 256MB |
| 410 | * away from the base address of the FW heap. |
| 411 | * However, the order of FW heap and MM heap doesn't matter since these |
| 412 | * two heaps are taken care of by separate code to ensure they are adjacent |
| 413 | * to each other. |
| 414 | * Don't swap the order unless you know what you are doing! |
| 415 | */ |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 416 | struct ion_platform_heap msm8960_heaps[] = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 417 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 418 | .id = ION_SYSTEM_HEAP_ID, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 419 | .type = ION_HEAP_TYPE_SYSTEM, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 420 | .name = ION_VMALLOC_HEAP_NAME, |
| 421 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 422 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 423 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 424 | .id = ION_CP_MM_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 425 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 426 | .name = ION_MM_HEAP_NAME, |
| 427 | .size = MSM_ION_MM_SIZE, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 428 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 429 | .extra_data = (void *) &cp_mm_msm8960_ion_pdata, |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 430 | .priv = &ion_mm_heap_device.dev, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 431 | }, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 432 | { |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 433 | .id = ION_MM_FIRMWARE_HEAP_ID, |
| 434 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 435 | .name = ION_MM_FIRMWARE_HEAP_NAME, |
| 436 | .size = MSM_ION_MM_FW_SIZE, |
| 437 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 438 | .extra_data = (void *) &fw_co_msm8960_ion_pdata, |
Olav Haugan | 42ebe71 | 2012-01-10 16:30:58 -0800 | [diff] [blame] | 439 | }, |
| 440 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 441 | .id = ION_CP_MFC_HEAP_ID, |
Olav Haugan | 0a85251 | 2012-01-09 10:20:55 -0800 | [diff] [blame] | 442 | .type = ION_HEAP_TYPE_CP, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 443 | .name = ION_MFC_HEAP_NAME, |
| 444 | .size = MSM_ION_MFC_SIZE, |
| 445 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 446 | .extra_data = (void *) &cp_mfc_msm8960_ion_pdata, |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 447 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 448 | #ifndef CONFIG_MSM_IOMMU |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 449 | { |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 450 | .id = ION_SF_HEAP_ID, |
| 451 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 452 | .name = ION_SF_HEAP_NAME, |
| 453 | .size = MSM_ION_SF_SIZE, |
| 454 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 455 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 456 | }, |
Olav Haugan | 3259455 | 2012-03-13 11:40:05 -0700 | [diff] [blame] | 457 | #endif |
Olav Haugan | 9cdfc2f | 2012-02-15 09:52:57 -0800 | [diff] [blame] | 458 | { |
Olav Haugan | b5be799 | 2011-11-18 14:29:02 -0800 | [diff] [blame] | 459 | .id = ION_IOMMU_HEAP_ID, |
Laura Abbott | 8c01736 | 2011-09-22 20:59:12 -0700 | [diff] [blame] | 460 | .type = ION_HEAP_TYPE_IOMMU, |
| 461 | .name = ION_IOMMU_HEAP_NAME, |
| 462 | }, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 463 | { |
| 464 | .id = ION_QSECOM_HEAP_ID, |
| 465 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 466 | .name = ION_QSECOM_HEAP_NAME, |
| 467 | .size = MSM_ION_QSECOM_SIZE, |
| 468 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 469 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 80854eb | 2012-01-12 12:00:23 -0800 | [diff] [blame] | 470 | }, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 471 | { |
| 472 | .id = ION_AUDIO_HEAP_ID, |
| 473 | .type = ION_HEAP_TYPE_CARVEOUT, |
| 474 | .name = ION_AUDIO_HEAP_NAME, |
| 475 | .size = MSM_ION_AUDIO_SIZE, |
| 476 | .memory_type = ION_EBI_TYPE, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 477 | .extra_data = (void *) &co_msm8960_ion_pdata, |
Olav Haugan | 7355db0 | 2012-01-13 16:59:13 -0800 | [diff] [blame] | 478 | }, |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 479 | #endif |
Benjamin Gaignard | 63d8103 | 2012-06-25 15:27:30 -0700 | [diff] [blame] | 480 | }; |
| 481 | |
| 482 | static struct ion_platform_data msm8960_ion_pdata = { |
| 483 | .nr = MSM_ION_HEAP_NUM, |
| 484 | .heaps = msm8960_heaps, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 485 | }; |
| 486 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 487 | static struct platform_device msm8960_ion_dev = { |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 488 | .name = "ion-msm", |
| 489 | .id = 1, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 490 | .dev = { .platform_data = &msm8960_ion_pdata }, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 491 | }; |
| 492 | #endif |
| 493 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 494 | struct platform_device msm8960_fmem_device = { |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 495 | .name = "fmem", |
| 496 | .id = 1, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 497 | .dev = { .platform_data = &msm8960_fmem_pdata }, |
Larry Bassel | 41a055b | 2011-12-06 16:15:14 -0800 | [diff] [blame] | 498 | }; |
| 499 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 500 | static void __init adjust_mem_for_liquid(void) |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 501 | { |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 502 | unsigned int i; |
| 503 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 504 | if (!pmem_param_set) { |
| 505 | if (machine_is_msm8960_liquid()) |
| 506 | msm_ion_sf_size = MSM_LIQUID_ION_SF_SIZE; |
| 507 | |
Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 508 | if (msm8960_hdmi_as_primary_selected()) |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 509 | msm_ion_sf_size = MSM_HDMI_PRIM_ION_SF_SIZE; |
| 510 | |
Ravishangar Kalyanam | fda36c4 | 2012-03-26 16:28:19 -0700 | [diff] [blame] | 511 | if (machine_is_msm8960_liquid() || |
| 512 | msm8960_hdmi_as_primary_selected()) { |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 513 | for (i = 0; i < msm8960_ion_pdata.nr; i++) { |
| 514 | if (msm8960_ion_pdata.heaps[i].id == |
| 515 | ION_SF_HEAP_ID) { |
| 516 | msm8960_ion_pdata.heaps[i].size = |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 517 | msm_ion_sf_size; |
| 518 | pr_debug("msm_ion_sf_size 0x%x\n", |
| 519 | msm_ion_sf_size); |
| 520 | break; |
| 521 | } |
Ravishangar Kalyanam | 671f5ce | 2011-12-06 20:25:29 -0800 | [diff] [blame] | 522 | } |
| 523 | } |
| 524 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 525 | } |
| 526 | |
| 527 | static void __init reserve_mem_for_ion(enum ion_memory_types mem_type, |
| 528 | unsigned long size) |
| 529 | { |
| 530 | msm8960_reserve_table[mem_type].size += size; |
| 531 | } |
| 532 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 533 | static void __init msm8960_reserve_fixed_area(unsigned long fixed_area_size) |
| 534 | { |
| 535 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 536 | int ret; |
| 537 | |
| 538 | if (fixed_area_size > MAX_FIXED_AREA_SIZE) |
| 539 | panic("fixed area size is larger than %dM\n", |
| 540 | MAX_FIXED_AREA_SIZE >> 20); |
| 541 | |
| 542 | reserve_info->fixed_area_size = fixed_area_size; |
| 543 | reserve_info->fixed_area_start = MSM8960_FW_START; |
| 544 | |
| 545 | ret = memblock_remove(reserve_info->fixed_area_start, |
| 546 | reserve_info->fixed_area_size); |
| 547 | BUG_ON(ret); |
| 548 | #endif |
| 549 | } |
| 550 | |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 551 | /** |
| 552 | * Reserve memory for ION and calculate amount of reusable memory for fmem. |
| 553 | * We only reserve memory for heaps that are not reusable. However, we only |
| 554 | * support one reusable heap at the moment so we ignore the reusable flag for |
| 555 | * other than the first heap with reusable flag set. Also handle special case |
Olav Haugan | f6dc774 | 2012-02-15 09:11:55 -0800 | [diff] [blame] | 556 | * for video heaps (MM,FW, and MFC). Video requires heaps MM and MFC to be |
| 557 | * at a higher address than FW in addition to not more than 256MB away from the |
| 558 | * base address of the firmware. This means that if MM is reusable the other |
| 559 | * two heaps must be allocated in the same region as FW. This is handled by the |
| 560 | * mem_is_fmem flag in the platform data. In addition the MM heap must be |
| 561 | * adjacent to the FW heap for content protection purposes. |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 562 | */ |
| 563 | static void __init reserve_ion_memory(void) |
| 564 | { |
| 565 | #if defined(CONFIG_ION_MSM) && defined(CONFIG_MSM_MULTIMEDIA_USE_ION) |
| 566 | unsigned int i; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 567 | int ret; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 568 | unsigned int fixed_size = 0; |
| 569 | unsigned int fixed_low_size, fixed_middle_size, fixed_high_size; |
| 570 | unsigned long fixed_low_start, fixed_middle_start, fixed_high_start; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 571 | unsigned long cma_alignment; |
| 572 | unsigned int low_use_cma = 0; |
| 573 | unsigned int middle_use_cma = 0; |
| 574 | unsigned int high_use_cma = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 575 | |
| 576 | adjust_mem_for_liquid(); |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 577 | fixed_low_size = 0; |
| 578 | fixed_middle_size = 0; |
| 579 | fixed_high_size = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 580 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 581 | cma_alignment = PAGE_SIZE << max(MAX_ORDER, pageblock_order); |
| 582 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 583 | for (i = 0; i < msm8960_ion_pdata.nr; ++i) { |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 584 | struct ion_platform_heap *heap = |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 585 | &(msm8960_ion_pdata.heaps[i]); |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 586 | int align = SZ_4K; |
| 587 | int iommu_map_all = 0; |
| 588 | int adjacent_mem_id = INVALID_HEAP_ID; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 589 | int use_cma = 0; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 590 | |
| 591 | if (heap->extra_data) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 592 | int fixed_position = NOT_FIXED; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 593 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 594 | switch ((int) heap->type) { |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 595 | case ION_HEAP_TYPE_CP: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 596 | fixed_position = ((struct ion_cp_heap_pdata *) |
| 597 | heap->extra_data)->fixed_position; |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 598 | align = ((struct ion_cp_heap_pdata *) |
| 599 | heap->extra_data)->align; |
| 600 | iommu_map_all = |
| 601 | ((struct ion_cp_heap_pdata *) |
| 602 | heap->extra_data)->iommu_map_all; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 603 | if (((struct ion_cp_heap_pdata *) |
| 604 | heap->extra_data)->is_cma) { |
| 605 | heap->size = ALIGN(heap->size, |
| 606 | cma_alignment); |
| 607 | use_cma = 1; |
| 608 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 609 | break; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 610 | case ION_HEAP_TYPE_DMA: |
| 611 | use_cma = 1; |
| 612 | /* Purposely fall through here */ |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 613 | case ION_HEAP_TYPE_CARVEOUT: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 614 | fixed_position = ((struct ion_co_heap_pdata *) |
| 615 | heap->extra_data)->fixed_position; |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 616 | adjacent_mem_id = ((struct ion_co_heap_pdata *) |
| 617 | heap->extra_data)->adjacent_mem_id; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 618 | break; |
| 619 | default: |
| 620 | break; |
| 621 | } |
| 622 | |
Olav Haugan | 8726caf | 2012-05-10 15:11:35 -0700 | [diff] [blame] | 623 | if (iommu_map_all) { |
| 624 | if (heap->size & (SZ_64K-1)) { |
| 625 | heap->size = ALIGN(heap->size, SZ_64K); |
| 626 | pr_info("Heap %s not aligned to 64K. Adjusting size to %x\n", |
| 627 | heap->name, heap->size); |
| 628 | } |
| 629 | } |
| 630 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 631 | if (fixed_position != NOT_FIXED) |
| 632 | fixed_size += heap->size; |
| 633 | else |
| 634 | reserve_mem_for_ion(MEMTYPE_EBI1, heap->size); |
| 635 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 636 | if (fixed_position == FIXED_LOW) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 637 | fixed_low_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 638 | low_use_cma = use_cma; |
| 639 | } else if (fixed_position == FIXED_MIDDLE) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 640 | fixed_middle_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 641 | middle_use_cma = use_cma; |
| 642 | } else if (fixed_position == FIXED_HIGH) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 643 | fixed_high_size += heap->size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 644 | high_use_cma = use_cma; |
| 645 | } else if (use_cma) { |
| 646 | /* |
| 647 | * Heaps that use CMA but are not part of the |
| 648 | * fixed set. Create wherever. |
| 649 | */ |
| 650 | dma_declare_contiguous( |
| 651 | heap->priv, |
| 652 | heap->size, |
| 653 | 0, |
| 654 | 0xb0000000); |
| 655 | } |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 656 | } |
| 657 | } |
| 658 | |
| 659 | if (!fixed_size) |
| 660 | return; |
| 661 | |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 662 | /* |
| 663 | * Given the setup for the fixed area, we can't round up all sizes. |
| 664 | * Some sizes must be set up exactly and aligned correctly. Incorrect |
| 665 | * alignments are considered a configuration issue |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 666 | */ |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 667 | |
| 668 | fixed_low_start = MSM8960_FIXED_AREA_START; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 669 | if (low_use_cma) { |
| 670 | BUG_ON(!IS_ALIGNED(fixed_low_start, cma_alignment)); |
| 671 | BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, cma_alignment)); |
| 672 | } else { |
| 673 | BUG_ON(!IS_ALIGNED(fixed_low_size + HOLE_SIZE, SECTION_SIZE)); |
| 674 | ret = memblock_remove(fixed_low_start, |
| 675 | fixed_low_size + HOLE_SIZE); |
| 676 | BUG_ON(ret); |
| 677 | } |
| 678 | |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 679 | fixed_middle_start = fixed_low_start + fixed_low_size + HOLE_SIZE; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 680 | if (middle_use_cma) { |
| 681 | BUG_ON(!IS_ALIGNED(fixed_middle_start, cma_alignment)); |
| 682 | BUG_ON(!IS_ALIGNED(fixed_middle_size, cma_alignment)); |
| 683 | } else { |
| 684 | BUG_ON(!IS_ALIGNED(fixed_middle_size, SECTION_SIZE)); |
| 685 | ret = memblock_remove(fixed_middle_start, fixed_middle_size); |
| 686 | BUG_ON(ret); |
| 687 | } |
| 688 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 689 | fixed_high_start = fixed_middle_start + fixed_middle_size; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 690 | if (high_use_cma) { |
| 691 | fixed_high_size = ALIGN(fixed_high_size, cma_alignment); |
| 692 | BUG_ON(!IS_ALIGNED(fixed_high_start, cma_alignment)); |
| 693 | } else { |
| 694 | /* This is the end of the fixed area so it's okay to round up */ |
| 695 | fixed_high_size = ALIGN(fixed_high_size, SECTION_SIZE); |
| 696 | ret = memblock_remove(fixed_high_start, fixed_high_size); |
| 697 | BUG_ON(ret); |
| 698 | } |
| 699 | |
| 700 | |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 701 | |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 702 | for (i = 0; i < msm8960_ion_pdata.nr; ++i) { |
| 703 | struct ion_platform_heap *heap = &(msm8960_ion_pdata.heaps[i]); |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 704 | |
| 705 | if (heap->extra_data) { |
| 706 | int fixed_position = NOT_FIXED; |
Steve Muckle | 75c34ca | 2012-06-12 14:27:40 -0700 | [diff] [blame] | 707 | struct ion_cp_heap_pdata *pdata = NULL; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 708 | |
Mitchel Humpherys | 362b52b | 2012-09-13 10:53:22 -0700 | [diff] [blame] | 709 | switch ((int) heap->type) { |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 710 | case ION_HEAP_TYPE_CP: |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 711 | pdata = |
| 712 | (struct ion_cp_heap_pdata *)heap->extra_data; |
| 713 | fixed_position = pdata->fixed_position; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 714 | break; |
| 715 | case ION_HEAP_TYPE_CARVEOUT: |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 716 | case ION_HEAP_TYPE_DMA: |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 717 | fixed_position = ((struct ion_co_heap_pdata *) |
| 718 | heap->extra_data)->fixed_position; |
| 719 | break; |
| 720 | default: |
| 721 | break; |
| 722 | } |
| 723 | |
| 724 | switch (fixed_position) { |
| 725 | case FIXED_LOW: |
| 726 | heap->base = fixed_low_start; |
| 727 | break; |
| 728 | case FIXED_MIDDLE: |
| 729 | heap->base = fixed_middle_start; |
Laura Abbott | c0e6403 | 2012-08-03 17:32:09 -0700 | [diff] [blame] | 730 | if (middle_use_cma) { |
| 731 | ret = dma_declare_contiguous( |
| 732 | &ion_mm_heap_device.dev, |
| 733 | heap->size, |
| 734 | fixed_middle_start, |
| 735 | 0xa0000000); |
| 736 | WARN_ON(ret); |
| 737 | } |
Deepak Kotur | 3582552 | 2012-06-06 15:49:14 -0700 | [diff] [blame] | 738 | pdata->secure_base = fixed_middle_start |
| 739 | - HOLE_SIZE; |
| 740 | pdata->secure_size = HOLE_SIZE + heap->size; |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 741 | break; |
| 742 | case FIXED_HIGH: |
| 743 | heap->base = fixed_high_start; |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 744 | break; |
| 745 | default: |
| 746 | break; |
| 747 | } |
| 748 | } |
Olav Haugan | 65f4bd8 | 2011-12-13 11:50:08 -0800 | [diff] [blame] | 749 | } |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 750 | #endif |
| 751 | } |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 752 | |
Laura Abbott | ac96331 | 2012-12-11 15:09:03 -0800 | [diff] [blame] | 753 | static void ion_adjust_secure_allocation(void) |
| 754 | { |
| 755 | int i; |
| 756 | |
| 757 | for (i = 0; i < msm8960_ion_pdata.nr; i++) { |
| 758 | struct ion_platform_heap *heap = |
| 759 | &(msm8960_ion_pdata.heaps[i]); |
| 760 | |
| 761 | |
| 762 | if (heap->extra_data) { |
| 763 | switch ((int) heap->type) { |
| 764 | case ION_HEAP_TYPE_CP: |
| 765 | if (cpu_is_msm8960()) { |
| 766 | ((struct ion_cp_heap_pdata *) |
Mitchel Humpherys | 345f023 | 2013-01-11 10:55:25 -0800 | [diff] [blame] | 767 | heap->extra_data)->allow_nonsecure_alloc |
| 768 | = 1; |
Laura Abbott | ac96331 | 2012-12-11 15:09:03 -0800 | [diff] [blame] | 769 | } |
| 770 | |
| 771 | } |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 776 | static void __init reserve_mdp_memory(void) |
| 777 | { |
| 778 | msm8960_mdp_writeback(msm8960_reserve_table); |
| 779 | } |
| 780 | |
Stephen Boyd | 668d765 | 2012-04-25 11:31:01 -0700 | [diff] [blame] | 781 | static void __init reserve_cache_dump_memory(void) |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 782 | { |
| 783 | #ifdef CONFIG_MSM_CACHE_DUMP |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 784 | unsigned int total; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 785 | |
Laura Abbott | 155ab6f | 2012-05-25 08:52:18 -0700 | [diff] [blame] | 786 | total = msm8960_cache_dump_pdata.l1_size + |
| 787 | msm8960_cache_dump_pdata.l2_size; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 788 | msm8960_reserve_table[MEMTYPE_EBI1].size += total; |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 789 | #endif |
| 790 | } |
| 791 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 792 | static void __init msm8960_calculate_reserve_sizes(void) |
| 793 | { |
| 794 | size_pmem_devices(); |
| 795 | reserve_pmem_memory(); |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 796 | reserve_ion_memory(); |
Huaibin Yang | a541942 | 2011-12-08 23:52:10 -0800 | [diff] [blame] | 797 | reserve_mdp_memory(); |
Laura Abbott | f8c03b9 | 2012-02-16 14:57:58 -0800 | [diff] [blame] | 798 | reserve_rtb_memory(); |
Laura Abbott | 306bcc2 | 2012-03-08 11:24:53 -0800 | [diff] [blame] | 799 | reserve_cache_dump_memory(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 800 | } |
| 801 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 802 | static struct reserve_info msm8960_reserve_info __initdata = { |
| 803 | .memtype_reserve_table = msm8960_reserve_table, |
| 804 | .calculate_reserve_sizes = msm8960_calculate_reserve_sizes, |
Larry Bassel | 2d8b42d | 2012-03-12 10:41:26 -0700 | [diff] [blame] | 805 | .reserve_fixed_area = msm8960_reserve_fixed_area, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 806 | .paddr_to_memtype = msm8960_paddr_to_memtype, |
| 807 | }; |
| 808 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 809 | static int msm8960_memory_bank_size(void) |
| 810 | { |
| 811 | return 1<<29; |
| 812 | } |
| 813 | |
| 814 | static void __init locate_unstable_memory(void) |
| 815 | { |
| 816 | struct membank *mb = &meminfo.bank[meminfo.nr_banks - 1]; |
| 817 | unsigned long bank_size; |
| 818 | unsigned long low, high; |
| 819 | |
| 820 | bank_size = msm8960_memory_bank_size(); |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 821 | msm8960_reserve_info.bank_size = bank_size; |
| 822 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 823 | low = meminfo.bank[0].start; |
| 824 | high = mb->start + mb->size; |
Olav Haugan | 62052e4 | 2011-10-28 14:28:32 -0700 | [diff] [blame] | 825 | |
| 826 | /* Check if 32 bit overflow occured */ |
| 827 | if (high < mb->start) |
| 828 | high = ~0UL; |
| 829 | |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 830 | if (high < MAX_FIXED_AREA_SIZE + MSM8960_FIXED_AREA_START) |
| 831 | panic("fixed area extends beyond end of memory\n"); |
| 832 | |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 833 | low &= ~(bank_size - 1); |
| 834 | |
| 835 | if (high - low <= bank_size) |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 836 | goto no_dmm; |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 837 | |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 838 | #ifdef CONFIG_ENABLE_DMM |
Jack Cheung | 60eaeab | 2012-01-09 16:40:26 -0800 | [diff] [blame] | 839 | msm8960_reserve_info.low_unstable_address = mb->start - |
| 840 | MIN_MEMORY_BLOCK_SIZE + mb->size; |
Jack Cheung | 0b1987e | 2011-11-18 13:36:29 -0800 | [diff] [blame] | 841 | msm8960_reserve_info.max_unstable_size = MIN_MEMORY_BLOCK_SIZE; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 842 | pr_info("low unstable address %lx max size %lx bank size %lx\n", |
| 843 | msm8960_reserve_info.low_unstable_address, |
| 844 | msm8960_reserve_info.max_unstable_size, |
| 845 | msm8960_reserve_info.bank_size); |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 846 | return; |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 847 | #endif |
Larry Bassel | 4d4f448 | 2012-04-04 11:26:09 -0700 | [diff] [blame] | 848 | no_dmm: |
| 849 | msm8960_reserve_info.low_unstable_address = high; |
| 850 | msm8960_reserve_info.max_unstable_size = 0; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 851 | } |
| 852 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 853 | static void __init place_movable_zone(void) |
| 854 | { |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 855 | #ifdef CONFIG_ENABLE_DMM |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 856 | movable_reserved_start = msm8960_reserve_info.low_unstable_address; |
| 857 | movable_reserved_size = msm8960_reserve_info.max_unstable_size; |
| 858 | pr_info("movable zone start %lx size %lx\n", |
| 859 | movable_reserved_start, movable_reserved_size); |
Larry Bassel | b8d6102 | 2012-02-24 10:49:45 -0800 | [diff] [blame] | 860 | #endif |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 861 | } |
| 862 | |
| 863 | static void __init msm8960_early_memory(void) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 864 | { |
| 865 | reserve_info = &msm8960_reserve_info; |
Larry Bassel | b4126da | 2011-07-18 14:31:33 -0700 | [diff] [blame] | 866 | locate_unstable_memory(); |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 867 | place_movable_zone(); |
| 868 | } |
| 869 | |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 870 | static char prim_panel_name[PANEL_NAME_MAX_LEN]; |
| 871 | static char ext_panel_name[PANEL_NAME_MAX_LEN]; |
| 872 | static int __init prim_display_setup(char *param) |
| 873 | { |
| 874 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 875 | strlcpy(prim_panel_name, param, PANEL_NAME_MAX_LEN); |
| 876 | return 0; |
| 877 | } |
| 878 | early_param("prim_display", prim_display_setup); |
| 879 | |
| 880 | static int __init ext_display_setup(char *param) |
| 881 | { |
| 882 | if (strnlen(param, PANEL_NAME_MAX_LEN)) |
| 883 | strlcpy(ext_panel_name, param, PANEL_NAME_MAX_LEN); |
| 884 | return 0; |
| 885 | } |
| 886 | early_param("ext_display", ext_display_setup); |
| 887 | |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 888 | static void __init msm8960_reserve(void) |
| 889 | { |
Ravishangar Kalyanam | 8c79ead | 2011-12-02 21:05:01 -0800 | [diff] [blame] | 890 | msm8960_set_display_params(prim_panel_name, ext_panel_name); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 891 | msm_reserve(); |
| 892 | } |
| 893 | |
Larry Bassel | a4414b1 | 2011-08-04 11:11:02 -0700 | [diff] [blame] | 894 | static int msm8960_change_memory_power(u64 start, u64 size, |
| 895 | int change_type) |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 896 | { |
Naveen Ramaraj | b03bb1b | 2011-09-12 14:34:31 -0700 | [diff] [blame] | 897 | return soc_change_memory_power(start, size, change_type); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 898 | } |
| 899 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 900 | static void __init msm8960_allocate_memory_regions(void) |
| 901 | { |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 902 | msm8960_allocate_fb_region(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 903 | } |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 904 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 905 | #ifdef CONFIG_WCD9310_CODEC |
| 906 | |
| 907 | #define TABLA_INTERRUPT_BASE (NR_MSM_IRQS + NR_GPIO_IRQS + NR_PM8921_IRQS) |
| 908 | |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 909 | /* Micbias setting is based on 8660 CDP/MTP/FLUID requirement |
| 910 | * 4 micbiases are used to power various analog and digital |
| 911 | * microphones operating at 1800 mV. Technically, all micbiases |
| 912 | * can source from single cfilter since all microphones operate |
| 913 | * at the same voltage level. The arrangement below is to make |
| 914 | * sure all cfilters are exercised. LDO_H regulator ouput level |
| 915 | * does not need to be as high as 2.85V. It is choosen for |
| 916 | * microphone sensitivity purpose. |
| 917 | */ |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 918 | static struct wcd9xxx_pdata tabla_platform_data = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 919 | .slimbus_slave_device = { |
| 920 | .name = "tabla-slave", |
| 921 | .e_addr = {0, 0, 0x10, 0, 0x17, 2}, |
| 922 | }, |
| 923 | .irq = MSM_GPIO_TO_INT(62), |
| 924 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 925 | .num_irqs = NR_WCD9XXX_IRQS, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 926 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 927 | .micbias = { |
| 928 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 929 | .cfilt1_mv = 1800, |
Joonwoo Park | cf473b4 | 2012-03-29 19:48:16 -0700 | [diff] [blame] | 930 | .cfilt2_mv = 2700, |
Patrick Lai | 3043fba | 2011-08-01 14:15:57 -0700 | [diff] [blame] | 931 | .cfilt3_mv = 1800, |
| 932 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 933 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 934 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 935 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 936 | }, |
| 937 | .regulator = { |
| 938 | { |
| 939 | .name = "CDC_VDD_CP", |
| 940 | .min_uV = 1800000, |
| 941 | .max_uV = 1800000, |
| 942 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 943 | }, |
| 944 | { |
| 945 | .name = "CDC_VDDA_RX", |
| 946 | .min_uV = 1800000, |
| 947 | .max_uV = 1800000, |
| 948 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 949 | }, |
| 950 | { |
| 951 | .name = "CDC_VDDA_TX", |
| 952 | .min_uV = 1800000, |
| 953 | .max_uV = 1800000, |
| 954 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 955 | }, |
| 956 | { |
| 957 | .name = "VDDIO_CDC", |
| 958 | .min_uV = 1800000, |
| 959 | .max_uV = 1800000, |
| 960 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 961 | }, |
| 962 | { |
| 963 | .name = "VDDD_CDC_D", |
| 964 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 965 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 966 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 967 | }, |
| 968 | { |
| 969 | .name = "CDC_VDDA_A_1P2V", |
| 970 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 971 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 972 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 973 | }, |
| 974 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 975 | }; |
| 976 | |
| 977 | static struct slim_device msm_slim_tabla = { |
| 978 | .name = "tabla-slim", |
| 979 | .e_addr = {0, 1, 0x10, 0, 0x17, 2}, |
| 980 | .dev = { |
| 981 | .platform_data = &tabla_platform_data, |
| 982 | }, |
| 983 | }; |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 984 | |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 985 | static struct wcd9xxx_pdata tabla20_platform_data = { |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 986 | .slimbus_slave_device = { |
| 987 | .name = "tabla-slave", |
| 988 | .e_addr = {0, 0, 0x60, 0, 0x17, 2}, |
| 989 | }, |
| 990 | .irq = MSM_GPIO_TO_INT(62), |
| 991 | .irq_base = TABLA_INTERRUPT_BASE, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 992 | .num_irqs = NR_WCD9XXX_IRQS, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 993 | .reset_gpio = PM8921_GPIO_PM_TO_SYS(34), |
| 994 | .micbias = { |
| 995 | .ldoh_v = TABLA_LDOH_2P85_V, |
| 996 | .cfilt1_mv = 1800, |
Joonwoo Park | cf473b4 | 2012-03-29 19:48:16 -0700 | [diff] [blame] | 997 | .cfilt2_mv = 2700, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 998 | .cfilt3_mv = 1800, |
| 999 | .bias1_cfilt_sel = TABLA_CFILT1_SEL, |
| 1000 | .bias2_cfilt_sel = TABLA_CFILT2_SEL, |
| 1001 | .bias3_cfilt_sel = TABLA_CFILT3_SEL, |
| 1002 | .bias4_cfilt_sel = TABLA_CFILT3_SEL, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1003 | }, |
| 1004 | .regulator = { |
| 1005 | { |
| 1006 | .name = "CDC_VDD_CP", |
| 1007 | .min_uV = 1800000, |
| 1008 | .max_uV = 1800000, |
| 1009 | .optimum_uA = WCD9XXX_CDC_VDDA_CP_CUR_MAX, |
| 1010 | }, |
| 1011 | { |
| 1012 | .name = "CDC_VDDA_RX", |
| 1013 | .min_uV = 1800000, |
| 1014 | .max_uV = 1800000, |
| 1015 | .optimum_uA = WCD9XXX_CDC_VDDA_RX_CUR_MAX, |
| 1016 | }, |
| 1017 | { |
| 1018 | .name = "CDC_VDDA_TX", |
| 1019 | .min_uV = 1800000, |
| 1020 | .max_uV = 1800000, |
| 1021 | .optimum_uA = WCD9XXX_CDC_VDDA_TX_CUR_MAX, |
| 1022 | }, |
| 1023 | { |
| 1024 | .name = "VDDIO_CDC", |
| 1025 | .min_uV = 1800000, |
| 1026 | .max_uV = 1800000, |
| 1027 | .optimum_uA = WCD9XXX_VDDIO_CDC_CUR_MAX, |
| 1028 | }, |
| 1029 | { |
| 1030 | .name = "VDDD_CDC_D", |
| 1031 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 1032 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1033 | .optimum_uA = WCD9XXX_VDDD_CDC_D_CUR_MAX, |
| 1034 | }, |
| 1035 | { |
| 1036 | .name = "CDC_VDDA_A_1P2V", |
| 1037 | .min_uV = 1225000, |
David Collins | 8f2a196 | 2012-05-18 09:47:59 -0700 | [diff] [blame] | 1038 | .max_uV = 1250000, |
Asish Bhattacharya | b1aeae2 | 2012-02-15 08:29:28 +0530 | [diff] [blame] | 1039 | .optimum_uA = WCD9XXX_VDDD_CDC_A_CUR_MAX, |
| 1040 | }, |
| 1041 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 1042 | }; |
| 1043 | |
| 1044 | static struct slim_device msm_slim_tabla20 = { |
| 1045 | .name = "tabla2x-slim", |
| 1046 | .e_addr = {0, 1, 0x60, 0, 0x17, 2}, |
| 1047 | .dev = { |
| 1048 | .platform_data = &tabla20_platform_data, |
| 1049 | }, |
| 1050 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1051 | #endif |
| 1052 | |
| 1053 | static struct slim_boardinfo msm_slim_devices[] = { |
| 1054 | #ifdef CONFIG_WCD9310_CODEC |
| 1055 | { |
| 1056 | .bus_num = 1, |
| 1057 | .slim_slave = &msm_slim_tabla, |
| 1058 | }, |
Santosh Mardi | 60e19d9 | 2011-10-28 01:15:14 +0530 | [diff] [blame] | 1059 | { |
| 1060 | .bus_num = 1, |
| 1061 | .slim_slave = &msm_slim_tabla20, |
| 1062 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1063 | #endif |
| 1064 | /* add more slimbus slaves as needed */ |
| 1065 | }; |
| 1066 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 1067 | #define MSM_WCNSS_PHYS 0x03000000 |
| 1068 | #define MSM_WCNSS_SIZE 0x280000 |
| 1069 | |
| 1070 | static struct resource resources_wcnss_wlan[] = { |
| 1071 | { |
| 1072 | .start = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 1073 | .end = RIVA_APPS_WLAN_RX_DATA_AVAIL_IRQ, |
| 1074 | .name = "wcnss_wlanrx_irq", |
| 1075 | .flags = IORESOURCE_IRQ, |
| 1076 | }, |
| 1077 | { |
| 1078 | .start = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 1079 | .end = RIVA_APPS_WLAN_DATA_XFER_DONE_IRQ, |
| 1080 | .name = "wcnss_wlantx_irq", |
| 1081 | .flags = IORESOURCE_IRQ, |
| 1082 | }, |
| 1083 | { |
| 1084 | .start = MSM_WCNSS_PHYS, |
| 1085 | .end = MSM_WCNSS_PHYS + MSM_WCNSS_SIZE - 1, |
| 1086 | .name = "wcnss_mmio", |
| 1087 | .flags = IORESOURCE_MEM, |
| 1088 | }, |
Ankur Nandwani | ad0d9ac | 2011-09-26 11:49:25 -0700 | [diff] [blame] | 1089 | { |
| 1090 | .start = 84, |
| 1091 | .end = 88, |
| 1092 | .name = "wcnss_gpios_5wire", |
| 1093 | .flags = IORESOURCE_IO, |
| 1094 | }, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 1095 | }; |
| 1096 | |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 1097 | static struct qcom_wcnss_opts qcom_wcnss_pdata = { |
| 1098 | .has_48mhz_xo = 1, |
| 1099 | }; |
| 1100 | |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 1101 | static struct platform_device msm_device_wcnss_wlan = { |
| 1102 | .name = "wcnss_wlan", |
| 1103 | .id = 0, |
| 1104 | .num_resources = ARRAY_SIZE(resources_wcnss_wlan), |
| 1105 | .resource = resources_wcnss_wlan, |
Ankur Nandwani | b0039b0 | 2011-08-09 14:00:45 -0700 | [diff] [blame] | 1106 | .dev = {.platform_data = &qcom_wcnss_pdata}, |
Yunsen Wang | 5c1a739 | 2011-07-09 19:10:16 -0700 | [diff] [blame] | 1107 | }; |
| 1108 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1109 | #ifdef CONFIG_QSEECOM |
| 1110 | /* qseecom bus scaling */ |
| 1111 | static struct msm_bus_vectors qseecom_clks_init_vectors[] = { |
| 1112 | { |
| 1113 | .src = MSM_BUS_MASTER_SPS, |
| 1114 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1115 | .ib = 0, |
| 1116 | .ab = 0, |
| 1117 | }, |
| 1118 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1119 | .src = MSM_BUS_MASTER_SPS, |
| 1120 | .dst = MSM_BUS_SLAVE_SPS, |
| 1121 | .ib = 0, |
| 1122 | .ab = 0, |
| 1123 | }, |
| 1124 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1125 | .src = MSM_BUS_MASTER_SPDM, |
| 1126 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1127 | .ib = 0, |
| 1128 | .ab = 0, |
| 1129 | }, |
| 1130 | }; |
| 1131 | |
| 1132 | static struct msm_bus_vectors qseecom_enable_dfab_vectors[] = { |
| 1133 | { |
| 1134 | .src = MSM_BUS_MASTER_SPS, |
| 1135 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1136 | .ib = (492 * 8) * 1000000UL, |
| 1137 | .ab = (492 * 8) * 100000UL, |
| 1138 | }, |
| 1139 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1140 | .src = MSM_BUS_MASTER_SPS, |
| 1141 | .dst = MSM_BUS_SLAVE_SPS, |
| 1142 | .ib = (492 * 8) * 1000000UL, |
| 1143 | .ab = (492 * 8) * 100000UL, |
| 1144 | }, |
| 1145 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1146 | .src = MSM_BUS_MASTER_SPDM, |
| 1147 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1148 | .ib = 0, |
| 1149 | .ab = 0, |
| 1150 | }, |
| 1151 | }; |
| 1152 | |
| 1153 | static struct msm_bus_vectors qseecom_enable_sfpb_vectors[] = { |
| 1154 | { |
| 1155 | .src = MSM_BUS_MASTER_SPS, |
| 1156 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1157 | .ib = 0, |
| 1158 | .ab = 0, |
| 1159 | }, |
| 1160 | { |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1161 | .src = MSM_BUS_MASTER_SPS, |
| 1162 | .dst = MSM_BUS_SLAVE_SPS, |
| 1163 | .ib = 0, |
| 1164 | .ab = 0, |
| 1165 | }, |
| 1166 | { |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1167 | .src = MSM_BUS_MASTER_SPDM, |
| 1168 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1169 | .ib = (64 * 8) * 1000000UL, |
| 1170 | .ab = (64 * 8) * 100000UL, |
| 1171 | }, |
| 1172 | }; |
| 1173 | |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1174 | static struct msm_bus_vectors qseecom_enable_dfab_sfpb_vectors[] = { |
| 1175 | { |
| 1176 | .src = MSM_BUS_MASTER_SPS, |
| 1177 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1178 | .ib = (492 * 8) * 1000000UL, |
| 1179 | .ab = (492 * 8) * 100000UL, |
| 1180 | }, |
| 1181 | { |
| 1182 | .src = MSM_BUS_MASTER_SPS, |
| 1183 | .dst = MSM_BUS_SLAVE_SPS, |
| 1184 | .ib = (492 * 8) * 1000000UL, |
| 1185 | .ab = (492 * 8) * 100000UL, |
| 1186 | }, |
| 1187 | { |
| 1188 | .src = MSM_BUS_MASTER_SPDM, |
| 1189 | .dst = MSM_BUS_SLAVE_SPDM, |
| 1190 | .ib = (64 * 8) * 1000000UL, |
| 1191 | .ab = (64 * 8) * 100000UL, |
| 1192 | }, |
| 1193 | }; |
| 1194 | |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1195 | static struct msm_bus_paths qseecom_hw_bus_scale_usecases[] = { |
| 1196 | { |
| 1197 | ARRAY_SIZE(qseecom_clks_init_vectors), |
| 1198 | qseecom_clks_init_vectors, |
| 1199 | }, |
| 1200 | { |
| 1201 | ARRAY_SIZE(qseecom_enable_dfab_vectors), |
Ramesh Masavarapu | 1e8c724 | 2012-09-04 11:52:57 -0700 | [diff] [blame] | 1202 | qseecom_enable_dfab_vectors, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1203 | }, |
| 1204 | { |
| 1205 | ARRAY_SIZE(qseecom_enable_sfpb_vectors), |
| 1206 | qseecom_enable_sfpb_vectors, |
| 1207 | }, |
Ramesh Masavarapu | 8d75658 | 2012-10-03 10:18:06 -0700 | [diff] [blame] | 1208 | { |
| 1209 | ARRAY_SIZE(qseecom_enable_dfab_sfpb_vectors), |
| 1210 | qseecom_enable_dfab_sfpb_vectors, |
| 1211 | }, |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 1212 | }; |
| 1213 | |
| 1214 | static struct msm_bus_scale_pdata qseecom_bus_pdata = { |
| 1215 | qseecom_hw_bus_scale_usecases, |
| 1216 | ARRAY_SIZE(qseecom_hw_bus_scale_usecases), |
| 1217 | .name = "qsee", |
| 1218 | }; |
| 1219 | |
| 1220 | static struct platform_device qseecom_device = { |
| 1221 | .name = "qseecom", |
| 1222 | .id = 0, |
| 1223 | .dev = { |
| 1224 | .platform_data = &qseecom_bus_pdata, |
| 1225 | }, |
| 1226 | }; |
| 1227 | #endif |
| 1228 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1229 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1230 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) || \ |
| 1231 | defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1232 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1233 | |
| 1234 | #define QCE_SIZE 0x10000 |
| 1235 | #define QCE_0_BASE 0x18500000 |
| 1236 | |
| 1237 | #define QCE_HW_KEY_SUPPORT 0 |
| 1238 | #define QCE_SHA_HMAC_SUPPORT 1 |
| 1239 | #define QCE_SHARE_CE_RESOURCE 1 |
| 1240 | #define QCE_CE_SHARED 0 |
| 1241 | |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1242 | /* Begin Bus scaling definitions */ |
| 1243 | static struct msm_bus_vectors crypto_hw_init_vectors[] = { |
| 1244 | { |
| 1245 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1246 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1247 | .ab = 0, |
| 1248 | .ib = 0, |
| 1249 | }, |
| 1250 | { |
| 1251 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1252 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1253 | .ab = 0, |
| 1254 | .ib = 0, |
| 1255 | }, |
| 1256 | }; |
| 1257 | |
| 1258 | static struct msm_bus_vectors crypto_hw_active_vectors[] = { |
| 1259 | { |
| 1260 | .src = MSM_BUS_MASTER_ADM_PORT0, |
| 1261 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1262 | .ab = 70000000UL, |
| 1263 | .ib = 70000000UL, |
| 1264 | }, |
| 1265 | { |
| 1266 | .src = MSM_BUS_MASTER_ADM_PORT1, |
| 1267 | .dst = MSM_BUS_SLAVE_GSBI1_UART, |
| 1268 | .ab = 2480000000UL, |
| 1269 | .ib = 2480000000UL, |
| 1270 | }, |
| 1271 | }; |
| 1272 | |
| 1273 | static struct msm_bus_paths crypto_hw_bus_scale_usecases[] = { |
| 1274 | { |
| 1275 | ARRAY_SIZE(crypto_hw_init_vectors), |
| 1276 | crypto_hw_init_vectors, |
| 1277 | }, |
| 1278 | { |
| 1279 | ARRAY_SIZE(crypto_hw_active_vectors), |
| 1280 | crypto_hw_active_vectors, |
| 1281 | }, |
| 1282 | }; |
| 1283 | |
| 1284 | static struct msm_bus_scale_pdata crypto_hw_bus_scale_pdata = { |
| 1285 | crypto_hw_bus_scale_usecases, |
| 1286 | ARRAY_SIZE(crypto_hw_bus_scale_usecases), |
| 1287 | .name = "cryptohw", |
| 1288 | }; |
| 1289 | /* End Bus Scaling Definitions*/ |
| 1290 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1291 | static struct resource qcrypto_resources[] = { |
| 1292 | [0] = { |
| 1293 | .start = QCE_0_BASE, |
| 1294 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1295 | .flags = IORESOURCE_MEM, |
| 1296 | }, |
| 1297 | [1] = { |
| 1298 | .name = "crypto_channels", |
| 1299 | .start = DMOV_CE_IN_CHAN, |
| 1300 | .end = DMOV_CE_OUT_CHAN, |
| 1301 | .flags = IORESOURCE_DMA, |
| 1302 | }, |
| 1303 | [2] = { |
| 1304 | .name = "crypto_crci_in", |
| 1305 | .start = DMOV_CE_IN_CRCI, |
| 1306 | .end = DMOV_CE_IN_CRCI, |
| 1307 | .flags = IORESOURCE_DMA, |
| 1308 | }, |
| 1309 | [3] = { |
| 1310 | .name = "crypto_crci_out", |
| 1311 | .start = DMOV_CE_OUT_CRCI, |
| 1312 | .end = DMOV_CE_OUT_CRCI, |
| 1313 | .flags = IORESOURCE_DMA, |
| 1314 | }, |
| 1315 | }; |
| 1316 | |
| 1317 | static struct resource qcedev_resources[] = { |
| 1318 | [0] = { |
| 1319 | .start = QCE_0_BASE, |
| 1320 | .end = QCE_0_BASE + QCE_SIZE - 1, |
| 1321 | .flags = IORESOURCE_MEM, |
| 1322 | }, |
| 1323 | [1] = { |
| 1324 | .name = "crypto_channels", |
| 1325 | .start = DMOV_CE_IN_CHAN, |
| 1326 | .end = DMOV_CE_OUT_CHAN, |
| 1327 | .flags = IORESOURCE_DMA, |
| 1328 | }, |
| 1329 | [2] = { |
| 1330 | .name = "crypto_crci_in", |
| 1331 | .start = DMOV_CE_IN_CRCI, |
| 1332 | .end = DMOV_CE_IN_CRCI, |
| 1333 | .flags = IORESOURCE_DMA, |
| 1334 | }, |
| 1335 | [3] = { |
| 1336 | .name = "crypto_crci_out", |
| 1337 | .start = DMOV_CE_OUT_CRCI, |
| 1338 | .end = DMOV_CE_OUT_CRCI, |
| 1339 | .flags = IORESOURCE_DMA, |
| 1340 | }, |
| 1341 | }; |
| 1342 | |
| 1343 | #endif |
| 1344 | |
| 1345 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 1346 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 1347 | |
| 1348 | static struct msm_ce_hw_support qcrypto_ce_hw_suppport = { |
| 1349 | .ce_shared = QCE_CE_SHARED, |
| 1350 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1351 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1352 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1353 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1354 | }; |
| 1355 | |
| 1356 | static struct platform_device qcrypto_device = { |
| 1357 | .name = "qcrypto", |
| 1358 | .id = 0, |
| 1359 | .num_resources = ARRAY_SIZE(qcrypto_resources), |
| 1360 | .resource = qcrypto_resources, |
| 1361 | .dev = { |
| 1362 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1363 | .platform_data = &qcrypto_ce_hw_suppport, |
| 1364 | }, |
| 1365 | }; |
| 1366 | #endif |
| 1367 | |
| 1368 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 1369 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 1370 | |
| 1371 | static struct msm_ce_hw_support qcedev_ce_hw_suppport = { |
| 1372 | .ce_shared = QCE_CE_SHARED, |
| 1373 | .shared_ce_resource = QCE_SHARE_CE_RESOURCE, |
| 1374 | .hw_key_support = QCE_HW_KEY_SUPPORT, |
| 1375 | .sha_hmac = QCE_SHA_HMAC_SUPPORT, |
Ramesh Masavarapu | 4925968 | 2011-12-02 14:00:18 -0800 | [diff] [blame] | 1376 | .bus_scale_table = &crypto_hw_bus_scale_pdata, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1377 | }; |
| 1378 | |
| 1379 | static struct platform_device qcedev_device = { |
| 1380 | .name = "qce", |
| 1381 | .id = 0, |
| 1382 | .num_resources = ARRAY_SIZE(qcedev_resources), |
| 1383 | .resource = qcedev_resources, |
| 1384 | .dev = { |
| 1385 | .coherent_dma_mask = DMA_BIT_MASK(32), |
| 1386 | .platform_data = &qcedev_ce_hw_suppport, |
| 1387 | }, |
| 1388 | }; |
| 1389 | #endif |
| 1390 | |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 1391 | static struct mdm_platform_data sglte_platform_data = { |
| 1392 | .mdm_version = "4.0", |
| 1393 | .ramdump_delay_ms = 1000, |
Taniya Das | 2b7646b | 2013-01-15 11:28:14 +0530 | [diff] [blame] | 1394 | /* delay between two PS_HOLDs */ |
| 1395 | .ps_hold_delay_ms = 500, |
Joel King | 63ce833 | 2012-06-01 09:59:26 -0700 | [diff] [blame] | 1396 | .soft_reset_inverted = 1, |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 1397 | .peripheral_platform_device = NULL, |
Ameya Thakur | c9a7a84 | 2012-06-24 22:47:52 -0700 | [diff] [blame] | 1398 | .ramdump_timeout_ms = 600000, |
Ameya Thakur | a98bde5 | 2012-06-28 18:55:19 -0700 | [diff] [blame] | 1399 | .no_powerdown_after_ramdumps = 1, |
Ameya Thakur | 43248fd | 2012-07-10 18:50:52 -0700 | [diff] [blame] | 1400 | .image_upgrade_supported = 1, |
Joel King | b8352a1 | 2011-11-15 18:46:24 -0800 | [diff] [blame] | 1401 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1402 | |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1403 | #define MSM_TSIF0_PHYS (0x18200000) |
| 1404 | #define MSM_TSIF1_PHYS (0x18201000) |
| 1405 | #define MSM_TSIF_SIZE (0x200) |
| 1406 | #define MSM_TSPP_PHYS (0x18202000) |
| 1407 | #define MSM_TSPP_SIZE (0x1000) |
| 1408 | #define MSM_TSPP_BAM_PHYS (0x18204000) |
| 1409 | #define MSM_TSPP_BAM_SIZE (0x2000) |
| 1410 | |
| 1411 | #define TSIF_0_CLK GPIO_CFG(75, 1, GPIO_CFG_INPUT, \ |
| 1412 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1413 | #define TSIF_0_EN GPIO_CFG(76, 1, GPIO_CFG_INPUT, \ |
| 1414 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1415 | #define TSIF_0_DATA GPIO_CFG(77, 1, GPIO_CFG_INPUT, \ |
| 1416 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1417 | #define TSIF_0_SYNC GPIO_CFG(82, 1, GPIO_CFG_INPUT, \ |
| 1418 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1419 | #define TSIF_1_CLK GPIO_CFG(79, 1, GPIO_CFG_INPUT, \ |
| 1420 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1421 | #define TSIF_1_EN GPIO_CFG(80, 1, GPIO_CFG_INPUT, \ |
| 1422 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1423 | #define TSIF_1_DATA GPIO_CFG(81, 1, GPIO_CFG_INPUT, \ |
| 1424 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1425 | #define TSIF_1_SYNC GPIO_CFG(78, 1, GPIO_CFG_INPUT, \ |
| 1426 | GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA) |
| 1427 | |
| 1428 | static const struct msm_gpio tsif_gpios[] = { |
| 1429 | { .gpio_cfg = TSIF_0_CLK, .label = "tsif0_clk", }, |
| 1430 | { .gpio_cfg = TSIF_0_EN, .label = "tsif0_en", }, |
| 1431 | { .gpio_cfg = TSIF_0_DATA, .label = "tsif0_data", }, |
| 1432 | { .gpio_cfg = TSIF_0_SYNC, .label = "tsif0_sync", }, |
| 1433 | { .gpio_cfg = TSIF_1_CLK, .label = "tsif1_clk", }, |
| 1434 | { .gpio_cfg = TSIF_1_EN, .label = "tsif1_en", }, |
| 1435 | { .gpio_cfg = TSIF_1_DATA, .label = "tsif1_data", }, |
| 1436 | { .gpio_cfg = TSIF_1_SYNC, .label = "tsif1_sync", }, |
| 1437 | }; |
| 1438 | |
| 1439 | static struct resource tspp_resources[] = { |
| 1440 | [0] = { |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1441 | .name = "TSIF_TSPP_IRQ", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1442 | .flags = IORESOURCE_IRQ, |
| 1443 | .start = TSIF_TSPP_IRQ, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1444 | .end = TSIF_TSPP_IRQ, |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1445 | }, |
| 1446 | [1] = { |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1447 | .name = "TSIF0_IRQ", |
| 1448 | .flags = IORESOURCE_IRQ, |
| 1449 | .start = TSIF1_IRQ, |
| 1450 | .end = TSIF1_IRQ, |
| 1451 | }, |
| 1452 | [2] = { |
| 1453 | .name = "TSIF1_IRQ", |
| 1454 | .flags = IORESOURCE_IRQ, |
| 1455 | .start = TSIF2_IRQ, |
| 1456 | .end = TSIF2_IRQ, |
| 1457 | }, |
| 1458 | [3] = { |
| 1459 | .name = "TSIF_BAM_IRQ", |
| 1460 | .flags = IORESOURCE_IRQ, |
| 1461 | .start = TSIF_BAM_IRQ, |
| 1462 | .end = TSIF_BAM_IRQ, |
| 1463 | }, |
| 1464 | [4] = { |
| 1465 | .name = "MSM_TSIF0_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1466 | .flags = IORESOURCE_MEM, |
| 1467 | .start = MSM_TSIF0_PHYS, |
| 1468 | .end = MSM_TSIF0_PHYS + MSM_TSIF_SIZE - 1, |
| 1469 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1470 | [5] = { |
| 1471 | .name = "MSM_TSIF1_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1472 | .flags = IORESOURCE_MEM, |
| 1473 | .start = MSM_TSIF1_PHYS, |
| 1474 | .end = MSM_TSIF1_PHYS + MSM_TSIF_SIZE - 1, |
| 1475 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1476 | [6] = { |
| 1477 | .name = "MSM_TSPP_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1478 | .flags = IORESOURCE_MEM, |
| 1479 | .start = MSM_TSPP_PHYS, |
| 1480 | .end = MSM_TSPP_PHYS + MSM_TSPP_SIZE - 1, |
| 1481 | }, |
Liron Kuch | 5933992 | 2013-01-01 18:29:47 +0200 | [diff] [blame] | 1482 | [7] = { |
| 1483 | .name = "MSM_TSPP_BAM_PHYS", |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 1484 | .flags = IORESOURCE_MEM, |
| 1485 | .start = MSM_TSPP_BAM_PHYS, |
| 1486 | .end = MSM_TSPP_BAM_PHYS + MSM_TSPP_BAM_SIZE - 1, |
| 1487 | }, |
| 1488 | }; |
| 1489 | |
| 1490 | static struct msm_tspp_platform_data tspp_platform_data = { |
| 1491 | .num_gpios = ARRAY_SIZE(tsif_gpios), |
| 1492 | .gpios = tsif_gpios, |
| 1493 | .tsif_pclk = "tsif_pclk", |
| 1494 | .tsif_ref_clk = "tsif_ref_clk", |
| 1495 | }; |
| 1496 | |
| 1497 | static struct platform_device msm_device_tspp = { |
| 1498 | .name = "msm_tspp", |
| 1499 | .id = 0, |
| 1500 | .num_resources = ARRAY_SIZE(tspp_resources), |
| 1501 | .resource = tspp_resources, |
| 1502 | .dev = { |
| 1503 | .platform_data = &tspp_platform_data |
| 1504 | }, |
| 1505 | }; |
| 1506 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1507 | #define MSM_SHARED_RAM_PHYS 0x80000000 |
| 1508 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1509 | static void __init msm8960_map_io(void) |
| 1510 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1511 | msm_shared_ram_phys = MSM_SHARED_RAM_PHYS; |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1512 | msm_map_msm8960_io(); |
Abhimanyu Kapur | 91a0a50 | 2013-01-11 19:24:59 -0800 | [diff] [blame] | 1513 | if (socinfo_init() < 0) |
Jeff Ohlstein | 3a77f9f | 2011-09-06 14:50:20 -0700 | [diff] [blame] | 1514 | pr_err("socinfo_init() failed!\n"); |
Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1515 | |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1516 | } |
| 1517 | |
| 1518 | static void __init msm8960_init_irq(void) |
| 1519 | { |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1520 | struct msm_mpm_device_data *data = NULL; |
| 1521 | |
| 1522 | #ifdef CONFIG_MSM_MPM |
| 1523 | data = &msm8960_mpm_dev_data; |
| 1524 | #endif |
| 1525 | |
| 1526 | msm_mpm_irq_extn_init(data); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1527 | gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1528 | (void *)MSM_QGIC_CPU_BASE); |
Stepan Moskovchenko | f441ca2 | 2010-12-01 19:31:16 -0800 | [diff] [blame] | 1529 | } |
| 1530 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1531 | static void __init msm8960_init_buses(void) |
| 1532 | { |
| 1533 | #ifdef CONFIG_MSM_BUS_SCALING |
Gagan Mac | dc1dc14 | 2011-09-16 15:13:35 -0600 | [diff] [blame] | 1534 | msm_bus_rpm_set_mt_mask(); |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1535 | msm_bus_8960_apps_fabric_pdata.rpm_enabled = 1; |
| 1536 | msm_bus_8960_sys_fabric_pdata.rpm_enabled = 1; |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1537 | msm_bus_apps_fabric.dev.platform_data = |
| 1538 | &msm_bus_8960_apps_fabric_pdata; |
| 1539 | msm_bus_sys_fabric.dev.platform_data = &msm_bus_8960_sys_fabric_pdata; |
Gagan Mac | 680bfc0 | 2012-07-19 19:11:00 -0600 | [diff] [blame] | 1540 | if (cpu_is_msm8960ab()) { |
| 1541 | msm_bus_8960_sg_mm_fabric_pdata.rpm_enabled = 1; |
| 1542 | msm_bus_mm_fabric.dev.platform_data = |
| 1543 | &msm_bus_8960_sg_mm_fabric_pdata; |
| 1544 | } else { |
| 1545 | msm_bus_8960_mm_fabric_pdata.rpm_enabled = 1; |
| 1546 | msm_bus_mm_fabric.dev.platform_data = |
| 1547 | &msm_bus_8960_mm_fabric_pdata; |
| 1548 | } |
Gagan Mac | ae154c4b | 2011-10-05 19:24:43 -0600 | [diff] [blame] | 1549 | msm_bus_sys_fpb.dev.platform_data = &msm_bus_8960_sys_fpb_pdata; |
| 1550 | msm_bus_cpss_fpb.dev.platform_data = &msm_bus_8960_cpss_fpb_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1551 | #endif |
| 1552 | } |
| 1553 | |
| 1554 | static struct msm_spi_platform_data msm8960_qup_spi_gsbi1_pdata = { |
| 1555 | .max_clock_speed = 15060000, |
Kiran Gunda | c5fbd7f | 2012-07-30 13:22:39 +0530 | [diff] [blame] | 1556 | .infinite_mode = 0xFFC0, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1557 | }; |
| 1558 | |
| 1559 | #ifdef CONFIG_USB_MSM_OTG_72K |
| 1560 | static struct msm_otg_platform_data msm_otg_pdata; |
| 1561 | #else |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1562 | static int wr_phy_init_seq[] = { |
| 1563 | 0x44, 0x80, /* set VBUS valid threshold |
| 1564 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1565 | 0x68, 0x81, /* update DC voltage level */ |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1566 | 0x14, 0x82, /* set preemphasis and rise/fall time */ |
| 1567 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1568 | -1}; |
| 1569 | |
| 1570 | static int liquid_v1_phy_init_seq[] = { |
| 1571 | 0x44, 0x80,/* set VBUS valid threshold |
| 1572 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1573 | 0x6C, 0x81,/* update DC voltage level */ |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 1574 | 0x18, 0x82,/* set preemphasis and rise/fall time */ |
| 1575 | 0x23, 0x83,/* set source impedance sdjusment */ |
| 1576 | -1}; |
| 1577 | |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 1578 | static int sglte_phy_init_seq[] = { |
| 1579 | 0x44, 0x80, /* set VBUS valid threshold |
| 1580 | and disconnect valid threshold */ |
Chiranjeevi Velempati | f983aeb | 2012-08-23 08:16:50 +0530 | [diff] [blame] | 1581 | 0x6A, 0x81, /* update DC voltage level */ |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 1582 | 0x24, 0x82, /* set preemphasis and rise/fall time */ |
| 1583 | 0x13, 0x83, /* set source impedance adjusment */ |
| 1584 | -1}; |
| 1585 | |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1586 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1587 | /* Bandwidth requests (zero) if no vote placed */ |
| 1588 | static struct msm_bus_vectors usb_init_vectors[] = { |
| 1589 | { |
| 1590 | .src = MSM_BUS_MASTER_SPS, |
| 1591 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1592 | .ab = 0, |
| 1593 | .ib = 0, |
| 1594 | }, |
| 1595 | }; |
| 1596 | |
| 1597 | /* Bus bandwidth requests in Bytes/sec */ |
| 1598 | static struct msm_bus_vectors usb_max_vectors[] = { |
| 1599 | { |
| 1600 | .src = MSM_BUS_MASTER_SPS, |
| 1601 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 1602 | .ab = 60000000, /* At least 480Mbps on bus. */ |
| 1603 | .ib = 960000000, /* MAX bursts rate */ |
| 1604 | }, |
| 1605 | }; |
| 1606 | |
| 1607 | static struct msm_bus_paths usb_bus_scale_usecases[] = { |
| 1608 | { |
| 1609 | ARRAY_SIZE(usb_init_vectors), |
| 1610 | usb_init_vectors, |
| 1611 | }, |
| 1612 | { |
| 1613 | ARRAY_SIZE(usb_max_vectors), |
| 1614 | usb_max_vectors, |
| 1615 | }, |
| 1616 | }; |
| 1617 | |
| 1618 | static struct msm_bus_scale_pdata usb_bus_scale_pdata = { |
| 1619 | usb_bus_scale_usecases, |
| 1620 | ARRAY_SIZE(usb_bus_scale_usecases), |
| 1621 | .name = "usb", |
| 1622 | }; |
| 1623 | #endif |
| 1624 | |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1625 | #define MSM_MPM_PIN_USB1_OTGSESSVLD 40 |
| 1626 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1627 | static struct msm_otg_platform_data msm_otg_pdata = { |
| 1628 | .mode = USB_OTG, |
| 1629 | .otg_control = OTG_PMIC_CONTROL, |
| 1630 | .phy_type = SNPS_28NM_INTEGRATED_PHY, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1631 | .pmic_id_irq = PM8921_USB_ID_IN_IRQ(PM8921_IRQ_BASE), |
Anji jonnala | 4e3e677 | 2011-09-15 18:53:42 +0530 | [diff] [blame] | 1632 | .power_budget = 750, |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1633 | #ifdef CONFIG_MSM_BUS_SCALING |
| 1634 | .bus_scale_table = &usb_bus_scale_pdata, |
Jack Pham | 87f202f | 2012-08-06 00:24:22 -0700 | [diff] [blame] | 1635 | .mpm_otgsessvld_int = MSM_MPM_PIN_USB1_OTGSESSVLD, |
Manu Gautam | cd82e9d | 2011-12-20 14:17:28 +0530 | [diff] [blame] | 1636 | #endif |
Pavankumar Kondeti | 2aec9f3 | 2012-06-13 09:06:03 +0530 | [diff] [blame] | 1637 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 1638 | .mhl_dev_name = "sii8334", |
| 1639 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1640 | }; |
| 1641 | #endif |
| 1642 | |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1643 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
Vijayavardhan Vennapusa | 2b592824f | 2011-11-02 19:51:32 +0530 | [diff] [blame] | 1644 | #define HSIC_HUB_RESET_GPIO 91 |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1645 | static struct msm_hsic_host_platform_data msm_hsic_pdata = { |
| 1646 | .strobe = 150, |
| 1647 | .data = 151, |
| 1648 | }; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1649 | |
| 1650 | static struct smsc_hub_platform_data hsic_hub_pdata = { |
| 1651 | .hub_reset = HSIC_HUB_RESET_GPIO, |
| 1652 | }; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1653 | #else |
| 1654 | static struct msm_hsic_host_platform_data msm_hsic_pdata; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1655 | static struct smsc_hub_platform_data hsic_hub_pdata; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 1656 | #endif |
| 1657 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 1658 | static struct platform_device smsc_hub_device = { |
| 1659 | .name = "msm_smsc_hub", |
| 1660 | .id = -1, |
| 1661 | .dev = { |
| 1662 | .platform_data = &hsic_hub_pdata, |
| 1663 | }, |
| 1664 | }; |
| 1665 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1666 | #define PID_MAGIC_ID 0x71432909 |
| 1667 | #define SERIAL_NUM_MAGIC_ID 0x61945374 |
| 1668 | #define SERIAL_NUMBER_LENGTH 127 |
| 1669 | #define DLOAD_USB_BASE_ADD 0x2A03F0C8 |
| 1670 | |
| 1671 | struct magic_num_struct { |
| 1672 | uint32_t pid; |
| 1673 | uint32_t serial_num; |
| 1674 | }; |
| 1675 | |
| 1676 | struct dload_struct { |
| 1677 | uint32_t reserved1; |
| 1678 | uint32_t reserved2; |
| 1679 | uint32_t reserved3; |
| 1680 | uint16_t reserved4; |
| 1681 | uint16_t pid; |
| 1682 | char serial_number[SERIAL_NUMBER_LENGTH]; |
| 1683 | uint16_t reserved5; |
| 1684 | struct magic_num_struct magic_struct; |
| 1685 | }; |
| 1686 | |
| 1687 | static int usb_diag_update_pid_and_serial_num(uint32_t pid, const char *snum) |
| 1688 | { |
| 1689 | struct dload_struct __iomem *dload = 0; |
| 1690 | |
| 1691 | dload = ioremap(DLOAD_USB_BASE_ADD, sizeof(*dload)); |
| 1692 | if (!dload) { |
| 1693 | pr_err("%s: cannot remap I/O memory region: %08x\n", |
| 1694 | __func__, DLOAD_USB_BASE_ADD); |
| 1695 | return -ENXIO; |
| 1696 | } |
| 1697 | |
| 1698 | pr_debug("%s: dload:%p pid:%x serial_num:%s\n", |
| 1699 | __func__, dload, pid, snum); |
| 1700 | /* update pid */ |
| 1701 | dload->magic_struct.pid = PID_MAGIC_ID; |
| 1702 | dload->pid = pid; |
| 1703 | |
| 1704 | /* update serial number */ |
| 1705 | dload->magic_struct.serial_num = 0; |
| 1706 | if (!snum) { |
| 1707 | memset(dload->serial_number, 0, SERIAL_NUMBER_LENGTH); |
| 1708 | goto out; |
| 1709 | } |
| 1710 | |
| 1711 | dload->magic_struct.serial_num = SERIAL_NUM_MAGIC_ID; |
Jin Hong | e49b148 | 2011-10-03 11:15:50 -0700 | [diff] [blame] | 1712 | strlcpy(dload->serial_number, snum, SERIAL_NUMBER_LENGTH); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1713 | out: |
| 1714 | iounmap(dload); |
| 1715 | return 0; |
| 1716 | } |
| 1717 | |
| 1718 | static struct android_usb_platform_data android_usb_pdata = { |
| 1719 | .update_pid_and_serial_num = usb_diag_update_pid_and_serial_num, |
| 1720 | }; |
| 1721 | |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 1722 | static struct platform_device android_usb_device = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1723 | .name = "android_usb", |
| 1724 | .id = -1, |
| 1725 | .dev = { |
| 1726 | .platform_data = &android_usb_pdata, |
| 1727 | }, |
| 1728 | }; |
| 1729 | |
| 1730 | static uint8_t spm_wfi_cmd_sequence[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1731 | 0x03, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1732 | }; |
| 1733 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1734 | static uint8_t spm_retention_cmd_sequence[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1735 | 0x00, 0x05, 0x03, 0x0D, |
| 1736 | 0x0B, 0x00, 0x0f, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1737 | }; |
| 1738 | |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1739 | static uint8_t spm_retention_with_krait_v3_cmd_sequence[] __initdata = { |
| 1740 | 0x42, 0x1B, 0x00, |
| 1741 | 0x05, 0x03, 0x01, 0x0B, |
| 1742 | 0x00, 0x42, 0x1B, |
| 1743 | 0x0f, |
| 1744 | }; |
| 1745 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1746 | static uint8_t spm_power_collapse_without_rpm[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1747 | 0x00, 0x24, 0x54, 0x10, |
| 1748 | 0x09, 0x03, 0x01, |
| 1749 | 0x10, 0x54, 0x30, 0x0C, |
| 1750 | 0x24, 0x30, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1751 | }; |
| 1752 | |
| 1753 | static uint8_t spm_power_collapse_with_rpm[] __initdata = { |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 1754 | 0x00, 0x24, 0x54, 0x10, |
| 1755 | 0x09, 0x07, 0x01, 0x0B, |
| 1756 | 0x10, 0x54, 0x30, 0x0C, |
| 1757 | 0x24, 0x30, 0x0f, |
| 1758 | }; |
| 1759 | |
| 1760 | /* 8960AB has a different command to assert apc_pdn */ |
| 1761 | static uint8_t spm_power_collapse_without_rpm_krait_v3[] __initdata = { |
| 1762 | 0x00, 0x24, 0x84, 0x10, |
| 1763 | 0x09, 0x03, 0x01, |
| 1764 | 0x10, 0x84, 0x30, 0x0C, |
| 1765 | 0x24, 0x30, 0x0f, |
| 1766 | }; |
| 1767 | |
| 1768 | static uint8_t spm_power_collapse_with_rpm_krait_v3[] __initdata = { |
| 1769 | 0x00, 0x24, 0x84, 0x10, |
| 1770 | 0x09, 0x07, 0x01, 0x0B, |
| 1771 | 0x10, 0x84, 0x30, 0x0C, |
| 1772 | 0x24, 0x30, 0x0f, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1773 | }; |
| 1774 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1775 | static struct msm_spm_seq_entry msm_spm_boot_cpu_seq_list[] __initdata = { |
| 1776 | [0] = { |
| 1777 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1778 | .notify_rpm = false, |
| 1779 | .cmd = spm_wfi_cmd_sequence, |
| 1780 | }, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1781 | [1] = { |
| 1782 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 1783 | .notify_rpm = false, |
| 1784 | .cmd = spm_retention_cmd_sequence, |
| 1785 | }, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1786 | [2] = { |
| 1787 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1788 | .notify_rpm = false, |
| 1789 | .cmd = spm_power_collapse_without_rpm, |
| 1790 | }, |
| 1791 | [3] = { |
| 1792 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1793 | .notify_rpm = true, |
| 1794 | .cmd = spm_power_collapse_with_rpm, |
| 1795 | }, |
| 1796 | }; |
| 1797 | |
| 1798 | static struct msm_spm_seq_entry msm_spm_nonboot_cpu_seq_list[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1799 | [0] = { |
| 1800 | .mode = MSM_SPM_MODE_CLOCK_GATING, |
| 1801 | .notify_rpm = false, |
| 1802 | .cmd = spm_wfi_cmd_sequence, |
| 1803 | }, |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1804 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1805 | [1] = { |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1806 | .mode = MSM_SPM_MODE_POWER_RETENTION, |
| 1807 | .notify_rpm = false, |
| 1808 | .cmd = spm_retention_cmd_sequence, |
| 1809 | }, |
| 1810 | |
| 1811 | [2] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1812 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1813 | .notify_rpm = false, |
| 1814 | .cmd = spm_power_collapse_without_rpm, |
| 1815 | }, |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 1816 | |
| 1817 | [3] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1818 | .mode = MSM_SPM_MODE_POWER_COLLAPSE, |
| 1819 | .notify_rpm = true, |
| 1820 | .cmd = spm_power_collapse_with_rpm, |
| 1821 | }, |
| 1822 | }; |
| 1823 | |
| 1824 | static struct msm_spm_platform_data msm_spm_data[] __initdata = { |
| 1825 | [0] = { |
| 1826 | .reg_base_addr = MSM_SAW0_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1827 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1828 | #if defined(CONFIG_MSM_AVS_HW) |
Anji Jonnala | 39dd725 | 2012-11-26 15:56:26 +0530 | [diff] [blame] | 1829 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x58589464, |
Praveen Chidambaram | 631f282 | 2012-03-16 12:08:42 -0600 | [diff] [blame] | 1830 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00020000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1831 | #endif |
| 1832 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1833 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x03020004, |
| 1834 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0084009C, |
| 1835 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A4001C, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1836 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1837 | .num_modes = ARRAY_SIZE(msm_spm_boot_cpu_seq_list), |
| 1838 | .modes = msm_spm_boot_cpu_seq_list, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1839 | }, |
| 1840 | [1] = { |
| 1841 | .reg_base_addr = MSM_SAW1_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1842 | .reg_init_values[MSM_SPM_REG_SAW2_CFG] = 0x1F, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1843 | #if defined(CONFIG_MSM_AVS_HW) |
Anji Jonnala | 39dd725 | 2012-11-26 15:56:26 +0530 | [diff] [blame] | 1844 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_CTL] = 0x58589464, |
Praveen Chidambaram | 631f282 | 2012-03-16 12:08:42 -0600 | [diff] [blame] | 1845 | .reg_init_values[MSM_SPM_REG_SAW2_AVS_HYSTERESIS] = 0x00020000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1846 | #endif |
| 1847 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x01, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1848 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1849 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x0060009C, |
| 1850 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x0000001C, |
| 1851 | .vctl_timeout_us = 50, |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 1852 | .num_modes = ARRAY_SIZE(msm_spm_nonboot_cpu_seq_list), |
| 1853 | .modes = msm_spm_nonboot_cpu_seq_list, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1854 | }, |
| 1855 | }; |
| 1856 | |
| 1857 | static uint8_t l2_spm_wfi_cmd_sequence[] __initdata = { |
| 1858 | 0x00, 0x20, 0x03, 0x20, |
| 1859 | 0x00, 0x0f, |
| 1860 | }; |
| 1861 | |
| 1862 | static uint8_t l2_spm_gdhs_cmd_sequence[] __initdata = { |
| 1863 | 0x00, 0x20, 0x34, 0x64, |
| 1864 | 0x48, 0x07, 0x48, 0x20, |
| 1865 | 0x50, 0x64, 0x04, 0x34, |
| 1866 | 0x50, 0x0f, |
| 1867 | }; |
| 1868 | static uint8_t l2_spm_power_off_cmd_sequence[] __initdata = { |
| 1869 | 0x00, 0x10, 0x34, 0x64, |
| 1870 | 0x48, 0x07, 0x48, 0x10, |
| 1871 | 0x50, 0x64, 0x04, 0x34, |
| 1872 | 0x50, 0x0F, |
| 1873 | }; |
| 1874 | |
| 1875 | static struct msm_spm_seq_entry msm_spm_l2_seq_list[] __initdata = { |
| 1876 | [0] = { |
| 1877 | .mode = MSM_SPM_L2_MODE_RETENTION, |
| 1878 | .notify_rpm = false, |
| 1879 | .cmd = l2_spm_wfi_cmd_sequence, |
| 1880 | }, |
| 1881 | [1] = { |
| 1882 | .mode = MSM_SPM_L2_MODE_GDHS, |
| 1883 | .notify_rpm = true, |
| 1884 | .cmd = l2_spm_gdhs_cmd_sequence, |
| 1885 | }, |
| 1886 | [2] = { |
| 1887 | .mode = MSM_SPM_L2_MODE_POWER_COLLAPSE, |
| 1888 | .notify_rpm = true, |
| 1889 | .cmd = l2_spm_power_off_cmd_sequence, |
| 1890 | }, |
| 1891 | }; |
| 1892 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1893 | static struct msm_spm_platform_data msm_spm_l2_data[] __initdata = { |
| 1894 | [0] = { |
| 1895 | .reg_base_addr = MSM_SAW_L2_BASE, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1896 | .reg_init_values[MSM_SPM_REG_SAW2_SPM_CTL] = 0x00, |
Praveen Chidambaram | e4b9eb1 | 2012-02-28 19:39:58 -0700 | [diff] [blame] | 1897 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DLY] = 0x02020204, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1898 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_0] = 0x00A000AE, |
| 1899 | .reg_init_values[MSM_SPM_REG_SAW2_PMIC_DATA_1] = 0x00A00020, |
| 1900 | .modes = msm_spm_l2_seq_list, |
| 1901 | .num_modes = ARRAY_SIZE(msm_spm_l2_seq_list), |
| 1902 | }, |
| 1903 | }; |
| 1904 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1905 | #define HAP_SHIFT_LVL_OE_GPIO 47 |
| 1906 | #define HAP_SHIFT_LVL_OE_GPIO_SGLTE 89 |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1907 | #define PM_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33) |
| 1908 | #define PM_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20) |
| 1909 | |
| 1910 | static struct msm_xo_voter *xo_handle_d1; |
| 1911 | |
| 1912 | static int isa1200_power(int on) |
| 1913 | { |
| 1914 | int rc = 0; |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1915 | int hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO; |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1916 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1917 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 1918 | hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO_SGLTE; |
| 1919 | |
| 1920 | |
| 1921 | gpio_set_value(hap_oe_gpio, !!on); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1922 | |
| 1923 | rc = on ? msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_ON) : |
| 1924 | msm_xo_mode_vote(xo_handle_d1, MSM_XO_MODE_OFF); |
| 1925 | if (rc < 0) { |
| 1926 | pr_err("%s: failed to %svote for TCXO D1 buffer%d\n", |
| 1927 | __func__, on ? "" : "de-", rc); |
| 1928 | goto err_xo_vote; |
| 1929 | } |
| 1930 | |
| 1931 | return 0; |
| 1932 | |
| 1933 | err_xo_vote: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1934 | gpio_set_value(hap_oe_gpio, !on); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1935 | return rc; |
| 1936 | } |
| 1937 | |
| 1938 | static int isa1200_dev_setup(bool enable) |
| 1939 | { |
| 1940 | int rc = 0; |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1941 | int hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO; |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1942 | |
| 1943 | struct pm_gpio hap_gpio_config = { |
| 1944 | .direction = PM_GPIO_DIR_OUT, |
| 1945 | .pull = PM_GPIO_PULL_NO, |
| 1946 | .out_strength = PM_GPIO_STRENGTH_HIGH, |
| 1947 | .function = PM_GPIO_FUNC_NORMAL, |
| 1948 | .inv_int_pol = 0, |
| 1949 | .vin_sel = 2, |
| 1950 | .output_buffer = PM_GPIO_OUT_BUF_CMOS, |
| 1951 | .output_value = 0, |
| 1952 | }; |
| 1953 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1954 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 1955 | hap_oe_gpio = HAP_SHIFT_LVL_OE_GPIO_SGLTE; |
| 1956 | |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1957 | if (enable == true) { |
| 1958 | rc = pm8xxx_gpio_config(PM_HAP_EN_GPIO, &hap_gpio_config); |
| 1959 | if (rc) { |
| 1960 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1961 | __func__, PM_HAP_EN_GPIO, rc); |
| 1962 | return rc; |
| 1963 | } |
| 1964 | |
| 1965 | rc = pm8xxx_gpio_config(PM_HAP_LEN_GPIO, &hap_gpio_config); |
| 1966 | if (rc) { |
| 1967 | pr_err("%s: pm8921 gpio %d config failed(%d)\n", |
| 1968 | __func__, PM_HAP_LEN_GPIO, rc); |
| 1969 | return rc; |
| 1970 | } |
| 1971 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1972 | rc = gpio_request(hap_oe_gpio, "hap_shft_lvl_oe"); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1973 | if (rc) { |
| 1974 | pr_err("%s: unable to request gpio %d (%d)\n", |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1975 | __func__, hap_oe_gpio, rc); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1976 | return rc; |
| 1977 | } |
| 1978 | |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1979 | rc = gpio_direction_output(hap_oe_gpio, 0); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1980 | if (rc) { |
| 1981 | pr_err("%s: Unable to set direction\n", __func__); |
| 1982 | goto free_gpio; |
| 1983 | } |
| 1984 | |
| 1985 | xo_handle_d1 = msm_xo_get(MSM_XO_TCXO_D1, "isa1200"); |
| 1986 | if (IS_ERR(xo_handle_d1)) { |
| 1987 | rc = PTR_ERR(xo_handle_d1); |
| 1988 | pr_err("%s: failed to get the handle for D1(%d)\n", |
| 1989 | __func__, rc); |
| 1990 | goto gpio_set_dir; |
| 1991 | } |
| 1992 | } else { |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 1993 | gpio_free(hap_oe_gpio); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 1994 | |
| 1995 | msm_xo_put(xo_handle_d1); |
| 1996 | } |
| 1997 | |
| 1998 | return 0; |
| 1999 | |
| 2000 | gpio_set_dir: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 2001 | gpio_set_value(hap_oe_gpio, 0); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2002 | free_gpio: |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 2003 | gpio_free(hap_oe_gpio); |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2004 | return rc; |
| 2005 | } |
| 2006 | |
| 2007 | static struct isa1200_regulator isa1200_reg_data[] = { |
| 2008 | { |
| 2009 | .name = "vcc_i2c", |
| 2010 | .min_uV = ISA_I2C_VTG_MIN_UV, |
| 2011 | .max_uV = ISA_I2C_VTG_MAX_UV, |
| 2012 | .load_uA = ISA_I2C_CURR_UA, |
| 2013 | }, |
| 2014 | }; |
| 2015 | |
| 2016 | static struct isa1200_platform_data isa1200_1_pdata = { |
| 2017 | .name = "vibrator", |
| 2018 | .dev_setup = isa1200_dev_setup, |
| 2019 | .power_on = isa1200_power, |
| 2020 | .hap_en_gpio = PM_HAP_EN_GPIO, |
| 2021 | .hap_len_gpio = PM_HAP_LEN_GPIO, |
| 2022 | .max_timeout = 15000, |
| 2023 | .mode_ctrl = PWM_GEN_MODE, |
| 2024 | .pwm_fd = { |
| 2025 | .pwm_div = 256, |
| 2026 | }, |
| 2027 | .is_erm = false, |
| 2028 | .smart_en = true, |
| 2029 | .ext_clk_en = true, |
| 2030 | .chip_en = 1, |
| 2031 | .regulator_info = isa1200_reg_data, |
| 2032 | .num_regulators = ARRAY_SIZE(isa1200_reg_data), |
| 2033 | }; |
| 2034 | |
| 2035 | static struct i2c_board_info msm_isa1200_board_info[] __initdata = { |
| 2036 | { |
| 2037 | I2C_BOARD_INFO("isa1200_1", 0x90>>1), |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 2038 | }, |
| 2039 | }; |
| 2040 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2041 | #define CYTTSP_TS_GPIO_IRQ 11 |
| 2042 | #define CYTTSP_TS_SLEEP_GPIO 50 |
| 2043 | #define CYTTSP_TS_RESOUT_N_GPIO 52 |
| 2044 | |
| 2045 | /*virtual key support */ |
| 2046 | static ssize_t tma340_vkeys_show(struct kobject *kobj, |
| 2047 | struct kobj_attribute *attr, char *buf) |
| 2048 | { |
| 2049 | return snprintf(buf, 200, |
| 2050 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":73:1120:97:97" |
| 2051 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":230:1120:97:97" |
| 2052 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":389:1120:97:97" |
| 2053 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":544:1120:97:97" |
| 2054 | "\n"); |
| 2055 | } |
| 2056 | |
| 2057 | static struct kobj_attribute tma340_vkeys_attr = { |
| 2058 | .attr = { |
| 2059 | .mode = S_IRUGO, |
| 2060 | }, |
| 2061 | .show = &tma340_vkeys_show, |
| 2062 | }; |
| 2063 | |
| 2064 | static struct attribute *tma340_properties_attrs[] = { |
| 2065 | &tma340_vkeys_attr.attr, |
| 2066 | NULL |
| 2067 | }; |
| 2068 | |
| 2069 | static struct attribute_group tma340_properties_attr_group = { |
| 2070 | .attrs = tma340_properties_attrs, |
| 2071 | }; |
| 2072 | |
| 2073 | |
| 2074 | static int cyttsp_platform_init(struct i2c_client *client) |
| 2075 | { |
| 2076 | int rc = 0; |
| 2077 | static struct kobject *tma340_properties_kobj; |
| 2078 | |
| 2079 | tma340_vkeys_attr.attr.name = "virtualkeys.cyttsp-i2c"; |
| 2080 | tma340_properties_kobj = kobject_create_and_add("board_properties", |
| 2081 | NULL); |
| 2082 | if (tma340_properties_kobj) |
| 2083 | rc = sysfs_create_group(tma340_properties_kobj, |
| 2084 | &tma340_properties_attr_group); |
| 2085 | if (!tma340_properties_kobj || rc) |
| 2086 | pr_err("%s: failed to create board_properties\n", |
| 2087 | __func__); |
| 2088 | |
| 2089 | return 0; |
| 2090 | } |
| 2091 | |
| 2092 | static struct cyttsp_regulator regulator_data[] = { |
| 2093 | { |
| 2094 | .name = "vdd", |
| 2095 | .min_uV = CY_TMA300_VTG_MIN_UV, |
| 2096 | .max_uV = CY_TMA300_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 2097 | .hpm_load_uA = CY_TMA300_CURR_24HZ_UA, |
| 2098 | .lpm_load_uA = CY_TMA300_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2099 | }, |
| 2100 | /* TODO: Remove after runtime PM is enabled in I2C driver */ |
| 2101 | { |
| 2102 | .name = "vcc_i2c", |
| 2103 | .min_uV = CY_I2C_VTG_MIN_UV, |
| 2104 | .max_uV = CY_I2C_VTG_MAX_UV, |
Anirudh Ghayal | f9929b1 | 2011-09-07 15:57:36 +0530 | [diff] [blame] | 2105 | .hpm_load_uA = CY_I2C_CURR_UA, |
| 2106 | .lpm_load_uA = CY_I2C_SLEEP_CURR_UA, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2107 | }, |
| 2108 | }; |
| 2109 | |
| 2110 | static struct cyttsp_platform_data cyttsp_pdata = { |
| 2111 | .panel_maxx = 634, |
| 2112 | .panel_maxy = 1166, |
| 2113 | .disp_maxx = 616, |
| 2114 | .disp_maxy = 1023, |
| 2115 | .disp_minx = 0, |
| 2116 | .disp_miny = 16, |
| 2117 | .flags = 0x01, |
| 2118 | .gen = CY_GEN3, /* or */ |
| 2119 | .use_st = CY_USE_ST, |
| 2120 | .use_mt = CY_USE_MT, |
| 2121 | .use_hndshk = CY_SEND_HNDSHK, |
| 2122 | .use_trk_id = CY_USE_TRACKING_ID, |
Anirudh Ghayal | e96f66d | 2011-08-11 14:06:38 +0530 | [diff] [blame] | 2123 | .use_sleep = CY_USE_DEEP_SLEEP_SEL | CY_USE_LOW_POWER_SEL, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2124 | .use_gestures = CY_USE_GESTURES, |
| 2125 | .fw_fname = "cyttsp_8960_cdp.hex", |
| 2126 | /* activate up to 4 groups |
| 2127 | * and set active distance |
| 2128 | */ |
| 2129 | .gest_set = CY_GEST_GRP1 | CY_GEST_GRP2 | |
| 2130 | CY_GEST_GRP3 | CY_GEST_GRP4 | |
| 2131 | CY_ACT_DIST, |
Amy Maloche | 7b741b2 | 2012-06-14 14:37:22 -0700 | [diff] [blame] | 2132 | .act_intrvl = 10, |
| 2133 | .tch_tmout = 200, |
| 2134 | .lp_intrvl = 30, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2135 | .sleep_gpio = CYTTSP_TS_SLEEP_GPIO, |
| 2136 | .resout_gpio = CYTTSP_TS_RESOUT_N_GPIO, |
| 2137 | .irq_gpio = CYTTSP_TS_GPIO_IRQ, |
| 2138 | .regulator_info = regulator_data, |
| 2139 | .num_regulators = ARRAY_SIZE(regulator_data), |
| 2140 | .init = cyttsp_platform_init, |
Mohan Pallaka | 49c37d6 | 2011-08-01 11:52:00 +0530 | [diff] [blame] | 2141 | .correct_fw_ver = 9, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2142 | }; |
| 2143 | |
| 2144 | static struct i2c_board_info cyttsp_info[] __initdata = { |
| 2145 | { |
| 2146 | I2C_BOARD_INFO(CY_I2C_NAME, 0x24), |
| 2147 | .platform_data = &cyttsp_pdata, |
| 2148 | #ifndef CY_USE_TIMER |
| 2149 | .irq = MSM_GPIO_TO_INT(CYTTSP_TS_GPIO_IRQ), |
| 2150 | #endif /* CY_USE_TIMER */ |
| 2151 | }, |
| 2152 | }; |
| 2153 | |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2154 | /* configuration data for mxt1386 */ |
| 2155 | static const u8 mxt1386_config_data[] = { |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2156 | /* T6 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2157 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2158 | /* T38 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2159 | 11, 2, 0, 11, 11, 11, 0, 0, 0, 0, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2160 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2161 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2162 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2163 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2164 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2165 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2166 | /* T7 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2167 | 100, 16, 50, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2168 | /* T8 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2169 | 8, 0, 0, 0, 0, 0, 8, 14, 50, 215, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2170 | /* T9 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2171 | 131, 0, 0, 26, 42, 0, 32, 63, 3, 5, |
| 2172 | 0, 2, 1, 113, 10, 10, 8, 10, 255, 2, |
| 2173 | 85, 5, 0, 0, 20, 20, 75, 25, 202, 29, |
| 2174 | 10, 10, 45, 46, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2175 | /* T15 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2176 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2177 | 0, |
Anirudh Ghayal | dab4e0d | 2012-01-09 14:59:27 +0530 | [diff] [blame] | 2178 | /* T18 Object */ |
| 2179 | 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2180 | /* T22 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2181 | 5, 0, 0, 0, 0, 0, 0, 0, 30, 0, |
| 2182 | 0, 0, 5, 8, 10, 13, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2183 | /* T24 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2184 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2185 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2186 | /* T25 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2187 | 3, 0, 188, 52, 52, 33, 0, 0, 0, 0, |
| 2188 | 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2189 | /* T27 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2190 | 0, 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2191 | /* T28 Object */ |
Jing Lin | 93f0708 | 2011-11-11 15:53:54 -0800 | [diff] [blame] | 2192 | 0, 0, 0, 8, 12, 60, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2193 | /* T40 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2194 | 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2195 | /* T41 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2196 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2197 | /* T43 Object */ |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2198 | 0, 0, 0, 0, 0, 0, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2199 | }; |
| 2200 | |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2201 | /* configuration data for mxt1386e using V1.0 firmware */ |
| 2202 | static const u8 mxt1386e_config_data_v1_0[] = { |
| 2203 | /* T6 Object */ |
| 2204 | 0, 0, 0, 0, 0, 0, |
| 2205 | /* T38 Object */ |
| 2206 | 12, 1, 0, 17, 1, 12, 0, 0, 0, 0, |
| 2207 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2208 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2209 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2210 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2211 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2212 | 0, 0, 0, 0, |
| 2213 | /* T7 Object */ |
| 2214 | 100, 16, 50, |
| 2215 | /* T8 Object */ |
| 2216 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 2217 | /* T9 Object */ |
| 2218 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 2219 | 0, 5, 5, 0, 10, 30, 10, 10, 255, 2, |
| 2220 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 2221 | 10, 5, 0, 0, 0, |
| 2222 | /* T18 Object */ |
| 2223 | 0, 0, |
| 2224 | /* T24 Object */ |
| 2225 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2226 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2227 | /* T25 Object */ |
| 2228 | 3, 0, 60, 115, 156, 99, |
| 2229 | /* T27 Object */ |
| 2230 | 0, 0, 0, 0, 0, 0, 0, |
| 2231 | /* T40 Object */ |
| 2232 | 0, 0, 0, 0, 0, |
| 2233 | /* T42 Object */ |
| 2234 | 2, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
| 2235 | /* T43 Object */ |
| 2236 | 0, 0, 0, 0, 0, 0, 0, |
| 2237 | /* T46 Object */ |
| 2238 | 64, 0, 20, 20, 0, 0, 0, 0, 0, |
| 2239 | /* T47 Object */ |
| 2240 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2241 | /* T48 Object */ |
| 2242 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
| 2243 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 2244 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 2245 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 2246 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2247 | 0, 0, 0, 0, |
| 2248 | /* T56 Object */ |
| 2249 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2250 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2251 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2252 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2253 | 2, 99, 33, |
| 2254 | }; |
| 2255 | |
| 2256 | /* configuration data for mxt1386e using V2.1 firmware */ |
| 2257 | static const u8 mxt1386e_config_data_v2_1[] = { |
| 2258 | /* T6 Object */ |
| 2259 | 0, 0, 0, 0, 0, 0, |
| 2260 | /* T38 Object */ |
Jing Lin | 4a8a3e4 | 2012-09-12 10:08:22 -0700 | [diff] [blame] | 2261 | 12, 5, 0, 28, 8, 12, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2262 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2263 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2264 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2265 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2266 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2267 | 0, 0, 0, 0, |
| 2268 | /* T7 Object */ |
Jing Lin | 4a8a3e4 | 2012-09-12 10:08:22 -0700 | [diff] [blame] | 2269 | 32, 16, 50, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2270 | /* T8 Object */ |
| 2271 | 25, 0, 20, 20, 0, 0, 20, 50, 0, 0, |
| 2272 | /* T9 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2273 | 139, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
Jing Lin | a0bc410 | 2012-07-06 17:03:45 -0700 | [diff] [blame] | 2274 | 0, 5, 5, 79, 10, 30, 10, 10, 255, 2, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2275 | 85, 5, 10, 10, 10, 10, 135, 55, 70, 40, |
| 2276 | 10, 5, 0, 0, 0, |
| 2277 | /* T18 Object */ |
| 2278 | 0, 0, |
| 2279 | /* T24 Object */ |
| 2280 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2281 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2282 | /* T25 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2283 | 1, 0, 60, 115, 156, 99, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2284 | /* T27 Object */ |
| 2285 | 0, 0, 0, 0, 0, 0, 0, |
| 2286 | /* T40 Object */ |
| 2287 | 0, 0, 0, 0, 0, |
| 2288 | /* T42 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2289 | 0, 0, 255, 0, 255, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2290 | /* T43 Object */ |
| 2291 | 0, 0, 0, 0, 0, 0, 0, 64, 0, 8, |
| 2292 | 16, |
| 2293 | /* T46 Object */ |
Jing Lin | a0bc410 | 2012-07-06 17:03:45 -0700 | [diff] [blame] | 2294 | 64, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2295 | /* T47 Object */ |
| 2296 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2297 | /* T48 Object */ |
Jing Lin | 763f477 | 2012-05-25 13:39:40 -0700 | [diff] [blame] | 2298 | 1, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2299 | 48, 40, 0, 10, 10, 0, 0, 100, 10, 80, |
| 2300 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, |
| 2301 | 52, 0, 12, 0, 17, 0, 1, 0, 0, 0, |
| 2302 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2303 | 0, 0, 0, 0, |
| 2304 | /* T56 Object */ |
| 2305 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2306 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2307 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2308 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2309 | 2, 99, 33, 0, 149, 24, 193, 255, 255, 255, |
| 2310 | 255, |
| 2311 | }; |
| 2312 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2313 | /* configuration data for mxt1386e on 3D SKU using V2.1 firmware */ |
| 2314 | static const u8 mxt1386e_config_data_3d[] = { |
| 2315 | /* T6 Object */ |
| 2316 | 0, 0, 0, 0, 0, 0, |
| 2317 | /* T38 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2318 | 13, 1, 0, 23, 2, 12, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2319 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2320 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2321 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2322 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2323 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2324 | 0, 0, 0, 0, |
| 2325 | /* T7 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2326 | 100, 10, 50, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2327 | /* T8 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2328 | 25, 0, 20, 20, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2329 | /* T9 Object */ |
| 2330 | 131, 0, 0, 26, 42, 0, 32, 80, 2, 5, |
| 2331 | 0, 5, 5, 0, 10, 30, 10, 10, 175, 4, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2332 | 127, 7, 26, 21, 17, 19, 143, 35, 207, 40, |
| 2333 | 20, 5, 54, 49, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2334 | /* T18 Object */ |
| 2335 | 0, 0, |
| 2336 | /* T24 Object */ |
| 2337 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2338 | 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2339 | /* T25 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2340 | 0, 0, 72, 113, 168, 97, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2341 | /* T27 Object */ |
| 2342 | 0, 0, 0, 0, 0, 0, 0, |
| 2343 | /* T40 Object */ |
| 2344 | 0, 0, 0, 0, 0, |
| 2345 | /* T42 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2346 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2347 | /* T43 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2348 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2349 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2350 | /* T46 Object */ |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2351 | 68, 0, 16, 16, 0, 0, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2352 | /* T47 Object */ |
| 2353 | 0, 0, 0, 0, 0, 0, 3, 64, 66, 0, |
| 2354 | /* T48 Object */ |
| 2355 | 31, 64, 64, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2356 | 32, 50, 0, 10, 10, 0, 0, 100, 10, 90, |
| 2357 | 0, 0, 0, 0, 0, 0, 0, 10, 1, 30, |
| 2358 | 52, 10, 5, 0, 33, 0, 1, 0, 0, 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2359 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2360 | 0, 0, 0, 0, |
| 2361 | /* T56 Object */ |
| 2362 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2363 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2364 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2365 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Jing Lin | 66ba78b | 2012-02-24 21:25:12 -0800 | [diff] [blame] | 2366 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 2367 | 0, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2368 | }; |
| 2369 | |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2370 | #define MXT_TS_GPIO_IRQ 11 |
| 2371 | #define MXT_TS_LDO_EN_GPIO 50 |
| 2372 | #define MXT_TS_RESET_GPIO 52 |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2373 | |
| 2374 | static void mxt_init_hw_liquid(void) |
| 2375 | { |
| 2376 | int rc; |
| 2377 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2378 | rc = gpio_request(MXT_TS_LDO_EN_GPIO, "mxt_ldo_en_gpio"); |
| 2379 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2380 | pr_err("%s: unable to request mxt_ldo_en_gpio [%d]\n", |
| 2381 | __func__, MXT_TS_LDO_EN_GPIO); |
| 2382 | return; |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2383 | } |
| 2384 | |
| 2385 | rc = gpio_direction_output(MXT_TS_LDO_EN_GPIO, 1); |
| 2386 | if (rc) { |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2387 | pr_err("%s: unable to set_direction for mxt_ldo_en_gpio [%d]\n", |
| 2388 | __func__, MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2389 | goto err_ldo_gpio_req; |
| 2390 | } |
| 2391 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2392 | return; |
| 2393 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2394 | err_ldo_gpio_req: |
| 2395 | gpio_free(MXT_TS_LDO_EN_GPIO); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2396 | } |
| 2397 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2398 | static struct mxt_config_info mxt_config_array_2d[] = { |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2399 | { |
| 2400 | .config = mxt1386_config_data, |
| 2401 | .config_length = ARRAY_SIZE(mxt1386_config_data), |
| 2402 | .family_id = 0xA0, |
| 2403 | .variant_id = 0x0, |
| 2404 | .version = 0x10, |
| 2405 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2406 | .bootldr_id = MXT_BOOTLOADER_ID_1386, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2407 | }, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2408 | { |
| 2409 | .config = mxt1386e_config_data_v1_0, |
| 2410 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v1_0), |
| 2411 | .family_id = 0xA0, |
| 2412 | .variant_id = 0x2, |
| 2413 | .version = 0x10, |
| 2414 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2415 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | aeaeed5 | 2012-03-26 14:57:15 -0700 | [diff] [blame] | 2416 | .fw_name = "atmel_8960_liquid_v2_2_AA.hex", |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2417 | }, |
| 2418 | { |
| 2419 | .config = mxt1386e_config_data_v2_1, |
| 2420 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 2421 | .family_id = 0xA0, |
| 2422 | .variant_id = 0x7, |
| 2423 | .version = 0x21, |
| 2424 | .build = 0xAA, |
Anirudh Ghayal | a77941e | 2012-02-23 19:12:26 -0800 | [diff] [blame] | 2425 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | aeaeed5 | 2012-03-26 14:57:15 -0700 | [diff] [blame] | 2426 | .fw_name = "atmel_8960_liquid_v2_2_AA.hex", |
| 2427 | }, |
| 2428 | { |
| 2429 | /* The config data for V2.2.AA is the same as for V2.1.AA */ |
| 2430 | .config = mxt1386e_config_data_v2_1, |
| 2431 | .config_length = ARRAY_SIZE(mxt1386e_config_data_v2_1), |
| 2432 | .family_id = 0xA0, |
| 2433 | .variant_id = 0x7, |
| 2434 | .version = 0x22, |
| 2435 | .build = 0xAA, |
| 2436 | .bootldr_id = MXT_BOOTLOADER_ID_1386E, |
Jing Lin | 33b007d | 2011-12-21 17:40:23 -0800 | [diff] [blame] | 2437 | }, |
Jing Lin | dc4413c | 2012-01-16 15:22:52 -0800 | [diff] [blame] | 2438 | }; |
| 2439 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2440 | static struct mxt_platform_data mxt_platform_data_2d = { |
| 2441 | .config_array = mxt_config_array_2d, |
| 2442 | .config_array_size = ARRAY_SIZE(mxt_config_array_2d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2443 | .panel_minx = 0, |
| 2444 | .panel_maxx = 1365, |
| 2445 | .panel_miny = 0, |
| 2446 | .panel_maxy = 767, |
| 2447 | .disp_minx = 0, |
| 2448 | .disp_maxx = 1365, |
| 2449 | .disp_miny = 0, |
| 2450 | .disp_maxy = 767, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2451 | .irqflags = IRQF_TRIGGER_FALLING, |
Jing Lin | 2f86317 | 2011-10-17 10:56:58 -0700 | [diff] [blame] | 2452 | .i2c_pull_up = true, |
Amy Maloche | 08266db | 2011-11-04 11:07:16 -0700 | [diff] [blame] | 2453 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2454 | .irq_gpio = MXT_TS_GPIO_IRQ, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2455 | }; |
| 2456 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2457 | static struct mxt_config_info mxt_config_array_3d[] = { |
| 2458 | { |
| 2459 | .config = mxt1386e_config_data_3d, |
| 2460 | .config_length = ARRAY_SIZE(mxt1386e_config_data_3d), |
| 2461 | .family_id = 0xA0, |
| 2462 | .variant_id = 0x7, |
| 2463 | .version = 0x21, |
| 2464 | .build = 0xAA, |
| 2465 | }, |
| 2466 | }; |
| 2467 | |
| 2468 | static struct mxt_platform_data mxt_platform_data_3d = { |
| 2469 | .config_array = mxt_config_array_3d, |
| 2470 | .config_array_size = ARRAY_SIZE(mxt_config_array_3d), |
Mohan Pallaka | 56a1a5d | 2012-02-23 12:05:13 -0800 | [diff] [blame] | 2471 | .panel_minx = 0, |
| 2472 | .panel_maxx = 1919, |
| 2473 | .panel_miny = 0, |
| 2474 | .panel_maxy = 1199, |
| 2475 | .disp_minx = 0, |
| 2476 | .disp_maxx = 1919, |
| 2477 | .disp_miny = 0, |
| 2478 | .disp_maxy = 1199, |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 2479 | .irqflags = IRQF_TRIGGER_FALLING, |
| 2480 | .i2c_pull_up = true, |
| 2481 | .reset_gpio = MXT_TS_RESET_GPIO, |
| 2482 | .irq_gpio = MXT_TS_GPIO_IRQ, |
| 2483 | }; |
| 2484 | |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2485 | static struct i2c_board_info mxt_device_info[] __initdata = { |
| 2486 | { |
| 2487 | I2C_BOARD_INFO("atmel_mxt_ts", 0x5b), |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 2488 | .irq = MSM_GPIO_TO_INT(MXT_TS_GPIO_IRQ), |
| 2489 | }, |
| 2490 | }; |
| 2491 | |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2492 | static struct msm_mhl_platform_data mhl_platform_data = { |
| 2493 | .irq = MSM_GPIO_TO_INT(4), |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 2494 | .gpio_mhl_int = MHL_GPIO_INT, |
| 2495 | .gpio_mhl_reset = MHL_GPIO_RESET, |
| 2496 | .gpio_mhl_power = 0, |
| 2497 | .gpio_hdmi_mhl_mux = 0, |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2498 | }; |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2499 | |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2500 | static struct i2c_board_info sii_device_info[] __initdata = { |
| 2501 | { |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2502 | #ifdef CONFIG_FB_MSM_HDMI_MHL_8334 |
| 2503 | /* |
| 2504 | * keeps SI 8334 as the default |
| 2505 | * MHL TX |
| 2506 | */ |
| 2507 | I2C_BOARD_INFO("sii8334", 0x39), |
| 2508 | .platform_data = &mhl_platform_data, |
| 2509 | #endif |
| 2510 | #ifdef CONFIG_FB_MSM_HDMI_MHL_9244 |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2511 | I2C_BOARD_INFO("Sil-9244", 0x39), |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2512 | .irq = MSM_GPIO_TO_INT(15), |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 2513 | #endif /* CONFIG_MSM_HDMI_MHL */ |
| 2514 | .flags = I2C_CLIENT_WAKE, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 2515 | }, |
| 2516 | }; |
| 2517 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2518 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi4_pdata = { |
| 2519 | .clk_freq = 100000, |
| 2520 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2521 | }; |
| 2522 | |
| 2523 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi3_pdata = { |
| 2524 | .clk_freq = 100000, |
| 2525 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2526 | }; |
| 2527 | |
| 2528 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi10_pdata = { |
| 2529 | .clk_freq = 100000, |
| 2530 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2531 | }; |
| 2532 | |
| 2533 | static struct msm_i2c_platform_data msm8960_i2c_qup_gsbi12_pdata = { |
| 2534 | .clk_freq = 100000, |
| 2535 | .src_clk_rate = 24000000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2536 | }; |
| 2537 | |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2538 | static struct ks8851_pdata spi_eth_pdata = { |
| 2539 | .irq_gpio = KS8851_IRQ_GPIO, |
| 2540 | .rst_gpio = KS8851_RST_GPIO, |
| 2541 | }; |
Praveen Chidambaram | 043f4ce | 2011-08-02 09:37:59 -0600 | [diff] [blame] | 2542 | |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 2543 | static struct spi_board_info spi_eth_info[] __initdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2544 | { |
| 2545 | .modalias = "ks8851", |
| 2546 | .irq = MSM_GPIO_TO_INT(KS8851_IRQ_GPIO), |
| 2547 | .max_speed_hz = 19200000, |
| 2548 | .bus_num = 0, |
| 2549 | .chip_select = 0, |
| 2550 | .mode = SPI_MODE_0, |
Stepan Moskovchenko | 93d79ec | 2011-09-21 16:52:16 -0700 | [diff] [blame] | 2551 | .platform_data = &spi_eth_pdata |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2552 | }, |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 2553 | }; |
| 2554 | static struct spi_board_info spi_board_info[] __initdata = { |
Chandan Uddaraju | 15e54b9 | 2011-09-12 10:52:36 -0700 | [diff] [blame] | 2555 | { |
| 2556 | .modalias = "dsi_novatek_3d_panel_spi", |
| 2557 | .max_speed_hz = 10800000, |
| 2558 | .bus_num = 0, |
| 2559 | .chip_select = 1, |
| 2560 | .mode = SPI_MODE_0, |
| 2561 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2562 | }; |
| 2563 | |
| 2564 | static struct platform_device msm_device_saw_core0 = { |
| 2565 | .name = "saw-regulator", |
| 2566 | .id = 0, |
| 2567 | .dev = { |
| 2568 | .platform_data = &msm_saw_regulator_pdata_s5, |
| 2569 | }, |
| 2570 | }; |
| 2571 | |
| 2572 | static struct platform_device msm_device_saw_core1 = { |
| 2573 | .name = "saw-regulator", |
| 2574 | .id = 1, |
| 2575 | .dev = { |
| 2576 | .platform_data = &msm_saw_regulator_pdata_s6, |
| 2577 | }, |
| 2578 | }; |
| 2579 | |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2580 | static struct tsens_platform_data msm_tsens_pdata = { |
Siddartha Mohanadoss | caeaa92 | 2012-02-07 16:41:38 -0800 | [diff] [blame] | 2581 | .slope = {910, 910, 910, 910, 910}, |
Siddartha Mohanadoss | ba21fdd | 2011-08-18 10:05:27 -0700 | [diff] [blame] | 2582 | .tsens_factor = 1000, |
| 2583 | .hw_type = MSM_8960, |
| 2584 | .tsens_num_sensor = 5, |
| 2585 | }; |
| 2586 | |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2587 | static struct platform_device msm_tsens_device = { |
| 2588 | .name = "tsens8960-tm", |
| 2589 | .id = -1, |
| 2590 | }; |
| 2591 | |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2592 | static struct msm_thermal_data msm_thermal_pdata = { |
| 2593 | .sensor_id = 0, |
Eugene Seah | 2ee4a5d | 2012-06-25 18:16:41 -0600 | [diff] [blame] | 2594 | .poll_ms = 250, |
| 2595 | .limit_temp_degC = 60, |
| 2596 | .temp_hysteresis_degC = 10, |
| 2597 | .freq_step = 2, |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 2598 | }; |
| 2599 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2600 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2601 | static struct platform_device fish_battery_device = { |
| 2602 | .name = "fish_battery", |
| 2603 | }; |
| 2604 | #endif |
| 2605 | |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 2606 | #ifdef CONFIG_BATTERY_BCL |
| 2607 | static struct platform_device battery_bcl_device = { |
| 2608 | .name = "battery_current_limit", |
| 2609 | .id = -1, |
| 2610 | }; |
| 2611 | #endif |
| 2612 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2613 | static struct platform_device msm8960_device_ext_5v_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2614 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2615 | .id = PM8921_MPP_PM_TO_SYS(7), |
| 2616 | .dev = { |
| 2617 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_5V], |
| 2618 | }, |
| 2619 | }; |
| 2620 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2621 | static struct platform_device msm8960_device_ext_l2_vreg __devinitdata = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2622 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2623 | .id = 91, |
| 2624 | .dev = { |
| 2625 | .platform_data = &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_L2], |
| 2626 | }, |
| 2627 | }; |
| 2628 | |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 2629 | static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = { |
| 2630 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2631 | .id = PM8921_GPIO_PM_TO_SYS(17), |
| 2632 | .dev = { |
| 2633 | .platform_data = |
| 2634 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V], |
| 2635 | }, |
| 2636 | }; |
| 2637 | |
David Collins | 35a78f5 | 2011-12-14 15:54:25 -0800 | [diff] [blame] | 2638 | static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = { |
| 2639 | .name = GPIO_REGULATOR_DEV_NAME, |
| 2640 | .id = PM8921_GPIO_PM_TO_SYS(42), |
| 2641 | .dev = { |
| 2642 | .platform_data = |
| 2643 | &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW], |
| 2644 | }, |
| 2645 | }; |
| 2646 | |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2647 | static struct platform_device msm8960_device_rpm_regulator __devinitdata = { |
| 2648 | .name = "rpm-regulator", |
| 2649 | .id = -1, |
| 2650 | .dev = { |
| 2651 | .platform_data = &msm_rpm_regulator_pdata, |
| 2652 | }, |
| 2653 | }; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2654 | #ifdef CONFIG_SERIAL_MSM_HS |
| 2655 | static int configure_uart_gpios(int on) |
| 2656 | { |
| 2657 | int ret = 0, i; |
| 2658 | int uart_gpios[] = {93, 94, 95, 96}; |
| 2659 | |
| 2660 | for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { |
| 2661 | if (on) { |
| 2662 | ret = gpio_request(uart_gpios[i], NULL); |
| 2663 | if (ret) { |
| 2664 | pr_err("%s: unable to request uart gpio[%d]\n", |
| 2665 | __func__, uart_gpios[i]); |
| 2666 | break; |
| 2667 | } |
| 2668 | } else { |
| 2669 | gpio_free(uart_gpios[i]); |
| 2670 | } |
| 2671 | } |
| 2672 | |
| 2673 | if (ret && on && i) |
| 2674 | for (; i >= 0; i--) |
| 2675 | gpio_free(uart_gpios[i]); |
| 2676 | return ret; |
| 2677 | } |
| 2678 | |
| 2679 | static struct msm_serial_hs_platform_data msm_uart_dm9_pdata = { |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 2680 | .gpio_config = configure_uart_gpios, |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2681 | }; |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 2682 | |
| 2683 | static int configure_gsbi8_uart_gpios(int on) |
| 2684 | { |
| 2685 | int ret = 0, i; |
| 2686 | int uart_gpios[] = {34, 35, 36, 37}; |
| 2687 | |
| 2688 | for (i = 0; i < ARRAY_SIZE(uart_gpios); i++) { |
| 2689 | if (on) { |
| 2690 | ret = gpio_request(uart_gpios[i], NULL); |
| 2691 | if (ret) { |
| 2692 | pr_err("%s: unable to request uart gpio[%d]\n", |
| 2693 | __func__, uart_gpios[i]); |
| 2694 | break; |
| 2695 | } |
| 2696 | } else { |
| 2697 | gpio_free(uart_gpios[i]); |
| 2698 | } |
| 2699 | } |
| 2700 | |
| 2701 | if (ret && on && i) |
| 2702 | for (; i >= 0; i--) |
| 2703 | gpio_free(uart_gpios[i]); |
| 2704 | return ret; |
| 2705 | } |
| 2706 | |
| 2707 | static struct msm_serial_hs_platform_data msm_uart_dm8_pdata = { |
| 2708 | .gpio_config = configure_gsbi8_uart_gpios, |
| 2709 | }; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2710 | #else |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 2711 | static struct msm_serial_hs_platform_data msm_uart_dm8_pdata; |
Mayank Rana | e009c92 | 2012-03-22 03:02:06 +0530 | [diff] [blame] | 2712 | static struct msm_serial_hs_platform_data msm_uart_dm9_pdata; |
| 2713 | #endif |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 2714 | |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2715 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2716 | enum WLANBT_STATUS { |
| 2717 | WLANOFF_BTOFF = 1, |
| 2718 | WLANOFF_BTON, |
| 2719 | WLANON_BTOFF, |
| 2720 | WLANON_BTON |
| 2721 | }; |
| 2722 | |
| 2723 | static DEFINE_MUTEX(ath_wlanbt_mutex); |
| 2724 | static int gpio_wlan_sys_rest_en = 26; |
| 2725 | static int ath_wlanbt_status = WLANOFF_BTOFF; |
| 2726 | |
| 2727 | static int ath6kl_power_control(int on) |
| 2728 | { |
| 2729 | int rc; |
| 2730 | |
| 2731 | if (on) { |
| 2732 | rc = gpio_request(gpio_wlan_sys_rest_en, "wlan sys_rst_n"); |
| 2733 | if (rc) { |
| 2734 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 2735 | __func__, gpio_wlan_sys_rest_en, rc); |
| 2736 | return rc; |
| 2737 | } |
| 2738 | rc = gpio_direction_output(gpio_wlan_sys_rest_en, 0); |
| 2739 | msleep(200); |
| 2740 | rc = gpio_direction_output(gpio_wlan_sys_rest_en, 1); |
| 2741 | msleep(100); |
| 2742 | } else { |
| 2743 | gpio_set_value(gpio_wlan_sys_rest_en, 0); |
| 2744 | rc = gpio_direction_input(gpio_wlan_sys_rest_en); |
| 2745 | msleep(100); |
| 2746 | gpio_free(gpio_wlan_sys_rest_en); |
| 2747 | } |
| 2748 | return 0; |
| 2749 | }; |
| 2750 | |
| 2751 | static int ath6kl_wlan_power(int on) |
| 2752 | { |
| 2753 | int ret = 0; |
| 2754 | |
| 2755 | mutex_lock(&ath_wlanbt_mutex); |
| 2756 | if (on) { |
| 2757 | if (ath_wlanbt_status == WLANOFF_BTOFF) { |
| 2758 | ret = ath6kl_power_control(1); |
| 2759 | ath_wlanbt_status = WLANON_BTOFF; |
| 2760 | } else if (ath_wlanbt_status == WLANOFF_BTON) |
| 2761 | ath_wlanbt_status = WLANON_BTON; |
| 2762 | } else { |
| 2763 | if (ath_wlanbt_status == WLANON_BTOFF) { |
| 2764 | ret = ath6kl_power_control(0); |
| 2765 | ath_wlanbt_status = WLANOFF_BTOFF; |
| 2766 | } else if (ath_wlanbt_status == WLANON_BTON) |
| 2767 | ath_wlanbt_status = WLANOFF_BTON; |
| 2768 | } |
| 2769 | mutex_unlock(&ath_wlanbt_mutex); |
| 2770 | pr_debug("%s on= %d, wlan_status= %d\n", |
| 2771 | __func__, on, ath_wlanbt_status); |
| 2772 | return ret; |
| 2773 | }; |
| 2774 | |
| 2775 | static struct wifi_platform_data ath6kl_wifi_control = { |
| 2776 | .set_power = ath6kl_wlan_power, |
| 2777 | }; |
| 2778 | |
| 2779 | static struct platform_device msm_wlan_power_device = { |
| 2780 | .name = "ath6kl_power", |
| 2781 | .dev = { |
| 2782 | .platform_data = &ath6kl_wifi_control, |
| 2783 | }, |
| 2784 | }; |
| 2785 | |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2786 | static struct resource bluesleep_resources[] = { |
| 2787 | { |
| 2788 | .name = "gpio_host_wake", |
| 2789 | .start = 27, |
| 2790 | .end = 27, |
| 2791 | .flags = IORESOURCE_IO, |
| 2792 | }, |
| 2793 | { |
| 2794 | .name = "gpio_ext_wake", |
| 2795 | .start = 29, |
| 2796 | .end = 29, |
| 2797 | .flags = IORESOURCE_IO, |
| 2798 | }, |
| 2799 | { |
| 2800 | .name = "host_wake", |
| 2801 | .start = MSM_GPIO_TO_INT(27), |
| 2802 | .end = MSM_GPIO_TO_INT(27), |
| 2803 | .flags = IORESOURCE_IRQ, |
| 2804 | }, |
| 2805 | }; |
| 2806 | |
| 2807 | static struct platform_device msm_bluesleep_device = { |
| 2808 | .name = "bluesleep", |
| 2809 | .id = -1, |
| 2810 | .num_resources = ARRAY_SIZE(bluesleep_resources), |
| 2811 | .resource = bluesleep_resources, |
| 2812 | }; |
| 2813 | |
| 2814 | static struct platform_device msm_bt_power_device = { |
| 2815 | .name = "bt_power", |
| 2816 | }; |
| 2817 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2818 | static int gpio_bt_sys_rest_en = 28; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2819 | |
| 2820 | static int bluetooth_power(int on) |
| 2821 | { |
| 2822 | int rc; |
| 2823 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2824 | mutex_lock(&ath_wlanbt_mutex); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2825 | if (on) { |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2826 | if (ath_wlanbt_status == WLANOFF_BTOFF) { |
| 2827 | ath6kl_power_control(1); |
| 2828 | ath_wlanbt_status = WLANOFF_BTON; |
| 2829 | } else if (ath_wlanbt_status == WLANON_BTOFF) |
| 2830 | ath_wlanbt_status = WLANON_BTON; |
| 2831 | |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2832 | rc = gpio_request(gpio_bt_sys_rest_en, "bt sys_rst_n"); |
| 2833 | if (rc) { |
| 2834 | pr_err("%s: unable to request gpio %d (%d)\n", |
| 2835 | __func__, gpio_bt_sys_rest_en, rc); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2836 | mutex_unlock(&ath_wlanbt_mutex); |
| 2837 | return rc; |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2838 | } |
| 2839 | rc = gpio_direction_output(gpio_bt_sys_rest_en, 0); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2840 | msleep(20); |
| 2841 | rc = gpio_direction_output(gpio_bt_sys_rest_en, 1); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2842 | msleep(100); |
| 2843 | } else { |
| 2844 | gpio_set_value(gpio_bt_sys_rest_en, 0); |
| 2845 | rc = gpio_direction_input(gpio_bt_sys_rest_en); |
| 2846 | msleep(100); |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2847 | gpio_free(gpio_bt_sys_rest_en); |
Ram Mohan Korukonda | c4cfb69 | 2012-08-18 22:24:03 +0530 | [diff] [blame] | 2848 | |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2849 | if (ath_wlanbt_status == WLANOFF_BTON) { |
| 2850 | ath6kl_power_control(0); |
| 2851 | ath_wlanbt_status = WLANOFF_BTOFF; |
| 2852 | } else if (ath_wlanbt_status == WLANON_BTON) |
| 2853 | ath_wlanbt_status = WLANON_BTOFF; |
| 2854 | } |
| 2855 | mutex_unlock(&ath_wlanbt_mutex); |
| 2856 | pr_debug("%s on= %d, wlan_status= %d\n", |
| 2857 | __func__, on, ath_wlanbt_status); |
| 2858 | return 0; |
| 2859 | }; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2860 | |
| 2861 | static void __init bt_power_init(void) |
| 2862 | { |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2863 | msm_bt_power_device.dev.platform_data = &bluetooth_power; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2864 | return; |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2865 | }; |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2866 | #else |
| 2867 | #define bt_power_init(x) do {} while (0) |
| 2868 | #endif |
| 2869 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2870 | static struct platform_device *common_devices[] __initdata = { |
Stepan Moskovchenko | df13d34 | 2011-08-03 19:01:25 -0700 | [diff] [blame] | 2871 | &msm8960_device_dmov, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2872 | &msm_device_smd, |
Mayank Rana | 9f51f58 | 2011-08-04 18:35:59 +0530 | [diff] [blame] | 2873 | &msm_device_uart_dm6, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2874 | &msm_device_saw_core0, |
| 2875 | &msm_device_saw_core1, |
| 2876 | &msm8960_device_ext_5v_vreg, |
David Collins | 8757961 | 2012-01-30 16:00:15 -0800 | [diff] [blame] | 2877 | &msm8960_device_ssbi_pmic, |
David Collins | 96aa3e1 | 2012-02-29 10:31:34 -0800 | [diff] [blame] | 2878 | &msm8960_device_ext_otg_sw_vreg, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2879 | &msm8960_device_qup_spi_gsbi1, |
| 2880 | &msm8960_device_qup_i2c_gsbi3, |
| 2881 | &msm8960_device_qup_i2c_gsbi4, |
| 2882 | &msm8960_device_qup_i2c_gsbi10, |
| 2883 | #ifndef CONFIG_MSM_DSPS |
| 2884 | &msm8960_device_qup_i2c_gsbi12, |
| 2885 | #endif |
| 2886 | &msm_slim_ctrl, |
| 2887 | &msm_device_wcnss_wlan, |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2888 | #if defined(CONFIG_BT) && defined(CONFIG_BT_HCIUART_ATH3K) |
| 2889 | &msm_bluesleep_device, |
| 2890 | &msm_bt_power_device, |
Ming-yi Lin | 9baad17 | 2012-10-17 11:50:15 +0800 | [diff] [blame] | 2891 | &msm_wlan_power_device, |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 2892 | #endif |
Ramesh Masavarapu | a26cce7 | 2012-04-09 12:32:25 -0700 | [diff] [blame] | 2893 | #if defined(CONFIG_QSEECOM) |
| 2894 | &qseecom_device, |
| 2895 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2896 | #if defined(CONFIG_CRYPTO_DEV_QCRYPTO) || \ |
| 2897 | defined(CONFIG_CRYPTO_DEV_QCRYPTO_MODULE) |
| 2898 | &qcrypto_device, |
| 2899 | #endif |
| 2900 | |
| 2901 | #if defined(CONFIG_CRYPTO_DEV_QCEDEV) || \ |
| 2902 | defined(CONFIG_CRYPTO_DEV_QCEDEV_MODULE) |
| 2903 | &qcedev_device, |
| 2904 | #endif |
| 2905 | #ifdef CONFIG_MSM_ROTATOR |
| 2906 | &msm_rotator_device, |
| 2907 | #endif |
| 2908 | &msm_device_sps, |
| 2909 | #ifdef CONFIG_MSM_FAKE_BATTERY |
| 2910 | &fish_battery_device, |
| 2911 | #endif |
Binqiang Qiu | f165c92 | 2012-08-15 18:00:18 -0700 | [diff] [blame] | 2912 | #ifdef CONFIG_BATTERY_BCL |
| 2913 | &battery_bcl_device, |
| 2914 | #endif |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2915 | &msm8960_fmem_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2916 | #ifdef CONFIG_ANDROID_PMEM |
Laura Abbott | 2d1760b | 2011-09-29 21:31:24 -0700 | [diff] [blame] | 2917 | #ifndef CONFIG_MSM_MULTIMEDIA_USE_ION |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2918 | &msm8960_android_pmem_device, |
| 2919 | &msm8960_android_pmem_adsp_device, |
| 2920 | &msm8960_android_pmem_audio_device, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2921 | #endif |
Bharath Ramachandramurthy | 4a3fa91 | 2012-03-13 19:16:24 -0700 | [diff] [blame] | 2922 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2923 | &msm_device_bam_dmux, |
| 2924 | &msm_fm_platform_init, |
Joel Nider | a126194 | 2011-09-12 16:30:09 +0300 | [diff] [blame] | 2925 | #if defined(CONFIG_TSIF) || defined(CONFIG_TSIF_MODULE) |
| 2926 | #ifdef CONFIG_MSM_USE_TSIF1 |
| 2927 | &msm_device_tsif[1], |
| 2928 | #else |
| 2929 | &msm_device_tsif[0], |
| 2930 | #endif |
| 2931 | #endif |
Joel Nider | 266a264 | 2011-10-16 10:58:05 +0200 | [diff] [blame] | 2932 | &msm_device_tspp, |
Mona Hossain | 9c430e3 | 2011-07-27 11:04:47 -0700 | [diff] [blame] | 2933 | #ifdef CONFIG_HW_RANDOM_MSM |
| 2934 | &msm_device_rng, |
| 2935 | #endif |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2936 | #ifdef CONFIG_ION_MSM |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2937 | &msm8960_ion_dev, |
Laura Abbott | d618379 | 2011-08-19 13:42:24 -0700 | [diff] [blame] | 2938 | #endif |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 2939 | &msm8960_rpm_device, |
| 2940 | &msm8960_rpm_log_device, |
| 2941 | &msm8960_rpm_stat_device, |
Anji Jonnala | 9312992 | 2012-10-09 20:57:53 +0530 | [diff] [blame] | 2942 | &msm8960_rpm_master_stat_device, |
Mona Hossain | 11c03ac | 2011-10-26 12:42:10 -0700 | [diff] [blame] | 2943 | &msm_device_tz_log, |
Pratik Patel | 3b0ca88 | 2012-06-01 16:54:14 -0700 | [diff] [blame] | 2944 | &coresight_tpiu_device, |
| 2945 | &coresight_etb_device, |
| 2946 | &coresight_funnel_device, |
| 2947 | &coresight_etm0_device, |
| 2948 | &coresight_etm1_device, |
Swaminathan Sathappan | b77c65e9 | 2011-09-30 18:36:09 -0700 | [diff] [blame] | 2949 | &msm_device_dspcrashd_8960, |
Jeff Ohlstein | 7e66855 | 2011-10-06 16:17:25 -0700 | [diff] [blame] | 2950 | &msm8960_device_watchdog, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2951 | &msm8960_rtb_device, |
Stepan Moskovchenko | 28662c5 | 2012-03-01 12:48:45 -0800 | [diff] [blame] | 2952 | &msm8960_device_cache_erp, |
Stepan Moskovchenko | c055725 | 2012-06-07 17:39:14 -0700 | [diff] [blame] | 2953 | &msm8960_device_ebi1_ch0_erp, |
| 2954 | &msm8960_device_ebi1_ch1_erp, |
Laura Abbott | b93525f | 2012-04-12 09:57:19 -0700 | [diff] [blame] | 2955 | &msm8960_cache_dump_device, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 2956 | &msm8960_iommu_domain_device, |
Siddartha Mohanadoss | 48cad91 | 2012-04-05 21:29:54 -0700 | [diff] [blame] | 2957 | &msm_tsens_device, |
Anji Jonnala | f91d897 | 2013-02-26 17:55:50 +0530 | [diff] [blame] | 2958 | &msm8960_cpu_slp_status, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2959 | }; |
| 2960 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2961 | static struct platform_device *cdp_devices[] __initdata = { |
Stephen Boyd | eb81988 | 2011-08-29 14:46:30 -0700 | [diff] [blame] | 2962 | &msm_8960_q6_lpass, |
Stephen Boyd | 322a992 | 2011-09-20 01:05:54 -0700 | [diff] [blame] | 2963 | &msm_8960_riva, |
Stephen Boyd | d89eebe | 2011-09-28 23:28:11 -0700 | [diff] [blame] | 2964 | &msm_pil_tzapps, |
Stephen Boyd | 25c4a0b | 2011-09-20 00:12:36 -0700 | [diff] [blame] | 2965 | &msm_pil_dsps, |
Stephen Boyd | 7b973de | 2012-03-09 12:26:16 -0800 | [diff] [blame] | 2966 | &msm_pil_vidc, |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 2967 | &msm8960_device_otg, |
| 2968 | &msm8960_device_gadget_peripheral, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2969 | &msm_device_hsusb_host, |
| 2970 | &android_usb_device, |
| 2971 | &msm_pcm, |
Kiran Kandi | 5e809b0 | 2012-01-31 00:24:33 -0800 | [diff] [blame] | 2972 | &msm_multi_ch_pcm, |
Jayasena Sangaraboina | 99bf09c | 2012-07-17 12:03:08 -0700 | [diff] [blame] | 2973 | &msm_lowlatency_pcm, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2974 | &msm_pcm_routing, |
| 2975 | &msm_cpudai0, |
| 2976 | &msm_cpudai1, |
Kiran Kandi | 97fe19d | 2012-05-20 22:34:04 -0700 | [diff] [blame] | 2977 | &msm8960_cpudai_slimbus_2_rx, |
Kiran Kandi | 1e6371d | 2012-03-29 11:48:57 -0700 | [diff] [blame] | 2978 | &msm8960_cpudai_slimbus_2_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2979 | &msm_cpudai_hdmi_rx, |
| 2980 | &msm_cpudai_bt_rx, |
| 2981 | &msm_cpudai_bt_tx, |
| 2982 | &msm_cpudai_fm_rx, |
| 2983 | &msm_cpudai_fm_tx, |
Bhalchandra Gajare | 0e795c4 | 2011-08-15 18:10:30 -0700 | [diff] [blame] | 2984 | &msm_cpudai_auxpcm_rx, |
| 2985 | &msm_cpudai_auxpcm_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2986 | &msm_cpu_fe, |
| 2987 | &msm_stub_codec, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2988 | #ifdef CONFIG_MSM_GEMINI |
| 2989 | &msm8960_gemini_device, |
| 2990 | #endif |
Kalyani Oruganti | 465d1e1 | 2012-05-15 10:23:05 -0700 | [diff] [blame] | 2991 | #ifdef CONFIG_MSM_MERCURY |
| 2992 | &msm8960_mercury_device, |
| 2993 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2994 | &msm_voice, |
| 2995 | &msm_voip, |
| 2996 | &msm_lpa_pcm, |
Laxminath Kasam | cee1d60 | 2011-08-01 19:26:57 +0530 | [diff] [blame] | 2997 | &msm_cpudai_afe_01_rx, |
| 2998 | &msm_cpudai_afe_01_tx, |
| 2999 | &msm_cpudai_afe_02_rx, |
| 3000 | &msm_cpudai_afe_02_tx, |
| 3001 | &msm_pcm_afe, |
Asish Bhattacharya | 96bb6f4 | 2011-11-01 20:36:09 +0530 | [diff] [blame] | 3002 | &msm_compr_dsp, |
Helen Zeng | 0705a5f | 2011-10-14 15:29:52 -0700 | [diff] [blame] | 3003 | &msm_cpudai_incall_music_rx, |
Helen Zeng | e3d716a | 2011-10-14 16:32:16 -0700 | [diff] [blame] | 3004 | &msm_cpudai_incall_record_rx, |
| 3005 | &msm_cpudai_incall_record_tx, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3006 | &msm_pcm_hostless, |
| 3007 | &msm_bus_apps_fabric, |
| 3008 | &msm_bus_sys_fabric, |
| 3009 | &msm_bus_mm_fabric, |
| 3010 | &msm_bus_sys_fpb, |
| 3011 | &msm_bus_cpss_fpb, |
| 3012 | }; |
| 3013 | |
| 3014 | static void __init msm8960_i2c_init(void) |
| 3015 | { |
Kiran Gunda | af3b356 | 2012-08-31 14:00:05 +0530 | [diff] [blame] | 3016 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 3017 | msm8960_i2c_qup_gsbi4_pdata.keep_ahb_clk_on = 1; |
| 3018 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3019 | msm8960_device_qup_i2c_gsbi4.dev.platform_data = |
| 3020 | &msm8960_i2c_qup_gsbi4_pdata; |
| 3021 | |
| 3022 | msm8960_device_qup_i2c_gsbi3.dev.platform_data = |
| 3023 | &msm8960_i2c_qup_gsbi3_pdata; |
| 3024 | |
| 3025 | msm8960_device_qup_i2c_gsbi10.dev.platform_data = |
| 3026 | &msm8960_i2c_qup_gsbi10_pdata; |
| 3027 | |
| 3028 | msm8960_device_qup_i2c_gsbi12.dev.platform_data = |
| 3029 | &msm8960_i2c_qup_gsbi12_pdata; |
| 3030 | } |
| 3031 | |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 3032 | static void __init msm8960_gfx_init(void) |
| 3033 | { |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 3034 | struct kgsl_device_platform_data *kgsl_3d0_pdata = |
| 3035 | msm_kgsl_3d0.dev.platform_data; |
Jeremy Gebben | 58b2dce | 2011-10-13 11:14:19 -0600 | [diff] [blame] | 3036 | uint32_t soc_platform_version = socinfo_get_version(); |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 3037 | |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 3038 | /* Fixup data that needs to change based on GPU ID */ |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 3039 | if (cpu_is_msm8960ab()) { |
| 3040 | kgsl_3d0_pdata->chipid = ADRENO_CHIPID(3, 2, 1, 0); |
Suman Tatiraju | 03a95db | 2012-10-29 18:24:53 -0700 | [diff] [blame] | 3041 | /* 8960PRO nominal clock rate is 320Mhz */ |
| 3042 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 320000000; |
Lucille Sylvester | 0a82ff2 | 2012-12-06 14:10:19 -0700 | [diff] [blame] | 3043 | #ifdef CONFIG_MSM_BUS_SCALING |
| 3044 | kgsl_3d0_pdata->bus_scale_table = &grp3d_bus_scale_pdata_ab; |
| 3045 | #endif |
Harsh Vardhan Dwivedi | 623b9a2 | 2012-10-28 20:54:17 -0600 | [diff] [blame] | 3046 | |
| 3047 | /* |
| 3048 | * If this an A320 GPU device (MSM8960AB), then |
| 3049 | * switch the resource table to 8960AB, to reflect the |
| 3050 | * separate register and shader memory mapping used in A320. |
| 3051 | */ |
| 3052 | |
| 3053 | msm_kgsl_3d0.num_resources = kgsl_num_resources_8960ab; |
| 3054 | msm_kgsl_3d0.resource = kgsl_3d0_resources_8960ab; |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 3055 | } else { |
| 3056 | kgsl_3d0_pdata->iommu_count = 1; |
Harsh Vardhan Dwivedi | 623b9a2 | 2012-10-28 20:54:17 -0600 | [diff] [blame] | 3057 | |
Carter Cooper | a4a7ed2 | 2012-08-20 22:11:42 -0600 | [diff] [blame] | 3058 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) == 1) { |
| 3059 | kgsl_3d0_pdata->pwrlevel[0].gpu_freq = 320000000; |
| 3060 | kgsl_3d0_pdata->pwrlevel[1].gpu_freq = 266667000; |
| 3061 | } |
| 3062 | if (SOCINFO_VERSION_MAJOR(soc_platform_version) >= 3) { |
| 3063 | /* 8960v3 GPU registers returns 5 for patch release |
| 3064 | * but it should be 6, so dummy up the chipid here |
| 3065 | * based the platform type |
| 3066 | */ |
| 3067 | kgsl_3d0_pdata->chipid = ADRENO_CHIPID(2, 2, 0, 6); |
| 3068 | } |
Jordan Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 3069 | } |
Carter Cooper | 83e9dab | 2012-08-20 15:17:23 -0600 | [diff] [blame] | 3070 | |
| 3071 | /* Register the 3D core */ |
| 3072 | platform_device_register(&msm_kgsl_3d0); |
| 3073 | |
| 3074 | /* Register the 2D cores if we are not 8960PRO */ |
| 3075 | if (!cpu_is_msm8960ab()) { |
| 3076 | platform_device_register(&msm_kgsl_2d0); |
| 3077 | platform_device_register(&msm_kgsl_2d1); |
| 3078 | } |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 3079 | } |
| 3080 | |
Subhash Jadavani | 933e6a6 | 2011-12-26 18:05:04 +0530 | [diff] [blame] | 3081 | static struct msm_rpmrs_level msm_rpmrs_levels[] = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3082 | { |
| 3083 | MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT, |
| 3084 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 3085 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3086 | 1, 784, 180000, 100, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3087 | }, |
| 3088 | |
| 3089 | { |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 3090 | MSM_PM_SLEEP_MODE_RETENTION, |
| 3091 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 3092 | true, |
| 3093 | 415, 715, 340827, 475, |
| 3094 | }, |
| 3095 | |
| 3096 | { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3097 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE_STANDALONE, |
| 3098 | MSM_RPMRS_LIMITS(ON, ACTIVE, MAX, ACTIVE), |
| 3099 | true, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3100 | 1300, 228, 1200000, 2000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3101 | }, |
| 3102 | |
| 3103 | { |
| 3104 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 3105 | MSM_RPMRS_LIMITS(ON, GDHS, MAX, ACTIVE), |
| 3106 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3107 | 2000, 138, 1208400, 3200, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3108 | }, |
| 3109 | |
| 3110 | { |
| 3111 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 3112 | MSM_RPMRS_LIMITS(ON, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 3113 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3114 | 6000, 119, 1850300, 9000, |
Maheshkumar Sivasubramanian | 7df1236 | 2011-11-02 08:25:49 -0600 | [diff] [blame] | 3115 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3116 | |
| 3117 | { |
| 3118 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 3119 | MSM_RPMRS_LIMITS(OFF, GDHS, MAX, ACTIVE), |
| 3120 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3121 | 9200, 68, 2839200, 16400, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3122 | }, |
| 3123 | |
| 3124 | { |
| 3125 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 3126 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, MAX, ACTIVE), |
| 3127 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3128 | 10300, 63, 3128000, 18200, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3129 | }, |
| 3130 | |
| 3131 | { |
| 3132 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 3133 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, ACTIVE, RET_HIGH), |
| 3134 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3135 | 18000, 10, 4602600, 27000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3136 | }, |
| 3137 | |
| 3138 | { |
| 3139 | MSM_PM_SLEEP_MODE_POWER_COLLAPSE, |
| 3140 | MSM_RPMRS_LIMITS(OFF, HSFS_OPEN, RET_HIGH, RET_LOW), |
| 3141 | false, |
Girish Mahadevan | 9bf7156 | 2012-04-13 14:41:44 -0600 | [diff] [blame] | 3142 | 20000, 2, 5752000, 32000, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3143 | }, |
| 3144 | }; |
| 3145 | |
Girish Mahadevan | 3bc9877 | 2012-08-15 10:01:27 -0600 | [diff] [blame] | 3146 | |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3147 | static struct msm_rpmrs_platform_data msm_rpmrs_data __initdata = { |
| 3148 | .levels = &msm_rpmrs_levels[0], |
| 3149 | .num_levels = ARRAY_SIZE(msm_rpmrs_levels), |
| 3150 | .vdd_mem_levels = { |
| 3151 | [MSM_RPMRS_VDD_MEM_RET_LOW] = 750000, |
| 3152 | [MSM_RPMRS_VDD_MEM_RET_HIGH] = 750000, |
| 3153 | [MSM_RPMRS_VDD_MEM_ACTIVE] = 1050000, |
| 3154 | [MSM_RPMRS_VDD_MEM_MAX] = 1150000, |
| 3155 | }, |
| 3156 | .vdd_dig_levels = { |
| 3157 | [MSM_RPMRS_VDD_DIG_RET_LOW] = 500000, |
| 3158 | [MSM_RPMRS_VDD_DIG_RET_HIGH] = 750000, |
| 3159 | [MSM_RPMRS_VDD_DIG_ACTIVE] = 950000, |
| 3160 | [MSM_RPMRS_VDD_DIG_MAX] = 1150000, |
| 3161 | }, |
| 3162 | .vdd_mask = 0x7FFFFF, |
| 3163 | .rpmrs_target_id = { |
| 3164 | [MSM_RPMRS_ID_PXO_CLK] = MSM_RPM_ID_PXO_CLK, |
| 3165 | [MSM_RPMRS_ID_L2_CACHE_CTL] = MSM_RPM_ID_LAST, |
| 3166 | [MSM_RPMRS_ID_VDD_DIG_0] = MSM_RPM_ID_PM8921_S3_0, |
| 3167 | [MSM_RPMRS_ID_VDD_DIG_1] = MSM_RPM_ID_PM8921_S3_1, |
| 3168 | [MSM_RPMRS_ID_VDD_MEM_0] = MSM_RPM_ID_PM8921_L24_0, |
| 3169 | [MSM_RPMRS_ID_VDD_MEM_1] = MSM_RPM_ID_PM8921_L24_1, |
| 3170 | [MSM_RPMRS_ID_RPM_CTL] = MSM_RPM_ID_RPM_CTL, |
| 3171 | }, |
| 3172 | }; |
| 3173 | |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 3174 | static struct msm_pm_boot_platform_data msm_pm_boot_pdata __initdata = { |
| 3175 | .mode = MSM_PM_BOOT_CONFIG_TZ, |
| 3176 | }; |
| 3177 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3178 | #ifdef CONFIG_I2C |
| 3179 | #define I2C_SURF 1 |
| 3180 | #define I2C_FFA (1 << 1) |
| 3181 | #define I2C_RUMI (1 << 2) |
| 3182 | #define I2C_SIM (1 << 3) |
| 3183 | #define I2C_FLUID (1 << 4) |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 3184 | #define I2C_LIQUID (1 << 5) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3185 | |
| 3186 | struct i2c_registry { |
| 3187 | u8 machs; |
| 3188 | int bus; |
| 3189 | struct i2c_board_info *info; |
| 3190 | int len; |
| 3191 | }; |
| 3192 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3193 | /* Sensors DSPS platform data */ |
| 3194 | #ifdef CONFIG_MSM_DSPS |
| 3195 | #define DSPS_PIL_GENERIC_NAME "dsps" |
| 3196 | #endif /* CONFIG_MSM_DSPS */ |
| 3197 | |
| 3198 | static void __init msm8960_init_dsps(void) |
| 3199 | { |
| 3200 | #ifdef CONFIG_MSM_DSPS |
| 3201 | struct msm_dsps_platform_data *pdata = |
| 3202 | msm_dsps_device.dev.platform_data; |
| 3203 | pdata->pil_name = DSPS_PIL_GENERIC_NAME; |
| 3204 | pdata->gpios = NULL; |
| 3205 | pdata->gpios_num = 0; |
| 3206 | |
| 3207 | platform_device_register(&msm_dsps_device); |
| 3208 | #endif /* CONFIG_MSM_DSPS */ |
| 3209 | } |
| 3210 | |
Vamsi Krishna | 6aa6b1f | 2011-12-14 22:55:20 -0800 | [diff] [blame] | 3211 | static int hsic_peripheral_status = 1; |
| 3212 | static DEFINE_MUTEX(hsic_status_lock); |
| 3213 | |
| 3214 | void peripheral_connect() |
| 3215 | { |
| 3216 | mutex_lock(&hsic_status_lock); |
| 3217 | if (hsic_peripheral_status) |
| 3218 | goto out; |
| 3219 | platform_device_add(&msm_device_hsic_host); |
| 3220 | hsic_peripheral_status = 1; |
| 3221 | out: |
| 3222 | mutex_unlock(&hsic_status_lock); |
| 3223 | } |
| 3224 | EXPORT_SYMBOL(peripheral_connect); |
| 3225 | |
| 3226 | void peripheral_disconnect() |
| 3227 | { |
| 3228 | mutex_lock(&hsic_status_lock); |
| 3229 | if (!hsic_peripheral_status) |
| 3230 | goto out; |
| 3231 | platform_device_del(&msm_device_hsic_host); |
| 3232 | hsic_peripheral_status = 0; |
| 3233 | out: |
| 3234 | mutex_unlock(&hsic_status_lock); |
| 3235 | } |
| 3236 | EXPORT_SYMBOL(peripheral_disconnect); |
| 3237 | |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3238 | static void __init msm8960_init_smsc_hub(void) |
| 3239 | { |
| 3240 | uint32_t version = socinfo_get_version(); |
| 3241 | |
| 3242 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
| 3243 | return; |
| 3244 | |
| 3245 | if (machine_is_msm8960_liquid()) |
| 3246 | platform_device_register(&smsc_hub_device); |
| 3247 | } |
| 3248 | |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3249 | static void __init msm8960_init_hsic(void) |
| 3250 | { |
| 3251 | #ifdef CONFIG_USB_EHCI_MSM_HSIC |
| 3252 | uint32_t version = socinfo_get_version(); |
| 3253 | |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 3254 | if (SOCINFO_VERSION_MAJOR(version) == 1) |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3255 | return; |
| 3256 | |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 3257 | if (machine_is_msm8960_liquid()) |
Vamsi Krishna | f74d2edb | 2011-12-02 10:41:11 -0800 | [diff] [blame] | 3258 | platform_device_register(&msm_device_hsic_host); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3259 | #endif |
| 3260 | } |
| 3261 | |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3262 | #ifdef CONFIG_ISL9519_CHARGER |
| 3263 | static struct isl_platform_data isl_data __initdata = { |
| 3264 | .valid_n_gpio = 0, /* Not required when notify-by-pmic */ |
| 3265 | .chg_detection_config = NULL, /* Not required when notify-by-pmic */ |
| 3266 | .max_system_voltage = 4200, |
| 3267 | .min_system_voltage = 3200, |
Amir Samuelov | 95f49ff | 2012-01-29 09:14:08 +0200 | [diff] [blame] | 3268 | .chgcurrent = 1900, |
| 3269 | .term_current = 0, |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3270 | .input_current = 2048, |
| 3271 | }; |
| 3272 | |
| 3273 | static struct i2c_board_info isl_charger_i2c_info[] __initdata = { |
| 3274 | { |
| 3275 | I2C_BOARD_INFO("isl9519q", 0x9), |
| 3276 | .irq = 0, /* Not required when notify-by-pmic */ |
| 3277 | .platform_data = &isl_data, |
| 3278 | }, |
| 3279 | }; |
| 3280 | #endif /* CONFIG_ISL9519_CHARGER */ |
| 3281 | |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 3282 | static struct i2c_board_info liquid_io_expander_i2c_info[] __initdata = { |
| 3283 | { |
| 3284 | I2C_BOARD_INFO("sx1508q", 0x20), |
| 3285 | .platform_data = &msm8960_sx150x_data[SX150X_LIQUID] |
| 3286 | }, |
| 3287 | }; |
| 3288 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3289 | static struct i2c_registry msm8960_i2c_devices[] __initdata = { |
Amir Samuelov | 5137e39 | 2011-09-21 17:31:25 +0300 | [diff] [blame] | 3290 | #ifdef CONFIG_ISL9519_CHARGER |
| 3291 | { |
| 3292 | I2C_LIQUID, |
| 3293 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 3294 | isl_charger_i2c_info, |
| 3295 | ARRAY_SIZE(isl_charger_i2c_info), |
| 3296 | }, |
| 3297 | #endif /* CONFIG_ISL9519_CHARGER */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3298 | { |
| 3299 | I2C_SURF | I2C_FFA | I2C_FLUID, |
| 3300 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 3301 | cyttsp_info, |
| 3302 | ARRAY_SIZE(cyttsp_info), |
Rohit Vaswani | cd2a59b | 2011-07-19 12:00:48 -0700 | [diff] [blame] | 3303 | }, |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 3304 | { |
| 3305 | I2C_LIQUID, |
| 3306 | MSM_8960_GSBI3_QUP_I2C_BUS_ID, |
| 3307 | mxt_device_info, |
| 3308 | ARRAY_SIZE(mxt_device_info), |
| 3309 | }, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3310 | { |
Manoj Rao | 1464874 | 2012-03-30 19:42:12 -0700 | [diff] [blame] | 3311 | I2C_SURF | I2C_FFA | I2C_LIQUID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3312 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 3313 | sii_device_info, |
| 3314 | ARRAY_SIZE(sii_device_info), |
| 3315 | }, |
| 3316 | { |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 3317 | I2C_LIQUID | I2C_FFA, |
Eugene Yasman | d2316b8 | 2011-12-07 18:23:48 +0200 | [diff] [blame] | 3318 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
Mohan Pallaka | 5e49039 | 2011-09-09 15:18:41 +0530 | [diff] [blame] | 3319 | msm_isa1200_board_info, |
| 3320 | ARRAY_SIZE(msm_isa1200_board_info), |
| 3321 | }, |
Amir Samuelov | 755616d | 2011-12-13 16:34:46 +0200 | [diff] [blame] | 3322 | { |
| 3323 | I2C_LIQUID, |
| 3324 | MSM_8960_GSBI10_QUP_I2C_BUS_ID, |
| 3325 | liquid_io_expander_i2c_info, |
| 3326 | ARRAY_SIZE(liquid_io_expander_i2c_info), |
| 3327 | }, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3328 | }; |
| 3329 | #endif /* CONFIG_I2C */ |
| 3330 | |
| 3331 | static void __init register_i2c_devices(void) |
| 3332 | { |
| 3333 | #ifdef CONFIG_I2C |
| 3334 | u8 mach_mask = 0; |
| 3335 | int i; |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 3336 | #ifdef CONFIG_MSM_CAMERA |
| 3337 | struct i2c_registry msm8960_camera_i2c_devices = { |
| 3338 | I2C_SURF | I2C_FFA | I2C_FLUID | I2C_LIQUID | I2C_RUMI, |
| 3339 | MSM_8960_GSBI4_QUP_I2C_BUS_ID, |
| 3340 | msm8960_camera_board_info.board_info, |
| 3341 | msm8960_camera_board_info.num_i2c_board_info, |
| 3342 | }; |
| 3343 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3344 | |
| 3345 | /* Build the matching 'supported_machs' bitmask */ |
| 3346 | if (machine_is_msm8960_cdp()) |
| 3347 | mach_mask = I2C_SURF; |
Amy Maloche | 2d02803 | 2011-07-20 14:08:06 -0700 | [diff] [blame] | 3348 | else if (machine_is_msm8960_fluid()) |
| 3349 | mach_mask = I2C_FLUID; |
Amir Samuelov | 05f8780 | 2011-08-27 18:30:12 +0300 | [diff] [blame] | 3350 | else if (machine_is_msm8960_liquid()) |
| 3351 | mach_mask = I2C_LIQUID; |
Amy Maloche | 1b0663f | 2011-08-02 16:46:22 -0700 | [diff] [blame] | 3352 | else if (machine_is_msm8960_mtp()) |
| 3353 | mach_mask = I2C_FFA; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3354 | else |
| 3355 | pr_err("unmatched machine ID in register_i2c_devices\n"); |
| 3356 | |
Jing Lin | eec88ca | 2012-02-08 11:18:30 -0800 | [diff] [blame] | 3357 | if (machine_is_msm8960_liquid()) { |
| 3358 | if (SOCINFO_VERSION_MAJOR(socinfo_get_platform_version()) == 3) |
| 3359 | mxt_device_info[0].platform_data = |
| 3360 | &mxt_platform_data_3d; |
| 3361 | else |
| 3362 | mxt_device_info[0].platform_data = |
| 3363 | &mxt_platform_data_2d; |
| 3364 | } |
| 3365 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3366 | /* Run the array and install devices as appropriate */ |
| 3367 | for (i = 0; i < ARRAY_SIZE(msm8960_i2c_devices); ++i) { |
| 3368 | if (msm8960_i2c_devices[i].machs & mach_mask) |
| 3369 | i2c_register_board_info(msm8960_i2c_devices[i].bus, |
| 3370 | msm8960_i2c_devices[i].info, |
| 3371 | msm8960_i2c_devices[i].len); |
| 3372 | } |
Manoj Rao | c6d904c | 2012-06-22 00:32:14 -0700 | [diff] [blame] | 3373 | |
| 3374 | if (!mhl_platform_data.gpio_mhl_power) |
| 3375 | pr_debug("mhl device configured for ext debug board\n"); |
| 3376 | |
Kevin Chan | 09f4e66 | 2011-12-16 08:17:02 -0800 | [diff] [blame] | 3377 | #ifdef CONFIG_MSM_CAMERA |
| 3378 | if (msm8960_camera_i2c_devices.machs & mach_mask) |
| 3379 | i2c_register_board_info(msm8960_camera_i2c_devices.bus, |
| 3380 | msm8960_camera_i2c_devices.info, |
| 3381 | msm8960_camera_i2c_devices.len); |
| 3382 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3383 | #endif |
| 3384 | } |
| 3385 | |
Siddartha Mohanadoss | 30447fe | 2012-09-26 09:42:32 -0700 | [diff] [blame] | 3386 | static void __init msm8960_tsens_init(void) |
| 3387 | { |
| 3388 | if (cpu_is_msm8960()) |
| 3389 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) == 1) |
| 3390 | return; |
| 3391 | |
| 3392 | msm_tsens_early_init(&msm_tsens_pdata); |
| 3393 | } |
| 3394 | |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3395 | static void __init msm8960ab_update_krait_spm(void) |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3396 | { |
| 3397 | int i; |
| 3398 | |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3399 | /* Update the SPM sequences for SPC and PC */ |
| 3400 | for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) { |
| 3401 | int j; |
| 3402 | struct msm_spm_platform_data *pdata = &msm_spm_data[i]; |
| 3403 | for (j = 0; j < pdata->num_modes; j++) { |
| 3404 | if (pdata->modes[j].cmd == |
| 3405 | spm_power_collapse_without_rpm) |
| 3406 | pdata->modes[j].cmd = |
| 3407 | spm_power_collapse_without_rpm_krait_v3; |
| 3408 | else if (pdata->modes[j].cmd == |
| 3409 | spm_power_collapse_with_rpm) |
| 3410 | pdata->modes[j].cmd = |
| 3411 | spm_power_collapse_with_rpm_krait_v3; |
| 3412 | } |
| 3413 | } |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3414 | } |
| 3415 | |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3416 | static void __init msm8960ab_update_retention_spm(void) |
| 3417 | { |
| 3418 | int i; |
| 3419 | |
| 3420 | /* Update the SPM sequences for krait retention on all cores */ |
| 3421 | for (i = 0; i < ARRAY_SIZE(msm_spm_data); i++) { |
| 3422 | int j; |
| 3423 | struct msm_spm_platform_data *pdata = &msm_spm_data[i]; |
| 3424 | for (j = 0; j < pdata->num_modes; j++) { |
| 3425 | if (pdata->modes[j].cmd == |
| 3426 | spm_retention_cmd_sequence) |
| 3427 | pdata->modes[j].cmd = |
| 3428 | spm_retention_with_krait_v3_cmd_sequence; |
| 3429 | } |
| 3430 | } |
| 3431 | } |
| 3432 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3433 | static void __init msm8960_cdp_init(void) |
| 3434 | { |
Naveen Ramaraj | 76483ad | 2011-09-06 14:25:44 -0700 | [diff] [blame] | 3435 | if (meminfo_init(SYS_MEMORY, SZ_256M) < 0) |
| 3436 | pr_err("meminfo_init() failed!\n"); |
| 3437 | |
Rohit Vaswani | b1cc493 | 2012-07-23 21:30:11 -0700 | [diff] [blame] | 3438 | platform_device_register(&msm_gpio_device); |
Siddartha Mohanadoss | 30447fe | 2012-09-26 09:42:32 -0700 | [diff] [blame] | 3439 | msm8960_tsens_init(); |
Praveen Chidambaram | 877d7a4 | 2012-06-05 14:33:20 -0600 | [diff] [blame] | 3440 | msm_thermal_init(&msm_thermal_pdata); |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 3441 | BUG_ON(msm_rpm_init(&msm8960_rpm_data)); |
| 3442 | BUG_ON(msm_rpmrs_levels_init(&msm_rpmrs_data)); |
Abhijeet Dharmapurikar | 6d565fd | 2011-09-15 18:49:56 -0700 | [diff] [blame] | 3443 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3444 | regulator_suppress_info_printing(); |
| 3445 | if (msm_xo_init()) |
| 3446 | pr_err("Failed to initialize XO votes\n"); |
David Collins | e68647e | 2012-09-04 15:44:19 -0700 | [diff] [blame] | 3447 | configure_msm8960_power_grid(); |
David Collins | 26f0556 | 2011-06-20 09:56:28 -0700 | [diff] [blame] | 3448 | platform_device_register(&msm8960_device_rpm_regulator); |
Stephen Boyd | bb600ae | 2011-08-02 20:11:40 -0700 | [diff] [blame] | 3449 | msm_clock_init(&msm8960_clock_init_data); |
Vijayavardhan Vennapusa | fc464f0 | 2011-11-04 21:54:00 +0530 | [diff] [blame] | 3450 | if (machine_is_msm8960_liquid()) |
| 3451 | msm_otg_pdata.mhl_enable = true; |
Stepan Moskovchenko | 14aa649 | 2011-08-08 15:15:01 -0700 | [diff] [blame] | 3452 | msm8960_device_otg.dev.platform_data = &msm_otg_pdata; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 3453 | if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() || |
| 3454 | machine_is_msm8960_cdp()) { |
Mayank Rana | a61da7a | 2012-08-14 10:57:00 +0530 | [diff] [blame] | 3455 | /* Due to availability of USB Switch in SGLTE Platform |
| 3456 | * it requires different HSUSB PHY settings compare to |
| 3457 | * 8960 MTP/CDP platform. |
| 3458 | */ |
| 3459 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 3460 | msm_otg_pdata.phy_init_seq = sglte_phy_init_seq; |
| 3461 | else |
| 3462 | msm_otg_pdata.phy_init_seq = wr_phy_init_seq; |
Anji jonnala | a8b8d73 | 2011-12-06 10:03:24 +0530 | [diff] [blame] | 3463 | } else if (machine_is_msm8960_liquid()) { |
| 3464 | msm_otg_pdata.phy_init_seq = |
| 3465 | liquid_v1_phy_init_seq; |
| 3466 | } |
Ofir Cohen | 94213a7 | 2012-05-03 14:26:32 +0300 | [diff] [blame] | 3467 | android_usb_pdata.swfi_latency = |
Anji jonnala | a7c1c5c | 2011-12-12 12:20:36 +0530 | [diff] [blame] | 3468 | msm_rpmrs_levels[0].latency_us; |
Vijayavardhan Vennapusa | e3316a1 | 2011-10-15 06:05:17 +0530 | [diff] [blame] | 3469 | msm_device_hsic_host.dev.platform_data = &msm_hsic_pdata; |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3470 | if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2 && |
| 3471 | machine_is_msm8960_liquid()) |
| 3472 | msm_device_hsic_host.dev.parent = &smsc_hub_device.dev; |
Stepan Moskovchenko | 3b09bf5 | 2011-12-06 20:40:53 -0800 | [diff] [blame] | 3473 | msm8960_init_gpiomux(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3474 | msm8960_device_qup_spi_gsbi1.dev.platform_data = |
| 3475 | &msm8960_qup_spi_gsbi1_pdata; |
| 3476 | spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info)); |
Anirudh Ghayal | 50137fb | 2012-07-31 16:58:53 +0530 | [diff] [blame] | 3477 | if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE) |
| 3478 | spi_register_board_info(spi_eth_info, ARRAY_SIZE(spi_eth_info)); |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 3479 | |
| 3480 | msm8960_init_pmic(); |
Anirudh Ghayal | 1569816 | 2012-07-31 11:51:32 +0530 | [diff] [blame] | 3481 | if (machine_is_msm8960_liquid() || (machine_is_msm8960_mtp() && |
Shantanu Jain | ae54a62 | 2012-12-03 15:09:39 +0530 | [diff] [blame] | 3482 | (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE || |
| 3483 | cpu_is_msm8960ab()))) |
Mohan Pallaka | f69f049 | 2011-11-21 13:08:33 +0530 | [diff] [blame] | 3484 | msm_isa1200_board_info[0].platform_data = &isa1200_1_pdata; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3485 | msm8960_i2c_init(); |
Lucille Sylvester | 34ec369 | 2011-08-16 16:28:04 -0600 | [diff] [blame] | 3486 | msm8960_gfx_init(); |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3487 | |
| 3488 | if (cpu_is_msm8960ab()) |
Praveen Chidambaram | c3c9082 | 2012-11-07 15:43:49 -0700 | [diff] [blame] | 3489 | msm8960ab_update_krait_spm(); |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3490 | if (cpu_is_krait_v3()) { |
Praveen Chidambaram | f27a515 | 2013-02-01 11:44:53 -0700 | [diff] [blame] | 3491 | struct msm_pm_init_data_type *pdata = |
| 3492 | msm8960_pm_8x60.dev.platform_data; |
| 3493 | pdata->retention_calls_tz = false; |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3494 | msm8960ab_update_retention_spm(); |
Anji Jonnala | 1a1711a | 2013-01-29 13:34:10 +0530 | [diff] [blame] | 3495 | } |
Praveen Chidambaram | f27a515 | 2013-02-01 11:44:53 -0700 | [diff] [blame] | 3496 | platform_device_register(&msm8960_pm_8x60); |
| 3497 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3498 | msm_spm_init(msm_spm_data, ARRAY_SIZE(msm_spm_data)); |
| 3499 | msm_spm_l2_init(msm_spm_l2_data); |
Mahesh Sivasubramanian | c5c82f4 | 2012-10-22 13:33:59 -0600 | [diff] [blame] | 3500 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3501 | msm8960_init_buses(); |
Stephen Boyd | 913c29d | 2012-10-25 11:46:04 -0700 | [diff] [blame] | 3502 | if (cpu_is_msm8960ab()) { |
| 3503 | platform_add_devices(msm8960ab_footswitch, |
| 3504 | msm8960ab_num_footswitch); |
| 3505 | } else { |
| 3506 | platform_add_devices(msm8960_footswitch, |
| 3507 | msm8960_num_footswitch); |
| 3508 | } |
David Collins | b10be1d | 2011-09-02 10:29:31 -0700 | [diff] [blame] | 3509 | if (machine_is_msm8960_liquid()) |
| 3510 | platform_device_register(&msm8960_device_ext_3p3v_vreg); |
David Collins | d5a4073 | 2011-11-29 15:53:56 -0800 | [diff] [blame] | 3511 | if (machine_is_msm8960_cdp()) |
| 3512 | platform_device_register(&msm8960_device_ext_l2_vreg); |
Stepan Moskovchenko | 2b4b1cd | 2012-03-29 18:21:04 -0700 | [diff] [blame] | 3513 | |
| 3514 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) |
| 3515 | platform_device_register(&msm8960_device_uart_gsbi8); |
| 3516 | else |
| 3517 | platform_device_register(&msm8960_device_uart_gsbi5); |
| 3518 | |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3519 | /* For 8960 Fusion 2.2 Primary IPC */ |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 3520 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) { |
| 3521 | msm_uart_dm9_pdata.wakeup_irq = gpio_to_irq(94); /* GSBI9(2) */ |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3522 | msm_device_uart_dm9.dev.platform_data = &msm_uart_dm9_pdata; |
Mayank Rana | 77f83c2 | 2012-07-10 09:31:02 +0530 | [diff] [blame] | 3523 | platform_device_register(&msm_device_uart_dm9); |
Mayank Rana | d85a508 | 2012-04-29 17:24:13 -0700 | [diff] [blame] | 3524 | } |
Mayank Rana | a7f75a6 | 2012-04-21 10:09:42 -0700 | [diff] [blame] | 3525 | |
Mayank Rana | 1f02d95 | 2012-07-04 19:11:20 +0530 | [diff] [blame] | 3526 | /* For 8960 Standalone External Bluetooth Interface */ |
| 3527 | if (socinfo_get_platform_subtype() != PLATFORM_SUBTYPE_SGLTE) { |
| 3528 | msm_device_uart_dm8.dev.platform_data = &msm_uart_dm8_pdata; |
| 3529 | platform_device_register(&msm_device_uart_dm8); |
| 3530 | } |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 3531 | if (cpu_is_msm8960ab()) |
| 3532 | platform_device_register(&msm8960ab_device_acpuclk); |
| 3533 | else |
| 3534 | platform_device_register(&msm8960_device_acpuclk); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3535 | platform_add_devices(common_devices, ARRAY_SIZE(common_devices)); |
Arun Menon | 697e91b | 2012-08-20 15:25:50 -0700 | [diff] [blame] | 3536 | msm8960_add_vidc_device(); |
Patrick Daly | 6578e0c | 2012-07-19 18:50:02 -0700 | [diff] [blame] | 3537 | |
Stepan Moskovchenko | ef1e0b6 | 2011-12-01 12:10:16 -0800 | [diff] [blame] | 3538 | msm8960_pm8921_gpio_mpp_init(); |
Stephen Boyd | ed03568 | 2012-09-13 12:41:31 -0700 | [diff] [blame] | 3539 | /* Don't add modem devices on APQ targets */ |
Stephen Boyd | bdb53f3 | 2012-06-05 18:39:47 -0700 | [diff] [blame] | 3540 | if (socinfo_get_id() != 124) |
| 3541 | platform_device_register(&msm_8960_q6_mss); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3542 | platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices)); |
Vijayavardhan Vennapusa | afbbb8f | 2012-04-13 16:28:45 +0530 | [diff] [blame] | 3543 | msm8960_init_smsc_hub(); |
Vamsi Krishna | 98f54fb | 2011-11-02 14:55:41 -0700 | [diff] [blame] | 3544 | msm8960_init_hsic(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3545 | #ifdef CONFIG_MSM_CAMERA |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3546 | msm8960_init_cam(); |
Steve Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 3547 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3548 | msm8960_init_mmc(); |
Mohan Pallaka | 5083738 | 2011-09-07 11:00:57 +0530 | [diff] [blame] | 3549 | if (machine_is_msm8960_liquid()) |
| 3550 | mxt_init_hw_liquid(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3551 | register_i2c_devices(); |
Stepan Moskovchenko | 24cd864 | 2011-11-29 13:07:53 -0800 | [diff] [blame] | 3552 | msm8960_init_fb(); |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3553 | slim_register_board_info(msm_slim_devices, |
| 3554 | ARRAY_SIZE(msm_slim_devices)); |
| 3555 | msm8960_init_dsps(); |
Larry Bassel | a7eadea | 2011-07-14 10:46:00 -0700 | [diff] [blame] | 3556 | change_memory_power = &msm8960_change_memory_power; |
Maheshkumar Sivasubramanian | c6c5503 | 2011-10-25 16:01:32 -0600 | [diff] [blame] | 3557 | BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata)); |
Ram Mohan Korukonda | ce14bd8 | 2012-07-11 13:55:52 +0530 | [diff] [blame] | 3558 | bt_power_init(); |
Joel King | 0cbf5d8 | 2012-05-24 15:21:38 -0700 | [diff] [blame] | 3559 | if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_SGLTE) { |
| 3560 | mdm_sglte_device.dev.platform_data = &sglte_platform_data; |
| 3561 | platform_device_register(&mdm_sglte_device); |
| 3562 | } |
Laura Abbott | ac96331 | 2012-12-11 15:09:03 -0800 | [diff] [blame] | 3563 | ion_adjust_secure_allocation(); |
Stepan Moskovchenko | d056fca | 2011-01-27 12:12:07 -0800 | [diff] [blame] | 3564 | } |
| 3565 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3566 | MACHINE_START(MSM8960_CDP, "QCT MSM8960 CDP") |
| 3567 | .map_io = msm8960_map_io, |
| 3568 | .reserve = msm8960_reserve, |
| 3569 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3570 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3571 | .timer = &msm_timer, |
| 3572 | .init_machine = msm8960_cdp_init, |
| 3573 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3574 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3575 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3576 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3577 | MACHINE_END |
| 3578 | |
| 3579 | MACHINE_START(MSM8960_MTP, "QCT MSM8960 MTP") |
| 3580 | .map_io = msm8960_map_io, |
| 3581 | .reserve = msm8960_reserve, |
| 3582 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3583 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3584 | .timer = &msm_timer, |
| 3585 | .init_machine = msm8960_cdp_init, |
| 3586 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3587 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3588 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3589 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3590 | MACHINE_END |
| 3591 | |
| 3592 | MACHINE_START(MSM8960_FLUID, "QCT MSM8960 FLUID") |
| 3593 | .map_io = msm8960_map_io, |
| 3594 | .reserve = msm8960_reserve, |
| 3595 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3596 | .handle_irq = gic_handle_irq, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3597 | .timer = &msm_timer, |
| 3598 | .init_machine = msm8960_cdp_init, |
| 3599 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3600 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3601 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3602 | .smp = &msm8960_smp_ops, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 3603 | MACHINE_END |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3604 | |
| 3605 | MACHINE_START(MSM8960_LIQUID, "QCT MSM8960 LIQUID") |
| 3606 | .map_io = msm8960_map_io, |
| 3607 | .reserve = msm8960_reserve, |
| 3608 | .init_irq = msm8960_init_irq, |
Marc Zyngier | 89bdafd1 | 2011-12-22 11:39:20 +0530 | [diff] [blame] | 3609 | .handle_irq = gic_handle_irq, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3610 | .timer = &msm_timer, |
| 3611 | .init_machine = msm8960_cdp_init, |
| 3612 | .init_early = msm8960_allocate_memory_regions, |
Larry Bassel | b830e18 | 2011-10-14 10:46:55 -0700 | [diff] [blame] | 3613 | .init_very_early = msm8960_early_memory, |
Jeff Ohlstein | dd0dd9b | 2012-05-29 17:47:21 -0700 | [diff] [blame] | 3614 | .restart = msm_restart, |
Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 3615 | .smp = &msm8960_smp_ops, |
Amir Samuelov | 0d1f8ae | 2011-07-28 11:13:58 +0300 | [diff] [blame] | 3616 | MACHINE_END |