blob: 4dda0b70cbf3d2ef8eeeb3b4a56f69448a29a00c [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#ifdef CONFIG_ION_MSM
24#include <linux/ion.h>
25#endif
26#include <linux/memory.h>
27#ifdef CONFIG_ANDROID_PMEM
28#include <linux/android_pmem.h>
29#endif
Michael Bohan037a0f52012-02-29 19:13:09 -080030#include <linux/regulator/stub-regulator.h>
Matt Wagantallecaa1172012-05-08 21:38:45 -070031#include <linux/regulator/machine.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070032#include <asm/mach/map.h>
33#include <asm/hardware/gic.h>
34#include <mach/board.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070035#include <mach/gpiomux.h>
36#include <mach/msm_iomap.h>
Olav Hauganb800c8c2012-01-30 08:50:45 -080037#ifdef CONFIG_ION_MSM
38#include <mach/ion.h>
39#endif
40#include <mach/msm_memtypes.h>
Jeff Hugo70946092012-02-10 11:30:43 -070041#include <mach/msm_smd.h>
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -060042#include <mach/rpm-smd.h>
David Collins8f4cebc2012-05-08 16:54:50 -070043#include <mach/rpm-regulator-smd.h>
Michael Bohan115cf652012-01-05 14:32:59 -080044#include <mach/qpnp-int.h>
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -070045#include <mach/socinfo.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"
Sathish Ambleyc58afc22011-10-09 21:55:39 -070050
Olav Hauganb800c8c2012-01-30 08:50:45 -080051#define MSM_KERNEL_EBI1_MEM_SIZE 0x280000
52#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
53#define MSM_ION_SF_SIZE 0x4000000 /* 64 Mbytes */
54#else
55#define MSM_ION_SF_SIZE 0x2800000 /* 40 Mbytes */
56#endif
Ashray Kulkarni2ad8a7d2012-05-15 14:03:44 -070057#define MSM_ION_MM_FW_SIZE 0xa00000 /* (10MB) */
Olav Hauganb800c8c2012-01-30 08:50:45 -080058#define MSM_ION_MM_SIZE 0x7800000 /* (120MB) */
59#define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */
60#define MSM_ION_MFC_SIZE SZ_8K
61#define MSM_ION_AUDIO_SIZE 0x2B4000
62#define MSM_ION_HEAP_NUM 8
63
64#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
65static unsigned kernel_ebi1_mem_size = MSM_KERNEL_EBI1_MEM_SIZE;
66static int __init kernel_ebi1_mem_size_setup(char *p)
67{
68 kernel_ebi1_mem_size = memparse(p, NULL);
69 return 0;
70}
71early_param("kernel_ebi1_mem_size", kernel_ebi1_mem_size_setup);
72#endif
73
74static struct memtype_reserve msm_copper_reserve_table[] __initdata = {
75 [MEMTYPE_SMI] = {
76 },
77 [MEMTYPE_EBI0] = {
78 .flags = MEMTYPE_FLAGS_1M_ALIGN,
79 },
80 [MEMTYPE_EBI1] = {
81 .flags = MEMTYPE_FLAGS_1M_ALIGN,
82 },
83};
84
85static int msm_copper_paddr_to_memtype(unsigned int paddr)
86{
87 return MEMTYPE_EBI1;
88}
89
90#ifdef CONFIG_ION_MSM
91static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
92 .permission_type = IPT_TYPE_MM_CARVEOUT,
93 .align = PAGE_SIZE,
94};
95
96static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
97 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
98 .align = PAGE_SIZE,
99};
100
101static struct ion_co_heap_pdata co_ion_pdata = {
102 .adjacent_mem_id = INVALID_HEAP_ID,
103 .align = PAGE_SIZE,
104};
105
106static struct ion_co_heap_pdata fw_co_ion_pdata = {
107 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
108 .align = SZ_128K,
109};
110
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800111/**
112 * These heaps are listed in the order they will be allocated. Due to
113 * video hardware restrictions and content protection the FW heap has to
114 * be allocated adjacent (below) the MM heap and the MFC heap has to be
115 * allocated after the MM heap to ensure MFC heap is not more than 256MB
116 * away from the base address of the FW heap.
117 * However, the order of FW heap and MM heap doesn't matter since these
118 * two heaps are taken care of by separate code to ensure they are adjacent
119 * to each other.
120 * Don't swap the order unless you know what you are doing!
121 */
Olav Hauganb800c8c2012-01-30 08:50:45 -0800122static struct ion_platform_data ion_pdata = {
123 .nr = MSM_ION_HEAP_NUM,
124 .heaps = {
125 {
126 .id = ION_SYSTEM_HEAP_ID,
127 .type = ION_HEAP_TYPE_SYSTEM,
128 .name = ION_VMALLOC_HEAP_NAME,
129 },
130 {
Olav Hauganb800c8c2012-01-30 08:50:45 -0800131 .id = ION_CP_MM_HEAP_ID,
132 .type = ION_HEAP_TYPE_CP,
133 .name = ION_MM_HEAP_NAME,
134 .size = MSM_ION_MM_SIZE,
135 .memory_type = ION_EBI_TYPE,
136 .extra_data = (void *) &cp_mm_ion_pdata,
137 },
138 {
139 .id = ION_MM_FIRMWARE_HEAP_ID,
140 .type = ION_HEAP_TYPE_CARVEOUT,
141 .name = ION_MM_FIRMWARE_HEAP_NAME,
142 .size = MSM_ION_MM_FW_SIZE,
143 .memory_type = ION_EBI_TYPE,
144 .extra_data = (void *) &fw_co_ion_pdata,
145 },
146 {
147 .id = ION_CP_MFC_HEAP_ID,
148 .type = ION_HEAP_TYPE_CP,
149 .name = ION_MFC_HEAP_NAME,
150 .size = MSM_ION_MFC_SIZE,
151 .memory_type = ION_EBI_TYPE,
152 .extra_data = (void *) &cp_mfc_ion_pdata,
153 },
154 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800155 .id = ION_SF_HEAP_ID,
156 .type = ION_HEAP_TYPE_CARVEOUT,
157 .name = ION_SF_HEAP_NAME,
158 .size = MSM_ION_SF_SIZE,
159 .memory_type = ION_EBI_TYPE,
160 .extra_data = (void *) &co_ion_pdata,
161 },
162 {
Olav Hauganb800c8c2012-01-30 08:50:45 -0800163 .id = ION_IOMMU_HEAP_ID,
164 .type = ION_HEAP_TYPE_IOMMU,
165 .name = ION_IOMMU_HEAP_NAME,
166 },
167 {
168 .id = ION_QSECOM_HEAP_ID,
169 .type = ION_HEAP_TYPE_CARVEOUT,
170 .name = ION_QSECOM_HEAP_NAME,
171 .size = MSM_ION_QSECOM_SIZE,
172 .memory_type = ION_EBI_TYPE,
173 .extra_data = (void *) &co_ion_pdata,
174 },
175 {
176 .id = ION_AUDIO_HEAP_ID,
177 .type = ION_HEAP_TYPE_CARVEOUT,
178 .name = ION_AUDIO_HEAP_NAME,
179 .size = MSM_ION_AUDIO_SIZE,
180 .memory_type = ION_EBI_TYPE,
181 .extra_data = (void *) &co_ion_pdata,
182 },
183 }
184};
185
186static struct platform_device ion_dev = {
187 .name = "ion-msm",
188 .id = 1,
189 .dev = { .platform_data = &ion_pdata },
190};
191
Stephen Boyd668d7652012-04-25 11:31:01 -0700192static void __init reserve_ion_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800193{
194 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
195 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
196 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
197 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
198 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
199 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
200#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
201 msm_copper_reserve_table[MEMTYPE_EBI1].size += kernel_ebi1_mem_size;
202#endif
203}
204#endif
205
Jeff Hugo70946092012-02-10 11:30:43 -0700206static struct resource smd_resource[] = {
207 {
208 .name = "modem_smd_in",
209 .start = 32 + 17, /* mss_sw_to_kpss_ipc_irq0 */
210 .flags = IORESOURCE_IRQ,
211 },
212 {
213 .name = "modem_smsm_in",
214 .start = 32 + 18, /* mss_sw_to_kpss_ipc_irq1 */
215 .flags = IORESOURCE_IRQ,
216 },
217 {
218 .name = "adsp_smd_in",
219 .start = 32 + 156, /* lpass_to_kpss_ipc_irq0 */
220 .flags = IORESOURCE_IRQ,
221 },
222 {
223 .name = "adsp_smsm_in",
224 .start = 32 + 157, /* lpass_to_kpss_ipc_irq1 */
225 .flags = IORESOURCE_IRQ,
226 },
227 {
228 .name = "wcnss_smd_in",
229 .start = 32 + 142, /* WcnssAppsSmdMedIrq */
230 .flags = IORESOURCE_IRQ,
231 },
232 {
233 .name = "wcnss_smsm_in",
Jeff Hugo89046272012-03-29 14:45:37 -0600234 .start = 32 + 144, /* RivaAppsWlanSmsmIrq */
Jeff Hugo70946092012-02-10 11:30:43 -0700235 .flags = IORESOURCE_IRQ,
236 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600237 {
238 .name = "rpm_smd_in",
239 .start = 32 + 168, /* rpm_to_kpss_ipc_irq4 */
240 .flags = IORESOURCE_IRQ,
241 },
Jeff Hugo70946092012-02-10 11:30:43 -0700242};
243
244static struct smd_subsystem_config smd_config_list[] = {
245 {
246 .irq_config_id = SMD_MODEM,
247 .subsys_name = "modem",
248 .edge = SMD_APPS_MODEM,
249
250 .smd_int.irq_name = "modem_smd_in",
251 .smd_int.flags = IRQF_TRIGGER_RISING,
252 .smd_int.irq_id = -1,
253 .smd_int.device_name = "smd_dev",
254 .smd_int.dev_id = 0,
255 .smd_int.out_bit_pos = 1 << 12,
256 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
257 .smd_int.out_offset = 0x8,
258
259 .smsm_int.irq_name = "modem_smsm_in",
260 .smsm_int.flags = IRQF_TRIGGER_RISING,
261 .smsm_int.irq_id = -1,
262 .smsm_int.device_name = "smsm_dev",
263 .smsm_int.dev_id = 0,
264 .smsm_int.out_bit_pos = 1 << 13,
265 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
266 .smsm_int.out_offset = 0x8,
267 },
268 {
269 .irq_config_id = SMD_Q6,
270 .subsys_name = "q6",
271 .edge = SMD_APPS_QDSP,
272
273 .smd_int.irq_name = "adsp_smd_in",
274 .smd_int.flags = IRQF_TRIGGER_RISING,
275 .smd_int.irq_id = -1,
276 .smd_int.device_name = "smd_dev",
277 .smd_int.dev_id = 0,
278 .smd_int.out_bit_pos = 1 << 8,
279 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
280 .smd_int.out_offset = 0x8,
281
282 .smsm_int.irq_name = "adsp_smsm_in",
283 .smsm_int.flags = IRQF_TRIGGER_RISING,
284 .smsm_int.irq_id = -1,
285 .smsm_int.device_name = "smsm_dev",
286 .smsm_int.dev_id = 0,
287 .smsm_int.out_bit_pos = 1 << 9,
288 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
289 .smsm_int.out_offset = 0x8,
290 },
291 {
292 .irq_config_id = SMD_WCNSS,
293 .subsys_name = "wcnss",
294 .edge = SMD_APPS_WCNSS,
295
296 .smd_int.irq_name = "wcnss_smd_in",
297 .smd_int.flags = IRQF_TRIGGER_RISING,
298 .smd_int.irq_id = -1,
299 .smd_int.device_name = "smd_dev",
300 .smd_int.dev_id = 0,
301 .smd_int.out_bit_pos = 1 << 17,
302 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
303 .smd_int.out_offset = 0x8,
304
305 .smsm_int.irq_name = "wcnss_smsm_in",
306 .smsm_int.flags = IRQF_TRIGGER_RISING,
307 .smsm_int.irq_id = -1,
308 .smsm_int.device_name = "smsm_dev",
309 .smsm_int.dev_id = 0,
310 .smsm_int.out_bit_pos = 1 << 19,
311 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
312 .smsm_int.out_offset = 0x8,
313 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600314 {
315 .irq_config_id = SMD_RPM,
316 .subsys_name = NULL, /* do not use PIL to load RPM */
317 .edge = SMD_APPS_RPM,
318
319 .smd_int.irq_name = "rpm_smd_in",
320 .smd_int.flags = IRQF_TRIGGER_RISING,
321 .smd_int.irq_id = -1,
322 .smd_int.device_name = "smd_dev",
323 .smd_int.dev_id = 0,
324 .smd_int.out_bit_pos = 1 << 0,
325 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
326 .smd_int.out_offset = 0x8,
327
328 .smsm_int.irq_name = NULL, /* RPM does not support SMSM */
329 .smsm_int.flags = 0,
330 .smsm_int.irq_id = 0,
331 .smsm_int.device_name = NULL,
332 .smsm_int.dev_id = 0,
333 .smsm_int.out_bit_pos = 0,
334 .smsm_int.out_base = NULL,
335 .smsm_int.out_offset = 0,
336 },
337};
338
339static struct smd_smem_regions aux_smem_areas[] = {
340 {
341 .phys_addr = (void *)(0xfc428000),
342 .size = 0x4000,
343 },
Jeff Hugo70946092012-02-10 11:30:43 -0700344};
345
Jeff Hugo3e366292012-03-29 15:19:14 -0600346static struct smd_subsystem_restart_config smd_ssr_cfg = {
347 .disable_smsm_reset_handshake = 1,
348};
349
Jeff Hugo70946092012-02-10 11:30:43 -0700350static struct smd_platform smd_platform_data = {
351 .num_ss_configs = ARRAY_SIZE(smd_config_list),
352 .smd_ss_configs = smd_config_list,
Jeff Hugo3e366292012-03-29 15:19:14 -0600353 .smd_ssr_config = &smd_ssr_cfg,
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600354 .num_smem_areas = ARRAY_SIZE(aux_smem_areas),
355 .smd_smem_areas = aux_smem_areas,
Jeff Hugo70946092012-02-10 11:30:43 -0700356};
357
358struct platform_device msm_device_smd_copper = {
359 .name = "msm_smd",
360 .id = -1,
361 .resource = smd_resource,
362 .num_resources = ARRAY_SIZE(smd_resource),
363 .dev = {
364 .platform_data = &smd_platform_data,
365 }
366};
367
Olav Hauganb800c8c2012-01-30 08:50:45 -0800368static void __init msm_copper_calculate_reserve_sizes(void)
369{
370#ifdef CONFIG_ION_MSM
371 reserve_ion_memory();
372#endif
373}
374
375static struct reserve_info msm_copper_reserve_info __initdata = {
376 .memtype_reserve_table = msm_copper_reserve_table,
377 .calculate_reserve_sizes = msm_copper_calculate_reserve_sizes,
378 .paddr_to_memtype = msm_copper_paddr_to_memtype,
379};
380
381static void __init msm_copper_early_memory(void)
382{
383 reserve_info = &msm_copper_reserve_info;
384}
385
386void __init msm_copper_reserve(void)
387{
388 msm_reserve();
389}
390
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530391static struct platform_device android_usb_device = {
392 .name = "android_usb",
393 .id = -1,
394};
395
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700396#define SHARED_IMEM_TZ_BASE 0xFE805720
Hariprasad Dhalinarasimha5a6d7d62012-05-29 17:48:52 -0700397static struct resource copper_tzlog_resources[] = {
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700398 {
399 .start = SHARED_IMEM_TZ_BASE,
400 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
401 .flags = IORESOURCE_MEM,
402 },
403};
404
Hariprasad Dhalinarasimha5a6d7d62012-05-29 17:48:52 -0700405struct platform_device copper_device_tz_log = {
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700406 .name = "tz_log",
407 .id = 0,
Hariprasad Dhalinarasimha5a6d7d62012-05-29 17:48:52 -0700408 .num_resources = ARRAY_SIZE(copper_tzlog_resources),
409 .resource = copper_tzlog_resources,
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700410};
411
412
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700413void __init msm_copper_add_devices(void)
414{
Olav Hauganb800c8c2012-01-30 08:50:45 -0800415#ifdef CONFIG_ION_MSM
416 platform_device_register(&ion_dev);
417#endif
Jeff Hugo70946092012-02-10 11:30:43 -0700418 platform_device_register(&msm_device_smd_copper);
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530419 platform_device_register(&android_usb_device);
Michael Bohan037a0f52012-02-29 19:13:09 -0800420 platform_add_devices(msm_copper_stub_regulator_devices,
421 msm_copper_stub_regulator_devices_len);
Hariprasad Dhalinarasimha5a6d7d62012-05-29 17:48:52 -0700422 platform_device_register(&copper_device_tz_log);
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700423}
424
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700425static struct clk_lookup msm_clocks_dummy[] = {
Matt Wagantallb3fe8992011-12-07 19:26:55 -0800426 CLK_DUMMY("xo", XO_CLK, NULL, OFF),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800427 CLK_DUMMY("xo", XO_CLK, "pil_pronto", OFF),
Sathish Ambley3d50c762011-10-25 15:26:00 -0700428 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
429 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
Sujit Reddy Thumma1a4a79e2011-11-04 09:44:32 +0530430 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
431 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
432 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
433 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530434 CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF),
435 CLK_DUMMY("core_clk", NULL, "msm_otg", OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530436 CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF),
Pavankumar Kondeti066bfbf2012-02-20 14:10:20 +0530437 CLK_DUMMY("xo", NULL, "msm_otg", OFF),
Yan He1466daa2011-11-30 17:25:38 -0800438 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
439 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
440 CLK_DUMMY("mem_clk", NULL, NULL, 0),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700441 CLK_DUMMY("core_clk", SPI_CLK, "spi_qsd.1", OFF),
442 CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.1", OFF),
Sagar Dharia218edb92012-01-15 18:03:01 -0700443 CLK_DUMMY("core_clk", NULL, "f9966000.i2c", 0),
444 CLK_DUMMY("iface_clk", NULL, "f9966000.i2c", 0),
Sagar Dhariaa316a962012-03-21 16:13:22 -0600445 CLK_DUMMY("core_clk", NULL, "fe12f000.slim", OFF),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700446};
447
448struct clock_init_data msm_dummy_clock_init_data __initdata = {
449 .table = msm_clocks_dummy,
450 .size = ARRAY_SIZE(msm_clocks_dummy),
451};
452
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700453/*
454 * Used to satisfy dependencies for devices that need to be
455 * run early or in a particular order. Most likely your device doesn't fall
456 * into this category, and thus the driver should not be added here. The
457 * EPROBE_DEFER can satisfy most dependency problems.
458 */
459void __init msm_copper_add_drivers(void)
460{
Jeff Hugoa643ca12012-06-11 16:00:23 -0600461 msm_init_modem_notifier_list();
Vikram Mulukutlaaa6f36c2012-06-12 18:16:29 -0700462 msm_smd_init();
463 msm_rpm_driver_init();
464 rpm_regulator_smd_driver_init();
465 msm_spm_device_init();
466 regulator_stub_init();
467 if (machine_is_copper_rumi())
468 msm_clock_init(&msm_dummy_clock_init_data);
469 else
470 msm_clock_init(&msmcopper_clock_init_data);
471}
472
473static struct of_device_id irq_match[] __initdata = {
474 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
475 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
476 { .compatible = "qcom,spmi-pmic-arb", .data = qpnpint_of_init, },
477 {}
478};
479
480void __init msm_copper_init_irq(void)
481{
482 of_irq_init(irq_match);
483}
484
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700485static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = {
Sathish Ambleyab783ab2011-11-27 22:21:48 -0800486 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
Sathish Ambley3d50c762011-10-25 15:26:00 -0700487 "msm_serial_hsl.0", NULL),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530488 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
489 "msm_otg", NULL),
Manu Gautam51be9712012-06-06 14:54:52 +0530490 OF_DEV_AUXDATA("qcom,dwc-usb3-msm", 0xF9200000, \
491 "msm_dwc3", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700492 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
493 "spi_qsd.1", NULL),
Kenneth Heitkef3c829c2012-01-13 17:02:43 -0700494 OF_DEV_AUXDATA("qcom,spmi-pmic-arb", 0xFC4C0000, \
495 "spmi-pmic-arb.0", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530496 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, \
David Ng665140f2012-04-12 16:03:45 -0700497 "msm_sdcc.1", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530498 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, \
499 "msm_sdcc.2", NULL),
500 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9864000, \
David Ng665140f2012-04-12 16:03:45 -0700501 "msm_sdcc.3", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530502 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98E4000, \
503 "msm_sdcc.4", NULL),
Matt Wagantallc2bbdc32012-03-21 19:44:50 -0700504 OF_DEV_AUXDATA("qcom,pil-q6v5-lpass", 0xFE200000, \
505 "pil-q6v5-lpass", NULL),
Matt Wagantall4e2599e2012-03-21 22:31:35 -0700506 OF_DEV_AUXDATA("qcom,pil-q6v5-mss", 0xFC880000, "pil-q6v5-mss", NULL),
Matt Wagantalle6e00d52012-03-08 17:39:07 -0800507 OF_DEV_AUXDATA("qcom,pil-mba", 0xFC820000, "pil-mba", NULL),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800508 OF_DEV_AUXDATA("qcom,pil-pronto", 0xFB21B000, \
509 "pil_pronto", NULL),
Hariprasad Dhalinarasimhade991f02012-05-31 13:15:51 -0700510 OF_DEV_AUXDATA("qcom,msm-rng", 0xF9BFF000, \
511 "msm_rng", NULL),
Ramesh Masavarapufb1f01e2012-06-14 09:40:40 -0700512 OF_DEV_AUXDATA("qcom,qseecom", 0xFE806000, \
513 "qseecom", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700514 {}
515};
516
517void __init msm_copper_init(struct of_dev_auxdata **adata)
518{
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700519 msm_copper_init_gpiomux();
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -0700520
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700521 *adata = msm_copper_auxdata_lookup;
Matt Wagantallecaa1172012-05-08 21:38:45 -0700522
523 regulator_has_full_constraints();
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700524}
Olav Hauganb800c8c2012-01-30 08:50:45 -0800525
526void __init msm_copper_very_early(void)
527{
528 msm_copper_early_memory();
529}