blob: e645ca68d7869777bd41072ac519260eda282f1b [file] [log] [blame]
Jeevan Shriram89b72f42015-01-07 16:33:25 -08001/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
Channagoud Kadabi123c9722014-02-06 13:22:50 -08002 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above
9 * copyright notice, this list of conditions and the following
10 * disclaimer in the documentation and/or other materials provided
11 * with the distribution.
12 * * Neither the name of The Linux Foundation nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
Channagoud Kadabi608b6a72014-04-14 13:58:03 -070029#ifndef _PLATFORM_MSM8994_IOMAP_H_
30#define _PLATFORM_MSM8994_IOMAP_H_
Channagoud Kadabi123c9722014-02-06 13:22:50 -080031
Channagoud Kadabi4983cf02014-05-06 17:34:52 -070032#define MSM_SHARED_BASE 0x06A00000
Channagoud Kadabi123c9722014-02-06 13:22:50 -080033
34#define MSM_IOMAP_BASE 0xF9000000
35#define MSM_IOMAP_END 0xFEFFFFFF
36
37#define SYSTEM_IMEM_BASE 0xFE800000
38#define MSM_SHARED_IMEM_BASE 0xFE87F000
Sridhar Parasuram39419a32014-09-12 18:11:05 -070039#define MSM_SHARED_IMEM_BASE2 0xFE80F000
Channagoud Kadabi123c9722014-02-06 13:22:50 -080040#define RESTART_REASON_ADDR (MSM_SHARED_IMEM_BASE + 0x65C)
Sridhar Parasuram39419a32014-09-12 18:11:05 -070041#define RESTART_REASON_ADDR2 (MSM_SHARED_IMEM_BASE2 + 0x65C)
Channagoud Kadabi123c9722014-02-06 13:22:50 -080042
Channagoud Kadabi2b78a432015-08-20 15:10:46 -070043#define DLOAD_MODE_ADDR (MSM_SHARED_IMEM_BASE + 0x0)
44#define EMERGENCY_DLOAD_MODE_ADDR (MSM_SHARED_IMEM_BASE + 0xFE0)
45#define DLOAD_MODE_ADDR_V2 (MSM_SHARED_IMEM_BASE2 + 0x0)
46#define EMERGENCY_DLOAD_MODE_ADDR_V2 (MSM_SHARED_IMEM_BASE2 + 0xFE0)
47
48
Sridhar Parasuram39419a32014-09-12 18:11:05 -070049#define BS_INFO_OFFSET (0x6B0)
50#define BS_INFO_ADDR (MSM_SHARED_IMEM_BASE + BS_INFO_OFFSET)
51#define BS_INFO_ADDR2 (MSM_SHARED_IMEM_BASE2 + BS_INFO_OFFSET)
Channagoud Kadabi123c9722014-02-06 13:22:50 -080052
53#define KPSS_BASE 0xF9000000
54
55#define MSM_GIC_DIST_BASE KPSS_BASE
56#define MSM_GIC_CPU_BASE (KPSS_BASE + 0x00002000)
57#define APCS_KPSS_ACS_BASE (KPSS_BASE + 0x00008000)
58#define APCS_APC_KPSS_PLL_BASE (KPSS_BASE + 0x0000A000)
59#define APCS_KPSS_CFG_BASE (KPSS_BASE + 0x00010000)
60#define APCS_KPSS_WDT_BASE (KPSS_BASE + 0x00017000)
61#define KPSS_APCS_QTMR_AC_BASE (KPSS_BASE + 0x00020000)
62#define KPSS_APCS_F0_QTMR_V1_BASE (KPSS_BASE + 0x00021000)
Sundarajan Srinivasan19b95c72014-07-24 16:37:04 -070063#define APCS_ALIAS0_IPC_INTERRUPT (KPSS_BASE + 0x0000D008)
Channagoud Kadabi123c9722014-02-06 13:22:50 -080064#define QTMR_BASE KPSS_APCS_F0_QTMR_V1_BASE
65
66#define PERIPH_SS_BASE 0xF9800000
67
68#define MSM_SDC1_BASE (PERIPH_SS_BASE + 0x00024000)
69#define MSM_SDC1_SDHCI_BASE (PERIPH_SS_BASE + 0x00024900)
70#define MSM_SDC3_BASE (PERIPH_SS_BASE + 0x00064000)
71#define MSM_SDC3_SDHCI_BASE (PERIPH_SS_BASE + 0x00064900)
72#define MSM_SDC2_BASE (PERIPH_SS_BASE + 0x000A4000)
73#define MSM_SDC2_SDHCI_BASE (PERIPH_SS_BASE + 0x000A4900)
74#define MSM_SDC4_BASE (PERIPH_SS_BASE + 0x000E4000)
75#define MSM_SDC4_SDHCI_BASE (PERIPH_SS_BASE + 0x000E4900)
76
77#define BLSP1_UART0_BASE (PERIPH_SS_BASE + 0x0011D000)
78#define BLSP1_UART1_BASE (PERIPH_SS_BASE + 0x0011E000)
79#define BLSP1_UART2_BASE (PERIPH_SS_BASE + 0x0011F000)
80#define BLSP1_UART3_BASE (PERIPH_SS_BASE + 0x00120000)
81#define BLSP1_UART4_BASE (PERIPH_SS_BASE + 0x00121000)
82#define BLSP1_UART5_BASE (PERIPH_SS_BASE + 0x00122000)
83
84#define BLSP2_UART1_BASE (PERIPH_SS_BASE + 0x0015E000)
85
86#define MSM_USB_BASE (PERIPH_SS_BASE + 0x00255000)
Sundarajan Srinivasan0ebf2fc2014-04-23 16:45:18 -070087#define USB2_PHY_SEL 0xFD4AB000
88
89/* QUSB2 PHY */
90#define QUSB2_PHY_BASE (PERIPH_SS_BASE + 0x00339000)
91
Channagoud Kadabi3dcc4ed2014-04-10 14:59:41 -070092#define MSM_USB30_BASE 0xF9200000
93#define MSM_USB30_QSCRATCH_BASE 0xF92F8800
94
95/* SS QMP (Qulacomm Multi Protocol) */
96#define QMP_PHY_BASE 0xF9B38000
97
Channagoud Kadabi123c9722014-02-06 13:22:50 -080098/* Clocks */
99#define CLK_CTL_BASE 0xFC400000
100
101/* GPLL */
102#define GPLL0_MODE (CLK_CTL_BASE + 0x0000)
103#define GPLL4_MODE (CLK_CTL_BASE + 0x1DC0)
104#define APCS_GPLL_ENA_VOTE (CLK_CTL_BASE + 0x1480)
105#define APCS_CLOCK_BRANCH_ENA_VOTE (CLK_CTL_BASE + 0x1484)
106
107/* UART */
108#define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x5C4)
109#define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x704)
110#define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x70C)
111#define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x710)
112#define BLSP1_UART2_APPS_M (CLK_CTL_BASE + 0x714)
113#define BLSP1_UART2_APPS_N (CLK_CTL_BASE + 0x718)
114#define BLSP1_UART2_APPS_D (CLK_CTL_BASE + 0x71C)
115#define BLSP2_AHB_CBCR (CLK_CTL_BASE + 0x944)
116#define BLSP2_UART2_APPS_CBCR (CLK_CTL_BASE + 0xA44)
117#define BLSP2_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0xA4C)
118#define BLSP2_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0xA50)
119#define BLSP2_UART2_APPS_M (CLK_CTL_BASE + 0xA54)
120#define BLSP2_UART2_APPS_N (CLK_CTL_BASE + 0xA58)
121#define BLSP2_UART2_APPS_D (CLK_CTL_BASE + 0xA5C)
122
123/* USB */
124#define USB_HS_BCR (CLK_CTL_BASE + 0x480)
125
126#define USB_HS_SYSTEM_CBCR (CLK_CTL_BASE + 0x484)
127#define USB_HS_AHB_CBCR (CLK_CTL_BASE + 0x488)
128#define USB_HS_SYSTEM_CMD_RCGR (CLK_CTL_BASE + 0x490)
129#define USB_HS_SYSTEM_CFG_RCGR (CLK_CTL_BASE + 0x494)
130
Channagoud Kadabi3dcc4ed2014-04-10 14:59:41 -0700131/* USB3 clocks */
132#define SYS_NOC_USB3_AXI_CBCR (CLK_CTL_BASE + 0x03FC)
133#define USB2B_PHY_SLEEP_CBCR (CLK_CTL_BASE + 0x04AC)
134#define USB2B_PHY_BCR (CLK_CTL_BASE + 0x04A8)
135#define USB30_MASTER_CMD_RCGR (CLK_CTL_BASE + 0x03D4)
136#define USB30_MASTER_CFG_RCGR (CLK_CTL_BASE + 0x03D8)
137#define USB30_MASTER_M (CLK_CTL_BASE + 0x03DC)
138#define USB30_MASTER_N (CLK_CTL_BASE + 0x03E0)
139#define USB30_MASTER_D (CLK_CTL_BASE + 0x03E4)
140#define USB30_MASTER_CBCR (CLK_CTL_BASE + 0x03C8)
141#define USB_30_BCR (CLK_CTL_BASE + 0x03C0)
142#define USB30_MOCK_UTMI_CMD_RCGR (CLK_CTL_BASE + 0x03E8)
143#define USB30_MOCK_UTMI_CFG_RCGR (CLK_CTL_BASE + 0x03EC)
144#define USB30_MOCK_UTMI_CBCR (CLK_CTL_BASE + 0x03D0)
145#define USB30_SLEEP_CBCR (CLK_CTL_BASE + 0x03CC)
146#define USB30_PHY_AUX_CMD_RCGR (CLK_CTL_BASE + 0x1414)
147#define USB30_PHY_AUX_CFG_RCGR (CLK_CTL_BASE + 0x1418)
148#define USB30_PHY_AUX_CBCR (CLK_CTL_BASE + 0x1408)
149#define USB30_PHY_PIPE_CBCR (CLK_CTL_BASE + 0x140C)
150#define USB30_PHY_BCR (CLK_CTL_BASE + 0x1400)
151#define USB30PHY_PHY_BCR (CLK_CTL_BASE + 0x1404)
152#define GCC_USB30_GDSCR (CLK_CTL_BASE + 0x03C4)
Sundarajan Srinivasan0ebf2fc2014-04-23 16:45:18 -0700153#define GCC_QUSB2_PHY_BCR (CLK_CTL_BASE + 0x04B8)
Channagoud Kadabi3c2be1c2014-06-01 18:59:21 -0700154#define USB_PHY_CFG_AHB2PHY_CBCR (CLK_CTL_BASE + 0x1A84)
Channagoud Kadabi3dcc4ed2014-04-10 14:59:41 -0700155
Channagoud Kadabi123c9722014-02-06 13:22:50 -0800156/* SDCC */
157#define SDCC1_BCR (CLK_CTL_BASE + 0x4C0) /* block reset */
158#define SDCC1_APPS_CBCR (CLK_CTL_BASE + 0x4C4) /* branch control */
159#define SDCC1_AHB_CBCR (CLK_CTL_BASE + 0x4C8)
160#define SDCC1_CMD_RCGR (CLK_CTL_BASE + 0x4D0) /* cmd */
161#define SDCC1_CFG_RCGR (CLK_CTL_BASE + 0x4D4) /* cfg */
162#define SDCC1_M (CLK_CTL_BASE + 0x4D8) /* m */
163#define SDCC1_N (CLK_CTL_BASE + 0x4DC) /* n */
164#define SDCC1_D (CLK_CTL_BASE + 0x4E0) /* d */
165
Channagoud Kadabie804d642014-08-20 17:43:57 -0700166/* SDCC2 */
167#define SDCC2_BCR (CLK_CTL_BASE + 0x500) /* block reset */
168#define SDCC2_APPS_CBCR (CLK_CTL_BASE + 0x504) /* branch control */
169#define SDCC2_AHB_CBCR (CLK_CTL_BASE + 0x508)
170#define SDCC2_INACTIVITY_TIMER_CBCR (CLK_CTL_BASE + 0x50C)
171#define SDCC2_CMD_RCGR (CLK_CTL_BASE + 0x510) /* cmd */
172#define SDCC2_CFG_RCGR (CLK_CTL_BASE + 0x514) /* cfg */
173#define SDCC2_M (CLK_CTL_BASE + 0x518) /* m */
174#define SDCC2_N (CLK_CTL_BASE + 0x51C) /* n */
175#define SDCC2_D (CLK_CTL_BASE + 0x520) /* d */
176
Channagoud Kadabi123c9722014-02-06 13:22:50 -0800177/* SDCC3 */
178#define SDCC3_BCR (CLK_CTL_BASE + 0x540) /* block reset */
179#define SDCC3_APPS_CBCR (CLK_CTL_BASE + 0x544) /* branch control */
180#define SDCC3_AHB_CBCR (CLK_CTL_BASE + 0x548)
181#define SDCC3_INACTIVITY_TIMER_CBCR (CLK_CTL_BASE + 0x54C)
182#define SDCC3_CMD_RCGR (CLK_CTL_BASE + 0x550) /* cmd */
183#define SDCC3_CFG_RCGR (CLK_CTL_BASE + 0x554) /* cfg */
184#define SDCC3_M (CLK_CTL_BASE + 0x558) /* m */
185#define SDCC3_N (CLK_CTL_BASE + 0x55C) /* n */
186#define SDCC3_D (CLK_CTL_BASE + 0x560) /* d */
187
188
189#define GCC_WDOG_DEBUG (CLK_CTL_BASE + 0x00001780)
190
191#define UFS_BASE (0xFC590000 + 0x00004000)
192
193#define SPMI_BASE 0xFC4C0000
194#define SPMI_GENI_BASE (SPMI_BASE + 0xA000)
195#define SPMI_PIC_BASE (SPMI_BASE + 0xB000)
196
Channagoud Kadabi27ff9342014-06-16 11:19:29 -0700197#define MSM_CE2_BAM_BASE 0xFD444000
198#define MSM_CE2_BASE 0xFD45A000
Channagoud Kadabi2c488742014-12-02 11:37:18 -0800199#define GCC_CE2_BCR (CLK_CTL_BASE + 0x1080)
Channagoud Kadabi123c9722014-02-06 13:22:50 -0800200
201#define TLMM_BASE_ADDR 0xFD510000
202#define GPIO_CONFIG_ADDR(x) (TLMM_BASE_ADDR + 0x1000 + (x)*0x10)
203#define GPIO_IN_OUT_ADDR(x) (TLMM_BASE_ADDR + 0x1004 + (x)*0x10)
204
205#define MPM2_MPM_CTRL_BASE 0xFC4A1000
206#define MPM2_MPM_PS_HOLD 0xFC4AB000
207#define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0xFC4A3000
208
209/* DRV strength for sdcc */
210#define SDC1_HDRV_PULL_CTL (TLMM_BASE_ADDR + 0x00002044)
Channagoud Kadabie804d642014-08-20 17:43:57 -0700211#define SDC2_HDRV_PULL_CTL (TLMM_BASE_ADDR + 0x00002048)
Channagoud Kadabi123c9722014-02-06 13:22:50 -0800212
213/* SDHCI */
214#define SDCC_MCI_HC_MODE (0x00000078)
215#define SDCC_HC_PWRCTL_STATUS_REG (0x000000DC)
216#define SDCC_HC_PWRCTL_MASK_REG (0x000000E0)
217#define SDCC_HC_PWRCTL_CLEAR_REG (0x000000E4)
218#define SDCC_HC_PWRCTL_CTL_REG (0x000000E8)
219
220/* Boot config */
221#define SEC_CTRL_CORE_BASE 0xFC4B8000
222#define BOOT_CONFIG_OFFSET 0x00006034
223#define BOOT_CONFIG_REG (SEC_CTRL_CORE_BASE+BOOT_CONFIG_OFFSET)
224
225#define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0xFC4A3000
226
Channagoud Kadabi3dcc4ed2014-04-10 14:59:41 -0700227#define TCSR_PHSS_USB2_PHY_SEL 0xFD4AB000
228#define PLATFORM_QMP_OFFSET 0x8
229
Channagoud Kadabi9e574882014-06-24 16:15:23 -0700230#define SMEM_TARG_INFO_ADDR 0xFE805FF0
Channagoud Kadabib4c64b82014-07-24 17:18:46 -0700231
Dhaval Patelddce3012014-08-12 14:08:31 -0700232/* MDSS */
233#define MSM_MMSS_CLK_CTL_BASE 0xFD8C0000
Channagoud Kadabi5f42b272014-08-21 18:40:39 -0700234#define MMSS_MISC_AHB_CBCR (MSM_MMSS_CLK_CTL_BASE + 0x502C)
Dhaval Patelddce3012014-08-12 14:08:31 -0700235#define MIPI_DSI_BASE (0xFD998000)
236#define MIPI_DSI0_BASE (MIPI_DSI_BASE)
237#define MIPI_DSI1_BASE (0xFD9A0000)
238#define DSI0_PHY_BASE (0xFD998500)
239#define DSI1_PHY_BASE (0xFD9A0500)
240#define DSI0_PLL_BASE (0xFD998300)
241#define DSI1_PLL_BASE (0xFD9A0300)
Jeevan Shriram89b72f42015-01-07 16:33:25 -0800242#define DSI0_REGULATOR_BASE (0xFD998780)
243#define DSI1_REGULATOR_BASE (0xFD9A0780)
Dhaval Patelddce3012014-08-12 14:08:31 -0700244
Huaibin Yang928201b2015-01-15 10:40:21 -0800245#define MMSS_DSI_PHY_PLL_CORE_VCO_TUNE 0x0160
246#define MMSS_DSI_PHY_PLL_CORE_KVCO_CODE 0x0168
247
Dhaval Patelddce3012014-08-12 14:08:31 -0700248#define MDP_BASE (0xfd900000)
249
Siddhartha Agrawal869809e2014-09-25 10:18:59 -0700250
251#ifdef MDP_PP_0_BASE
252#undef MDP_PP_0_BASE
253#endif
254#define MDP_PP_0_BASE REG_MDP(0x71000)
255
256#ifdef MDP_PP_1_BASE
257#undef MDP_PP_1_BASE
258#endif
259#define MDP_PP_1_BASE REG_MDP(0x71800)
260
Dhaval Patelddce3012014-08-12 14:08:31 -0700261#define REG_MDP(off) (MDP_BASE + (off))
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800262
263#ifdef MDP_HW_REV
264#undef MDP_HW_REV
265#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700266#define MDP_HW_REV REG_MDP(0x1000)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800267
268#ifdef MDP_INTR_EN
269#undef MDP_INTR_EN
270#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700271#define MDP_INTR_EN REG_MDP(0x1010)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800272
273#ifdef MDP_INTR_CLEAR
274#undef MDP_INTR_CLEAR
275#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700276#define MDP_INTR_CLEAR REG_MDP(0x1018)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800277
278#ifdef MDP_HIST_INTR_EN
279#undef MDP_HIST_INTR_EN
280#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700281#define MDP_HIST_INTR_EN REG_MDP(0x101C)
282
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800283#ifdef MDP_DISP_INTF_SEL
284#undef MDP_DISP_INTF_SEL
285#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700286#define MDP_DISP_INTF_SEL REG_MDP(0x1004)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800287
288#ifdef MDP_VIDEO_INTF_UNDERFLOW_CTL
289#undef MDP_VIDEO_INTF_UNDERFLOW_CTL
290#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700291#define MDP_VIDEO_INTF_UNDERFLOW_CTL REG_MDP(0x12E0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800292
293#ifdef MDP_UPPER_NEW_ROI_PRIOR_RO_START
294#undef MDP_UPPER_NEW_ROI_PRIOR_RO_START
295#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700296#define MDP_UPPER_NEW_ROI_PRIOR_RO_START REG_MDP(0x11EC)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800297
298#ifdef MDP_LOWER_NEW_ROI_PRIOR_TO_START
299#undef MDP_LOWER_NEW_ROI_PRIOR_TO_START
300#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700301#define MDP_LOWER_NEW_ROI_PRIOR_TO_START REG_MDP(0x13F8)
302
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800303#ifdef MDP_INTF_0_TIMING_ENGINE_EN
304#undef MDP_INTF_0_TIMING_ENGINE_EN
305#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700306#define MDP_INTF_0_TIMING_ENGINE_EN REG_MDP(0x6b000)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800307
308#ifdef MDP_INTF_1_TIMING_ENGINE_EN
309#undef MDP_INTF_1_TIMING_ENGINE_EN
310#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700311#define MDP_INTF_1_TIMING_ENGINE_EN REG_MDP(0x6b800)
Veera Sundaram Sankaranbacb4012014-12-16 18:16:44 -0800312
313#ifdef MDP_INTF_2_TIMING_ENGINE_EN
314#undef MDP_INTF_2_TIMING_ENGINE_EN
315#endif
Aravind Venkateswaran982bdd82014-12-08 12:03:11 -0800316#define MDP_INTF_2_TIMING_ENGINE_EN REG_MDP(0x6C000)
Dhaval Patelddce3012014-08-12 14:08:31 -0700317
Casey Piper47ea5dd2015-03-20 15:39:49 -0700318#ifdef MDP_INTF_3_TIMING_ENGINE_EN
319#undef MDP_INTF_3_TIMING_ENGINE_EN
320#endif
321#define MDP_INTF_3_TIMING_ENGINE_EN REG_MDP(0x6C800)
322
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800323#ifdef MDP_CTL_0_BASE
324#undef MDP_CTL_0_BASE
325#endif
326#define MDP_CTL_0_BASE REG_MDP(0x2000)
Dhaval Patelddce3012014-08-12 14:08:31 -0700327
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800328#ifdef MDP_CTL_1_BASE
329#undef MDP_CTL_1_BASE
330#endif
331#define MDP_CTL_1_BASE REG_MDP(0x2200)
332
333#ifdef MDP_REG_SPLIT_DISPLAY_EN
334#undef MDP_REG_SPLIT_DISPLAY_EN
335#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700336#define MDP_REG_SPLIT_DISPLAY_EN REG_MDP(0x12F4)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800337
338#ifdef MDP_REG_SPLIT_DISPLAY_UPPER_PIPE_CTL
339#undef MDP_REG_SPLIT_DISPLAY_UPPER_PIPE_CTL
340#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700341#define MDP_REG_SPLIT_DISPLAY_UPPER_PIPE_CTL REG_MDP(0x12F8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800342
343#ifdef MDP_REG_SPLIT_DISPLAY_LOWER_PIPE_CTL
344#undef MDP_REG_SPLIT_DISPLAY_LOWER_PIPE_CTL
345#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700346#define MDP_REG_SPLIT_DISPLAY_LOWER_PIPE_CTL REG_MDP(0x13F0)
347
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800348#ifdef MDP_INTF_0_BASE
349#undef MDP_INTF_0_BASE
350#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700351#define MDP_INTF_0_BASE REG_MDP(0x6b000)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800352
353#ifdef MDP_INTF_1_BASE
354#undef MDP_INTF_1_BASE
355#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700356#define MDP_INTF_1_BASE REG_MDP(0x6b800)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800357
358#ifdef MDP_INTF_2_BASE
359#undef MDP_INTF_2_BASE
360#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700361#define MDP_INTF_2_BASE REG_MDP(0x6c000)
362
Casey Piper47ea5dd2015-03-20 15:39:49 -0700363#ifdef MDP_INTF_3_BASE
364#undef MDP_INTF_3_BASE
365#endif
366#define MDP_INTF_3_BASE REG_MDP(0x6c800)
367
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800368#ifdef MDP_CLK_CTRL0
369#undef MDP_CLK_CTRL0
370#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700371#define MDP_CLK_CTRL0 REG_MDP(0x12AC)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800372
373#ifdef MDP_CLK_CTRL1
374#undef MDP_CLK_CTRL1
375#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700376#define MDP_CLK_CTRL1 REG_MDP(0x12B4)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800377
378#ifdef MDP_CLK_CTRL2
379#undef MDP_CLK_CTRL2
380#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700381#define MDP_CLK_CTRL2 REG_MDP(0x12BC)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800382
383#ifdef MDP_CLK_CTRL3
384#undef MDP_CLK_CTRL3
385#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700386#define MDP_CLK_CTRL3 REG_MDP(0x13A8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800387
388#ifdef MDP_CLK_CTRL4
389#undef MDP_CLK_CTRL4
390#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700391#define MDP_CLK_CTRL4 REG_MDP(0x13B0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800392
393#ifdef MDP_CLK_CTRL5
394#undef MDP_CLK_CTRL5
395#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700396#define MDP_CLK_CTRL5 REG_MDP(0x13B8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800397
398#ifdef MDP_CLK_CTRL6
399#undef MDP_CLK_CTRL6
400#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700401#define MDP_CLK_CTRL6 REG_MDP(0x12C4)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800402
403#ifdef MDP_CLK_CTRL7
404#undef MDP_CLK_CTRL7
405#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700406#define MDP_CLK_CTRL7 REG_MDP(0x13D0)
407
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800408#ifdef MMSS_MDP_SMP_ALLOC_W_BASE
409#undef MMSS_MDP_SMP_ALLOC_W_BASE
410#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700411#define MMSS_MDP_SMP_ALLOC_W_BASE REG_MDP(0x1080)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800412
413#ifdef MMSS_MDP_SMP_ALLOC_R_BASE
414#undef MMSS_MDP_SMP_ALLOC_R_BASE
415#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700416#define MMSS_MDP_SMP_ALLOC_R_BASE REG_MDP(0x1130)
417
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800418#ifdef MDP_QOS_REMAPPER_CLASS_0
419#undef MDP_QOS_REMAPPER_CLASS_0
420#endif
Ingrid Gallardo998ea442014-09-10 17:22:08 -0700421#define MDP_QOS_REMAPPER_CLASS_0 REG_MDP(0x11E0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800422
423#ifdef MDP_QOS_REMAPPER_CLASS_1
424#undef MDP_QOS_REMAPPER_CLASS_1
425#endif
Ingrid Gallardo998ea442014-09-10 17:22:08 -0700426#define MDP_QOS_REMAPPER_CLASS_1 REG_MDP(0x11E4)
Dhaval Patelddce3012014-08-12 14:08:31 -0700427
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800428#ifdef VBIF_VBIF_DDR_FORCE_CLK_ON
429#undef VBIF_VBIF_DDR_FORCE_CLK_ON
430#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700431#define VBIF_VBIF_DDR_FORCE_CLK_ON REG_MDP(0xc8004)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800432
433#ifdef VBIF_VBIF_DDR_OUT_MAX_BURST
434#undef VBIF_VBIF_DDR_OUT_MAX_BURST
435#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700436#define VBIF_VBIF_DDR_OUT_MAX_BURST REG_MDP(0xc80D8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800437
438#ifdef VBIF_VBIF_DDR_ARB_CTRL
439#undef VBIF_VBIF_DDR_ARB_CTRL
440#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700441#define VBIF_VBIF_DDR_ARB_CTRL REG_MDP(0xc80F0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800442
443#ifdef VBIF_VBIF_DDR_RND_RBN_QOS_ARB
444#undef VBIF_VBIF_DDR_RND_RBN_QOS_ARB
445#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700446#define VBIF_VBIF_DDR_RND_RBN_QOS_ARB REG_MDP(0xc8124)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800447
448#ifdef VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF0
449#undef VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF0
450#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700451#define VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF0 REG_MDP(0xc8160)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800452
453#ifdef VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF1
454#undef VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF1
455#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700456#define VBIF_VBIF_DDR_AXI_AMEMTYPE_CONF1 REG_MDP(0xc8164)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800457
458#ifdef VBIF_VBIF_DDR_OUT_AOOO_AXI_EN
459#undef VBIF_VBIF_DDR_OUT_AOOO_AXI_EN
460#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700461#define VBIF_VBIF_DDR_OUT_AOOO_AXI_EN REG_MDP(0xc8178)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800462
463#ifdef VBIF_VBIF_DDR_OUT_AX_AOOO
464#undef VBIF_VBIF_DDR_OUT_AX_AOOO
465#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700466#define VBIF_VBIF_DDR_OUT_AX_AOOO REG_MDP(0xc817C)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800467
468#ifdef VBIF_VBIF_IN_RD_LIM_CONF0
469#undef VBIF_VBIF_IN_RD_LIM_CONF0
470#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700471#define VBIF_VBIF_IN_RD_LIM_CONF0 REG_MDP(0xc80B0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800472
473#ifdef VBIF_VBIF_IN_RD_LIM_CONF1
474#undef VBIF_VBIF_IN_RD_LIM_CONF1
475#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700476#define VBIF_VBIF_IN_RD_LIM_CONF1 REG_MDP(0xc80B4)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800477
478#ifdef VBIF_VBIF_IN_RD_LIM_CONF2
479#undef VBIF_VBIF_IN_RD_LIM_CONF2
480#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700481#define VBIF_VBIF_IN_RD_LIM_CONF2 REG_MDP(0xc80B8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800482
483#ifdef VBIF_VBIF_IN_RD_LIM_CONF3
484#undef VBIF_VBIF_IN_RD_LIM_CONF3
485#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700486#define VBIF_VBIF_IN_RD_LIM_CONF3 REG_MDP(0xc80BC)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800487
488#ifdef VBIF_VBIF_IN_WR_LIM_CONF0
489#undef VBIF_VBIF_IN_WR_LIM_CONF0
490#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700491#define VBIF_VBIF_IN_WR_LIM_CONF0 REG_MDP(0xc80C0)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800492
493#ifdef VBIF_VBIF_IN_WR_LIM_CONF1
494#undef VBIF_VBIF_IN_WR_LIM_CONF1
495#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700496#define VBIF_VBIF_IN_WR_LIM_CONF1 REG_MDP(0xc80C4)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800497
498#ifdef VBIF_VBIF_IN_WR_LIM_CONF2
499#undef VBIF_VBIF_IN_WR_LIM_CONF2
500#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700501#define VBIF_VBIF_IN_WR_LIM_CONF2 REG_MDP(0xc80C8)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800502
503#ifdef VBIF_VBIF_IN_WR_LIM_CONF3
504#undef VBIF_VBIF_IN_WR_LIM_CONF3
505#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700506#define VBIF_VBIF_IN_WR_LIM_CONF3 REG_MDP(0xc80CC)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800507
508#ifdef VBIF_VBIF_ABIT_SHORT
509#undef VBIF_VBIF_ABIT_SHORT
510#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700511#define VBIF_VBIF_ABIT_SHORT REG_MDP(0xc8070)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800512
513#ifdef VBIF_VBIF_ABIT_SHORT_CONF
514#undef VBIF_VBIF_ABIT_SHORT_CONF
515#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700516#define VBIF_VBIF_ABIT_SHORT_CONF REG_MDP(0xc8074)
Veera Sundaram Sankaran602d95a2014-12-09 17:55:04 -0800517
518#ifdef VBIF_VBIF_GATE_OFF_WRREQ_EN
519#undef VBIF_VBIF_GATE_OFF_WRREQ_EN
520#endif
Dhaval Patelddce3012014-08-12 14:08:31 -0700521#define VBIF_VBIF_GATE_OFF_WRREQ_EN REG_MDP(0xc80A8)
522
523#define MDP_VP_0_VIG_0_BASE REG_MDP(0x5000)
524#define MDP_VP_0_VIG_1_BASE REG_MDP(0x7000)
525#define MDP_VP_0_RGB_0_BASE REG_MDP(0x15000)
526#define MDP_VP_0_RGB_1_BASE REG_MDP(0x17000)
527#define MDP_VP_0_DMA_0_BASE REG_MDP(0x25000)
528#define MDP_VP_0_DMA_1_BASE REG_MDP(0x27000)
529#define MDP_VP_0_MIXER_0_BASE REG_MDP(0x45000)
530#define MDP_VP_0_MIXER_1_BASE REG_MDP(0x46000)
531
532#define DMA_CMD_OFFSET 0x048
533#define DMA_CMD_LENGTH 0x04C
534
535#define INT_CTRL 0x110
536#define CMD_MODE_DMA_SW_TRIGGER 0x090
537
538#define EOT_PACKET_CTRL 0x0CC
539#define MISR_CMD_CTRL 0x0A0
540#define MISR_VIDEO_CTRL 0x0A4
541#define VIDEO_MODE_CTRL 0x010
542#define HS_TIMER_CTRL 0x0BC
Channagoud Kadabib4c64b82014-07-24 17:18:46 -0700543
544#define SOFT_RESET 0x118
545#define CLK_CTRL 0x11C
546#define TRIG_CTRL 0x084
547#define CTRL 0x004
548#define COMMAND_MODE_DMA_CTRL 0x03C
549#define COMMAND_MODE_MDP_CTRL 0x040
550#define COMMAND_MODE_MDP_DCS_CMD_CTRL 0x044
551#define COMMAND_MODE_MDP_STREAM0_CTRL 0x058
552#define COMMAND_MODE_MDP_STREAM0_TOTAL 0x05C
553#define COMMAND_MODE_MDP_STREAM1_CTRL 0x060
554#define COMMAND_MODE_MDP_STREAM1_TOTAL 0x064
555#define ERR_INT_MASK0 0x10C
556
Ray Zhangd1cd0852015-01-20 15:31:33 +0800557#define LANE_CTL 0x0AC
Channagoud Kadabib4c64b82014-07-24 17:18:46 -0700558#define LANE_SWAP_CTL 0x0B0
559#define TIMING_CTL 0x0C4
560
561#define VIDEO_MODE_ACTIVE_H 0x024
562#define VIDEO_MODE_ACTIVE_V 0x028
563#define VIDEO_MODE_TOTAL 0x02C
564#define VIDEO_MODE_HSYNC 0x030
565#define VIDEO_MODE_VSYNC 0x034
566#define VIDEO_MODE_VSYNC_VPOS 0x038
567
Shimrit Malichi561a5e52015-01-20 09:58:40 +0200568#define QPNP_LED_CTRL_BASE 0xD000
569#define QPNP_BLUE_LPG_CTRL_BASE 0xB100
570#define QPNP_GREEN_LPG_CTRL_BASE 0xB200
571#define QPNP_RED_LPG_CTRL_BASE 0xB300
572
Casey Piper47ea5dd2015-03-20 15:39:49 -0700573/* HDMI reg addresses */
574#define HDMI_BASE 0xFD9A8000
575#define REG_HDMI(off) (HDMI_BASE + (off))
576
577#define HDMI_ACR_32_0 REG_HDMI(0xC4)
578#define HDMI_ACR_32_1 REG_HDMI(0xC8)
579#define HDMI_ACR_44_0 REG_HDMI(0xCC)
580#define HDMI_ACR_44_1 REG_HDMI(0xD0)
581#define HDMI_ACR_48_0 REG_HDMI(0xD4)
582#define HDMI_ACR_48_1 REG_HDMI(0xD8)
583#define HDMI_AUDIO_PKT_CTRL2 REG_HDMI(0x44)
584#define HDMI_ACR_PKT_CTRL REG_HDMI(0x24)
585#define HDMI_INFOFRAME_CTRL0 REG_HDMI(0x2C)
586#define HDMI_AUDIO_INFO0 REG_HDMI(0xE4)
587#define HDMI_AUDIO_INFO1 REG_HDMI(0xE8)
588#define HDMI_AUDIO_PKT_CTRL REG_HDMI(0x20)
589#define HDMI_VBI_PKT_CTRL REG_HDMI(0x28)
590#define HDMI_GEN_PKT_CTRL REG_HDMI(0x34)
591#define HDMI_GC REG_HDMI(0x40)
592#define HDMI_AUDIO_CFG REG_HDMI(0x1D0)
593
594#define HDMI_DDC_SPEED REG_HDMI(0x220)
595#define HDMI_DDC_SETUP REG_HDMI(0x224)
596#define HDMI_DDC_REF REG_HDMI(0x27C)
597#define HDMI_DDC_DATA REG_HDMI(0x238)
598#define HDMI_DDC_TRANS0 REG_HDMI(0x228)
599#define HDMI_DDC_TRANS1 REG_HDMI(0x22C)
600#define HDMI_DDC_CTRL REG_HDMI(0x20C)
601#define HDMI_DDC_INT_CTRL REG_HDMI(0x214)
602#define HDMI_DDC_SW_STATUS REG_HDMI(0x218)
603#define HDMI_DDC_ARBITRATION REG_HDMI(0x210)
604
605#define HDMI_USEC_REFTIMER REG_HDMI(0x208)
606#define HDMI_CTRL REG_HDMI(0x000)
607#define HDMI_HPD_INT_STATUS REG_HDMI(0x250)
608#define HDMI_HPD_INT_CTRL REG_HDMI(0x254)
609#define HDMI_HPD_CTRL REG_HDMI(0x258)
610#define HDMI_PHY_CTRL REG_HDMI(0x2D4)
611#define HDMI_TOTAL REG_HDMI(0x2C0)
612#define HDMI_ACTIVE_H REG_HDMI(0x2B4)
613#define HDMI_ACTIVE_V REG_HDMI(0x2B8)
614#define HDMI_V_TOTAL_F2 REG_HDMI(0x2C4)
615#define HDMI_ACTIVE_V_F2 REG_HDMI(0x2BC)
616#define HDMI_FRAME_CTRL REG_HDMI(0x2C8)
617
618#define HDMI_AVI_INFO0 REG_HDMI(0x06C)
619#define HDMI_AVI_INFO1 REG_HDMI(0x070)
620#define HDMI_AVI_INFO2 REG_HDMI(0x074)
621#define HDMI_AVI_INFO3 REG_HDMI(0x078)
622
623#define LPASS_LPAIF_RDDMA_CTL0 0xFE0D2000
624#define LPASS_LPAIF_RDDMA_BASE0 0xFE0D2004
625#define LPASS_LPAIF_RDDMA_BUFF_LEN0 0xFE0D2008
626#define LPASS_LPAIF_RDDMA_PER_LEN0 0xFE0D2010
627#define LPASS_LPAIF_DEBUG_CTL 0xFE0DE004
628
Channagoud Kadabi123c9722014-02-06 13:22:50 -0800629#endif