blob: e2a57f911fafb05915f85471a180579459e3c4ee [file] [log] [blame]
Praveen Chidambaramf27a5152013-02-01 11:44:53 -07001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Praveen Chidambaram78499012011-11-01 17:15:17 -06002 *
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
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
Steve Mucklef132c6c2012-06-06 18:30:57 -070016#include <asm/io.h>
Mitchel Humpherys0cc2bce2012-09-06 11:35:55 -070017#include <linux/msm_ion.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060018#include <mach/msm_iomap.h>
19#include <mach/irqs-8930.h>
20#include <mach/rpm.h>
Arun Menonaabf2632012-02-24 15:30:47 -080021#include <mach/msm_bus.h>
Gagan Maccd5b3272012-02-09 18:13:10 -070022#include <mach/msm_bus_board.h>
Arun Menonaabf2632012-02-24 15:30:47 -080023#include <mach/board.h>
24#include <mach/socinfo.h>
Laura Abbott0577d7b2012-04-17 11:14:30 -070025#include <mach/iommu_domains.h>
Laura Abbott532b2df2012-04-12 10:53:48 -070026#include <mach/msm_rtb.h>
Laura Abbottf3173042012-05-29 15:23:18 -070027#include <mach/msm_cache_dump.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060028
29#include "devices.h"
30#include "rpm_log.h"
31#include "rpm_stats.h"
Girish Mahadevan898c56d2012-06-05 16:09:19 -060032#include "rpm_rbcpr_stats.h"
Matt Wagantall1f65d9d2012-04-25 14:24:20 -070033#include "footswitch.h"
Patrick Dalyc1227cb2012-08-28 13:39:17 -070034#include "acpuclock-krait.h"
Praveen Chidambaramf27a5152013-02-01 11:44:53 -070035#include "pm.h"
Praveen Chidambaram78499012011-11-01 17:15:17 -060036
37#ifdef CONFIG_MSM_MPM
Subhash Jadavani909e04f2012-04-12 10:52:50 +053038#include <mach/mpm.h>
Praveen Chidambaram78499012011-11-01 17:15:17 -060039#endif
Anji Jonnala6c2b6852012-09-21 13:34:44 +053040#define MSM8930_PC_CNTR_PHYS (MSM8930_IMEM_PHYS + 0x664)
41#define MSM8930_PC_CNTR_SIZE 0x40
Anji Jonnala93129922012-10-09 20:57:53 +053042#define MSM8930_RPM_MASTER_STATS_BASE 0x10B100
Anji Jonnala6c2b6852012-09-21 13:34:44 +053043
44static struct resource msm8930_resources_pccntr[] = {
45 {
46 .start = MSM8930_PC_CNTR_PHYS,
47 .end = MSM8930_PC_CNTR_PHYS + MSM8930_PC_CNTR_SIZE,
48 .flags = IORESOURCE_MEM,
49 },
50};
51
Praveen Chidambaramf27a5152013-02-01 11:44:53 -070052static struct msm_pm_init_data_type msm_pm_data = {
53 .retention_calls_tz = true,
54};
55
Anji Jonnalaf91d8972013-02-26 17:55:50 +053056static struct msm_pm_sleep_status_data msm_pm_slp_sts_data = {
57 .base_addr = MSM_ACC0_BASE + 0x08,
58 .cpu_offset = MSM_ACC1_BASE - MSM_ACC0_BASE,
59 .mask = 1UL << 13,
60};
61
62struct platform_device msm8930_cpu_slp_status = {
63 .name = "cpu_slp_status",
64 .id = -1,
65 .dev = {
66 .platform_data = &msm_pm_slp_sts_data,
67 },
68};
69
Praveen Chidambaramf27a5152013-02-01 11:44:53 -070070struct platform_device msm8930_pm_8x60 = {
71 .name = "pm-8x60",
Anji Jonnala6c2b6852012-09-21 13:34:44 +053072 .id = -1,
73 .num_resources = ARRAY_SIZE(msm8930_resources_pccntr),
74 .resource = msm8930_resources_pccntr,
Praveen Chidambaramf27a5152013-02-01 11:44:53 -070075 .dev = {
76 .platform_data = &msm_pm_data,
77 },
Anji Jonnala6c2b6852012-09-21 13:34:44 +053078};
Praveen Chidambaram78499012011-11-01 17:15:17 -060079
80struct msm_rpm_platform_data msm8930_rpm_data __initdata = {
81 .reg_base_addrs = {
82 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
83 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
84 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
85 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
86 },
87 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
Stephen Boydf61255e2012-02-24 14:31:09 -080088 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
Praveen Chidambarame396ce62012-03-30 11:15:57 -060089 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
Praveen Chidambaram78499012011-11-01 17:15:17 -060090 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
91 .ipc_rpm_val = 4,
92 .target_id = {
93 MSM_RPM_MAP(8930, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
94 MSM_RPM_MAP(8930, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
95 MSM_RPM_MAP(8930, INVALIDATE_0, INVALIDATE, 8),
Mahesh Sivasubramanianef2a0fa2012-01-24 15:57:01 -070096 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
97 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
Praveen Chidambaram78499012011-11-01 17:15:17 -060098 MSM_RPM_MAP(8930, RPM_CTL, RPM_CTL, 1),
99 MSM_RPM_MAP(8930, CXO_CLK, CXO_CLK, 1),
100 MSM_RPM_MAP(8930, PXO_CLK, PXO_CLK, 1),
101 MSM_RPM_MAP(8930, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
102 MSM_RPM_MAP(8930, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
103 MSM_RPM_MAP(8930, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
104 MSM_RPM_MAP(8930, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
105 MSM_RPM_MAP(8930, SFPB_CLK, SFPB_CLK, 1),
106 MSM_RPM_MAP(8930, CFPB_CLK, CFPB_CLK, 1),
107 MSM_RPM_MAP(8930, MMFPB_CLK, MMFPB_CLK, 1),
108 MSM_RPM_MAP(8930, EBI1_CLK, EBI1_CLK, 1),
109 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_HALT_0,
110 APPS_FABRIC_CFG_HALT, 2),
111 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_CLKMOD_0,
112 APPS_FABRIC_CFG_CLKMOD, 3),
113 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_IOCTL,
114 APPS_FABRIC_CFG_IOCTL, 1),
Mahesh Sivasubramanian2d2c70592012-03-20 17:07:24 -0600115 MSM_RPM_MAP(8930, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6),
Praveen Chidambaram78499012011-11-01 17:15:17 -0600116 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_HALT_0,
117 SYS_FABRIC_CFG_HALT, 2),
118 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_CLKMOD_0,
119 SYS_FABRIC_CFG_CLKMOD, 3),
120 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_IOCTL,
121 SYS_FABRIC_CFG_IOCTL, 1),
122 MSM_RPM_MAP(8930, SYSTEM_FABRIC_ARB_0,
Mahesh Sivasubramanian2d2c70592012-03-20 17:07:24 -0600123 SYSTEM_FABRIC_ARB, 20),
Praveen Chidambaram78499012011-11-01 17:15:17 -0600124 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_HALT_0,
125 MMSS_FABRIC_CFG_HALT, 2),
126 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_CLKMOD_0,
127 MMSS_FABRIC_CFG_CLKMOD, 3),
128 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_IOCTL,
129 MMSS_FABRIC_CFG_IOCTL, 1),
Mahesh Sivasubramanian2d2c70592012-03-20 17:07:24 -0600130 MSM_RPM_MAP(8930, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 11),
Praveen Chidambaram78499012011-11-01 17:15:17 -0600131 MSM_RPM_MAP(8930, PM8038_S1_0, PM8038_S1, 2),
132 MSM_RPM_MAP(8930, PM8038_S2_0, PM8038_S2, 2),
133 MSM_RPM_MAP(8930, PM8038_S3_0, PM8038_S3, 2),
134 MSM_RPM_MAP(8930, PM8038_S4_0, PM8038_S4, 2),
135 MSM_RPM_MAP(8930, PM8038_S5_0, PM8038_S5, 2),
136 MSM_RPM_MAP(8930, PM8038_S6_0, PM8038_S6, 2),
137 MSM_RPM_MAP(8930, PM8038_L1_0, PM8038_L1, 2),
138 MSM_RPM_MAP(8930, PM8038_L2_0, PM8038_L2, 2),
139 MSM_RPM_MAP(8930, PM8038_L3_0, PM8038_L3, 2),
140 MSM_RPM_MAP(8930, PM8038_L4_0, PM8038_L4, 2),
141 MSM_RPM_MAP(8930, PM8038_L5_0, PM8038_L5, 2),
142 MSM_RPM_MAP(8930, PM8038_L6_0, PM8038_L6, 2),
143 MSM_RPM_MAP(8930, PM8038_L7_0, PM8038_L7, 2),
144 MSM_RPM_MAP(8930, PM8038_L8_0, PM8038_L8, 2),
145 MSM_RPM_MAP(8930, PM8038_L9_0, PM8038_L9, 2),
146 MSM_RPM_MAP(8930, PM8038_L10_0, PM8038_L10, 2),
147 MSM_RPM_MAP(8930, PM8038_L11_0, PM8038_L11, 2),
148 MSM_RPM_MAP(8930, PM8038_L12_0, PM8038_L12, 2),
149 MSM_RPM_MAP(8930, PM8038_L13_0, PM8038_L13, 2),
150 MSM_RPM_MAP(8930, PM8038_L14_0, PM8038_L14, 2),
151 MSM_RPM_MAP(8930, PM8038_L15_0, PM8038_L15, 2),
152 MSM_RPM_MAP(8930, PM8038_L16_0, PM8038_L16, 2),
153 MSM_RPM_MAP(8930, PM8038_L17_0, PM8038_L17, 2),
154 MSM_RPM_MAP(8930, PM8038_L18_0, PM8038_L18, 2),
155 MSM_RPM_MAP(8930, PM8038_L19_0, PM8038_L19, 2),
156 MSM_RPM_MAP(8930, PM8038_L20_0, PM8038_L20, 2),
157 MSM_RPM_MAP(8930, PM8038_L21_0, PM8038_L21, 2),
158 MSM_RPM_MAP(8930, PM8038_L22_0, PM8038_L22, 2),
159 MSM_RPM_MAP(8930, PM8038_L23_0, PM8038_L23, 2),
160 MSM_RPM_MAP(8930, PM8038_L24_0, PM8038_L24, 2),
161 MSM_RPM_MAP(8930, PM8038_L25_0, PM8038_L25, 2),
162 MSM_RPM_MAP(8930, PM8038_L26_0, PM8038_L26, 2),
163 MSM_RPM_MAP(8930, PM8038_L27_0, PM8038_L27, 2),
164 MSM_RPM_MAP(8930, PM8038_CLK1_0, PM8038_CLK1, 2),
165 MSM_RPM_MAP(8930, PM8038_CLK2_0, PM8038_CLK2, 2),
166 MSM_RPM_MAP(8930, PM8038_LVS1, PM8038_LVS1, 1),
167 MSM_RPM_MAP(8930, PM8038_LVS2, PM8038_LVS2, 1),
David Collins64c86fb2012-11-29 17:31:39 -0800168 MSM_RPM_MAP_PMIC(8930, 8038, NCP_0, NCP, 2),
169 MSM_RPM_MAP_PMIC(8930, 8038, CXO_BUFFERS, CXO_BUFFERS, 1),
170 MSM_RPM_MAP_PMIC(8930, 8038, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
171 MSM_RPM_MAP_PMIC(8930, 8038, HDMI_SWITCH, HDMI_SWITCH, 1),
172 MSM_RPM_MAP_PMIC(8930, 8038, QDSS_CLK, QDSS_CLK, 1),
173 MSM_RPM_MAP_PMIC(8930, 8038, VOLTAGE_CORNER, VOLTAGE_CORNER, 1),
Praveen Chidambaram78499012011-11-01 17:15:17 -0600174 },
175 .target_status = {
176 MSM_RPM_STATUS_ID_MAP(8930, VERSION_MAJOR),
177 MSM_RPM_STATUS_ID_MAP(8930, VERSION_MINOR),
178 MSM_RPM_STATUS_ID_MAP(8930, VERSION_BUILD),
179 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_0),
180 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_1),
181 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_2),
182 MSM_RPM_STATUS_ID_MAP(8930, RESERVED_SUPPORTED_RESOURCES_0),
183 MSM_RPM_STATUS_ID_MAP(8930, SEQUENCE),
184 MSM_RPM_STATUS_ID_MAP(8930, RPM_CTL),
185 MSM_RPM_STATUS_ID_MAP(8930, CXO_CLK),
186 MSM_RPM_STATUS_ID_MAP(8930, PXO_CLK),
187 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CLK),
188 MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_CLK),
189 MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_CLK),
190 MSM_RPM_STATUS_ID_MAP(8930, DAYTONA_FABRIC_CLK),
191 MSM_RPM_STATUS_ID_MAP(8930, SFPB_CLK),
192 MSM_RPM_STATUS_ID_MAP(8930, CFPB_CLK),
193 MSM_RPM_STATUS_ID_MAP(8930, MMFPB_CLK),
194 MSM_RPM_STATUS_ID_MAP(8930, EBI1_CLK),
195 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_HALT),
196 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_CLKMOD),
197 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_IOCTL),
198 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_ARB),
199 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_HALT),
200 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_CLKMOD),
201 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_IOCTL),
202 MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_ARB),
203 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_HALT),
204 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_CLKMOD),
205 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_IOCTL),
206 MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_ARB),
207 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S1_0),
208 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S1_1),
209 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S2_0),
210 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S2_1),
211 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S3_0),
212 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S3_1),
213 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S4_0),
214 MSM_RPM_STATUS_ID_MAP(8930, PM8038_S4_1),
215 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L1_0),
216 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L1_1),
217 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L2_0),
218 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L2_1),
219 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L3_0),
220 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L3_1),
221 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L4_0),
222 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L4_1),
223 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L5_0),
224 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L5_1),
225 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L6_0),
226 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L6_1),
227 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L7_0),
228 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L7_1),
229 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L8_0),
230 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L8_1),
231 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L9_0),
232 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L9_1),
233 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L10_0),
234 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L10_1),
235 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L11_0),
236 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L11_1),
237 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L12_0),
238 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L12_1),
239 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L13_0),
240 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L13_1),
241 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L14_0),
242 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L14_1),
243 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L15_0),
244 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L15_1),
245 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L16_0),
246 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L16_1),
247 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L17_0),
248 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L17_1),
249 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L18_0),
250 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L18_1),
251 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L19_0),
252 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L19_1),
253 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L20_0),
254 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L20_1),
255 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L21_0),
256 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L21_1),
257 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L22_0),
258 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L22_1),
259 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L23_0),
260 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L23_1),
261 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L24_0),
262 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L24_1),
263 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L25_0),
264 MSM_RPM_STATUS_ID_MAP(8930, PM8038_L25_1),
265 MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK1_0),
266 MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK1_1),
267 MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK2_0),
268 MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK2_1),
269 MSM_RPM_STATUS_ID_MAP(8930, PM8038_LVS1),
270 MSM_RPM_STATUS_ID_MAP(8930, PM8038_LVS2),
Praveen Chidambaram75b8c812012-08-10 16:26:37 -0600271 MSM_RPM_STATUS_ID_MAP(8930, PM8038_NCP_0),
272 MSM_RPM_STATUS_ID_MAP(8930, PM8038_NCP_1),
273 MSM_RPM_STATUS_ID_MAP(8930, PM8038_CXO_BUFFERS),
274 MSM_RPM_STATUS_ID_MAP(8930, PM8038_USB_OTG_SWITCH),
275 MSM_RPM_STATUS_ID_MAP(8930, PM8038_HDMI_SWITCH),
276 MSM_RPM_STATUS_ID_MAP(8930, PM8038_QDSS_CLK),
277 MSM_RPM_STATUS_ID_MAP(8930, PM8038_VOLTAGE_CORNER),
Praveen Chidambaram78499012011-11-01 17:15:17 -0600278 },
279 .target_ctrl_id = {
280 MSM_RPM_CTRL_MAP(8930, VERSION_MAJOR),
281 MSM_RPM_CTRL_MAP(8930, VERSION_MINOR),
282 MSM_RPM_CTRL_MAP(8930, VERSION_BUILD),
283 MSM_RPM_CTRL_MAP(8930, REQ_CTX_0),
284 MSM_RPM_CTRL_MAP(8930, REQ_SEL_0),
285 MSM_RPM_CTRL_MAP(8930, ACK_CTX_0),
286 MSM_RPM_CTRL_MAP(8930, ACK_SEL_0),
287 },
288 .sel_invalidate = MSM_RPM_8930_SEL_INVALIDATE,
289 .sel_notification = MSM_RPM_8930_SEL_NOTIFICATION,
290 .sel_last = MSM_RPM_8930_SEL_LAST,
291 .ver = {3, 0, 0},
292};
293
Praveen Chidambaram75b8c812012-08-10 16:26:37 -0600294struct msm_rpm_platform_data msm8930_rpm_data_pm8917 __initdata = {
295 .reg_base_addrs = {
296 [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE,
297 [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400,
298 [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600,
299 [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00,
300 },
301 .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ,
302 .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ,
303 .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ,
304 .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008,
305 .ipc_rpm_val = 4,
306 .target_id = {
307 MSM_RPM_MAP(8930, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4),
308 MSM_RPM_MAP(8930, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4),
309 MSM_RPM_MAP(8930, INVALIDATE_0, INVALIDATE, 8),
310 MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1),
311 MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1),
312 MSM_RPM_MAP(8930, RPM_CTL, RPM_CTL, 1),
313 MSM_RPM_MAP(8930, CXO_CLK, CXO_CLK, 1),
314 MSM_RPM_MAP(8930, PXO_CLK, PXO_CLK, 1),
315 MSM_RPM_MAP(8930, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1),
316 MSM_RPM_MAP(8930, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1),
317 MSM_RPM_MAP(8930, MM_FABRIC_CLK, MM_FABRIC_CLK, 1),
318 MSM_RPM_MAP(8930, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1),
319 MSM_RPM_MAP(8930, SFPB_CLK, SFPB_CLK, 1),
320 MSM_RPM_MAP(8930, CFPB_CLK, CFPB_CLK, 1),
321 MSM_RPM_MAP(8930, MMFPB_CLK, MMFPB_CLK, 1),
322 MSM_RPM_MAP(8930, EBI1_CLK, EBI1_CLK, 1),
323 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_HALT_0,
324 APPS_FABRIC_CFG_HALT, 2),
325 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_CLKMOD_0,
326 APPS_FABRIC_CFG_CLKMOD, 3),
327 MSM_RPM_MAP(8930, APPS_FABRIC_CFG_IOCTL,
328 APPS_FABRIC_CFG_IOCTL, 1),
329 MSM_RPM_MAP(8930, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6),
330 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_HALT_0,
331 SYS_FABRIC_CFG_HALT, 2),
332 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_CLKMOD_0,
333 SYS_FABRIC_CFG_CLKMOD, 3),
334 MSM_RPM_MAP(8930, SYS_FABRIC_CFG_IOCTL,
335 SYS_FABRIC_CFG_IOCTL, 1),
336 MSM_RPM_MAP(8930, SYSTEM_FABRIC_ARB_0,
337 SYSTEM_FABRIC_ARB, 20),
338 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_HALT_0,
339 MMSS_FABRIC_CFG_HALT, 2),
340 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_CLKMOD_0,
341 MMSS_FABRIC_CFG_CLKMOD, 3),
342 MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_IOCTL,
343 MMSS_FABRIC_CFG_IOCTL, 1),
344 MSM_RPM_MAP(8930, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 11),
345 MSM_RPM_MAP(8930, PM8917_S1_0, PM8917_S1, 2),
346 MSM_RPM_MAP(8930, PM8917_S2_0, PM8917_S2, 2),
347 MSM_RPM_MAP(8930, PM8917_S3_0, PM8917_S3, 2),
348 MSM_RPM_MAP(8930, PM8917_S4_0, PM8917_S4, 2),
349 MSM_RPM_MAP(8930, PM8917_S5_0, PM8917_S5, 2),
350 MSM_RPM_MAP(8930, PM8917_S6_0, PM8917_S6, 2),
351 MSM_RPM_MAP(8930, PM8917_S7_0, PM8917_S7, 2),
352 MSM_RPM_MAP(8930, PM8917_S8_0, PM8917_S8, 2),
353 MSM_RPM_MAP(8930, PM8917_L1_0, PM8917_L1, 2),
354 MSM_RPM_MAP(8930, PM8917_L2_0, PM8917_L2, 2),
355 MSM_RPM_MAP(8930, PM8917_L3_0, PM8917_L3, 2),
356 MSM_RPM_MAP(8930, PM8917_L4_0, PM8917_L4, 2),
357 MSM_RPM_MAP(8930, PM8917_L5_0, PM8917_L5, 2),
358 MSM_RPM_MAP(8930, PM8917_L6_0, PM8917_L6, 2),
359 MSM_RPM_MAP(8930, PM8917_L7_0, PM8917_L7, 2),
360 MSM_RPM_MAP(8930, PM8917_L8_0, PM8917_L8, 2),
361 MSM_RPM_MAP(8930, PM8917_L9_0, PM8917_L9, 2),
362 MSM_RPM_MAP(8930, PM8917_L10_0, PM8917_L10, 2),
363 MSM_RPM_MAP(8930, PM8917_L11_0, PM8917_L11, 2),
364 MSM_RPM_MAP(8930, PM8917_L12_0, PM8917_L12, 2),
365 MSM_RPM_MAP(8930, PM8917_L14_0, PM8917_L14, 2),
366 MSM_RPM_MAP(8930, PM8917_L15_0, PM8917_L15, 2),
367 MSM_RPM_MAP(8930, PM8917_L16_0, PM8917_L16, 2),
368 MSM_RPM_MAP(8930, PM8917_L17_0, PM8917_L17, 2),
369 MSM_RPM_MAP(8930, PM8917_L18_0, PM8917_L18, 2),
370 MSM_RPM_MAP(8930, PM8917_L21_0, PM8917_L21, 2),
371 MSM_RPM_MAP(8930, PM8917_L22_0, PM8917_L22, 2),
372 MSM_RPM_MAP(8930, PM8917_L23_0, PM8917_L23, 2),
373 MSM_RPM_MAP(8930, PM8917_L24_0, PM8917_L24, 2),
374 MSM_RPM_MAP(8930, PM8917_L25_0, PM8917_L25, 2),
375 MSM_RPM_MAP(8930, PM8917_L26_0, PM8917_L26, 2),
376 MSM_RPM_MAP(8930, PM8917_L27_0, PM8917_L27, 2),
377 MSM_RPM_MAP(8930, PM8917_L28_0, PM8917_L28, 2),
378 MSM_RPM_MAP(8930, PM8917_L29_0, PM8917_L29, 2),
379 MSM_RPM_MAP(8930, PM8917_L30_0, PM8917_L30, 2),
380 MSM_RPM_MAP(8930, PM8917_L31_0, PM8917_L31, 2),
381 MSM_RPM_MAP(8930, PM8917_L32_0, PM8917_L32, 2),
382 MSM_RPM_MAP(8930, PM8917_L33_0, PM8917_L33, 2),
383 MSM_RPM_MAP(8930, PM8917_L34_0, PM8917_L34, 2),
384 MSM_RPM_MAP(8930, PM8917_L35_0, PM8917_L35, 2),
385 MSM_RPM_MAP(8930, PM8917_L36_0, PM8917_L36, 2),
386 MSM_RPM_MAP(8930, PM8917_CLK1_0, PM8917_CLK1, 2),
387 MSM_RPM_MAP(8930, PM8917_CLK2_0, PM8917_CLK2, 2),
388 MSM_RPM_MAP(8930, PM8917_LVS1, PM8917_LVS1, 1),
389 MSM_RPM_MAP(8930, PM8917_LVS3, PM8917_LVS3, 1),
390 MSM_RPM_MAP(8930, PM8917_LVS4, PM8917_LVS4, 1),
391 MSM_RPM_MAP(8930, PM8917_LVS5, PM8917_LVS5, 1),
392 MSM_RPM_MAP(8930, PM8917_LVS6, PM8917_LVS6, 1),
393 MSM_RPM_MAP(8930, PM8917_LVS7, PM8917_LVS7, 1),
David Collins64c86fb2012-11-29 17:31:39 -0800394 MSM_RPM_MAP_PMIC(8930, 8917, NCP_0, NCP, 2),
395 MSM_RPM_MAP_PMIC(8930, 8917, CXO_BUFFERS, CXO_BUFFERS, 1),
396 MSM_RPM_MAP_PMIC(8930, 8917, USB_OTG_SWITCH, USB_OTG_SWITCH, 1),
397 MSM_RPM_MAP_PMIC(8930, 8917, HDMI_SWITCH, HDMI_SWITCH, 1),
398 MSM_RPM_MAP_PMIC(8930, 8917, QDSS_CLK, QDSS_CLK, 1),
399 MSM_RPM_MAP_PMIC(8930, 8917, VOLTAGE_CORNER, VOLTAGE_CORNER, 1),
Praveen Chidambaram75b8c812012-08-10 16:26:37 -0600400 },
401 .target_status = {
402 MSM_RPM_STATUS_ID_MAP(8930, VERSION_MAJOR),
403 MSM_RPM_STATUS_ID_MAP(8930, VERSION_MINOR),
404 MSM_RPM_STATUS_ID_MAP(8930, VERSION_BUILD),
405 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_0),
406 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_1),
407 MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_2),
408 MSM_RPM_STATUS_ID_MAP(8930, RESERVED_SUPPORTED_RESOURCES_0),
409 MSM_RPM_STATUS_ID_MAP(8930, SEQUENCE),
410 MSM_RPM_STATUS_ID_MAP(8930, RPM_CTL),
411 MSM_RPM_STATUS_ID_MAP(8930, CXO_CLK),
412 MSM_RPM_STATUS_ID_MAP(8930, PXO_CLK),
413 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CLK),
414 MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_CLK),
415 MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_CLK),
416 MSM_RPM_STATUS_ID_MAP(8930, DAYTONA_FABRIC_CLK),
417 MSM_RPM_STATUS_ID_MAP(8930, SFPB_CLK),
418 MSM_RPM_STATUS_ID_MAP(8930, CFPB_CLK),
419 MSM_RPM_STATUS_ID_MAP(8930, MMFPB_CLK),
420 MSM_RPM_STATUS_ID_MAP(8930, EBI1_CLK),
421 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_HALT),
422 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_CLKMOD),
423 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_IOCTL),
424 MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_ARB),
425 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_HALT),
426 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_CLKMOD),
427 MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_IOCTL),
428 MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_ARB),
429 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_HALT),
430 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_CLKMOD),
431 MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_IOCTL),
432 MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_ARB),
433 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S1_0),
434 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S1_1),
435 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S2_0),
436 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S2_1),
437 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S3_0),
438 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S3_1),
439 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S4_0),
440 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S4_1),
441 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S5_0),
442 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S5_1),
443 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S6_0),
444 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S6_1),
445 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S7_0),
446 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S7_1),
447 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S8_0),
448 MSM_RPM_STATUS_ID_MAP(8930, PM8917_S8_1),
449 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L1_0),
450 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L1_1),
451 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L2_0),
452 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L2_1),
453 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L3_0),
454 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L3_1),
455 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L4_0),
456 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L4_1),
457 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L5_0),
458 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L5_1),
459 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L6_0),
460 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L6_1),
461 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L7_0),
462 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L7_1),
463 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L8_0),
464 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L8_1),
465 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L9_0),
466 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L9_1),
467 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L10_0),
468 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L10_1),
469 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L11_0),
470 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L11_1),
471 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L12_0),
472 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L12_1),
473 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L14_0),
474 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L14_1),
475 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L15_0),
476 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L15_1),
477 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L16_0),
478 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L16_1),
479 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L17_0),
480 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L17_1),
481 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L18_0),
482 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L18_1),
483 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L21_0),
484 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L21_1),
485 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L22_0),
486 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L22_1),
487 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L23_0),
488 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L23_1),
489 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L24_0),
490 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L24_1),
491 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L25_0),
492 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L25_1),
493 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L26_0),
494 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L26_1),
495 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L27_0),
496 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L27_1),
497 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L28_0),
498 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L28_1),
499 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L29_0),
500 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L29_1),
501 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L30_0),
502 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L30_1),
503 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L31_0),
504 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L31_1),
505 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L32_0),
506 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L32_1),
507 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L33_0),
508 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L33_1),
509 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L34_0),
510 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L34_1),
511 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L35_0),
512 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L35_1),
513 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L36_0),
514 MSM_RPM_STATUS_ID_MAP(8930, PM8917_L36_1),
515 MSM_RPM_STATUS_ID_MAP(8930, PM8917_CLK1_0),
516 MSM_RPM_STATUS_ID_MAP(8930, PM8917_CLK1_1),
517 MSM_RPM_STATUS_ID_MAP(8930, PM8917_CLK2_0),
518 MSM_RPM_STATUS_ID_MAP(8930, PM8917_CLK2_1),
519 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS1),
520 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS3),
521 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS4),
522 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS5),
523 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS6),
524 MSM_RPM_STATUS_ID_MAP(8930, PM8917_LVS7),
525 MSM_RPM_STATUS_ID_MAP(8930, PM8917_NCP_0),
526 MSM_RPM_STATUS_ID_MAP(8930, PM8917_NCP_1),
527 MSM_RPM_STATUS_ID_MAP(8930, PM8917_CXO_BUFFERS),
528 MSM_RPM_STATUS_ID_MAP(8930, PM8917_USB_OTG_SWITCH),
529 MSM_RPM_STATUS_ID_MAP(8930, PM8917_HDMI_SWITCH),
530 MSM_RPM_STATUS_ID_MAP(8930, PM8917_QDSS_CLK),
531 MSM_RPM_STATUS_ID_MAP(8930, PM8917_VOLTAGE_CORNER),
532 },
533 .target_ctrl_id = {
534 MSM_RPM_CTRL_MAP(8930, VERSION_MAJOR),
535 MSM_RPM_CTRL_MAP(8930, VERSION_MINOR),
536 MSM_RPM_CTRL_MAP(8930, VERSION_BUILD),
537 MSM_RPM_CTRL_MAP(8930, REQ_CTX_0),
538 MSM_RPM_CTRL_MAP(8930, REQ_SEL_0),
539 MSM_RPM_CTRL_MAP(8930, ACK_CTX_0),
540 MSM_RPM_CTRL_MAP(8930, ACK_SEL_0),
541 },
542 .sel_invalidate = MSM_RPM_8930_SEL_INVALIDATE,
543 .sel_notification = MSM_RPM_8930_SEL_NOTIFICATION,
544 .sel_last = MSM_RPM_8930_SEL_LAST,
545 .ver = {3, 0, 0},
546};
Praveen Chidambaram78499012011-11-01 17:15:17 -0600547struct platform_device msm8930_rpm_device = {
548 .name = "msm_rpm",
549 .id = -1,
550};
551
552static struct msm_rpm_log_platform_data msm_rpm_log_pdata = {
Anji Jonnala11efe5a2013-03-28 13:45:58 +0530553 .phys_addr_base = 0x10B6A0,
Praveen Chidambaram78499012011-11-01 17:15:17 -0600554 .reg_offsets = {
555 [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080,
556 [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0,
557 },
558 .phys_size = SZ_8K,
Anji Jonnala11efe5a2013-03-28 13:45:58 +0530559 .log_len = 8192, /* log's buffer length in bytes */
560 .log_len_mask = (8192 >> 2) - 1, /* length mask in units of u32 */
Praveen Chidambaram78499012011-11-01 17:15:17 -0600561};
562
563struct platform_device msm8930_rpm_log_device = {
564 .name = "msm_rpm_log",
565 .id = -1,
566 .dev = {
567 .platform_data = &msm_rpm_log_pdata,
568 },
569};
570
571static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = {
Priyanka Mathur71859f42012-10-17 10:54:35 -0700572 .version = 1,
Praveen Chidambaram78499012011-11-01 17:15:17 -0600573};
574
Priyanka Mathur71859f42012-10-17 10:54:35 -0700575static struct resource msm_rpm_stat_resource[] = {
576 {
577 .start = 0x0010D204,
578 .end = 0x0010D204 + SZ_8K,
579 .flags = IORESOURCE_MEM,
580 .name = "phys_addr_base"
581
582 },
583};
584
585
Praveen Chidambaram78499012011-11-01 17:15:17 -0600586struct platform_device msm8930_rpm_stat_device = {
587 .name = "msm_rpm_stat",
588 .id = -1,
Priyanka Mathur71859f42012-10-17 10:54:35 -0700589 .resource = msm_rpm_stat_resource,
590 .num_resources = ARRAY_SIZE(msm_rpm_stat_resource),
591 .dev = {
Praveen Chidambaram78499012011-11-01 17:15:17 -0600592 .platform_data = &msm_rpm_stat_pdata,
Priyanka Mathur71859f42012-10-17 10:54:35 -0700593 }
Praveen Chidambaram78499012011-11-01 17:15:17 -0600594};
595
Anji Jonnala93129922012-10-09 20:57:53 +0530596static struct resource resources_rpm_master_stats[] = {
597 {
598 .start = MSM8930_RPM_MASTER_STATS_BASE,
599 .end = MSM8930_RPM_MASTER_STATS_BASE + SZ_256,
600 .flags = IORESOURCE_MEM,
601 },
602};
603
604static char *master_names[] = {
605 "KPSS",
606 "MPSS",
607 "LPASS",
608 "RIVA",
609};
610
611static struct msm_rpm_master_stats_platform_data msm_rpm_master_stat_pdata = {
612 .masters = master_names,
613 .nomasters = ARRAY_SIZE(master_names),
614};
615
616struct platform_device msm8930_rpm_master_stat_device = {
617 .name = "msm_rpm_master_stat",
618 .id = -1,
619 .num_resources = ARRAY_SIZE(resources_rpm_master_stats),
620 .resource = resources_rpm_master_stats,
621 .dev = {
622 .platform_data = &msm_rpm_master_stat_pdata,
623 },
624};
625
Girish Mahadevan898c56d2012-06-05 16:09:19 -0600626static struct resource msm_rpm_rbcpr_resource = {
Girish Mahadevanea1a1d72012-09-10 12:43:26 -0600627 .start = 0x0010DB00,
628 .end = 0x0010DB00 + SZ_8K - 1,
Girish Mahadevan898c56d2012-06-05 16:09:19 -0600629 .flags = IORESOURCE_MEM,
630};
631
632static struct msm_rpmrbcpr_platform_data msm_rpm_rbcpr_pdata = {
633 .rbcpr_data = {
634 .upside_steps = 1,
635 .downside_steps = 2,
636 .svs_voltage = 1050000,
637 .nominal_voltage = 1162500,
638 .turbo_voltage = 1287500,
639 },
640};
641
642struct platform_device msm8930_rpm_rbcpr_device = {
643 .name = "msm_rpm_rbcpr",
644 .id = -1,
645 .dev = {
646 .platform_data = &msm_rpm_rbcpr_pdata,
647 },
648 .resource = &msm_rpm_rbcpr_resource,
649};
650
Gagan Maccd5b3272012-02-09 18:13:10 -0700651struct platform_device msm_bus_8930_sys_fabric = {
652 .name = "msm_bus_fabric",
653 .id = MSM_BUS_FAB_SYSTEM,
654};
655struct platform_device msm_bus_8930_apps_fabric = {
656 .name = "msm_bus_fabric",
657 .id = MSM_BUS_FAB_APPSS,
658};
659struct platform_device msm_bus_8930_mm_fabric = {
660 .name = "msm_bus_fabric",
661 .id = MSM_BUS_FAB_MMSS,
662};
663struct platform_device msm_bus_8930_sys_fpb = {
664 .name = "msm_bus_fabric",
665 .id = MSM_BUS_FAB_SYSTEM_FPB,
666};
667struct platform_device msm_bus_8930_cpss_fpb = {
668 .name = "msm_bus_fabric",
669 .id = MSM_BUS_FAB_CPSS_FPB,
670};
671
Matt Wagantallab730bd2012-06-07 20:13:51 -0700672struct platform_device msm8627_device_acpuclk = {
673 .name = "acpuclk-8627",
674 .id = -1,
675};
676
Patrick Dalyc1227cb2012-08-28 13:39:17 -0700677static struct acpuclk_platform_data acpuclk_8930_pdata = {
678 .uses_pm8917 = false,
679};
680
Matt Wagantall6dcfa922012-06-07 20:13:51 -0700681struct platform_device msm8930_device_acpuclk = {
682 .name = "acpuclk-8930",
683 .id = -1,
Patrick Dalyc1227cb2012-08-28 13:39:17 -0700684 .dev = {
685 .platform_data = &acpuclk_8930_pdata,
686 },
Matt Wagantall6dcfa922012-06-07 20:13:51 -0700687};
688
Tianyi Gou12370f12012-07-23 19:13:57 -0700689struct platform_device msm8930aa_device_acpuclk = {
690 .name = "acpuclk-8930aa",
691 .id = -1,
692};
693
Tianyi Gou2520b6e2012-10-29 19:13:53 -0700694static struct acpuclk_platform_data acpuclk_8930ab_pdata = {
695 .uses_pm8917 = false,
696};
697
698struct platform_device msm8930ab_device_acpuclk = {
699 .name = "acpuclk-8930ab",
700 .id = -1,
701 .dev = {
702 .platform_data = &acpuclk_8930ab_pdata,
703 },
704};
705
Matt Wagantall1f65d9d2012-04-25 14:24:20 -0700706static struct fs_driver_data gfx3d_fs_data = {
707 .clks = (struct fs_clk_data[]){
708 { .name = "core_clk", .reset_rate = 27000000 },
709 { .name = "iface_clk" },
710 { .name = "bus_clk" },
711 { 0 }
712 },
713 .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D,
714};
715
716static struct fs_driver_data ijpeg_fs_data = {
717 .clks = (struct fs_clk_data[]){
718 { .name = "core_clk" },
719 { .name = "iface_clk" },
720 { .name = "bus_clk" },
721 { 0 }
722 },
723 .bus_port0 = MSM_BUS_MASTER_JPEG_ENC,
724};
725
Tianyi Gou723843b2012-06-13 15:24:56 -0700726static struct fs_driver_data mdp_fs_data_8930 = {
Matt Wagantall1f65d9d2012-04-25 14:24:20 -0700727 .clks = (struct fs_clk_data[]){
728 { .name = "core_clk" },
729 { .name = "iface_clk" },
730 { .name = "bus_clk" },
731 { .name = "vsync_clk" },
732 { .name = "lut_clk" },
733 { .name = "tv_src_clk" },
734 { .name = "tv_clk" },
Matt Wagantallc33c1ed2012-07-23 17:19:08 -0700735 { .name = "reset1_clk" },
Matt Wagantall1f65d9d2012-04-25 14:24:20 -0700736 { 0 }
737 },
738 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
739 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
740};
741
Aravind Venkateswaran896d2f92012-10-29 17:54:55 -0700742static struct fs_driver_data mdp_fs_data_8930_pm8917 = {
743 .clks = (struct fs_clk_data[]){
744 { .name = "core_clk" },
745 { .name = "iface_clk" },
746 { .name = "bus_clk" },
747 { .name = "vsync_clk" },
748 { .name = "lut_clk" },
749 { .name = "reset1_clk" },
750 { 0 }
751 },
752 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
753 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
754};
755
Tianyi Gou723843b2012-06-13 15:24:56 -0700756static struct fs_driver_data mdp_fs_data_8627 = {
757 .clks = (struct fs_clk_data[]){
758 { .name = "core_clk" },
759 { .name = "iface_clk" },
760 { .name = "bus_clk" },
761 { .name = "vsync_clk" },
762 { .name = "lut_clk" },
763 { .name = "reset1_clk" },
764 { 0 }
765 },
766 .bus_port0 = MSM_BUS_MASTER_MDP_PORT0,
767 .bus_port1 = MSM_BUS_MASTER_MDP_PORT1,
768};
769
Matt Wagantall1f65d9d2012-04-25 14:24:20 -0700770static struct fs_driver_data rot_fs_data = {
771 .clks = (struct fs_clk_data[]){
772 { .name = "core_clk" },
773 { .name = "iface_clk" },
774 { .name = "bus_clk" },
775 { 0 }
776 },
777 .bus_port0 = MSM_BUS_MASTER_ROTATOR,
778};
779
780static struct fs_driver_data ved_fs_data = {
781 .clks = (struct fs_clk_data[]){
782 { .name = "core_clk" },
783 { .name = "iface_clk" },
784 { .name = "bus_clk" },
785 { 0 }
786 },
787 .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0,
788 .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1,
789};
790
791static struct fs_driver_data vfe_fs_data = {
792 .clks = (struct fs_clk_data[]){
793 { .name = "core_clk" },
794 { .name = "iface_clk" },
795 { .name = "bus_clk" },
796 { 0 }
797 },
798 .bus_port0 = MSM_BUS_MASTER_VFE,
799};
800
801static struct fs_driver_data vpe_fs_data = {
802 .clks = (struct fs_clk_data[]){
803 { .name = "core_clk" },
804 { .name = "iface_clk" },
805 { .name = "bus_clk" },
806 { 0 }
807 },
808 .bus_port0 = MSM_BUS_MASTER_VPE,
809};
810
811struct platform_device *msm8930_footswitch[] __initdata = {
Tianyi Gou723843b2012-06-13 15:24:56 -0700812 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8930),
Matt Wagantall316f2fc2012-05-03 20:41:42 -0700813 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
Matt Wagantalle4454b82012-05-03 20:48:01 -0700814 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
Kiran Kumar H Nfa18a032012-06-25 14:34:18 -0700815 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
816 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
Matt Wagantalld6fbf232012-05-03 20:09:28 -0700817 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
Matt Wagantall5e46aac2012-05-03 20:20:18 -0700818 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
Matt Wagantall1f65d9d2012-04-25 14:24:20 -0700819};
820unsigned msm8930_num_footswitch __initdata = ARRAY_SIZE(msm8930_footswitch);
821
Aravind Venkateswaran896d2f92012-10-29 17:54:55 -0700822struct platform_device *msm8930_pm8917_footswitch[] __initdata = {
823 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8930_pm8917),
824 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
825 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
826 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
827 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
828 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
829 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
830};
831unsigned msm8930_pm8917_num_footswitch __initdata =
832 ARRAY_SIZE(msm8930_pm8917_footswitch);
833
Tianyi Gou723843b2012-06-13 15:24:56 -0700834struct platform_device *msm8627_footswitch[] __initdata = {
835 FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8627),
836 FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data),
837 FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data),
838 FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data),
839 FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data),
840 FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data),
841 FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data),
842};
843unsigned msm8627_num_footswitch __initdata = ARRAY_SIZE(msm8627_footswitch);
844
Arun Menonaabf2632012-02-24 15:30:47 -0800845/* MSM Video core device */
846#ifdef CONFIG_MSM_BUS_SCALING
847static struct msm_bus_vectors vidc_init_vectors[] = {
848 {
849 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
850 .dst = MSM_BUS_SLAVE_EBI_CH0,
851 .ab = 0,
852 .ib = 0,
853 },
854 {
855 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
856 .dst = MSM_BUS_SLAVE_EBI_CH0,
857 .ab = 0,
858 .ib = 0,
859 },
860 {
861 .src = MSM_BUS_MASTER_AMPSS_M0,
862 .dst = MSM_BUS_SLAVE_EBI_CH0,
863 .ab = 0,
864 .ib = 0,
865 },
866 {
867 .src = MSM_BUS_MASTER_AMPSS_M0,
868 .dst = MSM_BUS_SLAVE_EBI_CH0,
869 .ab = 0,
870 .ib = 0,
871 },
872};
873static struct msm_bus_vectors vidc_venc_vga_vectors[] = {
874 {
875 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
876 .dst = MSM_BUS_SLAVE_EBI_CH0,
877 .ab = 54525952,
878 .ib = 436207616,
879 },
880 {
881 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
882 .dst = MSM_BUS_SLAVE_EBI_CH0,
883 .ab = 72351744,
884 .ib = 289406976,
885 },
886 {
887 .src = MSM_BUS_MASTER_AMPSS_M0,
888 .dst = MSM_BUS_SLAVE_EBI_CH0,
889 .ab = 500000,
890 .ib = 1000000,
891 },
892 {
893 .src = MSM_BUS_MASTER_AMPSS_M0,
894 .dst = MSM_BUS_SLAVE_EBI_CH0,
895 .ab = 500000,
896 .ib = 1000000,
897 },
898};
899static struct msm_bus_vectors vidc_vdec_vga_vectors[] = {
900 {
901 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
902 .dst = MSM_BUS_SLAVE_EBI_CH0,
903 .ab = 40894464,
904 .ib = 327155712,
905 },
906 {
907 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
908 .dst = MSM_BUS_SLAVE_EBI_CH0,
909 .ab = 48234496,
910 .ib = 192937984,
911 },
912 {
913 .src = MSM_BUS_MASTER_AMPSS_M0,
914 .dst = MSM_BUS_SLAVE_EBI_CH0,
915 .ab = 500000,
916 .ib = 2000000,
917 },
918 {
919 .src = MSM_BUS_MASTER_AMPSS_M0,
920 .dst = MSM_BUS_SLAVE_EBI_CH0,
921 .ab = 500000,
922 .ib = 2000000,
923 },
924};
925static struct msm_bus_vectors vidc_venc_720p_vectors[] = {
926 {
927 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
928 .dst = MSM_BUS_SLAVE_EBI_CH0,
929 .ab = 163577856,
930 .ib = 1308622848,
931 },
932 {
933 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
934 .dst = MSM_BUS_SLAVE_EBI_CH0,
935 .ab = 219152384,
936 .ib = 876609536,
937 },
938 {
939 .src = MSM_BUS_MASTER_AMPSS_M0,
940 .dst = MSM_BUS_SLAVE_EBI_CH0,
941 .ab = 1750000,
942 .ib = 3500000,
943 },
944 {
945 .src = MSM_BUS_MASTER_AMPSS_M0,
946 .dst = MSM_BUS_SLAVE_EBI_CH0,
947 .ab = 1750000,
948 .ib = 3500000,
949 },
950};
951static struct msm_bus_vectors vidc_vdec_720p_vectors[] = {
952 {
953 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
954 .dst = MSM_BUS_SLAVE_EBI_CH0,
955 .ab = 121634816,
956 .ib = 973078528,
957 },
958 {
959 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
960 .dst = MSM_BUS_SLAVE_EBI_CH0,
961 .ab = 155189248,
962 .ib = 620756992,
963 },
964 {
965 .src = MSM_BUS_MASTER_AMPSS_M0,
966 .dst = MSM_BUS_SLAVE_EBI_CH0,
967 .ab = 1750000,
968 .ib = 7000000,
969 },
970 {
971 .src = MSM_BUS_MASTER_AMPSS_M0,
972 .dst = MSM_BUS_SLAVE_EBI_CH0,
973 .ab = 1750000,
974 .ib = 7000000,
975 },
976};
977static struct msm_bus_vectors vidc_venc_1080p_vectors[] = {
978 {
979 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
980 .dst = MSM_BUS_SLAVE_EBI_CH0,
981 .ab = 372244480,
982 .ib = 2560000000U,
983 },
984 {
985 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
986 .dst = MSM_BUS_SLAVE_EBI_CH0,
987 .ab = 501219328,
988 .ib = 2560000000U,
989 },
990 {
991 .src = MSM_BUS_MASTER_AMPSS_M0,
992 .dst = MSM_BUS_SLAVE_EBI_CH0,
993 .ab = 2500000,
994 .ib = 5000000,
995 },
996 {
997 .src = MSM_BUS_MASTER_AMPSS_M0,
998 .dst = MSM_BUS_SLAVE_EBI_CH0,
999 .ab = 2500000,
1000 .ib = 5000000,
1001 },
1002};
1003static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = {
1004 {
1005 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1006 .dst = MSM_BUS_SLAVE_EBI_CH0,
1007 .ab = 222298112,
1008 .ib = 2560000000U,
1009 },
1010 {
1011 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1012 .dst = MSM_BUS_SLAVE_EBI_CH0,
1013 .ab = 330301440,
1014 .ib = 2560000000U,
1015 },
1016 {
1017 .src = MSM_BUS_MASTER_AMPSS_M0,
1018 .dst = MSM_BUS_SLAVE_EBI_CH0,
1019 .ab = 2500000,
1020 .ib = 700000000,
1021 },
1022 {
1023 .src = MSM_BUS_MASTER_AMPSS_M0,
1024 .dst = MSM_BUS_SLAVE_EBI_CH0,
1025 .ab = 2500000,
1026 .ib = 10000000,
1027 },
1028};
Arun Menonb31fefd2012-07-19 14:02:13 -07001029static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = {
1030 {
1031 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1032 .dst = MSM_BUS_SLAVE_EBI_CH0,
1033 .ab = 222298112,
1034 .ib = 3522000000U,
1035 },
1036 {
1037 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1038 .dst = MSM_BUS_SLAVE_EBI_CH0,
1039 .ab = 330301440,
1040 .ib = 3522000000U,
1041 },
1042 {
1043 .src = MSM_BUS_MASTER_AMPSS_M0,
1044 .dst = MSM_BUS_SLAVE_EBI_CH0,
1045 .ab = 2500000,
1046 .ib = 700000000,
1047 },
1048 {
1049 .src = MSM_BUS_MASTER_AMPSS_M0,
1050 .dst = MSM_BUS_SLAVE_EBI_CH0,
1051 .ab = 2500000,
1052 .ib = 10000000,
1053 },
1054};
1055static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = {
1056 {
1057 .src = MSM_BUS_MASTER_HD_CODEC_PORT0,
1058 .dst = MSM_BUS_SLAVE_EBI_CH0,
1059 .ab = 222298112,
1060 .ib = 3522000000U,
1061 },
1062 {
1063 .src = MSM_BUS_MASTER_HD_CODEC_PORT1,
1064 .dst = MSM_BUS_SLAVE_EBI_CH0,
1065 .ab = 330301440,
1066 .ib = 3522000000U,
1067 },
1068 {
1069 .src = MSM_BUS_MASTER_AMPSS_M0,
1070 .dst = MSM_BUS_SLAVE_EBI_CH0,
1071 .ab = 2500000,
1072 .ib = 700000000,
1073 },
1074 {
1075 .src = MSM_BUS_MASTER_AMPSS_M0,
1076 .dst = MSM_BUS_SLAVE_EBI_CH0,
1077 .ab = 2500000,
1078 .ib = 10000000,
1079 },
1080};
Arun Menonaabf2632012-02-24 15:30:47 -08001081
1082static struct msm_bus_paths vidc_bus_client_config[] = {
1083 {
1084 ARRAY_SIZE(vidc_init_vectors),
1085 vidc_init_vectors,
1086 },
1087 {
1088 ARRAY_SIZE(vidc_venc_vga_vectors),
1089 vidc_venc_vga_vectors,
1090 },
1091 {
1092 ARRAY_SIZE(vidc_vdec_vga_vectors),
1093 vidc_vdec_vga_vectors,
1094 },
1095 {
1096 ARRAY_SIZE(vidc_venc_720p_vectors),
1097 vidc_venc_720p_vectors,
1098 },
1099 {
1100 ARRAY_SIZE(vidc_vdec_720p_vectors),
1101 vidc_vdec_720p_vectors,
1102 },
1103 {
1104 ARRAY_SIZE(vidc_venc_1080p_vectors),
1105 vidc_venc_1080p_vectors,
1106 },
1107 {
1108 ARRAY_SIZE(vidc_vdec_1080p_vectors),
1109 vidc_vdec_1080p_vectors,
1110 },
Arun Menonb31fefd2012-07-19 14:02:13 -07001111 {
1112 ARRAY_SIZE(vidc_venc_1080p_turbo_vectors),
1113 vidc_vdec_1080p_turbo_vectors,
1114 },
1115 {
1116 ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors),
1117 vidc_vdec_1080p_turbo_vectors,
1118 },
Arun Menonaabf2632012-02-24 15:30:47 -08001119};
1120
1121static struct msm_bus_scale_pdata vidc_bus_client_data = {
1122 vidc_bus_client_config,
1123 ARRAY_SIZE(vidc_bus_client_config),
1124 .name = "vidc",
1125};
1126#endif
1127
1128#define MSM_VIDC_BASE_PHYS 0x04400000
1129#define MSM_VIDC_BASE_SIZE 0x00100000
1130
1131static struct resource apq8930_device_vidc_resources[] = {
1132 {
1133 .start = MSM_VIDC_BASE_PHYS,
1134 .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1,
1135 .flags = IORESOURCE_MEM,
1136 },
1137 {
1138 .start = VCODEC_IRQ,
1139 .end = VCODEC_IRQ,
1140 .flags = IORESOURCE_IRQ,
1141 },
1142};
1143
1144struct msm_vidc_platform_data apq8930_vidc_platform_data = {
1145#ifdef CONFIG_MSM_BUS_SCALING
1146 .vidc_bus_client_pdata = &vidc_bus_client_data,
1147#endif
1148#ifdef CONFIG_MSM_MULTIMEDIA_USE_ION
1149 .memtype = ION_CP_MM_HEAP_ID,
1150 .enable_ion = 1,
Deepak Kotur8097f782012-05-14 14:13:06 -07001151 .cp_enabled = 1,
Arun Menonaabf2632012-02-24 15:30:47 -08001152#else
1153 .memtype = MEMTYPE_EBI1,
1154 .enable_ion = 0,
1155#endif
Anil Gahlotd0ce26d2012-05-08 17:58:46 -07001156 .disable_dmx = 1,
Arun Menonaabf2632012-02-24 15:30:47 -08001157 .disable_fullhd = 0,
Mohan Kumar Gubbihalli Lachma Naik885fcc52012-10-26 17:55:27 -07001158 .cont_mode_dpb_count = 18,
Riaz Rahaman84f8c682012-05-30 13:32:10 +05301159 .fw_addr = 0x9fe00000,
Arun Menonaabf2632012-02-24 15:30:47 -08001160};
1161
1162struct platform_device apq8930_msm_device_vidc = {
1163 .name = "msm_vidc",
1164 .id = 0,
1165 .num_resources = ARRAY_SIZE(apq8930_device_vidc_resources),
1166 .resource = apq8930_device_vidc_resources,
1167 .dev = {
1168 .platform_data = &apq8930_vidc_platform_data,
1169 },
1170};
1171
1172struct platform_device *vidc_device[] __initdata = {
1173 &apq8930_msm_device_vidc
1174};
1175
1176void __init msm8930_add_vidc_device(void)
1177{
1178 if (cpu_is_msm8627()) {
1179 struct msm_vidc_platform_data *pdata;
1180 pdata = (struct msm_vidc_platform_data *)
1181 apq8930_msm_device_vidc.dev.platform_data;
1182 pdata->disable_fullhd = 1;
1183 }
1184 platform_add_devices(vidc_device, ARRAY_SIZE(vidc_device));
1185}
Laura Abbott0577d7b2012-04-17 11:14:30 -07001186
1187struct msm_iommu_domain_name msm8930_iommu_ctx_names[] = {
1188 /* Camera */
1189 {
Laura Abbott0577d7b2012-04-17 11:14:30 -07001190 .name = "ijpeg_src",
1191 .domain = CAMERA_DOMAIN,
1192 },
1193 /* Camera */
1194 {
1195 .name = "ijpeg_dst",
1196 .domain = CAMERA_DOMAIN,
1197 },
1198 /* Camera */
1199 {
1200 .name = "jpegd_src",
1201 .domain = CAMERA_DOMAIN,
1202 },
1203 /* Camera */
1204 {
1205 .name = "jpegd_dst",
1206 .domain = CAMERA_DOMAIN,
1207 },
1208 /* Rotator */
1209 {
1210 .name = "rot_src",
Olav Hauganef95ae32012-05-15 09:50:30 -07001211 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07001212 },
1213 /* Rotator */
1214 {
1215 .name = "rot_dst",
Olav Hauganef95ae32012-05-15 09:50:30 -07001216 .domain = ROTATOR_SRC_DOMAIN,
Laura Abbott0577d7b2012-04-17 11:14:30 -07001217 },
1218 /* Video */
1219 {
1220 .name = "vcodec_a_mm1",
1221 .domain = VIDEO_DOMAIN,
1222 },
1223 /* Video */
1224 {
1225 .name = "vcodec_b_mm2",
1226 .domain = VIDEO_DOMAIN,
1227 },
1228 /* Video */
1229 {
1230 .name = "vcodec_a_stream",
1231 .domain = VIDEO_DOMAIN,
1232 },
1233};
1234
1235static struct mem_pool msm8930_video_pools[] = {
1236 /*
1237 * Video hardware has the following requirements:
1238 * 1. All video addresses used by the video hardware must be at a higher
1239 * address than video firmware address.
1240 * 2. Video hardware can only access a range of 256MB from the base of
1241 * the video firmware.
1242 */
1243 [VIDEO_FIRMWARE_POOL] =
1244 /* Low addresses, intended for video firmware */
1245 {
1246 .paddr = SZ_128K,
1247 .size = SZ_16M - SZ_128K,
1248 },
1249 [VIDEO_MAIN_POOL] =
1250 /* Main video pool */
1251 {
1252 .paddr = SZ_16M,
1253 .size = SZ_256M - SZ_16M,
1254 },
1255 [GEN_POOL] =
1256 /* Remaining address space up to 2G */
1257 {
1258 .paddr = SZ_256M,
1259 .size = SZ_2G - SZ_256M,
1260 },
1261};
1262
1263static struct mem_pool msm8930_camera_pools[] = {
1264 [GEN_POOL] =
1265 /* One address space for camera */
1266 {
1267 .paddr = SZ_128K,
1268 .size = SZ_2G - SZ_128K,
1269 },
1270};
1271
Olav Hauganef95ae32012-05-15 09:50:30 -07001272static struct mem_pool msm8930_display_read_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07001273 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07001274 /* One address space for display reads */
Laura Abbott0577d7b2012-04-17 11:14:30 -07001275 {
1276 .paddr = SZ_128K,
1277 .size = SZ_2G - SZ_128K,
1278 },
1279};
1280
Olav Hauganef95ae32012-05-15 09:50:30 -07001281static struct mem_pool msm8930_rotator_src_pools[] = {
Laura Abbott0577d7b2012-04-17 11:14:30 -07001282 [GEN_POOL] =
Olav Hauganef95ae32012-05-15 09:50:30 -07001283 /* One address space for rotator src */
Laura Abbott0577d7b2012-04-17 11:14:30 -07001284 {
1285 .paddr = SZ_128K,
1286 .size = SZ_2G - SZ_128K,
1287 },
1288};
1289
1290static struct msm_iommu_domain msm8930_iommu_domains[] = {
1291 [VIDEO_DOMAIN] = {
1292 .iova_pools = msm8930_video_pools,
1293 .npools = ARRAY_SIZE(msm8930_video_pools),
1294 },
1295 [CAMERA_DOMAIN] = {
1296 .iova_pools = msm8930_camera_pools,
1297 .npools = ARRAY_SIZE(msm8930_camera_pools),
1298 },
Olav Hauganef95ae32012-05-15 09:50:30 -07001299 [DISPLAY_READ_DOMAIN] = {
1300 .iova_pools = msm8930_display_read_pools,
1301 .npools = ARRAY_SIZE(msm8930_display_read_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07001302 },
Olav Hauganef95ae32012-05-15 09:50:30 -07001303 [ROTATOR_SRC_DOMAIN] = {
1304 .iova_pools = msm8930_rotator_src_pools,
1305 .npools = ARRAY_SIZE(msm8930_rotator_src_pools),
Laura Abbott0577d7b2012-04-17 11:14:30 -07001306 },
1307};
1308
1309struct iommu_domains_pdata msm8930_iommu_domain_pdata = {
1310 .domains = msm8930_iommu_domains,
1311 .ndomains = ARRAY_SIZE(msm8930_iommu_domains),
1312 .domain_names = msm8930_iommu_ctx_names,
1313 .nnames = ARRAY_SIZE(msm8930_iommu_ctx_names),
1314 .domain_alloc_flags = 0,
1315};
1316
1317struct platform_device msm8930_iommu_domain_device = {
1318 .name = "iommu_domains",
1319 .id = -1,
1320 .dev = {
1321 .platform_data = &msm8930_iommu_domain_pdata,
Laura Abbott532b2df2012-04-12 10:53:48 -07001322 }
1323};
1324
1325struct msm_rtb_platform_data msm8930_rtb_pdata = {
1326 .size = SZ_1M,
1327};
1328
1329static int __init msm_rtb_set_buffer_size(char *p)
1330{
1331 int s;
1332
1333 s = memparse(p, NULL);
1334 msm8930_rtb_pdata.size = ALIGN(s, SZ_4K);
1335 return 0;
1336}
1337early_param("msm_rtb_size", msm_rtb_set_buffer_size);
1338
1339
1340struct platform_device msm8930_rtb_device = {
1341 .name = "msm_rtb",
1342 .id = -1,
1343 .dev = {
1344 .platform_data = &msm8930_rtb_pdata,
Laura Abbott0577d7b2012-04-17 11:14:30 -07001345 },
1346};
Laura Abbottf3173042012-05-29 15:23:18 -07001347
1348#define MSM8930_L1_SIZE SZ_1M
1349/*
1350 * The actual L2 size is smaller but we need a larger buffer
1351 * size to store other dump information
1352 */
1353#define MSM8930_L2_SIZE SZ_4M
1354
1355struct msm_cache_dump_platform_data msm8930_cache_dump_pdata = {
1356 .l2_size = MSM8930_L2_SIZE,
1357 .l1_size = MSM8930_L1_SIZE,
1358};
1359
1360struct platform_device msm8930_cache_dump_device = {
1361 .name = "msm_cache_dump",
1362 .id = -1,
1363 .dev = {
1364 .platform_data = &msm8930_cache_dump_pdata,
1365 },
1366};