blob: 240e09456bee3c7db22de8d11089fcab80c63a99 [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
Michael Bohan037a0f52012-02-29 19:13:09 -080027#include <linux/regulator/stub-regulator.h>
Matt Wagantallecaa1172012-05-08 21:38:45 -070028#include <linux/regulator/machine.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070029#include <asm/mach/map.h>
30#include <asm/hardware/gic.h>
31#include <mach/board.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070032#include <mach/gpiomux.h>
33#include <mach/msm_iomap.h>
Olav Hauganb800c8c2012-01-30 08:50:45 -080034#ifdef CONFIG_ION_MSM
35#include <mach/ion.h>
36#endif
37#include <mach/msm_memtypes.h>
Jeff Hugo70946092012-02-10 11:30:43 -070038#include <mach/msm_smd.h>
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060039#include <mach/rpm-smd.h>
David Collins8f4cebc2012-05-08 16:54:50 -070040#include <mach/rpm-regulator-smd.h>
Michael Bohan115cf652012-01-05 14:32:59 -080041#include <mach/qpnp-int.h>
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -070042#include <mach/socinfo.h>
Gagan Macdd9bb792012-04-25 16:56:48 -060043#include <mach/msm_bus_board.h>
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -060044#include <mach/mpm.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070045#include "clock.h"
Michael Bohan037a0f52012-02-29 19:13:09 -080046#include "devices.h"
Praveen Chidambaramda9501d2012-04-26 19:48:29 -060047#include "spm.h"
Jeff Hugoa643ca12012-06-11 16:00:23 -060048#include "modem_notifier.h"
Girish Mahadevan40abbe12012-04-25 14:58:13 -060049#include "lpm_resources.h"
Sathish Ambleyc58afc22011-10-09 21:55:39 -070050
Olav Hauganb800c8c2012-01-30 08:50:45 -080051#define MSM_KERNEL_EBI1_MEM_SIZE 0x280000
Olav Hauganb800c8c2012-01-30 08:50:45 -080052
53#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
54static unsigned kernel_ebi1_mem_size = MSM_KERNEL_EBI1_MEM_SIZE;
55static int __init kernel_ebi1_mem_size_setup(char *p)
56{
57 kernel_ebi1_mem_size = memparse(p, NULL);
58 return 0;
59}
60early_param("kernel_ebi1_mem_size", kernel_ebi1_mem_size_setup);
61#endif
62
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070063static struct memtype_reserve msm_8974_reserve_table[] __initdata = {
Olav Hauganb800c8c2012-01-30 08:50:45 -080064 [MEMTYPE_SMI] = {
65 },
66 [MEMTYPE_EBI0] = {
67 .flags = MEMTYPE_FLAGS_1M_ALIGN,
68 },
69 [MEMTYPE_EBI1] = {
70 .flags = MEMTYPE_FLAGS_1M_ALIGN,
71 },
72};
73
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070074static int msm_8974_paddr_to_memtype(unsigned int paddr)
Olav Hauganb800c8c2012-01-30 08:50:45 -080075{
76 return MEMTYPE_EBI1;
77}
78
Olav Haugan49173442012-08-01 13:23:18 -070079static void __init reserve_ebi_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -080080{
Olav Hauganb800c8c2012-01-30 08:50:45 -080081#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -070082 msm_8974_reserve_table[MEMTYPE_EBI1].size += kernel_ebi1_mem_size;
Olav Hauganb800c8c2012-01-30 08:50:45 -080083#endif
84}
Olav Hauganb800c8c2012-01-30 08:50:45 -080085
Jeff Hugo70946092012-02-10 11:30:43 -070086static struct resource smd_resource[] = {
87 {
88 .name = "modem_smd_in",
Jeff Hugo3417d072012-07-06 15:45:59 -060089 .start = 32 + 25, /* mss_sw_to_kpss_ipc_irq0 */
Jeff Hugo70946092012-02-10 11:30:43 -070090 .flags = IORESOURCE_IRQ,
91 },
92 {
93 .name = "modem_smsm_in",
Jeff Hugo3417d072012-07-06 15:45:59 -060094 .start = 32 + 26, /* mss_sw_to_kpss_ipc_irq1 */
Jeff Hugo70946092012-02-10 11:30:43 -070095 .flags = IORESOURCE_IRQ,
96 },
97 {
98 .name = "adsp_smd_in",
99 .start = 32 + 156, /* lpass_to_kpss_ipc_irq0 */
100 .flags = IORESOURCE_IRQ,
101 },
102 {
103 .name = "adsp_smsm_in",
104 .start = 32 + 157, /* lpass_to_kpss_ipc_irq1 */
105 .flags = IORESOURCE_IRQ,
106 },
107 {
108 .name = "wcnss_smd_in",
109 .start = 32 + 142, /* WcnssAppsSmdMedIrq */
110 .flags = IORESOURCE_IRQ,
111 },
112 {
113 .name = "wcnss_smsm_in",
Jeff Hugo89046272012-03-29 14:45:37 -0600114 .start = 32 + 144, /* RivaAppsWlanSmsmIrq */
Jeff Hugo70946092012-02-10 11:30:43 -0700115 .flags = IORESOURCE_IRQ,
116 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600117 {
118 .name = "rpm_smd_in",
119 .start = 32 + 168, /* rpm_to_kpss_ipc_irq4 */
120 .flags = IORESOURCE_IRQ,
121 },
Jeff Hugo70946092012-02-10 11:30:43 -0700122};
123
124static struct smd_subsystem_config smd_config_list[] = {
125 {
126 .irq_config_id = SMD_MODEM,
127 .subsys_name = "modem",
128 .edge = SMD_APPS_MODEM,
129
130 .smd_int.irq_name = "modem_smd_in",
131 .smd_int.flags = IRQF_TRIGGER_RISING,
132 .smd_int.irq_id = -1,
133 .smd_int.device_name = "smd_dev",
134 .smd_int.dev_id = 0,
135 .smd_int.out_bit_pos = 1 << 12,
136 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
137 .smd_int.out_offset = 0x8,
138
139 .smsm_int.irq_name = "modem_smsm_in",
140 .smsm_int.flags = IRQF_TRIGGER_RISING,
141 .smsm_int.irq_id = -1,
142 .smsm_int.device_name = "smsm_dev",
143 .smsm_int.dev_id = 0,
144 .smsm_int.out_bit_pos = 1 << 13,
145 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
146 .smsm_int.out_offset = 0x8,
147 },
148 {
149 .irq_config_id = SMD_Q6,
Jeff Hugoa1e3b8c2012-05-29 14:01:41 -0600150 .subsys_name = "adsp",
Jeff Hugo70946092012-02-10 11:30:43 -0700151 .edge = SMD_APPS_QDSP,
152
153 .smd_int.irq_name = "adsp_smd_in",
154 .smd_int.flags = IRQF_TRIGGER_RISING,
155 .smd_int.irq_id = -1,
156 .smd_int.device_name = "smd_dev",
157 .smd_int.dev_id = 0,
158 .smd_int.out_bit_pos = 1 << 8,
159 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
160 .smd_int.out_offset = 0x8,
161
162 .smsm_int.irq_name = "adsp_smsm_in",
163 .smsm_int.flags = IRQF_TRIGGER_RISING,
164 .smsm_int.irq_id = -1,
165 .smsm_int.device_name = "smsm_dev",
166 .smsm_int.dev_id = 0,
167 .smsm_int.out_bit_pos = 1 << 9,
168 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
169 .smsm_int.out_offset = 0x8,
170 },
171 {
172 .irq_config_id = SMD_WCNSS,
173 .subsys_name = "wcnss",
174 .edge = SMD_APPS_WCNSS,
175
176 .smd_int.irq_name = "wcnss_smd_in",
177 .smd_int.flags = IRQF_TRIGGER_RISING,
178 .smd_int.irq_id = -1,
179 .smd_int.device_name = "smd_dev",
180 .smd_int.dev_id = 0,
181 .smd_int.out_bit_pos = 1 << 17,
182 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
183 .smd_int.out_offset = 0x8,
184
185 .smsm_int.irq_name = "wcnss_smsm_in",
186 .smsm_int.flags = IRQF_TRIGGER_RISING,
187 .smsm_int.irq_id = -1,
188 .smsm_int.device_name = "smsm_dev",
189 .smsm_int.dev_id = 0,
190 .smsm_int.out_bit_pos = 1 << 19,
191 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
192 .smsm_int.out_offset = 0x8,
193 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600194 {
195 .irq_config_id = SMD_RPM,
196 .subsys_name = NULL, /* do not use PIL to load RPM */
197 .edge = SMD_APPS_RPM,
198
199 .smd_int.irq_name = "rpm_smd_in",
200 .smd_int.flags = IRQF_TRIGGER_RISING,
201 .smd_int.irq_id = -1,
202 .smd_int.device_name = "smd_dev",
203 .smd_int.dev_id = 0,
204 .smd_int.out_bit_pos = 1 << 0,
205 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
206 .smd_int.out_offset = 0x8,
207
208 .smsm_int.irq_name = NULL, /* RPM does not support SMSM */
209 .smsm_int.flags = 0,
210 .smsm_int.irq_id = 0,
211 .smsm_int.device_name = NULL,
212 .smsm_int.dev_id = 0,
213 .smsm_int.out_bit_pos = 0,
214 .smsm_int.out_base = NULL,
215 .smsm_int.out_offset = 0,
216 },
217};
218
219static struct smd_smem_regions aux_smem_areas[] = {
220 {
221 .phys_addr = (void *)(0xfc428000),
222 .size = 0x4000,
223 },
Jeff Hugo70946092012-02-10 11:30:43 -0700224};
225
Jeff Hugo3e366292012-03-29 15:19:14 -0600226static struct smd_subsystem_restart_config smd_ssr_cfg = {
227 .disable_smsm_reset_handshake = 1,
228};
229
Jeff Hugo70946092012-02-10 11:30:43 -0700230static struct smd_platform smd_platform_data = {
231 .num_ss_configs = ARRAY_SIZE(smd_config_list),
232 .smd_ss_configs = smd_config_list,
Jeff Hugo3e366292012-03-29 15:19:14 -0600233 .smd_ssr_config = &smd_ssr_cfg,
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600234 .num_smem_areas = ARRAY_SIZE(aux_smem_areas),
235 .smd_smem_areas = aux_smem_areas,
Jeff Hugo70946092012-02-10 11:30:43 -0700236};
237
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700238struct platform_device msm_device_smd_8974 = {
Jeff Hugo70946092012-02-10 11:30:43 -0700239 .name = "msm_smd",
240 .id = -1,
241 .resource = smd_resource,
242 .num_resources = ARRAY_SIZE(smd_resource),
243 .dev = {
244 .platform_data = &smd_platform_data,
245 }
246};
247
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700248static void __init msm_8974_calculate_reserve_sizes(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800249{
Olav Haugan49173442012-08-01 13:23:18 -0700250 reserve_ebi_memory();
Olav Hauganb800c8c2012-01-30 08:50:45 -0800251}
252
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700253static struct reserve_info msm_8974_reserve_info __initdata = {
254 .memtype_reserve_table = msm_8974_reserve_table,
255 .calculate_reserve_sizes = msm_8974_calculate_reserve_sizes,
256 .paddr_to_memtype = msm_8974_paddr_to_memtype,
Olav Hauganb800c8c2012-01-30 08:50:45 -0800257};
258
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700259static void __init msm_8974_early_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800260{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700261 reserve_info = &msm_8974_reserve_info;
Laura Abbottd8d0f772012-07-10 10:27:06 -0700262 of_scan_flat_dt(dt_scan_for_memory_reserve, msm_8974_reserve_table);
Olav Hauganb800c8c2012-01-30 08:50:45 -0800263}
264
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700265void __init msm_8974_reserve(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800266{
267 msm_reserve();
268}
269
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530270static struct platform_device android_usb_device = {
271 .name = "android_usb",
272 .id = -1,
273};
274
Gagan Macdd9bb792012-04-25 16:56:48 -0600275#define BIMC_BASE 0xfc380000
276#define BIMC_SIZE 0x0006A000
277#define SYS_NOC_BASE 0xfc460000
278#define PERIPH_NOC_BASE 0xFC468000
279#define OCMEM_NOC_BASE 0xfc470000
280#define MMSS_NOC_BASE 0xfc478000
281#define CONFIG_NOC_BASE 0xfc480000
282#define NOC_SIZE 0x00004000
283
284static struct resource bimc_res[] = {
285 {
286 .start = BIMC_BASE,
287 .end = BIMC_BASE + BIMC_SIZE,
288 .flags = IORESOURCE_MEM,
289 .name = "bimc_mem",
290 },
291};
292
293static struct resource ocmem_noc_res[] = {
294 {
295 .start = OCMEM_NOC_BASE,
296 .end = OCMEM_NOC_BASE + NOC_SIZE,
297 .flags = IORESOURCE_MEM,
298 .name = "ocmem_noc_mem",
299 },
300};
301
302static struct resource mmss_noc_res[] = {
303 {
304 .start = MMSS_NOC_BASE,
305 .end = MMSS_NOC_BASE + NOC_SIZE,
306 .flags = IORESOURCE_MEM,
307 .name = "mmss_noc_mem",
308 },
309};
310
311static struct resource sys_noc_res[] = {
312 {
313 .start = SYS_NOC_BASE,
314 .end = SYS_NOC_BASE + NOC_SIZE,
315 .flags = IORESOURCE_MEM,
316 .name = "sys_noc_mem",
317 },
318};
319
320static struct resource config_noc_res[] = {
321 {
322 .start = CONFIG_NOC_BASE,
323 .end = CONFIG_NOC_BASE + NOC_SIZE,
324 .flags = IORESOURCE_MEM,
325 .name = "config_noc_mem",
326 },
327};
328
329static struct resource periph_noc_res[] = {
330 {
331 .start = PERIPH_NOC_BASE,
332 .end = PERIPH_NOC_BASE + NOC_SIZE,
333 .flags = IORESOURCE_MEM,
334 .name = "periph_noc_mem",
335 },
336};
337
338static struct platform_device msm_bus_sys_noc = {
339 .name = "msm_bus_fabric",
340 .id = MSM_BUS_FAB_SYS_NOC,
341 .num_resources = ARRAY_SIZE(sys_noc_res),
342 .resource = sys_noc_res,
343};
344
345static struct platform_device msm_bus_bimc = {
346 .name = "msm_bus_fabric",
347 .id = MSM_BUS_FAB_BIMC,
348 .num_resources = ARRAY_SIZE(bimc_res),
349 .resource = bimc_res,
350};
351
352static struct platform_device msm_bus_mmss_noc = {
353 .name = "msm_bus_fabric",
354 .id = MSM_BUS_FAB_MMSS_NOC,
355 .num_resources = ARRAY_SIZE(mmss_noc_res),
356 .resource = mmss_noc_res,
357};
358
359static struct platform_device msm_bus_ocmem_noc = {
360 .name = "msm_bus_fabric",
361 .id = MSM_BUS_FAB_OCMEM_NOC,
362 .num_resources = ARRAY_SIZE(ocmem_noc_res),
363 .resource = ocmem_noc_res,
364};
365
366static struct platform_device msm_bus_periph_noc = {
367 .name = "msm_bus_fabric",
368 .id = MSM_BUS_FAB_PERIPH_NOC,
369 .num_resources = ARRAY_SIZE(periph_noc_res),
370 .resource = periph_noc_res,
371};
372
373static struct platform_device msm_bus_config_noc = {
374 .name = "msm_bus_fabric",
375 .id = MSM_BUS_FAB_CONFIG_NOC,
376 .num_resources = ARRAY_SIZE(config_noc_res),
377 .resource = config_noc_res,
378};
379
380static struct platform_device msm_bus_ocmem_vnoc = {
381 .name = "msm_bus_fabric",
382 .id = MSM_BUS_FAB_OCMEM_VNOC,
383};
384
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700385static struct platform_device *msm_bus_8974_devices[] = {
Gagan Macdd9bb792012-04-25 16:56:48 -0600386 &msm_bus_sys_noc,
387 &msm_bus_bimc,
388 &msm_bus_mmss_noc,
389 &msm_bus_ocmem_noc,
390 &msm_bus_periph_noc,
391 &msm_bus_config_noc,
392 &msm_bus_ocmem_vnoc,
393};
394
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700395static void __init msm8974_init_buses(void)
Gagan Macdd9bb792012-04-25 16:56:48 -0600396{
397#ifdef CONFIG_MSM_BUS_SCALING
398 msm_bus_sys_noc.dev.platform_data =
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700399 &msm_bus_8974_sys_noc_pdata;
400 msm_bus_bimc.dev.platform_data = &msm_bus_8974_bimc_pdata;
401 msm_bus_mmss_noc.dev.platform_data = &msm_bus_8974_mmss_noc_pdata;
402 msm_bus_ocmem_noc.dev.platform_data = &msm_bus_8974_ocmem_noc_pdata;
403 msm_bus_periph_noc.dev.platform_data = &msm_bus_8974_periph_noc_pdata;
404 msm_bus_config_noc.dev.platform_data = &msm_bus_8974_config_noc_pdata;
405 msm_bus_ocmem_vnoc.dev.platform_data = &msm_bus_8974_ocmem_vnoc_pdata;
Gagan Macdd9bb792012-04-25 16:56:48 -0600406#endif
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700407 platform_add_devices(msm_bus_8974_devices,
408 ARRAY_SIZE(msm_bus_8974_devices));
Gagan Macdd9bb792012-04-25 16:56:48 -0600409};
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700410
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700411void __init msm_8974_add_devices(void)
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700412{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700413 platform_device_register(&msm_device_smd_8974);
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530414 platform_device_register(&android_usb_device);
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700415 platform_add_devices(msm_8974_stub_regulator_devices,
416 msm_8974_stub_regulator_devices_len);
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700417}
418
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700419/*
420 * Used to satisfy dependencies for devices that need to be
421 * run early or in a particular order. Most likely your device doesn't fall
422 * into this category, and thus the driver should not be added here. The
423 * EPROBE_DEFER can satisfy most dependency problems.
424 */
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700425void __init msm_8974_add_drivers(void)
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700426{
Jeff Hugoa643ca12012-06-11 16:00:23 -0600427 msm_init_modem_notifier_list();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700428 msm_smd_init();
429 msm_rpm_driver_init();
Girish Mahadevan40abbe12012-04-25 14:58:13 -0600430 msm_lpmrs_module_init();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700431 rpm_regulator_smd_driver_init();
432 msm_spm_device_init();
433 regulator_stub_init();
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700434 if (machine_is_msm8974_rumi())
Vikram Mulukutla19245e02012-07-23 15:58:04 -0700435 msm_clock_init(&msm8974_rumi_clock_init_data);
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700436 else
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700437 msm_clock_init(&msm8974_clock_init_data);
438 msm8974_init_buses();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700439}
440
441static struct of_device_id irq_match[] __initdata = {
442 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
443 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
444 { .compatible = "qcom,spmi-pmic-arb", .data = qpnpint_of_init, },
445 {}
446};
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600447static struct of_device_id mpm_match[] __initdata = {
448 {.compatible = "qcom,mpm-v2", },
449 {},
450};
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700451
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700452void __init msm_8974_init_irq(void)
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700453{
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600454 struct device_node *node;
455
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700456 of_irq_init(irq_match);
Mahesh Sivasubramanian1a995322012-07-12 15:26:46 -0600457 node = of_find_matching_node(NULL, mpm_match);
458
459 WARN_ON(!node);
460
461 if (node)
462 of_mpm_init(node);
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700463}
464
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700465static struct of_dev_auxdata msm_8974_auxdata_lookup[] __initdata = {
Sathish Ambleyab783ab2011-11-27 22:21:48 -0800466 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
Sathish Ambley3d50c762011-10-25 15:26:00 -0700467 "msm_serial_hsl.0", NULL),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530468 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
469 "msm_otg", NULL),
Manu Gautam51be9712012-06-06 14:54:52 +0530470 OF_DEV_AUXDATA("qcom,dwc-usb3-msm", 0xF9200000, \
471 "msm_dwc3", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700472 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
473 "spi_qsd.1", NULL),
Kenneth Heitkef3c829c2012-01-13 17:02:43 -0700474 OF_DEV_AUXDATA("qcom,spmi-pmic-arb", 0xFC4C0000, \
475 "spmi-pmic-arb.0", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530476 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, \
David Ng665140f2012-04-12 16:03:45 -0700477 "msm_sdcc.1", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530478 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, \
479 "msm_sdcc.2", NULL),
480 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9864000, \
David Ng665140f2012-04-12 16:03:45 -0700481 "msm_sdcc.3", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530482 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98E4000, \
483 "msm_sdcc.4", NULL),
Matt Wagantallc2bbdc32012-03-21 19:44:50 -0700484 OF_DEV_AUXDATA("qcom,pil-q6v5-lpass", 0xFE200000, \
485 "pil-q6v5-lpass", NULL),
Matt Wagantall4e2599e2012-03-21 22:31:35 -0700486 OF_DEV_AUXDATA("qcom,pil-q6v5-mss", 0xFC880000, "pil-q6v5-mss", NULL),
Matt Wagantalle6e00d52012-03-08 17:39:07 -0800487 OF_DEV_AUXDATA("qcom,pil-mba", 0xFC820000, "pil-mba", NULL),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800488 OF_DEV_AUXDATA("qcom,pil-pronto", 0xFB21B000, \
489 "pil_pronto", NULL),
Hariprasad Dhalinarasimhade991f02012-05-31 13:15:51 -0700490 OF_DEV_AUXDATA("qcom,msm-rng", 0xF9BFF000, \
491 "msm_rng", NULL),
Ramesh Masavarapufb1f01e2012-06-14 09:40:40 -0700492 OF_DEV_AUXDATA("qcom,qseecom", 0xFE806000, \
493 "qseecom", NULL),
Adrian Salido-Moreno5ef3ac02012-05-14 18:40:47 -0700494 OF_DEV_AUXDATA("qcom,mdss_mdp", 0xFD900000, "mdp.0", NULL),
Siddartha Mohanadoss0a188882012-07-06 15:51:00 -0700495 OF_DEV_AUXDATA("qcom,msm-tsens", 0xFC4A8000, \
496 "msm-tsens", NULL),
Mona Hossainb43e94b2012-05-07 08:52:06 -0700497 OF_DEV_AUXDATA("qcom,qcedev", 0xFD440000, \
498 "qcedev.0", NULL),
499 OF_DEV_AUXDATA("qcom,qcrypto", 0xFD440000, \
500 "qcrypto.0", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700501 {}
502};
503
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700504void __init msm_8974_init(struct of_dev_auxdata **adata)
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700505{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700506 msm_8974_init_gpiomux();
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -0700507
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700508 *adata = msm_8974_auxdata_lookup;
Matt Wagantallecaa1172012-05-08 21:38:45 -0700509
510 regulator_has_full_constraints();
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700511}
Olav Hauganb800c8c2012-01-30 08:50:45 -0800512
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700513void __init msm_8974_very_early(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800514{
Abhimanyu Kapur90ced6e2012-06-26 17:41:25 -0700515 msm_8974_early_memory();
Olav Hauganb800c8c2012-01-30 08:50:45 -0800516}