blob: 5df355f0205ab539ac2284f94ed4d9f133822034 [file] [log] [blame]
Unnati Gandhib3820bc2014-07-04 16:56:27 +05301/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
2 *
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
47#define MSM_SHARED_BASE 0x86300000
48
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)
85
86#define TLMM_BASE_ADDR 0x1000000
87#define GPIO_CONFIG_ADDR(x) (TLMM_BASE_ADDR + (x)*0x1000)
88#define GPIO_IN_OUT_ADDR(x) (TLMM_BASE_ADDR + 0x00000004 + (x)*0x1000)
89
90#define MPM2_MPM_CTRL_BASE 0x004A0000
91#define MPM2_MPM_PS_HOLD 0x004AB000
Unnati Gandhif4cb6622014-08-28 13:54:56 +053092#define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0x004A3000
Unnati Gandhib3820bc2014-07-04 16:56:27 +053093
94/* CRYPTO ENGINE */
95#define MSM_CE1_BASE 0x073A000
96#define MSM_CE1_BAM_BASE 0x0704000
Unnati Gandhif4cb6622014-08-28 13:54:56 +053097#define GCC_CRYPTO_BCR (CLK_CTL_BASE + 0x16000)
98#define GCC_CRYPTO_CMD_RCGR (CLK_CTL_BASE + 0x16004)
99#define GCC_CRYPTO_CFG_RCGR (CLK_CTL_BASE + 0x16008)
100#define GCC_CRYPTO_CBCR (CLK_CTL_BASE + 0x1601C)
101#define GCC_CRYPTO_AXI_CBCR (CLK_CTL_BASE + 0x16020)
102#define GCC_CRYPTO_AHB_CBCR (CLK_CTL_BASE + 0x16024)
103
104/* I2C */
105#define GCC_BLSP1_QUP2_APPS_CBCR (CLK_CTL_BASE + 0x3010)
106#define GCC_BLSP1_QUP2_CFG_RCGR (CLK_CTL_BASE + 0x3018)
107#define GCC_BLSP1_QUP2_CMD_RCGR (CLK_CTL_BASE + 0x3014)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530108
109
110/* GPLL */
111#define GPLL0_STATUS (CLK_CTL_BASE + 0x21024)
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530112#define GPLL1_STATUS (CLK_CTL_BASE + 0x2001C)
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530113#define APCS_GPLL_ENA_VOTE (CLK_CTL_BASE + 0x45000)
114#define APCS_CLOCK_BRANCH_ENA_VOTE (CLK_CTL_BASE + 0x45004)
115
116/* SDCC */
117#define SDC1_HDRV_PULL_CTL (TLMM_BASE_ADDR + 0x10A000)
118#define SDCC1_BCR (CLK_CTL_BASE + 0x42000) /* block reset*/
119#define SDCC1_APPS_CBCR (CLK_CTL_BASE + 0x42018) /* branch ontrol */
120#define SDCC1_AHB_CBCR (CLK_CTL_BASE + 0x4201C)
121#define SDCC1_CMD_RCGR (CLK_CTL_BASE + 0x42004) /* cmd */
122#define SDCC1_CFG_RCGR (CLK_CTL_BASE + 0x42008) /* cfg */
123#define SDCC1_M (CLK_CTL_BASE + 0x4200C) /* m */
124#define SDCC1_N (CLK_CTL_BASE + 0x42010) /* n */
125#define SDCC1_D (CLK_CTL_BASE + 0x42014) /* d */
126
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530127#define SDCC2_BCR (CLK_CTL_BASE + 0x43000) /* block reset */
128#define SDCC2_APPS_CBCR (CLK_CTL_BASE + 0x43018) /* branch control */
129#define SDCC2_AHB_CBCR (CLK_CTL_BASE + 0x4301C)
130#define SDCC2_CMD_RCGR (CLK_CTL_BASE + 0x43004) /* cmd */
131#define SDCC2_CFG_RCGR (CLK_CTL_BASE + 0x43008) /* cfg */
132#define SDCC2_M (CLK_CTL_BASE + 0x4300C) /* m */
133#define SDCC2_N (CLK_CTL_BASE + 0x43010) /* n */
134#define SDCC2_D (CLK_CTL_BASE + 0x43014) /* d */
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530135
136/* UART */
137#define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x1008)
138#define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x302C)
139#define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x3034)
140#define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x3038)
141#define BLSP1_UART2_APPS_M (CLK_CTL_BASE + 0x303C)
142#define BLSP1_UART2_APPS_N (CLK_CTL_BASE + 0x3040)
143#define BLSP1_UART2_APPS_D (CLK_CTL_BASE + 0x3044)
144
145
146/* USB */
147#define USB_HS_BCR (CLK_CTL_BASE + 0x41000)
148#define USB_HS_SYSTEM_CBCR (CLK_CTL_BASE + 0x41004)
149#define USB_HS_AHB_CBCR (CLK_CTL_BASE + 0x41008)
150#define USB_HS_SYSTEM_CMD_RCGR (CLK_CTL_BASE + 0x41010)
151#define USB_HS_SYSTEM_CFG_RCGR (CLK_CTL_BASE + 0x41014)
152
Shivaraj Shetty83479fc2014-09-17 03:35:19 +0530153
154/* MDSS */
155#define MIPI_DSI_BASE (0x1AC8000)
156#define MIPI_DSI0_BASE MIPI_DSI_BASE
157#define MIPI_DSI1_BASE MIPI_DSI_BASE
158#define DSI0_PHY_BASE (0x1AC8500)
159#define DSI1_PHY_BASE DSI0_PHY_BASE
160#define DSI0_PLL_BASE (0x1AC8300)
161#define DSI1_PLL_BASE DSI0_PLL_BASE
162#define REG_DSI(off) (MIPI_DSI_BASE + 0x04 + (off))
163
164
165/* MDP */
166#define MDP_BASE 0x1A00000
167#define REG_MDP(off) (MDP_BASE + (off))
168
169#define MDP_DMA_P_CONFIG REG_MDP(0x90000)
170#define MDP_DMA_P_OUT_XY REG_MDP(0x90010)
171#define MDP_DMA_P_SIZE REG_MDP(0x90004)
172#define MDP_DMA_P_BUF_ADDR REG_MDP(0x90008)
173#define MDP_DMA_P_BUF_Y_STRIDE REG_MDP(0x9000C)
174
175#define MDP_DSI_VIDEO_EN REG_MDP(0xF0000)
176#define MDP_DSI_VIDEO_HSYNC_CTL REG_MDP(0xF0004)
177#define MDP_DSI_VIDEO_VSYNC_PERIOD REG_MDP(0xF0008)
178#define MDP_DSI_VIDEO_VSYNC_PULSE_WIDTH REG_MDP(0xF000C)
179#define MDP_DSI_VIDEO_DISPLAY_HCTL REG_MDP(0xF0010)
180#define MDP_DSI_VIDEO_DISPLAY_V_START REG_MDP(0xF0014)
181#define MDP_DSI_VIDEO_DISPLAY_V_END REG_MDP(0xF0018)
182#define MDP_DSI_VIDEO_BORDER_CLR REG_MDP(0xF0028)
183#define MDP_DSI_VIDEO_HSYNC_SKEW REG_MDP(0xF0030)
184#define MDP_DSI_VIDEO_CTL_POLARITY REG_MDP(0xF0038)
185#define MDP_DSI_VIDEO_TEST_CTL REG_MDP(0xF0034)
186
187#define MDP_DMA_P_START REG_MDP(0x00044)
188#define MDP_DMA_S_START REG_MDP(0x00048)
189#define MDP_DISP_INTF_SEL REG_MDP(0x00038)
190#define MDP_MAX_RD_PENDING_CMD_CONFIG REG_MDP(0x0004C)
191#define MDP_INTR_ENABLE REG_MDP(0x00020)
192#define MDP_INTR_CLEAR REG_MDP(0x00028)
193#define MDP_DSI_CMD_MODE_ID_MAP REG_MDP(0xF1000)
194#define MDP_DSI_CMD_MODE_TRIGGER_EN REG_MDP(0XF1004)
195
196#define MDP_TEST_MODE_CLK REG_MDP(0xF0000)
197#define MDP_INTR_STATUS REG_MDP(0x00054)
198
199#define SOFT_RESET 0x118
200#define CLK_CTRL 0x11C
201#define TRIG_CTRL 0x084
202#define CTRL 0x004
203#define COMMAND_MODE_DMA_CTRL 0x03C
204#define COMMAND_MODE_MDP_CTRL 0x040
205#define COMMAND_MODE_MDP_DCS_CMD_CTRL 0x044
206#define COMMAND_MODE_MDP_STREAM0_CTRL 0x058
207#define COMMAND_MODE_MDP_STREAM0_TOTAL 0x05C
208#define COMMAND_MODE_MDP_STREAM1_CTRL 0x060
209#define COMMAND_MODE_MDP_STREAM1_TOTAL 0x064
210#define ERR_INT_MASK0 0x10C
211
212#define LANE_SWAP_CTL 0x0B0
213#define TIMING_CTL 0x0C4
214
215#define VIDEO_MODE_ACTIVE_H 0x024
216#define VIDEO_MODE_ACTIVE_V 0x028
217#define VIDEO_MODE_TOTAL 0x02C
218#define VIDEO_MODE_HSYNC 0x030
219#define VIDEO_MODE_VSYNC 0x034
220#define VIDEO_MODE_VSYNC_VPOS 0x038
221
222#define DMA_CMD_OFFSET 0x048
223#define DMA_CMD_LENGTH 0x04C
224
225#define INT_CTRL 0x110
226#define CMD_MODE_DMA_SW_TRIGGER 0x090
227
228#define EOT_PACKET_CTRL 0x0CC
229#define MISR_CMD_CTRL 0x0A0
230#define MISR_VIDEO_CTRL 0x0A4
231#define VIDEO_MODE_CTRL 0x010
232#define HS_TIMER_CTRL 0x0BC
233
Unnati Gandhif4cb6622014-08-28 13:54:56 +0530234#define TCSR_TZ_WONCE 0x193D000
Unnati Gandhic43a2802014-09-19 17:27:25 +0530235
236/* Boot config */
237#define SEC_CTRL_CORE_BASE 0x00058000
238#define BOOT_CONFIG_OFFSET 0x0000602C
239#define BOOT_CONFIG_REG (SEC_CTRL_CORE_BASE + BOOT_CONFIG_OFFSET)
240
Unnati Gandhib3820bc2014-07-04 16:56:27 +0530241#endif