blob: dcc0d01a32e011427162d5281885dcc3846ee59e [file] [log] [blame]
Michael Bohan0425f6f2012-01-17 14:36:39 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Sathish Ambleyc58afc22011-10-09 21:55:39 -07002 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/io.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016#include <linux/gpio.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070017#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>
Michael Bohanc7224532012-01-06 16:02:52 -080022#include <linux/of_irq.h>
Olav Hauganb800c8c2012-01-30 08:50:45 -080023#include <linux/memory.h>
24#ifdef CONFIG_ANDROID_PMEM
25#include <linux/android_pmem.h>
26#endif
Matt Wagantallecaa1172012-05-08 21:38:45 -070027#include <linux/regulator/machine.h>
Michael Bohan2a468322012-08-14 17:06:34 -070028#include <linux/regulator/krait-regulator.h>
Eugene Seahce52ef22012-07-12 12:40:38 -060029#include <linux/msm_thermal.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070030#include <asm/mach/map.h>
31#include <asm/hardware/gic.h>
32#include <mach/board.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070033#include <mach/gpiomux.h>
34#include <mach/msm_iomap.h>
Olav Hauganb800c8c2012-01-30 08:50:45 -080035#ifdef CONFIG_ION_MSM
36#include <mach/ion.h>
37#endif
38#include <mach/msm_memtypes.h>
Jeff Hugo70946092012-02-10 11:30:43 -070039#include <mach/msm_smd.h>
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060040#include <mach/rpm-smd.h>
David Collins8f4cebc2012-05-08 16:54:50 -070041#include <mach/rpm-regulator-smd.h>
Michael Bohan115cf652012-01-05 14:32:59 -080042#include <mach/qpnp-int.h>
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -070043#include <mach/socinfo.h>
Gagan Macdd9bb792012-04-25 16:56:48 -060044#include <mach/msm_bus_board.h>
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -060045#include <mach/mpm.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070046#include "clock.h"
Michael Bohan037a0f52012-02-29 19:13:09 -080047#include "devices.h"
Praveen Chidambaramda9501d2012-04-26 19:48:29 -060048#include "spm.h"
Jeff Hugoa643ca12012-06-11 16:00:23 -060049#include "modem_notifier.h"
Girish Mahadevan40abbe12012-04-25 14:58:13 -060050#include "lpm_resources.h"
Sathish Ambleyc58afc22011-10-09 21:55:39 -070051
Olav Hauganb800c8c2012-01-30 08:50:45 -080052#define MSM_KERNEL_EBI1_MEM_SIZE 0x280000
Olav Hauganb800c8c2012-01-30 08:50:45 -080053
54#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
55static unsigned kernel_ebi1_mem_size = MSM_KERNEL_EBI1_MEM_SIZE;
56static int __init kernel_ebi1_mem_size_setup(char *p)
57{
58 kernel_ebi1_mem_size = memparse(p, NULL);
59 return 0;
60}
61early_param("kernel_ebi1_mem_size", kernel_ebi1_mem_size_setup);
62#endif
63
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070064static struct memtype_reserve msm_8974_reserve_table[] __initdata = {
Olav Hauganb800c8c2012-01-30 08:50:45 -080065 [MEMTYPE_SMI] = {
66 },
67 [MEMTYPE_EBI0] = {
68 .flags = MEMTYPE_FLAGS_1M_ALIGN,
69 },
70 [MEMTYPE_EBI1] = {
71 .flags = MEMTYPE_FLAGS_1M_ALIGN,
72 },
73};
74
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070075static int msm_8974_paddr_to_memtype(unsigned int paddr)
Olav Hauganb800c8c2012-01-30 08:50:45 -080076{
77 return MEMTYPE_EBI1;
78}
79
Olav Haugan49173442012-08-01 13:23:18 -070080static void __init reserve_ebi_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -080081{
Olav Hauganb800c8c2012-01-30 08:50:45 -080082#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070083 msm_8974_reserve_table[MEMTYPE_EBI1].size += kernel_ebi1_mem_size;
Olav Hauganb800c8c2012-01-30 08:50:45 -080084#endif
85}
Olav Hauganb800c8c2012-01-30 08:50:45 -080086
Jeff Hugo70946092012-02-10 11:30:43 -070087static struct resource smd_resource[] = {
88 {
89 .name = "modem_smd_in",
Jeff Hugo3417d072012-07-06 15:45:59 -060090 .start = 32 + 25, /* mss_sw_to_kpss_ipc_irq0 */
Jeff Hugo70946092012-02-10 11:30:43 -070091 .flags = IORESOURCE_IRQ,
92 },
93 {
94 .name = "modem_smsm_in",
Jeff Hugo3417d072012-07-06 15:45:59 -060095 .start = 32 + 26, /* mss_sw_to_kpss_ipc_irq1 */
Jeff Hugo70946092012-02-10 11:30:43 -070096 .flags = IORESOURCE_IRQ,
97 },
98 {
99 .name = "adsp_smd_in",
100 .start = 32 + 156, /* lpass_to_kpss_ipc_irq0 */
101 .flags = IORESOURCE_IRQ,
102 },
103 {
104 .name = "adsp_smsm_in",
105 .start = 32 + 157, /* lpass_to_kpss_ipc_irq1 */
106 .flags = IORESOURCE_IRQ,
107 },
108 {
109 .name = "wcnss_smd_in",
110 .start = 32 + 142, /* WcnssAppsSmdMedIrq */
111 .flags = IORESOURCE_IRQ,
112 },
113 {
114 .name = "wcnss_smsm_in",
Jeff Hugo89046272012-03-29 14:45:37 -0600115 .start = 32 + 144, /* RivaAppsWlanSmsmIrq */
Jeff Hugo70946092012-02-10 11:30:43 -0700116 .flags = IORESOURCE_IRQ,
117 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600118 {
119 .name = "rpm_smd_in",
120 .start = 32 + 168, /* rpm_to_kpss_ipc_irq4 */
121 .flags = IORESOURCE_IRQ,
122 },
Jeff Hugo70946092012-02-10 11:30:43 -0700123};
124
125static struct smd_subsystem_config smd_config_list[] = {
126 {
127 .irq_config_id = SMD_MODEM,
128 .subsys_name = "modem",
129 .edge = SMD_APPS_MODEM,
130
131 .smd_int.irq_name = "modem_smd_in",
132 .smd_int.flags = IRQF_TRIGGER_RISING,
133 .smd_int.irq_id = -1,
134 .smd_int.device_name = "smd_dev",
135 .smd_int.dev_id = 0,
136 .smd_int.out_bit_pos = 1 << 12,
137 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
138 .smd_int.out_offset = 0x8,
139
140 .smsm_int.irq_name = "modem_smsm_in",
141 .smsm_int.flags = IRQF_TRIGGER_RISING,
142 .smsm_int.irq_id = -1,
143 .smsm_int.device_name = "smsm_dev",
144 .smsm_int.dev_id = 0,
145 .smsm_int.out_bit_pos = 1 << 13,
146 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
147 .smsm_int.out_offset = 0x8,
148 },
149 {
150 .irq_config_id = SMD_Q6,
Jeff Hugoa1e3b8c2012-05-29 14:01:41 -0600151 .subsys_name = "adsp",
Jeff Hugo70946092012-02-10 11:30:43 -0700152 .edge = SMD_APPS_QDSP,
153
154 .smd_int.irq_name = "adsp_smd_in",
155 .smd_int.flags = IRQF_TRIGGER_RISING,
156 .smd_int.irq_id = -1,
157 .smd_int.device_name = "smd_dev",
158 .smd_int.dev_id = 0,
159 .smd_int.out_bit_pos = 1 << 8,
160 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
161 .smd_int.out_offset = 0x8,
162
163 .smsm_int.irq_name = "adsp_smsm_in",
164 .smsm_int.flags = IRQF_TRIGGER_RISING,
165 .smsm_int.irq_id = -1,
166 .smsm_int.device_name = "smsm_dev",
167 .smsm_int.dev_id = 0,
168 .smsm_int.out_bit_pos = 1 << 9,
169 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
170 .smsm_int.out_offset = 0x8,
171 },
172 {
173 .irq_config_id = SMD_WCNSS,
174 .subsys_name = "wcnss",
175 .edge = SMD_APPS_WCNSS,
176
177 .smd_int.irq_name = "wcnss_smd_in",
178 .smd_int.flags = IRQF_TRIGGER_RISING,
179 .smd_int.irq_id = -1,
180 .smd_int.device_name = "smd_dev",
181 .smd_int.dev_id = 0,
182 .smd_int.out_bit_pos = 1 << 17,
183 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
184 .smd_int.out_offset = 0x8,
185
186 .smsm_int.irq_name = "wcnss_smsm_in",
187 .smsm_int.flags = IRQF_TRIGGER_RISING,
188 .smsm_int.irq_id = -1,
189 .smsm_int.device_name = "smsm_dev",
190 .smsm_int.dev_id = 0,
191 .smsm_int.out_bit_pos = 1 << 19,
192 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
193 .smsm_int.out_offset = 0x8,
194 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600195 {
196 .irq_config_id = SMD_RPM,
197 .subsys_name = NULL, /* do not use PIL to load RPM */
198 .edge = SMD_APPS_RPM,
199
200 .smd_int.irq_name = "rpm_smd_in",
201 .smd_int.flags = IRQF_TRIGGER_RISING,
202 .smd_int.irq_id = -1,
203 .smd_int.device_name = "smd_dev",
204 .smd_int.dev_id = 0,
205 .smd_int.out_bit_pos = 1 << 0,
206 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
207 .smd_int.out_offset = 0x8,
208
209 .smsm_int.irq_name = NULL, /* RPM does not support SMSM */
210 .smsm_int.flags = 0,
211 .smsm_int.irq_id = 0,
212 .smsm_int.device_name = NULL,
213 .smsm_int.dev_id = 0,
214 .smsm_int.out_bit_pos = 0,
215 .smsm_int.out_base = NULL,
216 .smsm_int.out_offset = 0,
217 },
218};
219
220static struct smd_smem_regions aux_smem_areas[] = {
221 {
222 .phys_addr = (void *)(0xfc428000),
223 .size = 0x4000,
224 },
Jeff Hugo70946092012-02-10 11:30:43 -0700225};
226
Jeff Hugo3e366292012-03-29 15:19:14 -0600227static struct smd_subsystem_restart_config smd_ssr_cfg = {
228 .disable_smsm_reset_handshake = 1,
229};
230
Jeff Hugo70946092012-02-10 11:30:43 -0700231static struct smd_platform smd_platform_data = {
232 .num_ss_configs = ARRAY_SIZE(smd_config_list),
233 .smd_ss_configs = smd_config_list,
Jeff Hugo3e366292012-03-29 15:19:14 -0600234 .smd_ssr_config = &smd_ssr_cfg,
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600235 .num_smem_areas = ARRAY_SIZE(aux_smem_areas),
236 .smd_smem_areas = aux_smem_areas,
Jeff Hugo70946092012-02-10 11:30:43 -0700237};
238
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700239struct platform_device msm_device_smd_8974 = {
Jeff Hugo70946092012-02-10 11:30:43 -0700240 .name = "msm_smd",
241 .id = -1,
242 .resource = smd_resource,
243 .num_resources = ARRAY_SIZE(smd_resource),
244 .dev = {
245 .platform_data = &smd_platform_data,
246 }
247};
248
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700249static void __init msm_8974_calculate_reserve_sizes(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800250{
Olav Haugan49173442012-08-01 13:23:18 -0700251 reserve_ebi_memory();
Olav Hauganb800c8c2012-01-30 08:50:45 -0800252}
253
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700254static struct reserve_info msm_8974_reserve_info __initdata = {
255 .memtype_reserve_table = msm_8974_reserve_table,
256 .calculate_reserve_sizes = msm_8974_calculate_reserve_sizes,
257 .paddr_to_memtype = msm_8974_paddr_to_memtype,
Olav Hauganb800c8c2012-01-30 08:50:45 -0800258};
259
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700260static void __init msm_8974_early_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800261{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700262 reserve_info = &msm_8974_reserve_info;
Laura Abbottd8d0f772012-07-10 10:27:06 -0700263 of_scan_flat_dt(dt_scan_for_memory_reserve, msm_8974_reserve_table);
Olav Hauganb800c8c2012-01-30 08:50:45 -0800264}
265
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700266void __init msm_8974_reserve(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800267{
268 msm_reserve();
269}
270
Gagan Macdd9bb792012-04-25 16:56:48 -0600271#define BIMC_BASE 0xfc380000
272#define BIMC_SIZE 0x0006A000
273#define SYS_NOC_BASE 0xfc460000
274#define PERIPH_NOC_BASE 0xFC468000
275#define OCMEM_NOC_BASE 0xfc470000
276#define MMSS_NOC_BASE 0xfc478000
277#define CONFIG_NOC_BASE 0xfc480000
278#define NOC_SIZE 0x00004000
279
280static struct resource bimc_res[] = {
281 {
282 .start = BIMC_BASE,
283 .end = BIMC_BASE + BIMC_SIZE,
284 .flags = IORESOURCE_MEM,
285 .name = "bimc_mem",
286 },
287};
288
289static struct resource ocmem_noc_res[] = {
290 {
291 .start = OCMEM_NOC_BASE,
292 .end = OCMEM_NOC_BASE + NOC_SIZE,
293 .flags = IORESOURCE_MEM,
294 .name = "ocmem_noc_mem",
295 },
296};
297
298static struct resource mmss_noc_res[] = {
299 {
300 .start = MMSS_NOC_BASE,
301 .end = MMSS_NOC_BASE + NOC_SIZE,
302 .flags = IORESOURCE_MEM,
303 .name = "mmss_noc_mem",
304 },
305};
306
307static struct resource sys_noc_res[] = {
308 {
309 .start = SYS_NOC_BASE,
310 .end = SYS_NOC_BASE + NOC_SIZE,
311 .flags = IORESOURCE_MEM,
312 .name = "sys_noc_mem",
313 },
314};
315
316static struct resource config_noc_res[] = {
317 {
318 .start = CONFIG_NOC_BASE,
319 .end = CONFIG_NOC_BASE + NOC_SIZE,
320 .flags = IORESOURCE_MEM,
321 .name = "config_noc_mem",
322 },
323};
324
325static struct resource periph_noc_res[] = {
326 {
327 .start = PERIPH_NOC_BASE,
328 .end = PERIPH_NOC_BASE + NOC_SIZE,
329 .flags = IORESOURCE_MEM,
330 .name = "periph_noc_mem",
331 },
332};
333
334static struct platform_device msm_bus_sys_noc = {
335 .name = "msm_bus_fabric",
336 .id = MSM_BUS_FAB_SYS_NOC,
337 .num_resources = ARRAY_SIZE(sys_noc_res),
338 .resource = sys_noc_res,
339};
340
341static struct platform_device msm_bus_bimc = {
342 .name = "msm_bus_fabric",
343 .id = MSM_BUS_FAB_BIMC,
344 .num_resources = ARRAY_SIZE(bimc_res),
345 .resource = bimc_res,
346};
347
348static struct platform_device msm_bus_mmss_noc = {
349 .name = "msm_bus_fabric",
350 .id = MSM_BUS_FAB_MMSS_NOC,
351 .num_resources = ARRAY_SIZE(mmss_noc_res),
352 .resource = mmss_noc_res,
353};
354
355static struct platform_device msm_bus_ocmem_noc = {
356 .name = "msm_bus_fabric",
357 .id = MSM_BUS_FAB_OCMEM_NOC,
358 .num_resources = ARRAY_SIZE(ocmem_noc_res),
359 .resource = ocmem_noc_res,
360};
361
362static struct platform_device msm_bus_periph_noc = {
363 .name = "msm_bus_fabric",
364 .id = MSM_BUS_FAB_PERIPH_NOC,
365 .num_resources = ARRAY_SIZE(periph_noc_res),
366 .resource = periph_noc_res,
367};
368
369static struct platform_device msm_bus_config_noc = {
370 .name = "msm_bus_fabric",
371 .id = MSM_BUS_FAB_CONFIG_NOC,
372 .num_resources = ARRAY_SIZE(config_noc_res),
373 .resource = config_noc_res,
374};
375
376static struct platform_device msm_bus_ocmem_vnoc = {
377 .name = "msm_bus_fabric",
378 .id = MSM_BUS_FAB_OCMEM_VNOC,
379};
380
Bhakthavatsala Raghavendrab9766542012-08-17 16:25:48 -0700381static struct platform_device msm_fm_platform_init = {
382 .name = "iris_fm",
383 .id = -1,
384};
385
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700386static struct platform_device *msm_bus_8974_devices[] = {
Gagan Macdd9bb792012-04-25 16:56:48 -0600387 &msm_bus_sys_noc,
388 &msm_bus_bimc,
389 &msm_bus_mmss_noc,
390 &msm_bus_ocmem_noc,
391 &msm_bus_periph_noc,
392 &msm_bus_config_noc,
393 &msm_bus_ocmem_vnoc,
Bhakthavatsala Raghavendrab9766542012-08-17 16:25:48 -0700394 &msm_fm_platform_init,
Gagan Macdd9bb792012-04-25 16:56:48 -0600395};
396
Amy Maloche357e8c72012-07-25 16:41:18 -0700397static ssize_t mxt336s_vkeys_show(struct kobject *kobj,
398 struct kobj_attribute *attr, char *buf)
399{
400 return snprintf(buf, 200,
401 __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":62:1345:90:90" \
402 ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":240:1345:90:90" \
403 ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME) ":470:1345:90:90" \
404 ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":658:1345:90:90" \
405 "\n");
406}
407
408static struct kobj_attribute mxt336s_vkeys_attr = {
409 .attr = {
410 .mode = S_IRUGO,
411 },
412 .show = &mxt336s_vkeys_show,
413};
414
415static struct attribute *mxt336s_properties_attrs[] = {
416 &mxt336s_vkeys_attr.attr,
417 NULL
418};
419
420static struct attribute_group mxt336s_properties_attr_group = {
421 .attrs = mxt336s_properties_attrs,
422};
423
424static void mxt_init_vkeys_8974(void)
425{
426 int rc = 0;
427 static struct kobject *mxt336s_properties_kobj;
428
429 mxt336s_vkeys_attr.attr.name = "virtualkeys.atmel_mxt_ts";
430 mxt336s_properties_kobj = kobject_create_and_add("board_properties",
431 NULL);
432 if (mxt336s_properties_kobj)
433 rc = sysfs_create_group(mxt336s_properties_kobj,
434 &mxt336s_properties_attr_group);
435 if (!mxt336s_properties_kobj || rc)
436 pr_err("%s: failed to create board_properties\n",
437 __func__);
438
439 return;
440}
441
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700442static void __init msm8974_init_buses(void)
Gagan Macdd9bb792012-04-25 16:56:48 -0600443{
444#ifdef CONFIG_MSM_BUS_SCALING
445 msm_bus_sys_noc.dev.platform_data =
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700446 &msm_bus_8974_sys_noc_pdata;
447 msm_bus_bimc.dev.platform_data = &msm_bus_8974_bimc_pdata;
448 msm_bus_mmss_noc.dev.platform_data = &msm_bus_8974_mmss_noc_pdata;
449 msm_bus_ocmem_noc.dev.platform_data = &msm_bus_8974_ocmem_noc_pdata;
450 msm_bus_periph_noc.dev.platform_data = &msm_bus_8974_periph_noc_pdata;
451 msm_bus_config_noc.dev.platform_data = &msm_bus_8974_config_noc_pdata;
452 msm_bus_ocmem_vnoc.dev.platform_data = &msm_bus_8974_ocmem_vnoc_pdata;
Gagan Macdd9bb792012-04-25 16:56:48 -0600453#endif
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700454 platform_add_devices(msm_bus_8974_devices,
455 ARRAY_SIZE(msm_bus_8974_devices));
Gagan Macdd9bb792012-04-25 16:56:48 -0600456};
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700457
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700458void __init msm_8974_add_devices(void)
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700459{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700460 platform_device_register(&msm_device_smd_8974);
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700461}
462
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700463/*
464 * Used to satisfy dependencies for devices that need to be
465 * run early or in a particular order. Most likely your device doesn't fall
466 * into this category, and thus the driver should not be added here. The
467 * EPROBE_DEFER can satisfy most dependency problems.
468 */
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700469void __init msm_8974_add_drivers(void)
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700470{
Jeff Hugoa643ca12012-06-11 16:00:23 -0600471 msm_init_modem_notifier_list();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700472 msm_smd_init();
473 msm_rpm_driver_init();
Girish Mahadevan40abbe12012-04-25 14:58:13 -0600474 msm_lpmrs_module_init();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700475 rpm_regulator_smd_driver_init();
476 msm_spm_device_init();
Michael Bohan2a468322012-08-14 17:06:34 -0700477 krait_power_init();
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700478 if (machine_is_msm8974_rumi())
Vikram Mulukutla19245e02012-07-23 15:58:04 -0700479 msm_clock_init(&msm8974_rumi_clock_init_data);
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700480 else
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700481 msm_clock_init(&msm8974_clock_init_data);
482 msm8974_init_buses();
Eugene Seahce52ef22012-07-12 12:40:38 -0600483 msm_thermal_device_init();
Amy Maloche357e8c72012-07-25 16:41:18 -0700484 mxt_init_vkeys_8974();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700485}
486
487static struct of_device_id irq_match[] __initdata = {
488 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
489 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
490 { .compatible = "qcom,spmi-pmic-arb", .data = qpnpint_of_init, },
491 {}
492};
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600493static struct of_device_id mpm_match[] __initdata = {
494 {.compatible = "qcom,mpm-v2", },
495 {},
496};
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700497
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700498void __init msm_8974_init_irq(void)
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700499{
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600500 struct device_node *node;
501
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700502 of_irq_init(irq_match);
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600503 node = of_find_matching_node(NULL, mpm_match);
504
505 WARN_ON(!node);
506
507 if (node)
508 of_mpm_init(node);
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700509}
510
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700511static struct of_dev_auxdata msm_8974_auxdata_lookup[] __initdata = {
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530512 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
513 "msm_otg", NULL),
Manu Gautam51be9712012-06-06 14:54:52 +0530514 OF_DEV_AUXDATA("qcom,dwc-usb3-msm", 0xF9200000, \
515 "msm_dwc3", NULL),
Shimrit Malichi57ae1492012-08-06 14:03:45 +0300516 OF_DEV_AUXDATA("qcom,usb-bam-msm", 0xF9304000, \
517 "usb_bam", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700518 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
519 "spi_qsd.1", NULL),
Kenneth Heitkef3c829c2012-01-13 17:02:43 -0700520 OF_DEV_AUXDATA("qcom,spmi-pmic-arb", 0xFC4C0000, \
521 "spmi-pmic-arb.0", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530522 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, \
David Ng665140f2012-04-12 16:03:45 -0700523 "msm_sdcc.1", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530524 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, \
525 "msm_sdcc.2", NULL),
526 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9864000, \
David Ng665140f2012-04-12 16:03:45 -0700527 "msm_sdcc.3", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530528 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98E4000, \
529 "msm_sdcc.4", NULL),
Matt Wagantallc2bbdc32012-03-21 19:44:50 -0700530 OF_DEV_AUXDATA("qcom,pil-q6v5-lpass", 0xFE200000, \
531 "pil-q6v5-lpass", NULL),
Matt Wagantall4e2599e2012-03-21 22:31:35 -0700532 OF_DEV_AUXDATA("qcom,pil-q6v5-mss", 0xFC880000, "pil-q6v5-mss", NULL),
Matt Wagantalle6e00d52012-03-08 17:39:07 -0800533 OF_DEV_AUXDATA("qcom,pil-mba", 0xFC820000, "pil-mba", NULL),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800534 OF_DEV_AUXDATA("qcom,pil-pronto", 0xFB21B000, \
535 "pil_pronto", NULL),
Pratik Patel80515b52012-06-17 17:57:24 -0700536 OF_DEV_AUXDATA("arm,coresight-tmc", 0xFC322000, \
537 "coresight-tmc-etr", NULL),
538 OF_DEV_AUXDATA("arm,coresight-tpiu", 0xFC318000, \
539 "coresight-tpiu", NULL),
540 OF_DEV_AUXDATA("qcom,coresight-replicator", 0xFC31C000, \
541 "coresight-replicator", NULL),
542 OF_DEV_AUXDATA("arm,coresight-tmc", 0xFC307000, \
543 "coresight-tmc-etf", NULL),
544 OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC31B000, \
545 "coresight-funnel-merg", NULL),
546 OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC319000, \
547 "coresight-funnel-in0", NULL),
548 OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC31A000, \
549 "coresight-funnel-in1", NULL),
550 OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC345000, \
551 "coresight-funnel-kpss", NULL),
552 OF_DEV_AUXDATA("arm,coresight-funnel", 0xFC364000, \
553 "coresight-funnel-mmss", NULL),
554 OF_DEV_AUXDATA("arm,coresight-stm", 0xFC321000, \
555 "coresight-stm", NULL),
556 OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33C000, \
557 "coresight-etm0", NULL),
558 OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33D000, \
559 "coresight-etm1", NULL),
560 OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33E000, \
561 "coresight-etm2", NULL),
562 OF_DEV_AUXDATA("arm,coresight-etm", 0xFC33F000, \
563 "coresight-etm3", NULL),
Hariprasad Dhalinarasimhade991f02012-05-31 13:15:51 -0700564 OF_DEV_AUXDATA("qcom,msm-rng", 0xF9BFF000, \
565 "msm_rng", NULL),
Ramesh Masavarapufb1f01e2012-06-14 09:40:40 -0700566 OF_DEV_AUXDATA("qcom,qseecom", 0xFE806000, \
567 "qseecom", NULL),
Adrian Salido-Moreno5ef3ac02012-05-14 18:40:47 -0700568 OF_DEV_AUXDATA("qcom,mdss_mdp", 0xFD900000, "mdp.0", NULL),
Siddartha Mohanadoss0a188882012-07-06 15:51:00 -0700569 OF_DEV_AUXDATA("qcom,msm-tsens", 0xFC4A8000, \
570 "msm-tsens", NULL),
Mona Hossainb43e94b2012-05-07 08:52:06 -0700571 OF_DEV_AUXDATA("qcom,qcedev", 0xFD440000, \
572 "qcedev.0", NULL),
573 OF_DEV_AUXDATA("qcom,qcrypto", 0xFD440000, \
574 "qcrypto.0", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700575 {}
576};
577
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700578void __init msm_8974_init(struct of_dev_auxdata **adata)
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700579{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700580 msm_8974_init_gpiomux();
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -0700581
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700582 *adata = msm_8974_auxdata_lookup;
Matt Wagantallecaa1172012-05-08 21:38:45 -0700583
584 regulator_has_full_constraints();
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700585}
Olav Hauganb800c8c2012-01-30 08:50:45 -0800586
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700587void __init msm_8974_very_early(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800588{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700589 msm_8974_early_memory();
Olav Hauganb800c8c2012-01-30 08:50:45 -0800590}