| Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 2 | * | 
|  | 3 | * This program is free software; you can redistribute it and/or modify | 
|  | 4 | * it under the terms of the GNU General Public License version 2 and | 
|  | 5 | * only version 2 as published by the Free Software Foundation. | 
|  | 6 | * | 
|  | 7 | * This program is distributed in the hope that it will be useful, | 
|  | 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|  | 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|  | 10 | * GNU General Public License for more details. | 
|  | 11 | */ | 
|  | 12 |  | 
| Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 13 | #include <linux/err.h> | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 14 | #include <linux/kernel.h> | 
|  | 15 | #include <linux/platform_device.h> | 
|  | 16 | #include <linux/io.h> | 
|  | 17 | #include <linux/irq.h> | 
|  | 18 | #include <linux/irqdomain.h> | 
|  | 19 | #include <linux/of.h> | 
|  | 20 | #include <linux/of_address.h> | 
|  | 21 | #include <linux/of_platform.h> | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 22 | #include <linux/memory.h> | 
|  | 23 | #ifdef CONFIG_ANDROID_PMEM | 
|  | 24 | #include <linux/android_pmem.h> | 
|  | 25 | #endif | 
| Matt Wagantall | ecaa117 | 2012-05-08 21:38:45 -0700 | [diff] [blame] | 26 | #include <linux/regulator/machine.h> | 
| Michael Bohan | 2a46832 | 2012-08-14 17:06:34 -0700 | [diff] [blame] | 27 | #include <linux/regulator/krait-regulator.h> | 
| Eugene Seah | ce52ef2 | 2012-07-12 12:40:38 -0600 | [diff] [blame] | 28 | #include <linux/msm_thermal.h> | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 29 | #include <asm/mach/map.h> | 
|  | 30 | #include <asm/hardware/gic.h> | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 31 | #include <asm/mach/map.h> | 
|  | 32 | #include <asm/mach/arch.h> | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 33 | #include <mach/board.h> | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 34 | #include <mach/gpiomux.h> | 
|  | 35 | #include <mach/msm_iomap.h> | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 36 | #ifdef CONFIG_ION_MSM | 
|  | 37 | #include <mach/ion.h> | 
|  | 38 | #endif | 
|  | 39 | #include <mach/msm_memtypes.h> | 
| Jeff Hugo | 7094609 | 2012-02-10 11:30:43 -0700 | [diff] [blame] | 40 | #include <mach/msm_smd.h> | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 41 | #include <mach/restart.h> | 
| Mahesh Sivasubramanian | a8ff992 | 2012-03-27 17:50:42 -0600 | [diff] [blame] | 42 | #include <mach/rpm-smd.h> | 
| David Collins | 8f4cebc | 2012-05-08 16:54:50 -0700 | [diff] [blame] | 43 | #include <mach/rpm-regulator-smd.h> | 
| Vikram Mulukutla | aeadb5f | 2012-05-04 14:03:07 -0700 | [diff] [blame] | 44 | #include <mach/socinfo.h> | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 45 | #include <mach/msm_bus_board.h> | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 46 | #include "board-dt.h" | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 47 | #include "clock.h" | 
| Michael Bohan | 037a0f5 | 2012-02-29 19:13:09 -0800 | [diff] [blame] | 48 | #include "devices.h" | 
| Praveen Chidambaram | da9501d | 2012-04-26 19:48:29 -0600 | [diff] [blame] | 49 | #include "spm.h" | 
| Jeff Hugo | a643ca1 | 2012-06-11 16:00:23 -0600 | [diff] [blame] | 50 | #include "modem_notifier.h" | 
| Girish Mahadevan | 40abbe1 | 2012-04-25 14:58:13 -0600 | [diff] [blame] | 51 | #include "lpm_resources.h" | 
| Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 52 | #include "platsmp.h" | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 53 |  | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 54 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 55 | static struct memtype_reserve msm8974_reserve_table[] __initdata = { | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 56 | [MEMTYPE_SMI] = { | 
|  | 57 | }, | 
|  | 58 | [MEMTYPE_EBI0] = { | 
|  | 59 | .flags	=	MEMTYPE_FLAGS_1M_ALIGN, | 
|  | 60 | }, | 
|  | 61 | [MEMTYPE_EBI1] = { | 
|  | 62 | .flags	=	MEMTYPE_FLAGS_1M_ALIGN, | 
|  | 63 | }, | 
|  | 64 | }; | 
|  | 65 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 66 | static int msm8974_paddr_to_memtype(unsigned int paddr) | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 67 | { | 
|  | 68 | return MEMTYPE_EBI1; | 
|  | 69 | } | 
|  | 70 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 71 | static struct reserve_info msm8974_reserve_info __initdata = { | 
|  | 72 | .memtype_reserve_table = msm8974_reserve_table, | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 73 | .paddr_to_memtype = msm8974_paddr_to_memtype, | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 74 | }; | 
|  | 75 |  | 
| Neeti Desai | 1b2cb55 | 2012-11-01 21:57:36 -0700 | [diff] [blame] | 76 | void __init msm_8974_reserve(void) | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 77 | { | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 78 | reserve_info = &msm8974_reserve_info; | 
|  | 79 | of_scan_flat_dt(dt_scan_for_memory_reserve, msm8974_reserve_table); | 
| Neeti Desai | 1b2cb55 | 2012-11-01 21:57:36 -0700 | [diff] [blame] | 80 | msm_reserve(); | 
|  | 81 | } | 
|  | 82 |  | 
|  | 83 | static void __init msm8974_early_memory(void) | 
|  | 84 | { | 
|  | 85 | reserve_info = &msm8974_reserve_info; | 
|  | 86 | of_scan_flat_dt(dt_scan_for_memory_hole, msm8974_reserve_table); | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 87 | } | 
|  | 88 |  | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 89 | #define BIMC_BASE	0xfc380000 | 
|  | 90 | #define BIMC_SIZE	0x0006A000 | 
|  | 91 | #define SYS_NOC_BASE	0xfc460000 | 
|  | 92 | #define PERIPH_NOC_BASE 0xFC468000 | 
|  | 93 | #define OCMEM_NOC_BASE	0xfc470000 | 
|  | 94 | #define	MMSS_NOC_BASE	0xfc478000 | 
|  | 95 | #define CONFIG_NOC_BASE	0xfc480000 | 
|  | 96 | #define NOC_SIZE	0x00004000 | 
|  | 97 |  | 
|  | 98 | static struct resource bimc_res[] = { | 
|  | 99 | { | 
|  | 100 | .start = BIMC_BASE, | 
|  | 101 | .end = BIMC_BASE + BIMC_SIZE, | 
|  | 102 | .flags = IORESOURCE_MEM, | 
|  | 103 | .name = "bimc_mem", | 
|  | 104 | }, | 
|  | 105 | }; | 
|  | 106 |  | 
|  | 107 | static struct resource ocmem_noc_res[] = { | 
|  | 108 | { | 
|  | 109 | .start = OCMEM_NOC_BASE, | 
|  | 110 | .end = OCMEM_NOC_BASE + NOC_SIZE, | 
|  | 111 | .flags = IORESOURCE_MEM, | 
|  | 112 | .name = "ocmem_noc_mem", | 
|  | 113 | }, | 
|  | 114 | }; | 
|  | 115 |  | 
|  | 116 | static struct resource mmss_noc_res[] = { | 
|  | 117 | { | 
|  | 118 | .start = MMSS_NOC_BASE, | 
|  | 119 | .end = MMSS_NOC_BASE + NOC_SIZE, | 
|  | 120 | .flags = IORESOURCE_MEM, | 
|  | 121 | .name = "mmss_noc_mem", | 
|  | 122 | }, | 
|  | 123 | }; | 
|  | 124 |  | 
|  | 125 | static struct resource sys_noc_res[] = { | 
|  | 126 | { | 
|  | 127 | .start = SYS_NOC_BASE, | 
|  | 128 | .end = SYS_NOC_BASE + NOC_SIZE, | 
|  | 129 | .flags = IORESOURCE_MEM, | 
|  | 130 | .name = "sys_noc_mem", | 
|  | 131 | }, | 
|  | 132 | }; | 
|  | 133 |  | 
|  | 134 | static struct resource config_noc_res[] = { | 
|  | 135 | { | 
|  | 136 | .start = CONFIG_NOC_BASE, | 
|  | 137 | .end = CONFIG_NOC_BASE + NOC_SIZE, | 
|  | 138 | .flags = IORESOURCE_MEM, | 
|  | 139 | .name = "config_noc_mem", | 
|  | 140 | }, | 
|  | 141 | }; | 
|  | 142 |  | 
|  | 143 | static struct resource periph_noc_res[] = { | 
|  | 144 | { | 
|  | 145 | .start = PERIPH_NOC_BASE, | 
|  | 146 | .end = PERIPH_NOC_BASE + NOC_SIZE, | 
|  | 147 | .flags = IORESOURCE_MEM, | 
|  | 148 | .name = "periph_noc_mem", | 
|  | 149 | }, | 
|  | 150 | }; | 
|  | 151 |  | 
|  | 152 | static struct platform_device msm_bus_sys_noc = { | 
|  | 153 | .name  = "msm_bus_fabric", | 
|  | 154 | .id    =  MSM_BUS_FAB_SYS_NOC, | 
|  | 155 | .num_resources = ARRAY_SIZE(sys_noc_res), | 
|  | 156 | .resource = sys_noc_res, | 
|  | 157 | }; | 
|  | 158 |  | 
|  | 159 | static struct platform_device msm_bus_bimc = { | 
|  | 160 | .name  = "msm_bus_fabric", | 
|  | 161 | .id    = MSM_BUS_FAB_BIMC, | 
|  | 162 | .num_resources = ARRAY_SIZE(bimc_res), | 
|  | 163 | .resource = bimc_res, | 
|  | 164 | }; | 
|  | 165 |  | 
|  | 166 | static struct platform_device msm_bus_mmss_noc = { | 
|  | 167 | .name  = "msm_bus_fabric", | 
|  | 168 | .id    = MSM_BUS_FAB_MMSS_NOC, | 
|  | 169 | .num_resources = ARRAY_SIZE(mmss_noc_res), | 
|  | 170 | .resource = mmss_noc_res, | 
|  | 171 | }; | 
|  | 172 |  | 
|  | 173 | static struct platform_device msm_bus_ocmem_noc = { | 
|  | 174 | .name  = "msm_bus_fabric", | 
|  | 175 | .id    = MSM_BUS_FAB_OCMEM_NOC, | 
|  | 176 | .num_resources = ARRAY_SIZE(ocmem_noc_res), | 
|  | 177 | .resource = ocmem_noc_res, | 
|  | 178 | }; | 
|  | 179 |  | 
|  | 180 | static struct platform_device msm_bus_periph_noc = { | 
|  | 181 | .name  = "msm_bus_fabric", | 
|  | 182 | .id    = MSM_BUS_FAB_PERIPH_NOC, | 
|  | 183 | .num_resources = ARRAY_SIZE(periph_noc_res), | 
|  | 184 | .resource = periph_noc_res, | 
|  | 185 | }; | 
|  | 186 |  | 
|  | 187 | static struct platform_device msm_bus_config_noc = { | 
|  | 188 | .name  = "msm_bus_fabric", | 
|  | 189 | .id    = MSM_BUS_FAB_CONFIG_NOC, | 
|  | 190 | .num_resources = ARRAY_SIZE(config_noc_res), | 
|  | 191 | .resource = config_noc_res, | 
|  | 192 | }; | 
|  | 193 |  | 
|  | 194 | static struct platform_device msm_bus_ocmem_vnoc = { | 
|  | 195 | .name  = "msm_bus_fabric", | 
|  | 196 | .id    = MSM_BUS_FAB_OCMEM_VNOC, | 
|  | 197 | }; | 
|  | 198 |  | 
| Bhakthavatsala Raghavendra | b976654 | 2012-08-17 16:25:48 -0700 | [diff] [blame] | 199 | static struct platform_device msm_fm_platform_init = { | 
|  | 200 | .name  = "iris_fm", | 
|  | 201 | .id    = -1, | 
|  | 202 | }; | 
|  | 203 |  | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 204 | static struct platform_device *msm_bus_8974_devices[] = { | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 205 | &msm_bus_sys_noc, | 
|  | 206 | &msm_bus_bimc, | 
|  | 207 | &msm_bus_mmss_noc, | 
|  | 208 | &msm_bus_ocmem_noc, | 
|  | 209 | &msm_bus_periph_noc, | 
|  | 210 | &msm_bus_config_noc, | 
|  | 211 | &msm_bus_ocmem_vnoc, | 
| Bhakthavatsala Raghavendra | b976654 | 2012-08-17 16:25:48 -0700 | [diff] [blame] | 212 | &msm_fm_platform_init, | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 213 | }; | 
|  | 214 |  | 
| Amy Maloche | 357e8c7 | 2012-07-25 16:41:18 -0700 | [diff] [blame] | 215 | static ssize_t mxt336s_vkeys_show(struct kobject *kobj, | 
|  | 216 | struct kobj_attribute *attr, char *buf) | 
|  | 217 | { | 
|  | 218 | return snprintf(buf, 200, | 
|  | 219 | __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":62:1345:90:90" \ | 
|  | 220 | ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":240:1345:90:90" \ | 
|  | 221 | ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":470:1345:90:90" \ | 
|  | 222 | ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":658:1345:90:90" \ | 
|  | 223 | "\n"); | 
|  | 224 | } | 
|  | 225 |  | 
|  | 226 | static struct kobj_attribute mxt336s_vkeys_attr = { | 
|  | 227 | .attr = { | 
|  | 228 | .mode = S_IRUGO, | 
|  | 229 | }, | 
|  | 230 | .show = &mxt336s_vkeys_show, | 
|  | 231 | }; | 
|  | 232 |  | 
|  | 233 | static struct attribute *mxt336s_properties_attrs[] = { | 
|  | 234 | &mxt336s_vkeys_attr.attr, | 
|  | 235 | NULL | 
|  | 236 | }; | 
|  | 237 |  | 
|  | 238 | static struct attribute_group mxt336s_properties_attr_group = { | 
|  | 239 | .attrs = mxt336s_properties_attrs, | 
|  | 240 | }; | 
|  | 241 |  | 
|  | 242 | static void mxt_init_vkeys_8974(void) | 
|  | 243 | { | 
|  | 244 | int rc = 0; | 
|  | 245 | static struct kobject *mxt336s_properties_kobj; | 
|  | 246 |  | 
|  | 247 | mxt336s_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts"; | 
|  | 248 | mxt336s_properties_kobj = kobject_create_and_add("board_properties", | 
|  | 249 | NULL); | 
|  | 250 | if (mxt336s_properties_kobj) | 
|  | 251 | rc = sysfs_create_group(mxt336s_properties_kobj, | 
|  | 252 | &mxt336s_properties_attr_group); | 
|  | 253 | if (!mxt336s_properties_kobj || rc) | 
|  | 254 | pr_err("%s: failed to create board_properties\n", | 
|  | 255 | __func__); | 
|  | 256 |  | 
|  | 257 | return; | 
|  | 258 | } | 
|  | 259 |  | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 260 | static void __init msm8974_init_buses(void) | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 261 | { | 
|  | 262 | #ifdef CONFIG_MSM_BUS_SCALING | 
|  | 263 | msm_bus_sys_noc.dev.platform_data = | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 264 | &msm_bus_8974_sys_noc_pdata; | 
|  | 265 | msm_bus_bimc.dev.platform_data = &msm_bus_8974_bimc_pdata; | 
|  | 266 | msm_bus_mmss_noc.dev.platform_data = &msm_bus_8974_mmss_noc_pdata; | 
|  | 267 | msm_bus_ocmem_noc.dev.platform_data = &msm_bus_8974_ocmem_noc_pdata; | 
|  | 268 | msm_bus_periph_noc.dev.platform_data = &msm_bus_8974_periph_noc_pdata; | 
|  | 269 | msm_bus_config_noc.dev.platform_data = &msm_bus_8974_config_noc_pdata; | 
|  | 270 | msm_bus_ocmem_vnoc.dev.platform_data = &msm_bus_8974_ocmem_vnoc_pdata; | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 271 | #endif | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 272 | platform_add_devices(msm_bus_8974_devices, | 
|  | 273 | ARRAY_SIZE(msm_bus_8974_devices)); | 
| Gagan Mac | dd9bb79 | 2012-04-25 16:56:48 -0600 | [diff] [blame] | 274 | }; | 
| Hariprasad Dhalinarasimha | f42732a | 2012-05-21 18:00:49 -0700 | [diff] [blame] | 275 |  | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 276 | /* | 
|  | 277 | * Used to satisfy dependencies for devices that need to be | 
|  | 278 | * run early or in a particular order. Most likely your device doesn't fall | 
|  | 279 | * into this category, and thus the driver should not be added here. The | 
|  | 280 | * EPROBE_DEFER can satisfy most dependency problems. | 
|  | 281 | */ | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 282 | void __init msm8974_add_drivers(void) | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 283 | { | 
| Jeff Hugo | a643ca1 | 2012-06-11 16:00:23 -0600 | [diff] [blame] | 284 | msm_init_modem_notifier_list(); | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 285 | msm_smd_init(); | 
|  | 286 | msm_rpm_driver_init(); | 
| Girish Mahadevan | 40abbe1 | 2012-04-25 14:58:13 -0600 | [diff] [blame] | 287 | msm_lpmrs_module_init(); | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 288 | rpm_regulator_smd_driver_init(); | 
|  | 289 | msm_spm_device_init(); | 
| Michael Bohan | 2a46832 | 2012-08-14 17:06:34 -0700 | [diff] [blame] | 290 | krait_power_init(); | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 291 | if (machine_is_msm8974_rumi()) | 
| Vikram Mulukutla | 19245e0 | 2012-07-23 15:58:04 -0700 | [diff] [blame] | 292 | msm_clock_init(&msm8974_rumi_clock_init_data); | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 293 | else | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 294 | msm_clock_init(&msm8974_clock_init_data); | 
|  | 295 | msm8974_init_buses(); | 
| Eugene Seah | ce52ef2 | 2012-07-12 12:40:38 -0600 | [diff] [blame] | 296 | msm_thermal_device_init(); | 
| Amy Maloche | 357e8c7 | 2012-07-25 16:41:18 -0700 | [diff] [blame] | 297 | mxt_init_vkeys_8974(); | 
| Vikram Mulukutla | aa6f36c | 2012-06-12 18:16:29 -0700 | [diff] [blame] | 298 | } | 
|  | 299 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 300 | static struct of_dev_auxdata msm8974_auxdata_lookup[] __initdata = { | 
| Pavankumar Kondeti | 0063b84 | 2012-01-16 12:19:58 +0530 | [diff] [blame] | 301 | OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \ | 
|  | 302 | "msm_otg", NULL), | 
| Manu Gautam | 51be971 | 2012-06-06 14:54:52 +0530 | [diff] [blame] | 303 | OF_DEV_AUXDATA("qcom,dwc-usb3-msm", 0xF9200000, \ | 
|  | 304 | "msm_dwc3", NULL), | 
| Shimrit Malichi | 57ae149 | 2012-08-06 14:03:45 +0300 | [diff] [blame] | 305 | OF_DEV_AUXDATA("qcom,usb-bam-msm", 0xF9304000, \ | 
|  | 306 | "usb_bam", NULL), | 
| Harini Jayaraman | 5f98dbb | 2011-12-20 13:38:19 -0700 | [diff] [blame] | 307 | OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \ | 
|  | 308 | "spi_qsd.1", NULL), | 
| Sujit Reddy Thumma | 85fc52c | 2012-05-02 12:53:45 +0530 | [diff] [blame] | 309 | OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, \ | 
| David Ng | 665140f | 2012-04-12 16:03:45 -0700 | [diff] [blame] | 310 | "msm_sdcc.1", NULL), | 
| Sujit Reddy Thumma | 85fc52c | 2012-05-02 12:53:45 +0530 | [diff] [blame] | 311 | OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, \ | 
|  | 312 | "msm_sdcc.2", NULL), | 
|  | 313 | OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9864000, \ | 
| David Ng | 665140f | 2012-04-12 16:03:45 -0700 | [diff] [blame] | 314 | "msm_sdcc.3", NULL), | 
| Sujit Reddy Thumma | 85fc52c | 2012-05-02 12:53:45 +0530 | [diff] [blame] | 315 | OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98E4000, \ | 
|  | 316 | "msm_sdcc.4", NULL), | 
| Pratik Patel | 80515b5 | 2012-06-17 17:57:24 -0700 | [diff] [blame] | 317 | OF_DEV_AUXDATA("arm,coresight-tmc", 0xFC322000, \ | 
|  | 318 | "coresight-tmc-etr", NULL), | 
|  | 319 | OF_DEV_AUXDATA("arm,coresight-tpiu", 0xFC318000, \ | 
|  | 320 | "coresight-tpiu", NULL), | 
|  | 321 | OF_DEV_AUXDATA("qcom,coresight-replicator", 0xFC31C000, \ | 
|  | 322 | "coresight-replicator", NULL), | 
|  | 323 | OF_DEV_AUXDATA("arm,coresight-tmc", 0xFC307000, \ | 
|  | 324 | "coresight-tmc-etf", NULL), | 
|  | 325 | OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC31B000, \ | 
|  | 326 | "coresight-funnel-merg", NULL), | 
|  | 327 | OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC319000, \ | 
|  | 328 | "coresight-funnel-in0", NULL), | 
|  | 329 | OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC31A000, \ | 
|  | 330 | "coresight-funnel-in1", NULL), | 
|  | 331 | OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC345000, \ | 
|  | 332 | "coresight-funnel-kpss", NULL), | 
|  | 333 | OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC364000, \ | 
|  | 334 | "coresight-funnel-mmss", NULL), | 
|  | 335 | OF_DEV_AUXDATA("arm,coresight-stm", 0xFC321000, \ | 
|  | 336 | "coresight-stm", NULL), | 
|  | 337 | OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33C000, \ | 
|  | 338 | "coresight-etm0", NULL), | 
|  | 339 | OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33D000, \ | 
|  | 340 | "coresight-etm1", NULL), | 
|  | 341 | OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33E000, \ | 
|  | 342 | "coresight-etm2", NULL), | 
|  | 343 | OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33F000, \ | 
|  | 344 | "coresight-etm3", NULL), | 
| Hariprasad Dhalinarasimha | de991f0 | 2012-05-31 13:15:51 -0700 | [diff] [blame] | 345 | OF_DEV_AUXDATA("qcom,msm-rng", 0xF9BFF000, \ | 
|  | 346 | "msm_rng", NULL), | 
| Ramesh Masavarapu | fb1f01e | 2012-06-14 09:40:40 -0700 | [diff] [blame] | 347 | OF_DEV_AUXDATA("qcom,qseecom", 0xFE806000, \ | 
|  | 348 | "qseecom", NULL), | 
| Adrian Salido-Moreno | 5ef3ac0 | 2012-05-14 18:40:47 -0700 | [diff] [blame] | 349 | OF_DEV_AUXDATA("qcom,mdss_mdp", 0xFD900000, "mdp.0", NULL), | 
| Siddartha Mohanadoss | 0a18888 | 2012-07-06 15:51:00 -0700 | [diff] [blame] | 350 | OF_DEV_AUXDATA("qcom,msm-tsens", 0xFC4A8000, \ | 
|  | 351 | "msm-tsens", NULL), | 
| Mona Hossain | b43e94b | 2012-05-07 08:52:06 -0700 | [diff] [blame] | 352 | OF_DEV_AUXDATA("qcom,qcedev", 0xFD440000, \ | 
|  | 353 | "qcedev.0", NULL), | 
|  | 354 | OF_DEV_AUXDATA("qcom,qcrypto", 0xFD440000, \ | 
|  | 355 | "qcrypto.0", NULL), | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 356 | {} | 
|  | 357 | }; | 
|  | 358 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 359 | static void __init msm8974_map_io(void) | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 360 | { | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 361 | msm_map_8974_io(); | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 362 | } | 
|  | 363 |  | 
|  | 364 | void __init msm8974_init(void) | 
|  | 365 | { | 
|  | 366 | struct of_dev_auxdata *adata = msm8974_auxdata_lookup; | 
| Abhimanyu Kapur | 440cdde | 2012-12-04 00:05:40 -0800 | [diff] [blame] | 367 | struct device *parent; | 
|  | 368 |  | 
|  | 369 | parent = socinfo_init(); | 
|  | 370 | if (IS_ERR_OR_NULL(parent)) | 
|  | 371 | pr_err("%s: socinfo_init() failed\n", __func__); | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 372 |  | 
| Abhimanyu Kapur | 90ced6e | 2012-06-26 17:41:25 -0700 | [diff] [blame] | 373 | msm_8974_init_gpiomux(); | 
| Matt Wagantall | ecaa117 | 2012-05-08 21:38:45 -0700 | [diff] [blame] | 374 | regulator_has_full_constraints(); | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 375 | of_platform_populate(NULL, of_default_bus_match_table, adata, NULL); | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 376 | msm8974_add_drivers(); | 
| Sathish Ambley | c58afc2 | 2011-10-09 21:55:39 -0700 | [diff] [blame] | 377 | } | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 378 |  | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 379 | void __init msm8974_init_very_early(void) | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 380 | { | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 381 | msm8974_early_memory(); | 
| Olav Haugan | b800c8c | 2012-01-30 08:50:45 -0800 | [diff] [blame] | 382 | } | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 383 |  | 
|  | 384 | static const char *msm8974_dt_match[] __initconst = { | 
|  | 385 | "qcom,msm8974", | 
|  | 386 | NULL | 
|  | 387 | }; | 
|  | 388 |  | 
|  | 389 | DT_MACHINE_START(MSM8974_DT, "Qualcomm MSM 8974 (Flattened Device Tree)") | 
|  | 390 | .map_io = msm8974_map_io, | 
|  | 391 | .init_irq = msm_dt_init_irq, | 
|  | 392 | .init_machine = msm8974_init, | 
|  | 393 | .handle_irq = gic_handle_irq, | 
|  | 394 | .timer = &msm_dt_timer, | 
|  | 395 | .dt_compat = msm8974_dt_match, | 
| Neeti Desai | 1b2cb55 | 2012-11-01 21:57:36 -0700 | [diff] [blame] | 396 | .reserve = msm_8974_reserve, | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 397 | .init_very_early = msm8974_init_very_early, | 
|  | 398 | .restart = msm_restart, | 
| Syed Rameez Mustafa | 9de4634 | 2012-11-30 11:00:08 -0800 | [diff] [blame] | 399 | .smp = &msm8974_smp_ops, | 
| Rohit Vaswani | 750bee1 | 2012-09-20 16:18:10 -0700 | [diff] [blame] | 400 | MACHINE_END |