Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 1 | /* Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 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 Muckle | f132c6c | 2012-06-06 18:30:57 -0700 | [diff] [blame] | 16 | #include <asm/io.h> |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 17 | #include <linux/ion.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 18 | #include <mach/msm_iomap.h> |
| 19 | #include <mach/irqs-8930.h> |
| 20 | #include <mach/rpm.h> |
Praveen Chidambaram | 5c8adf2 | 2012-02-23 18:44:37 -0700 | [diff] [blame] | 21 | #include <mach/msm_dcvs.h> |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 22 | #include <mach/msm_bus.h> |
Gagan Mac | cd5b327 | 2012-02-09 18:13:10 -0700 | [diff] [blame] | 23 | #include <mach/msm_bus_board.h> |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 24 | #include <mach/board.h> |
| 25 | #include <mach/socinfo.h> |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 26 | #include <mach/iommu_domains.h> |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 27 | #include <mach/msm_rtb.h> |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 28 | #include <mach/msm_cache_dump.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 29 | |
| 30 | #include "devices.h" |
| 31 | #include "rpm_log.h" |
| 32 | #include "rpm_stats.h" |
Girish Mahadevan | 898c56d | 2012-06-05 16:09:19 -0600 | [diff] [blame] | 33 | #include "rpm_rbcpr_stats.h" |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 34 | #include "footswitch.h" |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 35 | |
| 36 | #ifdef CONFIG_MSM_MPM |
Subhash Jadavani | 909e04f | 2012-04-12 10:52:50 +0530 | [diff] [blame] | 37 | #include <mach/mpm.h> |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 38 | #endif |
| 39 | |
| 40 | struct msm_rpm_platform_data msm8930_rpm_data __initdata = { |
| 41 | .reg_base_addrs = { |
| 42 | [MSM_RPM_PAGE_STATUS] = MSM_RPM_BASE, |
| 43 | [MSM_RPM_PAGE_CTRL] = MSM_RPM_BASE + 0x400, |
| 44 | [MSM_RPM_PAGE_REQ] = MSM_RPM_BASE + 0x600, |
| 45 | [MSM_RPM_PAGE_ACK] = MSM_RPM_BASE + 0xa00, |
| 46 | }, |
| 47 | .irq_ack = RPM_APCC_CPU0_GP_HIGH_IRQ, |
Stephen Boyd | f61255e | 2012-02-24 14:31:09 -0800 | [diff] [blame] | 48 | .irq_err = RPM_APCC_CPU0_GP_LOW_IRQ, |
Praveen Chidambaram | e396ce6 | 2012-03-30 11:15:57 -0600 | [diff] [blame] | 49 | .irq_wakeup = RPM_APCC_CPU0_WAKE_UP_IRQ, |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 50 | .ipc_rpm_reg = MSM_APCS_GCC_BASE + 0x008, |
| 51 | .ipc_rpm_val = 4, |
| 52 | .target_id = { |
| 53 | MSM_RPM_MAP(8930, NOTIFICATION_CONFIGURED_0, NOTIFICATION, 4), |
| 54 | MSM_RPM_MAP(8930, NOTIFICATION_REGISTERED_0, NOTIFICATION, 4), |
| 55 | MSM_RPM_MAP(8930, INVALIDATE_0, INVALIDATE, 8), |
Mahesh Sivasubramanian | ef2a0fa | 2012-01-24 15:57:01 -0700 | [diff] [blame] | 56 | MSM_RPM_MAP(8960, TRIGGER_TIMED_TO, TRIGGER_TIMED, 1), |
| 57 | MSM_RPM_MAP(8960, TRIGGER_TIMED_SCLK_COUNT, TRIGGER_TIMED, 1), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 58 | MSM_RPM_MAP(8930, RPM_CTL, RPM_CTL, 1), |
| 59 | MSM_RPM_MAP(8930, CXO_CLK, CXO_CLK, 1), |
| 60 | MSM_RPM_MAP(8930, PXO_CLK, PXO_CLK, 1), |
| 61 | MSM_RPM_MAP(8930, APPS_FABRIC_CLK, APPS_FABRIC_CLK, 1), |
| 62 | MSM_RPM_MAP(8930, SYSTEM_FABRIC_CLK, SYSTEM_FABRIC_CLK, 1), |
| 63 | MSM_RPM_MAP(8930, MM_FABRIC_CLK, MM_FABRIC_CLK, 1), |
| 64 | MSM_RPM_MAP(8930, DAYTONA_FABRIC_CLK, DAYTONA_FABRIC_CLK, 1), |
| 65 | MSM_RPM_MAP(8930, SFPB_CLK, SFPB_CLK, 1), |
| 66 | MSM_RPM_MAP(8930, CFPB_CLK, CFPB_CLK, 1), |
| 67 | MSM_RPM_MAP(8930, MMFPB_CLK, MMFPB_CLK, 1), |
| 68 | MSM_RPM_MAP(8930, EBI1_CLK, EBI1_CLK, 1), |
| 69 | MSM_RPM_MAP(8930, APPS_FABRIC_CFG_HALT_0, |
| 70 | APPS_FABRIC_CFG_HALT, 2), |
| 71 | MSM_RPM_MAP(8930, APPS_FABRIC_CFG_CLKMOD_0, |
| 72 | APPS_FABRIC_CFG_CLKMOD, 3), |
| 73 | MSM_RPM_MAP(8930, APPS_FABRIC_CFG_IOCTL, |
| 74 | APPS_FABRIC_CFG_IOCTL, 1), |
Mahesh Sivasubramanian | 2d2c7059 | 2012-03-20 17:07:24 -0600 | [diff] [blame] | 75 | MSM_RPM_MAP(8930, APPS_FABRIC_ARB_0, APPS_FABRIC_ARB, 6), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 76 | MSM_RPM_MAP(8930, SYS_FABRIC_CFG_HALT_0, |
| 77 | SYS_FABRIC_CFG_HALT, 2), |
| 78 | MSM_RPM_MAP(8930, SYS_FABRIC_CFG_CLKMOD_0, |
| 79 | SYS_FABRIC_CFG_CLKMOD, 3), |
| 80 | MSM_RPM_MAP(8930, SYS_FABRIC_CFG_IOCTL, |
| 81 | SYS_FABRIC_CFG_IOCTL, 1), |
| 82 | MSM_RPM_MAP(8930, SYSTEM_FABRIC_ARB_0, |
Mahesh Sivasubramanian | 2d2c7059 | 2012-03-20 17:07:24 -0600 | [diff] [blame] | 83 | SYSTEM_FABRIC_ARB, 20), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 84 | MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_HALT_0, |
| 85 | MMSS_FABRIC_CFG_HALT, 2), |
| 86 | MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_CLKMOD_0, |
| 87 | MMSS_FABRIC_CFG_CLKMOD, 3), |
| 88 | MSM_RPM_MAP(8930, MMSS_FABRIC_CFG_IOCTL, |
| 89 | MMSS_FABRIC_CFG_IOCTL, 1), |
Mahesh Sivasubramanian | 2d2c7059 | 2012-03-20 17:07:24 -0600 | [diff] [blame] | 90 | MSM_RPM_MAP(8930, MM_FABRIC_ARB_0, MM_FABRIC_ARB, 11), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 91 | MSM_RPM_MAP(8930, PM8038_S1_0, PM8038_S1, 2), |
| 92 | MSM_RPM_MAP(8930, PM8038_S2_0, PM8038_S2, 2), |
| 93 | MSM_RPM_MAP(8930, PM8038_S3_0, PM8038_S3, 2), |
| 94 | MSM_RPM_MAP(8930, PM8038_S4_0, PM8038_S4, 2), |
| 95 | MSM_RPM_MAP(8930, PM8038_S5_0, PM8038_S5, 2), |
| 96 | MSM_RPM_MAP(8930, PM8038_S6_0, PM8038_S6, 2), |
| 97 | MSM_RPM_MAP(8930, PM8038_L1_0, PM8038_L1, 2), |
| 98 | MSM_RPM_MAP(8930, PM8038_L2_0, PM8038_L2, 2), |
| 99 | MSM_RPM_MAP(8930, PM8038_L3_0, PM8038_L3, 2), |
| 100 | MSM_RPM_MAP(8930, PM8038_L4_0, PM8038_L4, 2), |
| 101 | MSM_RPM_MAP(8930, PM8038_L5_0, PM8038_L5, 2), |
| 102 | MSM_RPM_MAP(8930, PM8038_L6_0, PM8038_L6, 2), |
| 103 | MSM_RPM_MAP(8930, PM8038_L7_0, PM8038_L7, 2), |
| 104 | MSM_RPM_MAP(8930, PM8038_L8_0, PM8038_L8, 2), |
| 105 | MSM_RPM_MAP(8930, PM8038_L9_0, PM8038_L9, 2), |
| 106 | MSM_RPM_MAP(8930, PM8038_L10_0, PM8038_L10, 2), |
| 107 | MSM_RPM_MAP(8930, PM8038_L11_0, PM8038_L11, 2), |
| 108 | MSM_RPM_MAP(8930, PM8038_L12_0, PM8038_L12, 2), |
| 109 | MSM_RPM_MAP(8930, PM8038_L13_0, PM8038_L13, 2), |
| 110 | MSM_RPM_MAP(8930, PM8038_L14_0, PM8038_L14, 2), |
| 111 | MSM_RPM_MAP(8930, PM8038_L15_0, PM8038_L15, 2), |
| 112 | MSM_RPM_MAP(8930, PM8038_L16_0, PM8038_L16, 2), |
| 113 | MSM_RPM_MAP(8930, PM8038_L17_0, PM8038_L17, 2), |
| 114 | MSM_RPM_MAP(8930, PM8038_L18_0, PM8038_L18, 2), |
| 115 | MSM_RPM_MAP(8930, PM8038_L19_0, PM8038_L19, 2), |
| 116 | MSM_RPM_MAP(8930, PM8038_L20_0, PM8038_L20, 2), |
| 117 | MSM_RPM_MAP(8930, PM8038_L21_0, PM8038_L21, 2), |
| 118 | MSM_RPM_MAP(8930, PM8038_L22_0, PM8038_L22, 2), |
| 119 | MSM_RPM_MAP(8930, PM8038_L23_0, PM8038_L23, 2), |
| 120 | MSM_RPM_MAP(8930, PM8038_L24_0, PM8038_L24, 2), |
| 121 | MSM_RPM_MAP(8930, PM8038_L25_0, PM8038_L25, 2), |
| 122 | MSM_RPM_MAP(8930, PM8038_L26_0, PM8038_L26, 2), |
| 123 | MSM_RPM_MAP(8930, PM8038_L27_0, PM8038_L27, 2), |
| 124 | MSM_RPM_MAP(8930, PM8038_CLK1_0, PM8038_CLK1, 2), |
| 125 | MSM_RPM_MAP(8930, PM8038_CLK2_0, PM8038_CLK2, 2), |
| 126 | MSM_RPM_MAP(8930, PM8038_LVS1, PM8038_LVS1, 1), |
| 127 | MSM_RPM_MAP(8930, PM8038_LVS2, PM8038_LVS2, 1), |
| 128 | MSM_RPM_MAP(8930, NCP_0, NCP, 2), |
| 129 | MSM_RPM_MAP(8930, CXO_BUFFERS, CXO_BUFFERS, 1), |
| 130 | MSM_RPM_MAP(8930, USB_OTG_SWITCH, USB_OTG_SWITCH, 1), |
| 131 | MSM_RPM_MAP(8930, HDMI_SWITCH, HDMI_SWITCH, 1), |
| 132 | MSM_RPM_MAP(8930, QDSS_CLK, QDSS_CLK, 1), |
Mahesh Sivasubramanian | 9e52ce4 | 2012-02-01 16:00:19 -0700 | [diff] [blame] | 133 | MSM_RPM_MAP(8930, VOLTAGE_CORNER, VOLTAGE_CORNER, 1), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 134 | }, |
| 135 | .target_status = { |
| 136 | MSM_RPM_STATUS_ID_MAP(8930, VERSION_MAJOR), |
| 137 | MSM_RPM_STATUS_ID_MAP(8930, VERSION_MINOR), |
| 138 | MSM_RPM_STATUS_ID_MAP(8930, VERSION_BUILD), |
| 139 | MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_0), |
| 140 | MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_1), |
| 141 | MSM_RPM_STATUS_ID_MAP(8930, SUPPORTED_RESOURCES_2), |
| 142 | MSM_RPM_STATUS_ID_MAP(8930, RESERVED_SUPPORTED_RESOURCES_0), |
| 143 | MSM_RPM_STATUS_ID_MAP(8930, SEQUENCE), |
| 144 | MSM_RPM_STATUS_ID_MAP(8930, RPM_CTL), |
| 145 | MSM_RPM_STATUS_ID_MAP(8930, CXO_CLK), |
| 146 | MSM_RPM_STATUS_ID_MAP(8930, PXO_CLK), |
| 147 | MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CLK), |
| 148 | MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_CLK), |
| 149 | MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_CLK), |
| 150 | MSM_RPM_STATUS_ID_MAP(8930, DAYTONA_FABRIC_CLK), |
| 151 | MSM_RPM_STATUS_ID_MAP(8930, SFPB_CLK), |
| 152 | MSM_RPM_STATUS_ID_MAP(8930, CFPB_CLK), |
| 153 | MSM_RPM_STATUS_ID_MAP(8930, MMFPB_CLK), |
| 154 | MSM_RPM_STATUS_ID_MAP(8930, EBI1_CLK), |
| 155 | MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_HALT), |
| 156 | MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_CLKMOD), |
| 157 | MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_CFG_IOCTL), |
| 158 | MSM_RPM_STATUS_ID_MAP(8930, APPS_FABRIC_ARB), |
| 159 | MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_HALT), |
| 160 | MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_CLKMOD), |
| 161 | MSM_RPM_STATUS_ID_MAP(8930, SYS_FABRIC_CFG_IOCTL), |
| 162 | MSM_RPM_STATUS_ID_MAP(8930, SYSTEM_FABRIC_ARB), |
| 163 | MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_HALT), |
| 164 | MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_CLKMOD), |
| 165 | MSM_RPM_STATUS_ID_MAP(8930, MMSS_FABRIC_CFG_IOCTL), |
| 166 | MSM_RPM_STATUS_ID_MAP(8930, MM_FABRIC_ARB), |
| 167 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S1_0), |
| 168 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S1_1), |
| 169 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S2_0), |
| 170 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S2_1), |
| 171 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S3_0), |
| 172 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S3_1), |
| 173 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S4_0), |
| 174 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_S4_1), |
| 175 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L1_0), |
| 176 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L1_1), |
| 177 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L2_0), |
| 178 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L2_1), |
| 179 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L3_0), |
| 180 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L3_1), |
| 181 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L4_0), |
| 182 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L4_1), |
| 183 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L5_0), |
| 184 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L5_1), |
| 185 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L6_0), |
| 186 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L6_1), |
| 187 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L7_0), |
| 188 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L7_1), |
| 189 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L8_0), |
| 190 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L8_1), |
| 191 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L9_0), |
| 192 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L9_1), |
| 193 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L10_0), |
| 194 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L10_1), |
| 195 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L11_0), |
| 196 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L11_1), |
| 197 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L12_0), |
| 198 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L12_1), |
| 199 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L13_0), |
| 200 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L13_1), |
| 201 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L14_0), |
| 202 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L14_1), |
| 203 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L15_0), |
| 204 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L15_1), |
| 205 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L16_0), |
| 206 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L16_1), |
| 207 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L17_0), |
| 208 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L17_1), |
| 209 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L18_0), |
| 210 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L18_1), |
| 211 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L19_0), |
| 212 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L19_1), |
| 213 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L20_0), |
| 214 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L20_1), |
| 215 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L21_0), |
| 216 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L21_1), |
| 217 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L22_0), |
| 218 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L22_1), |
| 219 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L23_0), |
| 220 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L23_1), |
| 221 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L24_0), |
| 222 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L24_1), |
| 223 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L25_0), |
| 224 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_L25_1), |
| 225 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK1_0), |
| 226 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK1_1), |
| 227 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK2_0), |
| 228 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_CLK2_1), |
| 229 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_LVS1), |
| 230 | MSM_RPM_STATUS_ID_MAP(8930, PM8038_LVS2), |
| 231 | MSM_RPM_STATUS_ID_MAP(8930, NCP_0), |
| 232 | MSM_RPM_STATUS_ID_MAP(8930, NCP_1), |
| 233 | MSM_RPM_STATUS_ID_MAP(8930, CXO_BUFFERS), |
| 234 | MSM_RPM_STATUS_ID_MAP(8930, USB_OTG_SWITCH), |
| 235 | MSM_RPM_STATUS_ID_MAP(8930, HDMI_SWITCH), |
Mahesh Sivasubramanian | ef2a0fa | 2012-01-24 15:57:01 -0700 | [diff] [blame] | 236 | MSM_RPM_STATUS_ID_MAP(8930, QDSS_CLK), |
Mahesh Sivasubramanian | 9e52ce4 | 2012-02-01 16:00:19 -0700 | [diff] [blame] | 237 | MSM_RPM_STATUS_ID_MAP(8930, VOLTAGE_CORNER), |
Praveen Chidambaram | 7849901 | 2011-11-01 17:15:17 -0600 | [diff] [blame] | 238 | }, |
| 239 | .target_ctrl_id = { |
| 240 | MSM_RPM_CTRL_MAP(8930, VERSION_MAJOR), |
| 241 | MSM_RPM_CTRL_MAP(8930, VERSION_MINOR), |
| 242 | MSM_RPM_CTRL_MAP(8930, VERSION_BUILD), |
| 243 | MSM_RPM_CTRL_MAP(8930, REQ_CTX_0), |
| 244 | MSM_RPM_CTRL_MAP(8930, REQ_SEL_0), |
| 245 | MSM_RPM_CTRL_MAP(8930, ACK_CTX_0), |
| 246 | MSM_RPM_CTRL_MAP(8930, ACK_SEL_0), |
| 247 | }, |
| 248 | .sel_invalidate = MSM_RPM_8930_SEL_INVALIDATE, |
| 249 | .sel_notification = MSM_RPM_8930_SEL_NOTIFICATION, |
| 250 | .sel_last = MSM_RPM_8930_SEL_LAST, |
| 251 | .ver = {3, 0, 0}, |
| 252 | }; |
| 253 | |
| 254 | struct platform_device msm8930_rpm_device = { |
| 255 | .name = "msm_rpm", |
| 256 | .id = -1, |
| 257 | }; |
| 258 | |
| 259 | static struct msm_rpm_log_platform_data msm_rpm_log_pdata = { |
| 260 | .phys_addr_base = 0x0010C000, |
| 261 | .reg_offsets = { |
| 262 | [MSM_RPM_LOG_PAGE_INDICES] = 0x00000080, |
| 263 | [MSM_RPM_LOG_PAGE_BUFFER] = 0x000000A0, |
| 264 | }, |
| 265 | .phys_size = SZ_8K, |
| 266 | .log_len = 4096, /* log's buffer length in bytes */ |
| 267 | .log_len_mask = (4096 >> 2) - 1, /* length mask in units of u32 */ |
| 268 | }; |
| 269 | |
| 270 | struct platform_device msm8930_rpm_log_device = { |
| 271 | .name = "msm_rpm_log", |
| 272 | .id = -1, |
| 273 | .dev = { |
| 274 | .platform_data = &msm_rpm_log_pdata, |
| 275 | }, |
| 276 | }; |
| 277 | |
| 278 | static struct msm_rpmstats_platform_data msm_rpm_stat_pdata = { |
| 279 | .phys_addr_base = 0x0010D204, |
| 280 | .phys_size = SZ_8K, |
| 281 | }; |
| 282 | |
| 283 | struct platform_device msm8930_rpm_stat_device = { |
| 284 | .name = "msm_rpm_stat", |
| 285 | .id = -1, |
| 286 | .dev = { |
| 287 | .platform_data = &msm_rpm_stat_pdata, |
| 288 | }, |
| 289 | }; |
| 290 | |
Girish Mahadevan | 898c56d | 2012-06-05 16:09:19 -0600 | [diff] [blame] | 291 | static struct resource msm_rpm_rbcpr_resource = { |
| 292 | .start = 0x0010CB00, |
| 293 | .end = 0x0010CB00 + SZ_8K - 1, |
| 294 | .flags = IORESOURCE_MEM, |
| 295 | }; |
| 296 | |
| 297 | static struct msm_rpmrbcpr_platform_data msm_rpm_rbcpr_pdata = { |
| 298 | .rbcpr_data = { |
| 299 | .upside_steps = 1, |
| 300 | .downside_steps = 2, |
| 301 | .svs_voltage = 1050000, |
| 302 | .nominal_voltage = 1162500, |
| 303 | .turbo_voltage = 1287500, |
| 304 | }, |
| 305 | }; |
| 306 | |
| 307 | struct platform_device msm8930_rpm_rbcpr_device = { |
| 308 | .name = "msm_rpm_rbcpr", |
| 309 | .id = -1, |
| 310 | .dev = { |
| 311 | .platform_data = &msm_rpm_rbcpr_pdata, |
| 312 | }, |
| 313 | .resource = &msm_rpm_rbcpr_resource, |
| 314 | }; |
| 315 | |
Praveen Chidambaram | 8ea3dcd | 2011-12-07 14:46:31 -0700 | [diff] [blame] | 316 | static int msm8930_LPM_latency = 1000; /* >100 usec for WFI */ |
| 317 | |
| 318 | struct platform_device msm8930_cpu_idle_device = { |
| 319 | .name = "msm_cpu_idle", |
| 320 | .id = -1, |
| 321 | .dev = { |
| 322 | .platform_data = &msm8930_LPM_latency, |
| 323 | }, |
| 324 | }; |
Praveen Chidambaram | 5c8adf2 | 2012-02-23 18:44:37 -0700 | [diff] [blame] | 325 | |
| 326 | static struct msm_dcvs_freq_entry msm8930_freq[] = { |
| 327 | { 384000, 166981, 345600}, |
| 328 | { 702000, 213049, 632502}, |
| 329 | {1026000, 285712, 925613}, |
| 330 | {1242000, 383945, 1176550}, |
| 331 | {1458000, 419729, 1465478}, |
| 332 | {1512000, 434116, 1546674}, |
| 333 | |
| 334 | }; |
| 335 | |
| 336 | static struct msm_dcvs_core_info msm8930_core_info = { |
| 337 | .freq_tbl = &msm8930_freq[0], |
| 338 | .core_param = { |
| 339 | .max_time_us = 100000, |
| 340 | .num_freq = ARRAY_SIZE(msm8930_freq), |
| 341 | }, |
| 342 | .algo_param = { |
| 343 | .slack_time_us = 58000, |
| 344 | .scale_slack_time = 0, |
| 345 | .scale_slack_time_pct = 0, |
| 346 | .disable_pc_threshold = 1458000, |
| 347 | .em_window_size = 100000, |
| 348 | .em_max_util_pct = 97, |
| 349 | .ss_window_size = 1000000, |
| 350 | .ss_util_pct = 95, |
| 351 | .ss_iobusy_conv = 100, |
| 352 | }, |
| 353 | }; |
| 354 | |
| 355 | struct platform_device msm8930_msm_gov_device = { |
| 356 | .name = "msm_dcvs_gov", |
| 357 | .id = -1, |
| 358 | .dev = { |
| 359 | .platform_data = &msm8930_core_info, |
| 360 | }, |
| 361 | }; |
Gagan Mac | cd5b327 | 2012-02-09 18:13:10 -0700 | [diff] [blame] | 362 | |
| 363 | struct platform_device msm_bus_8930_sys_fabric = { |
| 364 | .name = "msm_bus_fabric", |
| 365 | .id = MSM_BUS_FAB_SYSTEM, |
| 366 | }; |
| 367 | struct platform_device msm_bus_8930_apps_fabric = { |
| 368 | .name = "msm_bus_fabric", |
| 369 | .id = MSM_BUS_FAB_APPSS, |
| 370 | }; |
| 371 | struct platform_device msm_bus_8930_mm_fabric = { |
| 372 | .name = "msm_bus_fabric", |
| 373 | .id = MSM_BUS_FAB_MMSS, |
| 374 | }; |
| 375 | struct platform_device msm_bus_8930_sys_fpb = { |
| 376 | .name = "msm_bus_fabric", |
| 377 | .id = MSM_BUS_FAB_SYSTEM_FPB, |
| 378 | }; |
| 379 | struct platform_device msm_bus_8930_cpss_fpb = { |
| 380 | .name = "msm_bus_fabric", |
| 381 | .id = MSM_BUS_FAB_CPSS_FPB, |
| 382 | }; |
| 383 | |
Matt Wagantall | ab730bd | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 384 | struct platform_device msm8627_device_acpuclk = { |
| 385 | .name = "acpuclk-8627", |
| 386 | .id = -1, |
| 387 | }; |
| 388 | |
Matt Wagantall | 6dcfa92 | 2012-06-07 20:13:51 -0700 | [diff] [blame] | 389 | struct platform_device msm8930_device_acpuclk = { |
| 390 | .name = "acpuclk-8930", |
| 391 | .id = -1, |
| 392 | }; |
| 393 | |
Tianyi Gou | 12370f1 | 2012-07-23 19:13:57 -0700 | [diff] [blame] | 394 | struct platform_device msm8930aa_device_acpuclk = { |
| 395 | .name = "acpuclk-8930aa", |
| 396 | .id = -1, |
| 397 | }; |
| 398 | |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 399 | static struct fs_driver_data gfx3d_fs_data = { |
| 400 | .clks = (struct fs_clk_data[]){ |
| 401 | { .name = "core_clk", .reset_rate = 27000000 }, |
| 402 | { .name = "iface_clk" }, |
| 403 | { .name = "bus_clk" }, |
| 404 | { 0 } |
| 405 | }, |
| 406 | .bus_port0 = MSM_BUS_MASTER_GRAPHICS_3D, |
| 407 | }; |
| 408 | |
| 409 | static struct fs_driver_data ijpeg_fs_data = { |
| 410 | .clks = (struct fs_clk_data[]){ |
| 411 | { .name = "core_clk" }, |
| 412 | { .name = "iface_clk" }, |
| 413 | { .name = "bus_clk" }, |
| 414 | { 0 } |
| 415 | }, |
| 416 | .bus_port0 = MSM_BUS_MASTER_JPEG_ENC, |
| 417 | }; |
| 418 | |
Tianyi Gou | 723843b | 2012-06-13 15:24:56 -0700 | [diff] [blame] | 419 | static struct fs_driver_data mdp_fs_data_8930 = { |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 420 | .clks = (struct fs_clk_data[]){ |
| 421 | { .name = "core_clk" }, |
| 422 | { .name = "iface_clk" }, |
| 423 | { .name = "bus_clk" }, |
| 424 | { .name = "vsync_clk" }, |
| 425 | { .name = "lut_clk" }, |
| 426 | { .name = "tv_src_clk" }, |
| 427 | { .name = "tv_clk" }, |
Matt Wagantall | c33c1ed | 2012-07-23 17:19:08 -0700 | [diff] [blame] | 428 | { .name = "reset1_clk" }, |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 429 | { 0 } |
| 430 | }, |
| 431 | .bus_port0 = MSM_BUS_MASTER_MDP_PORT0, |
| 432 | .bus_port1 = MSM_BUS_MASTER_MDP_PORT1, |
| 433 | }; |
| 434 | |
Tianyi Gou | 723843b | 2012-06-13 15:24:56 -0700 | [diff] [blame] | 435 | static struct fs_driver_data mdp_fs_data_8627 = { |
| 436 | .clks = (struct fs_clk_data[]){ |
| 437 | { .name = "core_clk" }, |
| 438 | { .name = "iface_clk" }, |
| 439 | { .name = "bus_clk" }, |
| 440 | { .name = "vsync_clk" }, |
| 441 | { .name = "lut_clk" }, |
| 442 | { .name = "reset1_clk" }, |
| 443 | { 0 } |
| 444 | }, |
| 445 | .bus_port0 = MSM_BUS_MASTER_MDP_PORT0, |
| 446 | .bus_port1 = MSM_BUS_MASTER_MDP_PORT1, |
| 447 | }; |
| 448 | |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 449 | static struct fs_driver_data rot_fs_data = { |
| 450 | .clks = (struct fs_clk_data[]){ |
| 451 | { .name = "core_clk" }, |
| 452 | { .name = "iface_clk" }, |
| 453 | { .name = "bus_clk" }, |
| 454 | { 0 } |
| 455 | }, |
| 456 | .bus_port0 = MSM_BUS_MASTER_ROTATOR, |
| 457 | }; |
| 458 | |
| 459 | static struct fs_driver_data ved_fs_data = { |
| 460 | .clks = (struct fs_clk_data[]){ |
| 461 | { .name = "core_clk" }, |
| 462 | { .name = "iface_clk" }, |
| 463 | { .name = "bus_clk" }, |
| 464 | { 0 } |
| 465 | }, |
| 466 | .bus_port0 = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 467 | .bus_port1 = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 468 | }; |
| 469 | |
| 470 | static struct fs_driver_data vfe_fs_data = { |
| 471 | .clks = (struct fs_clk_data[]){ |
| 472 | { .name = "core_clk" }, |
| 473 | { .name = "iface_clk" }, |
| 474 | { .name = "bus_clk" }, |
| 475 | { 0 } |
| 476 | }, |
| 477 | .bus_port0 = MSM_BUS_MASTER_VFE, |
| 478 | }; |
| 479 | |
| 480 | static struct fs_driver_data vpe_fs_data = { |
| 481 | .clks = (struct fs_clk_data[]){ |
| 482 | { .name = "core_clk" }, |
| 483 | { .name = "iface_clk" }, |
| 484 | { .name = "bus_clk" }, |
| 485 | { 0 } |
| 486 | }, |
| 487 | .bus_port0 = MSM_BUS_MASTER_VPE, |
| 488 | }; |
| 489 | |
| 490 | struct platform_device *msm8930_footswitch[] __initdata = { |
Tianyi Gou | 723843b | 2012-06-13 15:24:56 -0700 | [diff] [blame] | 491 | FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8930), |
Matt Wagantall | 316f2fc | 2012-05-03 20:41:42 -0700 | [diff] [blame] | 492 | FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data), |
Matt Wagantall | e4454b8 | 2012-05-03 20:48:01 -0700 | [diff] [blame] | 493 | FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data), |
Kiran Kumar H N | fa18a03 | 2012-06-25 14:34:18 -0700 | [diff] [blame] | 494 | FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data), |
| 495 | FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data), |
Matt Wagantall | d6fbf23 | 2012-05-03 20:09:28 -0700 | [diff] [blame] | 496 | FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data), |
Matt Wagantall | 5e46aac | 2012-05-03 20:20:18 -0700 | [diff] [blame] | 497 | FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data), |
Matt Wagantall | 1f65d9d | 2012-04-25 14:24:20 -0700 | [diff] [blame] | 498 | }; |
| 499 | unsigned msm8930_num_footswitch __initdata = ARRAY_SIZE(msm8930_footswitch); |
| 500 | |
Tianyi Gou | 723843b | 2012-06-13 15:24:56 -0700 | [diff] [blame] | 501 | struct platform_device *msm8627_footswitch[] __initdata = { |
| 502 | FS_8X60(FS_MDP, "vdd", "mdp.0", &mdp_fs_data_8627), |
| 503 | FS_8X60(FS_ROT, "vdd", "msm_rotator.0", &rot_fs_data), |
| 504 | FS_8X60(FS_IJPEG, "vdd", "msm_gemini.0", &ijpeg_fs_data), |
| 505 | FS_8X60(FS_VFE, "vdd", "msm_vfe.0", &vfe_fs_data), |
| 506 | FS_8X60(FS_VPE, "vdd", "msm_vpe.0", &vpe_fs_data), |
| 507 | FS_8X60(FS_GFX3D, "vdd", "kgsl-3d0.0", &gfx3d_fs_data), |
| 508 | FS_8X60(FS_VED, "vdd", "msm_vidc.0", &ved_fs_data), |
| 509 | }; |
| 510 | unsigned msm8627_num_footswitch __initdata = ARRAY_SIZE(msm8627_footswitch); |
| 511 | |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 512 | /* MSM Video core device */ |
| 513 | #ifdef CONFIG_MSM_BUS_SCALING |
| 514 | static struct msm_bus_vectors vidc_init_vectors[] = { |
| 515 | { |
| 516 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 517 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 518 | .ab = 0, |
| 519 | .ib = 0, |
| 520 | }, |
| 521 | { |
| 522 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 523 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 524 | .ab = 0, |
| 525 | .ib = 0, |
| 526 | }, |
| 527 | { |
| 528 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 529 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 530 | .ab = 0, |
| 531 | .ib = 0, |
| 532 | }, |
| 533 | { |
| 534 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 535 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 536 | .ab = 0, |
| 537 | .ib = 0, |
| 538 | }, |
| 539 | }; |
| 540 | static struct msm_bus_vectors vidc_venc_vga_vectors[] = { |
| 541 | { |
| 542 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 543 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 544 | .ab = 54525952, |
| 545 | .ib = 436207616, |
| 546 | }, |
| 547 | { |
| 548 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 549 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 550 | .ab = 72351744, |
| 551 | .ib = 289406976, |
| 552 | }, |
| 553 | { |
| 554 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 555 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 556 | .ab = 500000, |
| 557 | .ib = 1000000, |
| 558 | }, |
| 559 | { |
| 560 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 561 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 562 | .ab = 500000, |
| 563 | .ib = 1000000, |
| 564 | }, |
| 565 | }; |
| 566 | static struct msm_bus_vectors vidc_vdec_vga_vectors[] = { |
| 567 | { |
| 568 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 569 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 570 | .ab = 40894464, |
| 571 | .ib = 327155712, |
| 572 | }, |
| 573 | { |
| 574 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 575 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 576 | .ab = 48234496, |
| 577 | .ib = 192937984, |
| 578 | }, |
| 579 | { |
| 580 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 581 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 582 | .ab = 500000, |
| 583 | .ib = 2000000, |
| 584 | }, |
| 585 | { |
| 586 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 587 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 588 | .ab = 500000, |
| 589 | .ib = 2000000, |
| 590 | }, |
| 591 | }; |
| 592 | static struct msm_bus_vectors vidc_venc_720p_vectors[] = { |
| 593 | { |
| 594 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 595 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 596 | .ab = 163577856, |
| 597 | .ib = 1308622848, |
| 598 | }, |
| 599 | { |
| 600 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 601 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 602 | .ab = 219152384, |
| 603 | .ib = 876609536, |
| 604 | }, |
| 605 | { |
| 606 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 607 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 608 | .ab = 1750000, |
| 609 | .ib = 3500000, |
| 610 | }, |
| 611 | { |
| 612 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 613 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 614 | .ab = 1750000, |
| 615 | .ib = 3500000, |
| 616 | }, |
| 617 | }; |
| 618 | static struct msm_bus_vectors vidc_vdec_720p_vectors[] = { |
| 619 | { |
| 620 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 621 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 622 | .ab = 121634816, |
| 623 | .ib = 973078528, |
| 624 | }, |
| 625 | { |
| 626 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 627 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 628 | .ab = 155189248, |
| 629 | .ib = 620756992, |
| 630 | }, |
| 631 | { |
| 632 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 633 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 634 | .ab = 1750000, |
| 635 | .ib = 7000000, |
| 636 | }, |
| 637 | { |
| 638 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 639 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 640 | .ab = 1750000, |
| 641 | .ib = 7000000, |
| 642 | }, |
| 643 | }; |
| 644 | static struct msm_bus_vectors vidc_venc_1080p_vectors[] = { |
| 645 | { |
| 646 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 647 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 648 | .ab = 372244480, |
| 649 | .ib = 2560000000U, |
| 650 | }, |
| 651 | { |
| 652 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 653 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 654 | .ab = 501219328, |
| 655 | .ib = 2560000000U, |
| 656 | }, |
| 657 | { |
| 658 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 659 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 660 | .ab = 2500000, |
| 661 | .ib = 5000000, |
| 662 | }, |
| 663 | { |
| 664 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 665 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 666 | .ab = 2500000, |
| 667 | .ib = 5000000, |
| 668 | }, |
| 669 | }; |
| 670 | static struct msm_bus_vectors vidc_vdec_1080p_vectors[] = { |
| 671 | { |
| 672 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 673 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 674 | .ab = 222298112, |
| 675 | .ib = 2560000000U, |
| 676 | }, |
| 677 | { |
| 678 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 679 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 680 | .ab = 330301440, |
| 681 | .ib = 2560000000U, |
| 682 | }, |
| 683 | { |
| 684 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 685 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 686 | .ab = 2500000, |
| 687 | .ib = 700000000, |
| 688 | }, |
| 689 | { |
| 690 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 691 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 692 | .ab = 2500000, |
| 693 | .ib = 10000000, |
| 694 | }, |
| 695 | }; |
Arun Menon | b31fefd | 2012-07-19 14:02:13 -0700 | [diff] [blame] | 696 | static struct msm_bus_vectors vidc_venc_1080p_turbo_vectors[] = { |
| 697 | { |
| 698 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 699 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 700 | .ab = 222298112, |
| 701 | .ib = 3522000000U, |
| 702 | }, |
| 703 | { |
| 704 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 705 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 706 | .ab = 330301440, |
| 707 | .ib = 3522000000U, |
| 708 | }, |
| 709 | { |
| 710 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 711 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 712 | .ab = 2500000, |
| 713 | .ib = 700000000, |
| 714 | }, |
| 715 | { |
| 716 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 717 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 718 | .ab = 2500000, |
| 719 | .ib = 10000000, |
| 720 | }, |
| 721 | }; |
| 722 | static struct msm_bus_vectors vidc_vdec_1080p_turbo_vectors[] = { |
| 723 | { |
| 724 | .src = MSM_BUS_MASTER_HD_CODEC_PORT0, |
| 725 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 726 | .ab = 222298112, |
| 727 | .ib = 3522000000U, |
| 728 | }, |
| 729 | { |
| 730 | .src = MSM_BUS_MASTER_HD_CODEC_PORT1, |
| 731 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 732 | .ab = 330301440, |
| 733 | .ib = 3522000000U, |
| 734 | }, |
| 735 | { |
| 736 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 737 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 738 | .ab = 2500000, |
| 739 | .ib = 700000000, |
| 740 | }, |
| 741 | { |
| 742 | .src = MSM_BUS_MASTER_AMPSS_M0, |
| 743 | .dst = MSM_BUS_SLAVE_EBI_CH0, |
| 744 | .ab = 2500000, |
| 745 | .ib = 10000000, |
| 746 | }, |
| 747 | }; |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 748 | |
| 749 | static struct msm_bus_paths vidc_bus_client_config[] = { |
| 750 | { |
| 751 | ARRAY_SIZE(vidc_init_vectors), |
| 752 | vidc_init_vectors, |
| 753 | }, |
| 754 | { |
| 755 | ARRAY_SIZE(vidc_venc_vga_vectors), |
| 756 | vidc_venc_vga_vectors, |
| 757 | }, |
| 758 | { |
| 759 | ARRAY_SIZE(vidc_vdec_vga_vectors), |
| 760 | vidc_vdec_vga_vectors, |
| 761 | }, |
| 762 | { |
| 763 | ARRAY_SIZE(vidc_venc_720p_vectors), |
| 764 | vidc_venc_720p_vectors, |
| 765 | }, |
| 766 | { |
| 767 | ARRAY_SIZE(vidc_vdec_720p_vectors), |
| 768 | vidc_vdec_720p_vectors, |
| 769 | }, |
| 770 | { |
| 771 | ARRAY_SIZE(vidc_venc_1080p_vectors), |
| 772 | vidc_venc_1080p_vectors, |
| 773 | }, |
| 774 | { |
| 775 | ARRAY_SIZE(vidc_vdec_1080p_vectors), |
| 776 | vidc_vdec_1080p_vectors, |
| 777 | }, |
Arun Menon | b31fefd | 2012-07-19 14:02:13 -0700 | [diff] [blame] | 778 | { |
| 779 | ARRAY_SIZE(vidc_venc_1080p_turbo_vectors), |
| 780 | vidc_vdec_1080p_turbo_vectors, |
| 781 | }, |
| 782 | { |
| 783 | ARRAY_SIZE(vidc_vdec_1080p_turbo_vectors), |
| 784 | vidc_vdec_1080p_turbo_vectors, |
| 785 | }, |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 786 | }; |
| 787 | |
| 788 | static struct msm_bus_scale_pdata vidc_bus_client_data = { |
| 789 | vidc_bus_client_config, |
| 790 | ARRAY_SIZE(vidc_bus_client_config), |
| 791 | .name = "vidc", |
| 792 | }; |
| 793 | #endif |
| 794 | |
| 795 | #define MSM_VIDC_BASE_PHYS 0x04400000 |
| 796 | #define MSM_VIDC_BASE_SIZE 0x00100000 |
| 797 | |
| 798 | static struct resource apq8930_device_vidc_resources[] = { |
| 799 | { |
| 800 | .start = MSM_VIDC_BASE_PHYS, |
| 801 | .end = MSM_VIDC_BASE_PHYS + MSM_VIDC_BASE_SIZE - 1, |
| 802 | .flags = IORESOURCE_MEM, |
| 803 | }, |
| 804 | { |
| 805 | .start = VCODEC_IRQ, |
| 806 | .end = VCODEC_IRQ, |
| 807 | .flags = IORESOURCE_IRQ, |
| 808 | }, |
| 809 | }; |
| 810 | |
| 811 | struct msm_vidc_platform_data apq8930_vidc_platform_data = { |
| 812 | #ifdef CONFIG_MSM_BUS_SCALING |
| 813 | .vidc_bus_client_pdata = &vidc_bus_client_data, |
| 814 | #endif |
| 815 | #ifdef CONFIG_MSM_MULTIMEDIA_USE_ION |
| 816 | .memtype = ION_CP_MM_HEAP_ID, |
| 817 | .enable_ion = 1, |
Deepak Kotur | 8097f78 | 2012-05-14 14:13:06 -0700 | [diff] [blame] | 818 | .cp_enabled = 1, |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 819 | #else |
| 820 | .memtype = MEMTYPE_EBI1, |
| 821 | .enable_ion = 0, |
| 822 | #endif |
Anil Gahlot | d0ce26d | 2012-05-08 17:58:46 -0700 | [diff] [blame] | 823 | .disable_dmx = 1, |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 824 | .disable_fullhd = 0, |
Riaz Rahaman | 84f8c68 | 2012-05-30 13:32:10 +0530 | [diff] [blame] | 825 | .fw_addr = 0x9fe00000, |
Arun Menon | aabf263 | 2012-02-24 15:30:47 -0800 | [diff] [blame] | 826 | }; |
| 827 | |
| 828 | struct platform_device apq8930_msm_device_vidc = { |
| 829 | .name = "msm_vidc", |
| 830 | .id = 0, |
| 831 | .num_resources = ARRAY_SIZE(apq8930_device_vidc_resources), |
| 832 | .resource = apq8930_device_vidc_resources, |
| 833 | .dev = { |
| 834 | .platform_data = &apq8930_vidc_platform_data, |
| 835 | }, |
| 836 | }; |
| 837 | |
| 838 | struct platform_device *vidc_device[] __initdata = { |
| 839 | &apq8930_msm_device_vidc |
| 840 | }; |
| 841 | |
| 842 | void __init msm8930_add_vidc_device(void) |
| 843 | { |
| 844 | if (cpu_is_msm8627()) { |
| 845 | struct msm_vidc_platform_data *pdata; |
| 846 | pdata = (struct msm_vidc_platform_data *) |
| 847 | apq8930_msm_device_vidc.dev.platform_data; |
| 848 | pdata->disable_fullhd = 1; |
| 849 | } |
| 850 | platform_add_devices(vidc_device, ARRAY_SIZE(vidc_device)); |
| 851 | } |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 852 | |
| 853 | struct msm_iommu_domain_name msm8930_iommu_ctx_names[] = { |
| 854 | /* Camera */ |
| 855 | { |
| 856 | .name = "vpe_src", |
| 857 | .domain = CAMERA_DOMAIN, |
| 858 | }, |
| 859 | /* Camera */ |
| 860 | { |
| 861 | .name = "vpe_dst", |
| 862 | .domain = CAMERA_DOMAIN, |
| 863 | }, |
| 864 | /* Camera */ |
| 865 | { |
| 866 | .name = "vfe_imgwr", |
| 867 | .domain = CAMERA_DOMAIN, |
| 868 | }, |
| 869 | /* Camera */ |
| 870 | { |
| 871 | .name = "vfe_misc", |
| 872 | .domain = CAMERA_DOMAIN, |
| 873 | }, |
| 874 | /* Camera */ |
| 875 | { |
| 876 | .name = "ijpeg_src", |
| 877 | .domain = CAMERA_DOMAIN, |
| 878 | }, |
| 879 | /* Camera */ |
| 880 | { |
| 881 | .name = "ijpeg_dst", |
| 882 | .domain = CAMERA_DOMAIN, |
| 883 | }, |
| 884 | /* Camera */ |
| 885 | { |
| 886 | .name = "jpegd_src", |
| 887 | .domain = CAMERA_DOMAIN, |
| 888 | }, |
| 889 | /* Camera */ |
| 890 | { |
| 891 | .name = "jpegd_dst", |
| 892 | .domain = CAMERA_DOMAIN, |
| 893 | }, |
| 894 | /* Rotator */ |
| 895 | { |
| 896 | .name = "rot_src", |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 897 | .domain = ROTATOR_SRC_DOMAIN, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 898 | }, |
| 899 | /* Rotator */ |
| 900 | { |
| 901 | .name = "rot_dst", |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 902 | .domain = ROTATOR_SRC_DOMAIN, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 903 | }, |
| 904 | /* Video */ |
| 905 | { |
| 906 | .name = "vcodec_a_mm1", |
| 907 | .domain = VIDEO_DOMAIN, |
| 908 | }, |
| 909 | /* Video */ |
| 910 | { |
| 911 | .name = "vcodec_b_mm2", |
| 912 | .domain = VIDEO_DOMAIN, |
| 913 | }, |
| 914 | /* Video */ |
| 915 | { |
| 916 | .name = "vcodec_a_stream", |
| 917 | .domain = VIDEO_DOMAIN, |
| 918 | }, |
| 919 | }; |
| 920 | |
| 921 | static struct mem_pool msm8930_video_pools[] = { |
| 922 | /* |
| 923 | * Video hardware has the following requirements: |
| 924 | * 1. All video addresses used by the video hardware must be at a higher |
| 925 | * address than video firmware address. |
| 926 | * 2. Video hardware can only access a range of 256MB from the base of |
| 927 | * the video firmware. |
| 928 | */ |
| 929 | [VIDEO_FIRMWARE_POOL] = |
| 930 | /* Low addresses, intended for video firmware */ |
| 931 | { |
| 932 | .paddr = SZ_128K, |
| 933 | .size = SZ_16M - SZ_128K, |
| 934 | }, |
| 935 | [VIDEO_MAIN_POOL] = |
| 936 | /* Main video pool */ |
| 937 | { |
| 938 | .paddr = SZ_16M, |
| 939 | .size = SZ_256M - SZ_16M, |
| 940 | }, |
| 941 | [GEN_POOL] = |
| 942 | /* Remaining address space up to 2G */ |
| 943 | { |
| 944 | .paddr = SZ_256M, |
| 945 | .size = SZ_2G - SZ_256M, |
| 946 | }, |
| 947 | }; |
| 948 | |
| 949 | static struct mem_pool msm8930_camera_pools[] = { |
| 950 | [GEN_POOL] = |
| 951 | /* One address space for camera */ |
| 952 | { |
| 953 | .paddr = SZ_128K, |
| 954 | .size = SZ_2G - SZ_128K, |
| 955 | }, |
| 956 | }; |
| 957 | |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 958 | static struct mem_pool msm8930_display_read_pools[] = { |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 959 | [GEN_POOL] = |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 960 | /* One address space for display reads */ |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 961 | { |
| 962 | .paddr = SZ_128K, |
| 963 | .size = SZ_2G - SZ_128K, |
| 964 | }, |
| 965 | }; |
| 966 | |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 967 | static struct mem_pool msm8930_rotator_src_pools[] = { |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 968 | [GEN_POOL] = |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 969 | /* One address space for rotator src */ |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 970 | { |
| 971 | .paddr = SZ_128K, |
| 972 | .size = SZ_2G - SZ_128K, |
| 973 | }, |
| 974 | }; |
| 975 | |
| 976 | static struct msm_iommu_domain msm8930_iommu_domains[] = { |
| 977 | [VIDEO_DOMAIN] = { |
| 978 | .iova_pools = msm8930_video_pools, |
| 979 | .npools = ARRAY_SIZE(msm8930_video_pools), |
| 980 | }, |
| 981 | [CAMERA_DOMAIN] = { |
| 982 | .iova_pools = msm8930_camera_pools, |
| 983 | .npools = ARRAY_SIZE(msm8930_camera_pools), |
| 984 | }, |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 985 | [DISPLAY_READ_DOMAIN] = { |
| 986 | .iova_pools = msm8930_display_read_pools, |
| 987 | .npools = ARRAY_SIZE(msm8930_display_read_pools), |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 988 | }, |
Olav Haugan | ef95ae3 | 2012-05-15 09:50:30 -0700 | [diff] [blame] | 989 | [ROTATOR_SRC_DOMAIN] = { |
| 990 | .iova_pools = msm8930_rotator_src_pools, |
| 991 | .npools = ARRAY_SIZE(msm8930_rotator_src_pools), |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 992 | }, |
| 993 | }; |
| 994 | |
| 995 | struct iommu_domains_pdata msm8930_iommu_domain_pdata = { |
| 996 | .domains = msm8930_iommu_domains, |
| 997 | .ndomains = ARRAY_SIZE(msm8930_iommu_domains), |
| 998 | .domain_names = msm8930_iommu_ctx_names, |
| 999 | .nnames = ARRAY_SIZE(msm8930_iommu_ctx_names), |
| 1000 | .domain_alloc_flags = 0, |
| 1001 | }; |
| 1002 | |
| 1003 | struct platform_device msm8930_iommu_domain_device = { |
| 1004 | .name = "iommu_domains", |
| 1005 | .id = -1, |
| 1006 | .dev = { |
| 1007 | .platform_data = &msm8930_iommu_domain_pdata, |
Laura Abbott | 532b2df | 2012-04-12 10:53:48 -0700 | [diff] [blame] | 1008 | } |
| 1009 | }; |
| 1010 | |
| 1011 | struct msm_rtb_platform_data msm8930_rtb_pdata = { |
| 1012 | .size = SZ_1M, |
| 1013 | }; |
| 1014 | |
| 1015 | static int __init msm_rtb_set_buffer_size(char *p) |
| 1016 | { |
| 1017 | int s; |
| 1018 | |
| 1019 | s = memparse(p, NULL); |
| 1020 | msm8930_rtb_pdata.size = ALIGN(s, SZ_4K); |
| 1021 | return 0; |
| 1022 | } |
| 1023 | early_param("msm_rtb_size", msm_rtb_set_buffer_size); |
| 1024 | |
| 1025 | |
| 1026 | struct platform_device msm8930_rtb_device = { |
| 1027 | .name = "msm_rtb", |
| 1028 | .id = -1, |
| 1029 | .dev = { |
| 1030 | .platform_data = &msm8930_rtb_pdata, |
Laura Abbott | 0577d7b | 2012-04-17 11:14:30 -0700 | [diff] [blame] | 1031 | }, |
| 1032 | }; |
Laura Abbott | f317304 | 2012-05-29 15:23:18 -0700 | [diff] [blame] | 1033 | |
| 1034 | #define MSM8930_L1_SIZE SZ_1M |
| 1035 | /* |
| 1036 | * The actual L2 size is smaller but we need a larger buffer |
| 1037 | * size to store other dump information |
| 1038 | */ |
| 1039 | #define MSM8930_L2_SIZE SZ_4M |
| 1040 | |
| 1041 | struct msm_cache_dump_platform_data msm8930_cache_dump_pdata = { |
| 1042 | .l2_size = MSM8930_L2_SIZE, |
| 1043 | .l1_size = MSM8930_L1_SIZE, |
| 1044 | }; |
| 1045 | |
| 1046 | struct platform_device msm8930_cache_dump_device = { |
| 1047 | .name = "msm_cache_dump", |
| 1048 | .id = -1, |
| 1049 | .dev = { |
| 1050 | .platform_data = &msm8930_cache_dump_pdata, |
| 1051 | }, |
| 1052 | }; |