blob: f92f556d41ce5c33a6612844522b762773488ae8 [file] [log] [blame]
anisha agarwal70b8cd12015-02-02 11:44:46 -08001/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
Joonwoo Park451dca32014-04-02 11:47:03 -07002 *
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
anisha agarwaldd04af62014-11-17 10:57:49 -080029#ifndef _PLATFORM_MDM9640_IOMAP_H_
30#define _PLATFORM_MDM9640_IOMAP_H_
Joonwoo Park451dca32014-04-02 11:47:03 -070031
Channagoud Kadabi6cf28622015-05-28 15:12:43 -070032#include <stdint.h>
33
34uint32_t platform_boot_config();
35
Joonwoo Park451dca32014-04-02 11:47:03 -070036/* NAND */
37#define MSM_NAND_BASE 0x079B0000
38/* NAND BAM */
39#define MSM_NAND_BAM_BASE 0x07984000
40
41#define APPS_SS_BASE 0x0B000000
42
Channagoud Kadabi1b69e482014-09-23 15:20:22 -070043#define MSM_IOMAP_BASE 0x00000000
44#define MSM_IOMAP_END 0x80000000
Joonwoo Park451dca32014-04-02 11:47:03 -070045
46#define SYSTEM_IMEM_BASE 0x08600000
47#define MSM_SHARED_IMEM_BASE 0x08600000
48
49#define RESTART_REASON_ADDR (MSM_SHARED_IMEM_BASE + 0x65C)
50#define BS_INFO_OFFSET (0x6B0)
51#define BS_INFO_ADDR (MSM_SHARED_IMEM_BASE + BS_INFO_OFFSET)
52#define SDRAM_START_ADDR 0x80000000
53
Joonwoo Parkb574b8a2014-08-25 15:41:14 -070054#define MSM_SHARED_BASE 0x87E80000
Joonwoo Park451dca32014-04-02 11:47:03 -070055
56#define MSM_GIC_DIST_BASE APPS_SS_BASE
57#define MSM_GIC_CPU_BASE (APPS_SS_BASE + 0x2000)
58#define APPS_APCS_QTMR_AC_BASE (APPS_SS_BASE + 0x00020000)
59#define APPS_APCS_F0_QTMR_V1_BASE (APPS_SS_BASE + 0x00021000)
60#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)
65#define MSM_SDC1_SDHCI_BASE (PERIPH_SS_BASE + 0x00024900)
66
67/* SDHCI */
68#define SDCC_MCI_HC_MODE (0x00000078)
69#define SDCC_HC_PWRCTL_STATUS_REG (0x000000DC)
70#define SDCC_HC_PWRCTL_MASK_REG (0x000000E0)
71#define SDCC_HC_PWRCTL_CLEAR_REG (0x000000E4)
72#define SDCC_HC_PWRCTL_CTL_REG (0x000000E8)
73#define BLSP1_UART0_BASE (PERIPH_SS_BASE + 0x000AF000)
74#define BLSP1_UART1_BASE (PERIPH_SS_BASE + 0x000B0000)
Channagoud Kadabi1b69e482014-09-23 15:20:22 -070075#define BLSP1_UART2_BASE (PERIPH_SS_BASE + 0x000B1000)
Joonwoo Park451dca32014-04-02 11:47:03 -070076#define MSM_USB30_BASE 0x08A00000
77#define MSM_USB30_QSCRATCH_BASE 0x08AF8800
78
79#define CLK_CTL_BASE 0x1800000
80
81#define SPMI_BASE 0x02000000
82#define SPMI_GENI_BASE (SPMI_BASE + 0xA000)
83#define SPMI_PIC_BASE (SPMI_BASE + 0x01800000)
84#define PMIC_ARB_CORE 0x200F000
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
92#define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0x004A3000
93
94/* CRYPTO ENGINE */
95#define GCC_CRYPTO_BCR (CLK_CTL_BASE + 0x16000)
96#define GCC_CRYPTO_CMD_RCGR (CLK_CTL_BASE + 0x16004)
97#define GCC_0RYPTO_CFG_RCGR (CLK_CTL_BASE + 0x16008)
98#define GCC_CRYPTO_CBCR (CLK_CTL_BASE + 0x1601C)
99#define GCC_CRYPTO_AXI_CBCR (CLK_CTL_BASE + 0x16020)
100#define GCC_CRYPTO_AHB_CBCR (CLK_CTL_BASE + 0x16024)
101/* GPLL */
102#define GPLL0_STATUS (CLK_CTL_BASE + 0x21000)
103#define APCS_GPLL_ENA_VOTE (CLK_CTL_BASE + 0x45000)
104#define APCS_CLOCK_BRANCH_ENA_VOTE (CLK_CTL_BASE + 0x45004)
105
106/* SDCC */
107#define SDC1_HDRV_PULL_CTL (TLMM_BASE_ADDR + 0x10A000)
108#define SDCC1_BCR (CLK_CTL_BASE + 0x42000)
109#define SDCC1_APPS_CBCR (CLK_CTL_BASE + 0x42018)
110#define SDCC1_AHB_CBCR (CLK_CTL_BASE + 0x4201C)
111#define SDCC1_CMD_RCGR (CLK_CTL_BASE + 0x42004)
112#define SDCC1_CFG_RCGR (CLK_CTL_BASE + 0x42008)
113#define SDCC1_M (CLK_CTL_BASE + 0x4200C)
114#define SDCC1_N (CLK_CTL_BASE + 0x42010)
115#define SDCC1_D (CLK_CTL_BASE + 0x42014)
116
117/* UART */
118#define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x1008)
119#define BLSP1_UART1_APPS_CBCR (CLK_CTL_BASE + 0x203C)
120#define BLSP1_UART1_APPS_CMD_RCGR (CLK_CTL_BASE + 0x2044)
121#define BLSP1_UART1_APPS_CFG_RCGR (CLK_CTL_BASE + 0x2048)
122#define BLSP1_UART1_APPS_M (CLK_CTL_BASE + 0x204C)
123#define BLSP1_UART1_APPS_N (CLK_CTL_BASE + 0x2050)
124#define BLSP1_UART1_APPS_D (CLK_CTL_BASE + 0x2054)
125
126#define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x302C)
127#define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x3034)
128#define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x3038)
129#define BLSP1_UART2_APPS_M (CLK_CTL_BASE + 0x303C)
130#define BLSP1_UART2_APPS_N (CLK_CTL_BASE + 0x3040)
131#define BLSP1_UART2_APPS_D (CLK_CTL_BASE + 0x3044)
132
133#define BLSP1_UART3_APPS_CBCR (CLK_CTL_BASE + 0x403C)
134#define BLSP1_UART3_APPS_CMD_RCGR (CLK_CTL_BASE + 0x4044)
Channagoud Kadabi1b69e482014-09-23 15:20:22 -0700135#define BLSP1_UART3_APPS_CFG_RCGR (CLK_CTL_BASE + 0x4048)
136#define BLSP1_UART3_APPS_M (CLK_CTL_BASE + 0x404C)
Joonwoo Park451dca32014-04-02 11:47:03 -0700137#define BLSP1_UART3_APPS_N (CLK_CTL_BASE + 0x4050)
138#define BLSP1_UART3_APPS_D (CLK_CTL_BASE + 0x4054)
139
140
141/* USB */
142#define USB_HS_BCR (CLK_CTL_BASE + 0x41000)
143#define USB_HS_SYSTEM_CBCR (CLK_CTL_BASE + 0x41004)
144#define USB_HS_AHB_CBCR (CLK_CTL_BASE + 0x41008)
145#define USB_HS_SYSTEM_CMD_RCGR (CLK_CTL_BASE + 0x41010)
146#define USB_HS_SYSTEM_CFG_RCGR (CLK_CTL_BASE + 0x41014)
Joonwoo Park76641c72014-05-22 16:37:10 -0700147#define QUSB2A_PHY_BCR (CLK_CTL_BASE + 0x41028)
Joonwoo Park451dca32014-04-02 11:47:03 -0700148
149/* USB 3.0 clock */
150#define SYS_NOC_USB3_AXI_CBCR (CLK_CTL_BASE + 0x5E084)
151#define GCC_USB30_MASTER_CBCR (CLK_CTL_BASE + 0x5E000)
152#define GCC_USB30_GDSCR (CLK_CTL_BASE + 0x5E078)
153#define GCC_USB30_MASTER_CMD_RCGR (CLK_CTL_BASE + 0x5E00C)
154#define GCC_USB30_MASTER_CFG_RCGR (CLK_CTL_BASE + 0x5E010)
155#define GCC_USB30_MASTER_M (CLK_CTL_BASE + 0x5E014)
156#define GCC_USB30_MASTER_N (CLK_CTL_BASE + 0x5E018)
157#define GCC_USB30_MASTER_D (CLK_CTL_BASE + 0x5E01C)
158
159/* USB 3.0 base */
160#define USB3_PIPE_CMD_RCGR (CLK_CTL_BASE + 0x5E048)
161#define USB3_PIPE_CFG_RCGR (CLK_CTL_BASE + 0x5E04C)
162#define USB_PHY_CFG_AHB_CBCR (CLK_CTL_BASE + 0x5E080)
163#define USB3_PIPE_CBCR (CLK_CTL_BASE + 0x5E040)
Channagoud Kadabi1b69e482014-09-23 15:20:22 -0700164#define USB3_PIPE_BCR (CLK_CTL_BASE + 0x5E03C)
Joonwoo Park451dca32014-04-02 11:47:03 -0700165
166#define USB3_AUX_CMD_RCGR (CLK_CTL_BASE + 0x5E05C)
167#define USB3_AUX_CFG_RCGR (CLK_CTL_BASE + 0x5E060)
168#define USB3_AUX_M (CLK_CTL_BASE + 0x5E064)
169#define USB3_AUX_N (CLK_CTL_BASE + 0x5E068)
170#define USB3_AUX_D (CLK_CTL_BASE + 0x5E06C)
171#define USB3_AUX_CBCR (CLK_CTL_BASE + 0x5E044)
172
173/* USB 3.0 phy */
174#define USB3_PHY_BCR (CLK_CTL_BASE + 0x0005E034)
175
Joonwoo Park39aed062014-06-09 17:00:07 -0700176/* QUSB2 PHY */
177#define QUSB2_PHY_BASE 0x00079000
Joonwoo Park39aed062014-06-09 17:00:07 -0700178#define GCC_QUSB2_PHY_BCR (CLK_CTL_BASE + 0x00041028)
179
Joonwoo Park451dca32014-04-02 11:47:03 -0700180/* SS QMP (Qulacomm Multi Protocol) */
181#define QMP_PHY_BASE 0x78000
182
Channagoud Kadabi4517eb12015-09-02 18:43:13 -0700183#define AHB2_PHY_BASE 0x0007e000
184#define PERIPH_SS_AHB2PHY_TOP_CFG (AHB2_PHY_BASE + 0x10)
Joonwoo Park451dca32014-04-02 11:47:03 -0700185/* QMP register offset */
186#define PLATFORM_QMP_OFFSET 0x8
187
188/* Boot config */
189#define SEC_CTRL_CORE_BASE 0x00058000
190#define BOOT_CONFIG_OFFSET 0x0000602C
Channagoud Kadabi6cf28622015-05-28 15:12:43 -0700191#define BOOT_CONFIG_REG_V1 (SEC_CTRL_CORE_BASE + BOOT_CONFIG_OFFSET)
192#define BOOT_CONFIG_REG_V2 0x000A602C
193#define BOOT_CONFIG_REG platform_boot_config()
Joonwoo Park451dca32014-04-02 11:47:03 -0700194
anisha agarwalffb78ab2014-11-18 15:20:31 -0800195/* QPIC DISPLAY */
196#define QPIC_BASE 0x7980000
197#define APCS_ALIAS0_IPC_INTERRUPT 0xB011008
anisha agarwal70b8cd12015-02-02 11:44:46 -0800198/* eMMC Display */
199#define TLMM_EBI2_EMMC_GPIO_CFG 0x01111000
200#define EBI2_BOOT_SELECT 0x2
Joonwoo Park451dca32014-04-02 11:47:03 -0700201#endif