blob: e2a66fecf19656651316eda982a996922b1fa3d2 [file] [log] [blame]
Jeevan Shriram89b72f42015-01-07 16:33:25 -08001/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
Unnati Gandhib3820bc2014-07-04 16:56:27 +05302 *
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
Unnati Gandhi89d71a12014-09-18 12:01:08 +053029#ifndef _PLATFORM_MSM8909_IOMAP_H_
30#define _PLATFORM_MSM8909_IOMAP_H_
Unnati Gandhib3820bc2014-07-04 16:56:27 +053031
32#define MSM_IOMAP_BASE 0x00000000
33#define MSM_IOMAP_END 0x08000000
34
Unnati Gandhif4cb6622014-08-28 13:54:56 +053035#define A7_SS_BASE 0x0B000000
36#define A7_SS_END 0x0B200000
37
38#define SYSTEM_IMEM_BASE 0x08600000
39#define MSM_SHARED_IMEM_BASE 0x08600000
40
41#define RESTART_REASON_ADDR (MSM_SHARED_IMEM_BASE + 0x65C)
42#define BS_INFO_OFFSET (0x6B0)
43#define BS_INFO_ADDR (MSM_SHARED_IMEM_BASE + BS_INFO_OFFSET)
44
Unnati Gandhib3820bc2014-07-04 16:56:27 +053045#define SDRAM_START_ADDR 0x80000000
46
Unnati Gandhi0a9a9d12014-09-23 19:18:11 +053047#define MSM_SHARED_BASE 0x87D00000
Unnati Gandhib3820bc2014-07-04 16:56:27 +053048
Unnati Gandhic43a2802014-09-19 17:27:25 +053049#define MSM_NAND_BASE 0x79B0000
50/* NAND BAM */
51#define MSM_NAND_BAM_BASE 0x7984000
52
Unnati Gandhib3820bc2014-07-04 16:56:27 +053053#define APPS_SS_BASE 0x0B000000
54
55#define MSM_GIC_DIST_BASE APPS_SS_BASE
56#define MSM_GIC_CPU_BASE (APPS_SS_BASE + 0x2000)
57#define APPS_APCS_QTMR_AC_BASE (APPS_SS_BASE + 0x00020000)
58#define APPS_APCS_F0_QTMR_V1_BASE (APPS_SS_BASE + 0x00021000)
Unnati Gandhic24a86f2014-09-19 16:07:16 +053059#define APCS_ALIAS0_IPC_INTERRUPT (APPS_SS_BASE + 0x00011008)
Unnati Gandhib3820bc2014-07-04 16:56:27 +053060#define QTMR_BASE APPS_APCS_F0_QTMR_V1_BASE
61
62#define PERIPH_SS_BASE 0x07800000
63
64#define MSM_SDC1_BASE (PERIPH_SS_BASE + 0x00024000)
Unnati Gandhi4d637e42014-07-11 14:47:25 +053065#define MSM_SDC1_SDHCI_BASE (PERIPH_SS_BASE + 0x00024900)
Unnati Gandhib3820bc2014-07-04 16:56:27 +053066#define MSM_SDC2_BASE (PERIPH_SS_BASE + 0x00064000)
Unnati Gandhi4d637e42014-07-11 14:47:25 +053067#define MSM_SDC2_SDHCI_BASE (PERIPH_SS_BASE + 0x00064900)
68
69/* SDHCI */
70#define SDCC_MCI_HC_MODE (0x00000078)
71#define SDCC_HC_PWRCTL_STATUS_REG (0x000000DC)
72#define SDCC_HC_PWRCTL_MASK_REG (0x000000E0)
73#define SDCC_HC_PWRCTL_CLEAR_REG (0x000000E4)
74#define SDCC_HC_PWRCTL_CTL_REG (0x000000E8)
Unnati Gandhib3820bc2014-07-04 16:56:27 +053075
76#define BLSP1_UART0_BASE (PERIPH_SS_BASE + 0x000AF000)
77#define BLSP1_UART1_BASE (PERIPH_SS_BASE + 0x000B0000)
78#define MSM_USB_BASE (PERIPH_SS_BASE + 0x000D9000)
79
80#define CLK_CTL_BASE 0x1800000
81
82#define SPMI_BASE 0x02000000
83#define SPMI_GENI_BASE (SPMI_BASE + 0xA000)
84#define SPMI_PIC_BASE (SPMI_BASE + 0x01800000)
Unnati Gandhi8e4711b2014-10-13 05:03:00 +053085#define PMIC_ARB_CORE 0x200F000
Unnati Gandhib3820bc2014-07-04 16:56:27 +053086
87#define TLMM_BASE_ADDR 0x1000000
88#define GPIO_CONFIG_ADDR(x) (TLMM_BASE_ADDR + (x)*0x1000)
89#define GPIO_IN_OUT_ADDR(x) (TLMM_BASE_ADDR + 0x00000004 + (x)*0x1000)
90
91#define MPM2_MPM_CTRL_BASE 0x004A0000
92#define MPM2_MPM_PS_HOLD 0x004AB000
Unnati Gandhif4cb6622014-08-28 13:54:56 +053093#define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0x004A3000
Unnati Gandhib3820bc2014-07-04 16:56:27 +053094
95/* CRYPTO ENGINE */
96#define MSM_CE1_BASE 0x073A000
97#define MSM_CE1_BAM_BASE 0x0704000
Unnati Gandhif4cb6622014-08-28 13:54:56 +053098#define GCC_CRYPTO_BCR (CLK_CTL_BASE + 0x16000)
99#define GCC_CRYPTO_CMD_RCGR (CLK_CTL_BASE + 0x16004)
100#define GCC_CRYPTO_CFG_RCGR (CLK_CTL_BASE + 0x16008)
101#define GCC_CRYPTO_CBCR (CLK_CTL_BASE + 0x1601C)
102#define GCC_CRYPTO_AXI_CBCR (CLK_CTL_BASE + 0x16020)
103#define GCC_CRYPTO_AHB_CBCR (CLK_CTL_BASE + 0x16024)
104
105/* I2C */
Unnati Gandhi88cf23b2014-12-10 15:39:12 +0530106#define BLSP_QUP_BASE(blsp_id, qup_id) (PERIPH_SS_BASE + 0xB5000 + 0x1000 * qup_id)
107#define GCC_BLSP1_QUP1_APPS_CBCR (CLK_CTL_BASE + 0x2008)
108#define GCC_BLSP1_QUP1_CFG_RCGR (CLK_CTL_BASE + 0x2010)
109#define GCC_BLSP1_QUP1_CMD_RCGR (CLK_CTL_BASE + 0x200C)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530110
Unnati Gandhi88cf23b2014-12-10 15:39:12 +0530111#define GCC_BLSP1_QUP2_APPS_CBCR (CLK_CTL_BASE + 0x3010)
112#define GCC_BLSP1_QUP2_CFG_RCGR (CLK_CTL_BASE + 0x3004)
113#define GCC_BLSP1_QUP2_CMD_RCGR (CLK_CTL_BASE + 0x3000)
114
115#define GCC_BLSP1_QUP3_APPS_CBCR (CLK_CTL_BASE + 0x4020)
116#define GCC_BLSP1_QUP3_CFG_RCGR (CLK_CTL_BASE + 0x4004)
117#define GCC_BLSP1_QUP3_CMD_RCGR (CLK_CTL_BASE + 0x4000)
118
119#define GCC_BLSP1_QUP4_APPS_CBCR (CLK_CTL_BASE + 0x5020)
120#define GCC_BLSP1_QUP4_CFG_RCGR (CLK_CTL_BASE + 0x5004)
121#define GCC_BLSP1_QUP4_CMD_RCGR (CLK_CTL_BASE + 0x5000)
122
123#define GCC_BLSP1_QUP5_APPS_CBCR (CLK_CTL_BASE + 0x6020)
124#define GCC_BLSP1_QUP5_CFG_RCGR (CLK_CTL_BASE + 0x6004)
125#define GCC_BLSP1_QUP5_CMD_RCGR (CLK_CTL_BASE + 0x6000)
126
127#define GCC_BLSP1_QUP6_APPS_CBCR (CLK_CTL_BASE + 0x7020)
128#define GCC_BLSP1_QUP6_CFG_RCGR (CLK_CTL_BASE + 0x7004)
129#define GCC_BLSP1_QUP6_CMD_RCGR (CLK_CTL_BASE + 0x7000)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530130
131/* GPLL */
132#define GPLL0_STATUS (CLK_CTL_BASE + 0x21024)
Aparna Mallavarapubabab6d2014-10-16 14:32:40 -0700133#define GPLL0_MODE (CLK_CTL_BASE + 0x21000)
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530134#define GPLL1_STATUS (CLK_CTL_BASE + 0x2001C)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530135#define APCS_GPLL_ENA_VOTE (CLK_CTL_BASE + 0x45000)
136#define APCS_CLOCK_BRANCH_ENA_VOTE (CLK_CTL_BASE + 0x45004)
137
138/* SDCC */
139#define SDC1_HDRV_PULL_CTL (TLMM_BASE_ADDR + 0x10A000)
140#define SDCC1_BCR (CLK_CTL_BASE + 0x42000) /* block reset*/
141#define SDCC1_APPS_CBCR (CLK_CTL_BASE + 0x42018) /* branch ontrol */
142#define SDCC1_AHB_CBCR (CLK_CTL_BASE + 0x4201C)
143#define SDCC1_CMD_RCGR (CLK_CTL_BASE + 0x42004) /* cmd */
144#define SDCC1_CFG_RCGR (CLK_CTL_BASE + 0x42008) /* cfg */
145#define SDCC1_M (CLK_CTL_BASE + 0x4200C) /* m */
146#define SDCC1_N (CLK_CTL_BASE + 0x42010) /* n */
147#define SDCC1_D (CLK_CTL_BASE + 0x42014) /* d */
148
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530149#define SDCC2_BCR (CLK_CTL_BASE + 0x43000) /* block reset */
150#define SDCC2_APPS_CBCR (CLK_CTL_BASE + 0x43018) /* branch control */
151#define SDCC2_AHB_CBCR (CLK_CTL_BASE + 0x4301C)
152#define SDCC2_CMD_RCGR (CLK_CTL_BASE + 0x43004) /* cmd */
153#define SDCC2_CFG_RCGR (CLK_CTL_BASE + 0x43008) /* cfg */
154#define SDCC2_M (CLK_CTL_BASE + 0x4300C) /* m */
155#define SDCC2_N (CLK_CTL_BASE + 0x43010) /* n */
156#define SDCC2_D (CLK_CTL_BASE + 0x43014) /* d */
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530157
158/* UART */
159#define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x1008)
160#define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x302C)
161#define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x3034)
162#define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x3038)
163#define BLSP1_UART2_APPS_M (CLK_CTL_BASE + 0x303C)
164#define BLSP1_UART2_APPS_N (CLK_CTL_BASE + 0x3040)
165#define BLSP1_UART2_APPS_D (CLK_CTL_BASE + 0x3044)
166
Unnati Gandhid119ebc2014-10-14 03:41:46 -0700167#define BLSP1_UART1_APPS_CBCR (CLK_CTL_BASE + 0x203C)
168#define BLSP1_UART1_APPS_CMD_RCGR (CLK_CTL_BASE + 0x2044)
169#define BLSP1_UART1_APPS_CFG_RCGR (CLK_CTL_BASE + 0x2048)
170#define BLSP1_UART1_APPS_M (CLK_CTL_BASE + 0x204C)
171#define BLSP1_UART1_APPS_N (CLK_CTL_BASE + 0x2050)
172#define BLSP1_UART1_APPS_D (CLK_CTL_BASE + 0x2054)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530173
174/* USB */
175#define USB_HS_BCR (CLK_CTL_BASE + 0x41000)
176#define USB_HS_SYSTEM_CBCR (CLK_CTL_BASE + 0x41004)
177#define USB_HS_AHB_CBCR (CLK_CTL_BASE + 0x41008)
178#define USB_HS_SYSTEM_CMD_RCGR (CLK_CTL_BASE + 0x41010)
179#define USB_HS_SYSTEM_CFG_RCGR (CLK_CTL_BASE + 0x41014)
180
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530181
182/* MDSS */
183#define MIPI_DSI_BASE (0x1AC8000)
184#define MIPI_DSI0_BASE MIPI_DSI_BASE
185#define MIPI_DSI1_BASE MIPI_DSI_BASE
186#define DSI0_PHY_BASE (0x1AC8500)
187#define DSI1_PHY_BASE DSI0_PHY_BASE
188#define DSI0_PLL_BASE (0x1AC8300)
189#define DSI1_PLL_BASE DSI0_PLL_BASE
Jeevan Shriram89b72f42015-01-07 16:33:25 -0800190#define DSI0_REGULATOR_BASE (0x1AC8780)
191#define DSI1_REGULATOR_BASE DSI0_REGULATOR_BASE
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530192
193/* MDP */
194#define MDP_BASE 0x1A00000
195#define REG_MDP(off) (MDP_BASE + (off))
196
197#define MDP_DMA_P_CONFIG REG_MDP(0x90000)
198#define MDP_DMA_P_OUT_XY REG_MDP(0x90010)
199#define MDP_DMA_P_SIZE REG_MDP(0x90004)
200#define MDP_DMA_P_BUF_ADDR REG_MDP(0x90008)
201#define MDP_DMA_P_BUF_Y_STRIDE REG_MDP(0x9000C)
202
Sandeep Pandac5aa91d2014-12-17 18:37:24 +0530203#define MDP_DMA_P_QOS_REMAPPER REG_MDP(0x90090)
204#define MDP_DMA_P_WATERMARK_0 REG_MDP(0x90094)
205#define MDP_DMA_P_WATERMARK_1 REG_MDP(0x90098)
206#define MDP_DMA_P_WATERMARK_2 REG_MDP(0x9009C)
207#define MDP_PANIC_ROBUST_CTRL REG_MDP(0x900A0)
208#define MDP_PANIC_LUT0 REG_MDP(0x900A4)
209#define MDP_ROBUST_LUT REG_MDP(0x900AC)
210
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530211#define MDP_DSI_VIDEO_EN REG_MDP(0xF0000)
212#define MDP_DSI_VIDEO_HSYNC_CTL REG_MDP(0xF0004)
213#define MDP_DSI_VIDEO_VSYNC_PERIOD REG_MDP(0xF0008)
214#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH REG_MDP(0xF000C)
215#define MDP_DSI_VIDEO_DISPLAY_HCTL REG_MDP(0xF0010)
216#define MDP_DSI_VIDEO_DISPLAY_V_START REG_MDP(0xF0014)
217#define MDP_DSI_VIDEO_DISPLAY_V_END REG_MDP(0xF0018)
218#define MDP_DSI_VIDEO_BORDER_CLR REG_MDP(0xF0028)
219#define MDP_DSI_VIDEO_HSYNC_SKEW REG_MDP(0xF0030)
220#define MDP_DSI_VIDEO_CTL_POLARITY REG_MDP(0xF0038)
221#define MDP_DSI_VIDEO_TEST_CTL REG_MDP(0xF0034)
222
223#define MDP_DMA_P_START REG_MDP(0x00044)
224#define MDP_DMA_S_START REG_MDP(0x00048)
225#define MDP_DISP_INTF_SEL REG_MDP(0x00038)
226#define MDP_MAX_RD_PENDING_CMD_CONFIG REG_MDP(0x0004C)
227#define MDP_INTR_ENABLE REG_MDP(0x00020)
228#define MDP_INTR_CLEAR REG_MDP(0x00028)
229#define MDP_DSI_CMD_MODE_ID_MAP REG_MDP(0xF1000)
230#define MDP_DSI_CMD_MODE_TRIGGER_EN REG_MDP(0XF1004)
231
232#define MDP_TEST_MODE_CLK REG_MDP(0xF0000)
233#define MDP_INTR_STATUS REG_MDP(0x00054)
234
Shivaraj Shetty41d2d482014-11-04 16:07:32 +0530235#define MDP_CGC_EN REG_MDP(0x100)
236
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530237#define SOFT_RESET 0x118
238#define CLK_CTRL 0x11C
239#define TRIG_CTRL 0x084
240#define CTRL 0x004
241#define COMMAND_MODE_DMA_CTRL 0x03C
242#define COMMAND_MODE_MDP_CTRL 0x040
243#define COMMAND_MODE_MDP_DCS_CMD_CTRL 0x044
244#define COMMAND_MODE_MDP_STREAM0_CTRL 0x058
245#define COMMAND_MODE_MDP_STREAM0_TOTAL 0x05C
246#define COMMAND_MODE_MDP_STREAM1_CTRL 0x060
247#define COMMAND_MODE_MDP_STREAM1_TOTAL 0x064
248#define ERR_INT_MASK0 0x10C
249
Ray Zhangd1cd0852015-01-20 15:31:33 +0800250#define LANE_CTL 0x0AC
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530251#define LANE_SWAP_CTL 0x0B0
252#define TIMING_CTL 0x0C4
253
254#define VIDEO_MODE_ACTIVE_H 0x024
255#define VIDEO_MODE_ACTIVE_V 0x028
256#define VIDEO_MODE_TOTAL 0x02C
257#define VIDEO_MODE_HSYNC 0x030
258#define VIDEO_MODE_VSYNC 0x034
259#define VIDEO_MODE_VSYNC_VPOS 0x038
260
261#define DMA_CMD_OFFSET 0x048
262#define DMA_CMD_LENGTH 0x04C
263
264#define INT_CTRL 0x110
265#define CMD_MODE_DMA_SW_TRIGGER 0x090
266
267#define EOT_PACKET_CTRL 0x0CC
268#define MISR_CMD_CTRL 0x0A0
269#define MISR_VIDEO_CTRL 0x0A4
270#define VIDEO_MODE_CTRL 0x010
271#define HS_TIMER_CTRL 0x0BC
272
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530273#define TCSR_TZ_WONCE 0x193D000
Unnati Gandhic43a2802014-09-19 17:27:25 +0530274
275/* Boot config */
276#define SEC_CTRL_CORE_BASE 0x00058000
277#define BOOT_CONFIG_OFFSET 0x0000602C
278#define BOOT_CONFIG_REG (SEC_CTRL_CORE_BASE + BOOT_CONFIG_OFFSET)
279
Unnati Gandhi24885052014-11-27 16:57:49 +0530280#define SECURITY_CONTROL_CORE_FEATURE_CONFIG0 0x0005E004
Aparna Mallavarapu5f80cbf2014-10-13 11:10:22 -0700281/* EBI2 */
282#define TLMM_EBI2_EMMC_GPIO_CFG (TLMM_BASE_ADDR + 0x00111000)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530283#endif