blob: f5fe3d1013c25444872d300ee0413bbf0e9da1f7 [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>
16#include <linux/irq.h>
17#include <linux/irqdomain.h>
18#include <linux/of.h>
19#include <linux/of_address.h>
20#include <linux/of_platform.h>
Michael Bohanc7224532012-01-06 16:02:52 -080021#include <linux/of_irq.h>
Olav Hauganb800c8c2012-01-30 08:50:45 -080022#ifdef CONFIG_ION_MSM
23#include <linux/ion.h>
24#endif
25#include <linux/memory.h>
26#ifdef CONFIG_ANDROID_PMEM
27#include <linux/android_pmem.h>
28#endif
Michael Bohan037a0f52012-02-29 19:13:09 -080029#include <linux/regulator/stub-regulator.h>
Matt Wagantallecaa1172012-05-08 21:38:45 -070030#include <linux/regulator/machine.h>
Sathish Ambleyc58afc22011-10-09 21:55:39 -070031#include <asm/mach/map.h>
32#include <asm/hardware/gic.h>
33#include <mach/board.h>
34#include <mach/gpio.h>
35#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>
Michael Bohan115cf652012-01-05 14:32:59 -080043#include <mach/qpnp-int.h>
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -070044#include <mach/socinfo.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"
Sathish Ambleyc58afc22011-10-09 21:55:39 -070048
Olav Hauganb800c8c2012-01-30 08:50:45 -080049#define MSM_KERNEL_EBI1_MEM_SIZE 0x280000
50#ifdef CONFIG_FB_MSM_HDMI_AS_PRIMARY
51#define MSM_ION_SF_SIZE 0x4000000 /* 64 Mbytes */
52#else
53#define MSM_ION_SF_SIZE 0x2800000 /* 40 Mbytes */
54#endif
Ashray Kulkarni2ad8a7d2012-05-15 14:03:44 -070055#define MSM_ION_MM_FW_SIZE 0xa00000 /* (10MB) */
Olav Hauganb800c8c2012-01-30 08:50:45 -080056#define MSM_ION_MM_SIZE 0x7800000 /* (120MB) */
57#define MSM_ION_QSECOM_SIZE 0x100000 /* (1MB) */
58#define MSM_ION_MFC_SIZE SZ_8K
59#define MSM_ION_AUDIO_SIZE 0x2B4000
60#define MSM_ION_HEAP_NUM 8
61
62#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
63static unsigned kernel_ebi1_mem_size = MSM_KERNEL_EBI1_MEM_SIZE;
64static int __init kernel_ebi1_mem_size_setup(char *p)
65{
66 kernel_ebi1_mem_size = memparse(p, NULL);
67 return 0;
68}
69early_param("kernel_ebi1_mem_size", kernel_ebi1_mem_size_setup);
70#endif
71
72static struct memtype_reserve msm_copper_reserve_table[] __initdata = {
73 [MEMTYPE_SMI] = {
74 },
75 [MEMTYPE_EBI0] = {
76 .flags = MEMTYPE_FLAGS_1M_ALIGN,
77 },
78 [MEMTYPE_EBI1] = {
79 .flags = MEMTYPE_FLAGS_1M_ALIGN,
80 },
81};
82
83static int msm_copper_paddr_to_memtype(unsigned int paddr)
84{
85 return MEMTYPE_EBI1;
86}
87
88#ifdef CONFIG_ION_MSM
89static struct ion_cp_heap_pdata cp_mm_ion_pdata = {
90 .permission_type = IPT_TYPE_MM_CARVEOUT,
91 .align = PAGE_SIZE,
92};
93
94static struct ion_cp_heap_pdata cp_mfc_ion_pdata = {
95 .permission_type = IPT_TYPE_MFC_SHAREDMEM,
96 .align = PAGE_SIZE,
97};
98
99static struct ion_co_heap_pdata co_ion_pdata = {
100 .adjacent_mem_id = INVALID_HEAP_ID,
101 .align = PAGE_SIZE,
102};
103
104static struct ion_co_heap_pdata fw_co_ion_pdata = {
105 .adjacent_mem_id = ION_CP_MM_HEAP_ID,
106 .align = SZ_128K,
107};
108
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800109/**
110 * These heaps are listed in the order they will be allocated. Due to
111 * video hardware restrictions and content protection the FW heap has to
112 * be allocated adjacent (below) the MM heap and the MFC heap has to be
113 * allocated after the MM heap to ensure MFC heap is not more than 256MB
114 * away from the base address of the FW heap.
115 * However, the order of FW heap and MM heap doesn't matter since these
116 * two heaps are taken care of by separate code to ensure they are adjacent
117 * to each other.
118 * Don't swap the order unless you know what you are doing!
119 */
Olav Hauganb800c8c2012-01-30 08:50:45 -0800120static struct ion_platform_data ion_pdata = {
121 .nr = MSM_ION_HEAP_NUM,
122 .heaps = {
123 {
124 .id = ION_SYSTEM_HEAP_ID,
125 .type = ION_HEAP_TYPE_SYSTEM,
126 .name = ION_VMALLOC_HEAP_NAME,
127 },
128 {
Olav Hauganb800c8c2012-01-30 08:50:45 -0800129 .id = ION_CP_MM_HEAP_ID,
130 .type = ION_HEAP_TYPE_CP,
131 .name = ION_MM_HEAP_NAME,
132 .size = MSM_ION_MM_SIZE,
133 .memory_type = ION_EBI_TYPE,
134 .extra_data = (void *) &cp_mm_ion_pdata,
135 },
136 {
137 .id = ION_MM_FIRMWARE_HEAP_ID,
138 .type = ION_HEAP_TYPE_CARVEOUT,
139 .name = ION_MM_FIRMWARE_HEAP_NAME,
140 .size = MSM_ION_MM_FW_SIZE,
141 .memory_type = ION_EBI_TYPE,
142 .extra_data = (void *) &fw_co_ion_pdata,
143 },
144 {
145 .id = ION_CP_MFC_HEAP_ID,
146 .type = ION_HEAP_TYPE_CP,
147 .name = ION_MFC_HEAP_NAME,
148 .size = MSM_ION_MFC_SIZE,
149 .memory_type = ION_EBI_TYPE,
150 .extra_data = (void *) &cp_mfc_ion_pdata,
151 },
152 {
Olav Haugan9cdfc2f2012-02-15 09:52:57 -0800153 .id = ION_SF_HEAP_ID,
154 .type = ION_HEAP_TYPE_CARVEOUT,
155 .name = ION_SF_HEAP_NAME,
156 .size = MSM_ION_SF_SIZE,
157 .memory_type = ION_EBI_TYPE,
158 .extra_data = (void *) &co_ion_pdata,
159 },
160 {
Olav Hauganb800c8c2012-01-30 08:50:45 -0800161 .id = ION_IOMMU_HEAP_ID,
162 .type = ION_HEAP_TYPE_IOMMU,
163 .name = ION_IOMMU_HEAP_NAME,
164 },
165 {
166 .id = ION_QSECOM_HEAP_ID,
167 .type = ION_HEAP_TYPE_CARVEOUT,
168 .name = ION_QSECOM_HEAP_NAME,
169 .size = MSM_ION_QSECOM_SIZE,
170 .memory_type = ION_EBI_TYPE,
171 .extra_data = (void *) &co_ion_pdata,
172 },
173 {
174 .id = ION_AUDIO_HEAP_ID,
175 .type = ION_HEAP_TYPE_CARVEOUT,
176 .name = ION_AUDIO_HEAP_NAME,
177 .size = MSM_ION_AUDIO_SIZE,
178 .memory_type = ION_EBI_TYPE,
179 .extra_data = (void *) &co_ion_pdata,
180 },
181 }
182};
183
184static struct platform_device ion_dev = {
185 .name = "ion-msm",
186 .id = 1,
187 .dev = { .platform_data = &ion_pdata },
188};
189
Stephen Boyd668d7652012-04-25 11:31:01 -0700190static void __init reserve_ion_memory(void)
Olav Hauganb800c8c2012-01-30 08:50:45 -0800191{
192 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_SIZE;
193 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MM_FW_SIZE;
194 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_SF_SIZE;
195 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_MFC_SIZE;
196 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_QSECOM_SIZE;
197 msm_copper_reserve_table[MEMTYPE_EBI1].size += MSM_ION_AUDIO_SIZE;
198#ifdef CONFIG_KERNEL_PMEM_EBI_REGION
199 msm_copper_reserve_table[MEMTYPE_EBI1].size += kernel_ebi1_mem_size;
200#endif
201}
202#endif
203
Jeff Hugo70946092012-02-10 11:30:43 -0700204static struct resource smd_resource[] = {
205 {
206 .name = "modem_smd_in",
207 .start = 32 + 17, /* mss_sw_to_kpss_ipc_irq0 */
208 .flags = IORESOURCE_IRQ,
209 },
210 {
211 .name = "modem_smsm_in",
212 .start = 32 + 18, /* mss_sw_to_kpss_ipc_irq1 */
213 .flags = IORESOURCE_IRQ,
214 },
215 {
216 .name = "adsp_smd_in",
217 .start = 32 + 156, /* lpass_to_kpss_ipc_irq0 */
218 .flags = IORESOURCE_IRQ,
219 },
220 {
221 .name = "adsp_smsm_in",
222 .start = 32 + 157, /* lpass_to_kpss_ipc_irq1 */
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .name = "wcnss_smd_in",
227 .start = 32 + 142, /* WcnssAppsSmdMedIrq */
228 .flags = IORESOURCE_IRQ,
229 },
230 {
231 .name = "wcnss_smsm_in",
Jeff Hugo89046272012-03-29 14:45:37 -0600232 .start = 32 + 144, /* RivaAppsWlanSmsmIrq */
Jeff Hugo70946092012-02-10 11:30:43 -0700233 .flags = IORESOURCE_IRQ,
234 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600235 {
236 .name = "rpm_smd_in",
237 .start = 32 + 168, /* rpm_to_kpss_ipc_irq4 */
238 .flags = IORESOURCE_IRQ,
239 },
Jeff Hugo70946092012-02-10 11:30:43 -0700240};
241
242static struct smd_subsystem_config smd_config_list[] = {
243 {
244 .irq_config_id = SMD_MODEM,
245 .subsys_name = "modem",
246 .edge = SMD_APPS_MODEM,
247
248 .smd_int.irq_name = "modem_smd_in",
249 .smd_int.flags = IRQF_TRIGGER_RISING,
250 .smd_int.irq_id = -1,
251 .smd_int.device_name = "smd_dev",
252 .smd_int.dev_id = 0,
253 .smd_int.out_bit_pos = 1 << 12,
254 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
255 .smd_int.out_offset = 0x8,
256
257 .smsm_int.irq_name = "modem_smsm_in",
258 .smsm_int.flags = IRQF_TRIGGER_RISING,
259 .smsm_int.irq_id = -1,
260 .smsm_int.device_name = "smsm_dev",
261 .smsm_int.dev_id = 0,
262 .smsm_int.out_bit_pos = 1 << 13,
263 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
264 .smsm_int.out_offset = 0x8,
265 },
266 {
267 .irq_config_id = SMD_Q6,
268 .subsys_name = "q6",
269 .edge = SMD_APPS_QDSP,
270
271 .smd_int.irq_name = "adsp_smd_in",
272 .smd_int.flags = IRQF_TRIGGER_RISING,
273 .smd_int.irq_id = -1,
274 .smd_int.device_name = "smd_dev",
275 .smd_int.dev_id = 0,
276 .smd_int.out_bit_pos = 1 << 8,
277 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
278 .smd_int.out_offset = 0x8,
279
280 .smsm_int.irq_name = "adsp_smsm_in",
281 .smsm_int.flags = IRQF_TRIGGER_RISING,
282 .smsm_int.irq_id = -1,
283 .smsm_int.device_name = "smsm_dev",
284 .smsm_int.dev_id = 0,
285 .smsm_int.out_bit_pos = 1 << 9,
286 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
287 .smsm_int.out_offset = 0x8,
288 },
289 {
290 .irq_config_id = SMD_WCNSS,
291 .subsys_name = "wcnss",
292 .edge = SMD_APPS_WCNSS,
293
294 .smd_int.irq_name = "wcnss_smd_in",
295 .smd_int.flags = IRQF_TRIGGER_RISING,
296 .smd_int.irq_id = -1,
297 .smd_int.device_name = "smd_dev",
298 .smd_int.dev_id = 0,
299 .smd_int.out_bit_pos = 1 << 17,
300 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
301 .smd_int.out_offset = 0x8,
302
303 .smsm_int.irq_name = "wcnss_smsm_in",
304 .smsm_int.flags = IRQF_TRIGGER_RISING,
305 .smsm_int.irq_id = -1,
306 .smsm_int.device_name = "smsm_dev",
307 .smsm_int.dev_id = 0,
308 .smsm_int.out_bit_pos = 1 << 19,
309 .smsm_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
310 .smsm_int.out_offset = 0x8,
311 },
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600312 {
313 .irq_config_id = SMD_RPM,
314 .subsys_name = NULL, /* do not use PIL to load RPM */
315 .edge = SMD_APPS_RPM,
316
317 .smd_int.irq_name = "rpm_smd_in",
318 .smd_int.flags = IRQF_TRIGGER_RISING,
319 .smd_int.irq_id = -1,
320 .smd_int.device_name = "smd_dev",
321 .smd_int.dev_id = 0,
322 .smd_int.out_bit_pos = 1 << 0,
323 .smd_int.out_base = (void __iomem *)MSM_APCS_GCC_BASE,
324 .smd_int.out_offset = 0x8,
325
326 .smsm_int.irq_name = NULL, /* RPM does not support SMSM */
327 .smsm_int.flags = 0,
328 .smsm_int.irq_id = 0,
329 .smsm_int.device_name = NULL,
330 .smsm_int.dev_id = 0,
331 .smsm_int.out_bit_pos = 0,
332 .smsm_int.out_base = NULL,
333 .smsm_int.out_offset = 0,
334 },
335};
336
337static struct smd_smem_regions aux_smem_areas[] = {
338 {
339 .phys_addr = (void *)(0xfc428000),
340 .size = 0x4000,
341 },
Jeff Hugo70946092012-02-10 11:30:43 -0700342};
343
Jeff Hugo3e366292012-03-29 15:19:14 -0600344static struct smd_subsystem_restart_config smd_ssr_cfg = {
345 .disable_smsm_reset_handshake = 1,
346};
347
Jeff Hugo70946092012-02-10 11:30:43 -0700348static struct smd_platform smd_platform_data = {
349 .num_ss_configs = ARRAY_SIZE(smd_config_list),
350 .smd_ss_configs = smd_config_list,
Jeff Hugo3e366292012-03-29 15:19:14 -0600351 .smd_ssr_config = &smd_ssr_cfg,
Jeff Hugo9a5dc6e2012-03-29 14:39:42 -0600352 .num_smem_areas = ARRAY_SIZE(aux_smem_areas),
353 .smd_smem_areas = aux_smem_areas,
Jeff Hugo70946092012-02-10 11:30:43 -0700354};
355
356struct platform_device msm_device_smd_copper = {
357 .name = "msm_smd",
358 .id = -1,
359 .resource = smd_resource,
360 .num_resources = ARRAY_SIZE(smd_resource),
361 .dev = {
362 .platform_data = &smd_platform_data,
363 }
364};
365
Olav Hauganb800c8c2012-01-30 08:50:45 -0800366static void __init msm_copper_calculate_reserve_sizes(void)
367{
368#ifdef CONFIG_ION_MSM
369 reserve_ion_memory();
370#endif
371}
372
373static struct reserve_info msm_copper_reserve_info __initdata = {
374 .memtype_reserve_table = msm_copper_reserve_table,
375 .calculate_reserve_sizes = msm_copper_calculate_reserve_sizes,
376 .paddr_to_memtype = msm_copper_paddr_to_memtype,
377};
378
379static void __init msm_copper_early_memory(void)
380{
381 reserve_info = &msm_copper_reserve_info;
382}
383
384void __init msm_copper_reserve(void)
385{
386 msm_reserve();
387}
388
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530389static struct platform_device android_usb_device = {
390 .name = "android_usb",
391 .id = -1,
392};
393
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700394#define SHARED_IMEM_TZ_BASE 0xFE805720
395static struct resource tzlog_resources[] = {
396 {
397 .start = SHARED_IMEM_TZ_BASE,
398 .end = SHARED_IMEM_TZ_BASE + SZ_4K - 1,
399 .flags = IORESOURCE_MEM,
400 },
401};
402
403struct platform_device apq_device_tz_log = {
404 .name = "tz_log",
405 .id = 0,
406 .num_resources = ARRAY_SIZE(tzlog_resources),
407 .resource = tzlog_resources,
408};
409
Hariprasad Dhalinarasimha3bd477a2012-05-23 12:02:54 -0700410#ifdef CONFIG_HW_RANDOM_MSM
411/* PRNG device */
412#define MSM_PRNG_PHYS 0xF9BFF000
413static struct resource rng_resources = {
414 .flags = IORESOURCE_MEM,
415 .start = MSM_PRNG_PHYS,
416 .end = MSM_PRNG_PHYS + SZ_512 - 1,
417};
418
419struct platform_device msm8974_device_rng = {
420 .name = "msm_rng",
421 .id = 0,
422 .num_resources = 1,
423 .resource = &rng_resources,
424};
425#endif
426
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700427
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700428void __init msm_copper_add_devices(void)
429{
Olav Hauganb800c8c2012-01-30 08:50:45 -0800430#ifdef CONFIG_ION_MSM
431 platform_device_register(&ion_dev);
432#endif
Jeff Hugo70946092012-02-10 11:30:43 -0700433 platform_device_register(&msm_device_smd_copper);
Pavankumar Kondeti8c447382012-03-29 09:02:09 +0530434 platform_device_register(&android_usb_device);
Michael Bohan037a0f52012-02-29 19:13:09 -0800435 platform_add_devices(msm_copper_stub_regulator_devices,
436 msm_copper_stub_regulator_devices_len);
Hariprasad Dhalinarasimhaf42732a2012-05-21 18:00:49 -0700437 platform_device_register(&apq_device_tz_log);
Hariprasad Dhalinarasimha3bd477a2012-05-23 12:02:54 -0700438#ifdef CONFIG_HW_RANDOM_MSM
439 platform_device_register(&msm8974_device_rng);
440#endif
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700441}
442
Michael Bohane7c2b472012-03-30 14:27:18 -0700443/*
444 * Used to satisfy dependencies for devices that need to be
445 * run early or in a particular order. Most likely your device doesn't fall
446 * into this category, and thus the driver should not be added here. The
447 * EPROBE_DEFER can satisfy most dependency problems.
448 */
449void __init msm_copper_add_drivers(void)
450{
Mahesh Sivasubramanian56186f82012-05-09 13:11:59 -0600451 msm_smd_init();
Mahesh Sivasubramaniana8ff9922012-03-27 17:50:42 -0600452 msm_rpm_driver_init();
Praveen Chidambaramda9501d2012-04-26 19:48:29 -0600453 msm_spm_device_init();
Michael Bohane7c2b472012-03-30 14:27:18 -0700454 regulator_stub_init();
455}
456
Michael Bohanc7224532012-01-06 16:02:52 -0800457static struct of_device_id irq_match[] __initdata = {
458 { .compatible = "qcom,msm-qgic2", .data = gic_of_init, },
Michael Bohan0425f6f2012-01-17 14:36:39 -0800459 { .compatible = "qcom,msm-gpio", .data = msm_gpio_of_init, },
Michael Bohan115cf652012-01-05 14:32:59 -0800460 { .compatible = "qcom,spmi-pmic-arb", .data = qpnpint_of_init, },
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700461 {}
462};
463
464void __init msm_copper_init_irq(void)
465{
Michael Bohanc7224532012-01-06 16:02:52 -0800466 of_irq_init(irq_match);
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700467}
468
469static struct clk_lookup msm_clocks_dummy[] = {
Matt Wagantallb3fe8992011-12-07 19:26:55 -0800470 CLK_DUMMY("xo", XO_CLK, NULL, OFF),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800471 CLK_DUMMY("xo", XO_CLK, "pil_pronto", OFF),
Sathish Ambley3d50c762011-10-25 15:26:00 -0700472 CLK_DUMMY("core_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
473 CLK_DUMMY("iface_clk", BLSP2_UART_CLK, "msm_serial_hsl.0", OFF),
Sujit Reddy Thumma1a4a79e2011-11-04 09:44:32 +0530474 CLK_DUMMY("core_clk", SDC1_CLK, NULL, OFF),
475 CLK_DUMMY("iface_clk", SDC1_P_CLK, NULL, OFF),
476 CLK_DUMMY("core_clk", SDC3_CLK, NULL, OFF),
477 CLK_DUMMY("iface_clk", SDC3_P_CLK, NULL, OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530478 CLK_DUMMY("phy_clk", NULL, "msm_otg", OFF),
479 CLK_DUMMY("core_clk", NULL, "msm_otg", OFF),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530480 CLK_DUMMY("iface_clk", NULL, "msm_otg", OFF),
Pavankumar Kondeti066bfbf2012-02-20 14:10:20 +0530481 CLK_DUMMY("xo", NULL, "msm_otg", OFF),
Yan He1466daa2011-11-30 17:25:38 -0800482 CLK_DUMMY("dfab_clk", DFAB_CLK, NULL, 0),
483 CLK_DUMMY("dma_bam_pclk", DMA_BAM_P_CLK, NULL, 0),
484 CLK_DUMMY("mem_clk", NULL, NULL, 0),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700485 CLK_DUMMY("core_clk", SPI_CLK, "spi_qsd.1", OFF),
486 CLK_DUMMY("iface_clk", SPI_P_CLK, "spi_qsd.1", OFF),
Sagar Dharia218edb92012-01-15 18:03:01 -0700487 CLK_DUMMY("core_clk", NULL, "f9966000.i2c", 0),
488 CLK_DUMMY("iface_clk", NULL, "f9966000.i2c", 0),
Sagar Dhariaa316a962012-03-21 16:13:22 -0600489 CLK_DUMMY("core_clk", NULL, "fe12f000.slim", OFF),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700490};
491
492struct clock_init_data msm_dummy_clock_init_data __initdata = {
493 .table = msm_clocks_dummy,
494 .size = ARRAY_SIZE(msm_clocks_dummy),
495};
496
497static struct of_dev_auxdata msm_copper_auxdata_lookup[] __initdata = {
Sathish Ambleyab783ab2011-11-27 22:21:48 -0800498 OF_DEV_AUXDATA("qcom,msm-lsuart-v14", 0xF991F000, \
Sathish Ambley3d50c762011-10-25 15:26:00 -0700499 "msm_serial_hsl.0", NULL),
Pavankumar Kondeti0063b842012-01-16 12:19:58 +0530500 OF_DEV_AUXDATA("qcom,hsusb-otg", 0xF9A55000, \
501 "msm_otg", NULL),
Harini Jayaraman5f98dbb2011-12-20 13:38:19 -0700502 OF_DEV_AUXDATA("qcom,spi-qup-v2", 0xF9924000, \
503 "spi_qsd.1", NULL),
Kenneth Heitkef3c829c2012-01-13 17:02:43 -0700504 OF_DEV_AUXDATA("qcom,spmi-pmic-arb", 0xFC4C0000, \
505 "spmi-pmic-arb.0", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530506 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9824000, \
David Ng665140f2012-04-12 16:03:45 -0700507 "msm_sdcc.1", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530508 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98A4000, \
509 "msm_sdcc.2", NULL),
510 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF9864000, \
David Ng665140f2012-04-12 16:03:45 -0700511 "msm_sdcc.3", NULL),
Sujit Reddy Thumma85fc52c2012-05-02 12:53:45 +0530512 OF_DEV_AUXDATA("qcom,msm-sdcc", 0xF98E4000, \
513 "msm_sdcc.4", NULL),
Matt Wagantallc2bbdc32012-03-21 19:44:50 -0700514 OF_DEV_AUXDATA("qcom,pil-q6v5-lpass", 0xFE200000, \
515 "pil-q6v5-lpass", NULL),
Tianyi Gouc1e049f82011-11-23 14:20:16 -0800516 OF_DEV_AUXDATA("qcom,pil-pronto", 0xFB21B000, \
517 "pil_pronto", NULL),
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700518 {}
519};
520
521void __init msm_copper_init(struct of_dev_auxdata **adata)
522{
Sathish Ambleyb17ec7e2012-04-03 15:20:03 -0700523 msm_copper_init_gpiomux();
Vikram Mulukutlaaeadb5f2012-05-04 14:03:07 -0700524
525 if (machine_is_copper_rumi())
526 msm_clock_init(&msm_dummy_clock_init_data);
527 else
528 msm_clock_init(&msmcopper_clock_init_data);
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700529
530 *adata = msm_copper_auxdata_lookup;
Matt Wagantallecaa1172012-05-08 21:38:45 -0700531
532 regulator_has_full_constraints();
Sathish Ambleyc58afc22011-10-09 21:55:39 -0700533}
Olav Hauganb800c8c2012-01-30 08:50:45 -0800534
535void __init msm_copper_very_early(void)
536{
537 msm_copper_early_memory();
538}