Sundarajan Srinivasan | 749d260 | 2013-12-11 17:12:11 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 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 | |
Smita Solanki | 6bd7d5f | 2014-01-03 06:42:36 -0800 | [diff] [blame] | 29 | #ifndef _PLATFORM_MDM9635_IOMAP_H_ |
| 30 | #define _PLATFORM_MDM9635_IOMAP_H_ |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 31 | |
| 32 | #define MSM_IOMAP_BASE 0xF9000000 |
| 33 | #define MSM_IOMAP_END 0xFEFFFFFF |
| 34 | |
| 35 | #define MSM_SHARED_BASE 0x01100000 |
| 36 | |
| 37 | /*SDRAM start address */ |
| 38 | #define SDRAM_START_ADDR 0x00000000 |
| 39 | |
| 40 | #define MSM_SHARED_IMEM_BASE 0xFE805000 |
| 41 | #define RESTART_REASON_ADDR (MSM_SHARED_IMEM_BASE + 0x65C) |
| 42 | |
| 43 | #define MSM_SHARED_IMEM_BASE_V2 0xFE807800 |
| 44 | #define RESTART_REASON_ADDR_V2 (MSM_SHARED_IMEM_BASE_V2 + 0x65C) |
| 45 | |
| 46 | #define A7SS_BASE 0xF9000000 |
| 47 | |
| 48 | /* Peripheral subsystem */ |
| 49 | #define PERIPH_SS_BASE 0xF9800000 |
| 50 | #define PERIPH_SS_QPIC_BASE 0xF9AC4000 |
| 51 | |
| 52 | #define CLK_CTL_BASE 0xFC400000 /* GCC base */ |
| 53 | |
| 54 | /* MPM2_MPM */ |
| 55 | #define MPM2_MPM_SLEEP_TIMETICK_COUNT_VAL 0xFC4A3000 |
| 56 | #define MPM2_MPM_PS_HOLD 0xFC4AB000 |
| 57 | |
Sundarajan Srinivasan | 749d260 | 2013-12-11 17:12:11 -0800 | [diff] [blame] | 58 | #define BS_INFO_OFFSET (0x6B0) |
| 59 | #define BS_INFO_ADDR (MSM_SHARED_IMEM_BASE + BS_INFO_OFFSET) |
| 60 | |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 61 | #define SPMI_BASE 0xFC4C0000 |
| 62 | #define SPMI_GENI_BASE (SPMI_BASE + 0xA000) |
| 63 | #define SPMI_PIC_BASE (SPMI_BASE + 0xB000) |
| 64 | #define TLMM_BASE_ADDR 0xFD500000 |
| 65 | |
| 66 | /* QGIC2 */ |
| 67 | #define MSM_GIC_DIST_BASE (A7SS_BASE + 0x0000) |
| 68 | #define MSM_GIC_CPU_BASE (A7SS_BASE + 0x2000) |
| 69 | |
| 70 | /* QTMR */ |
| 71 | #define APCS_F0_QTMR_V1_BASE (A7SS_BASE + 0x21000) |
| 72 | #define QTMR_BASE APCS_F0_QTMR_V1_BASE |
| 73 | |
| 74 | /* GPIO */ |
| 75 | #define GPIO_CONFIG_ADDR(x) (TLMM_BASE_ADDR + 0x10000 + 0x1000 + (x)*0x10) |
| 76 | #define GPIO_IN_OUT_ADDR(x) (TLMM_BASE_ADDR + 0x10000 + 0x1004 + (x)*0x10) |
| 77 | |
| 78 | /* USB */ |
| 79 | #define MSM_USB_BASE (PERIPH_SS_BASE + 0x00255000) |
Channagoud Kadabi | 5a83d2f | 2014-02-04 17:00:13 -0800 | [diff] [blame] | 80 | #define MSM_USB30_BASE 0xF9200000 |
| 81 | #define MSM_USB30_QSCRATCH_BASE 0xF92F8800 |
| 82 | |
| 83 | /* SS QMP (Qulacomm Multi Protocol) */ |
| 84 | #define QMP_PHY_BASE 0xF9B38000 |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 85 | |
| 86 | /* UART */ |
| 87 | #define MSM_UART2_BASE 0xF991F000 |
| 88 | |
| 89 | /* NAND */ |
| 90 | #define MSM_NAND_BASE 0xF9AF0000 |
| 91 | /* NAND BAM */ |
| 92 | #define MSM_NAND_BAM_BASE 0xF9AC4000 |
| 93 | |
| 94 | /************ CLOCKS ***********/ |
| 95 | |
| 96 | /* GPLL */ |
Sundarajan Srinivasan | 7b39014 | 2013-10-29 12:32:50 -0700 | [diff] [blame] | 97 | #define GPLL0_STATUS (CLK_CTL_BASE + 0x0000) |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 98 | #define APCS_GPLL_ENA_VOTE (CLK_CTL_BASE + 0x1480) |
| 99 | |
| 100 | /* UART */ |
| 101 | |
| 102 | #define BLSP1_AHB_CBCR (CLK_CTL_BASE + 0x5C4) |
| 103 | |
| 104 | #define BLSP1_UART1_APPS_CBCR (CLK_CTL_BASE + 0x684) |
| 105 | #define BLSP1_UART1_APPS_CMD_RCGR (CLK_CTL_BASE + 0x68C) |
| 106 | #define BLSP1_UART1_APPS_CFG_RCGR (CLK_CTL_BASE + 0x690) |
| 107 | #define BLSP1_UART1_APPS_M (CLK_CTL_BASE + 0x694) |
| 108 | #define BLSP1_UART1_APPS_N (CLK_CTL_BASE + 0x698) |
| 109 | #define BLSP1_UART1_APPS_D (CLK_CTL_BASE + 0x69C) |
| 110 | |
| 111 | #define BLSP1_UART3_APPS_CBCR (CLK_CTL_BASE + 0x784) |
| 112 | #define BLSP1_UART3_APPS_CMD_RCGR (CLK_CTL_BASE + 0x78C) |
| 113 | #define BLSP1_UART3_APPS_CFG_RCGR (CLK_CTL_BASE + 0x790) |
| 114 | #define BLSP1_UART3_APPS_M (CLK_CTL_BASE + 0x794) |
| 115 | #define BLSP1_UART3_APPS_N (CLK_CTL_BASE + 0x798) |
| 116 | #define BLSP1_UART3_APPS_D (CLK_CTL_BASE + 0x79C) |
| 117 | |
| 118 | #define BLSP1_UART2_APPS_CBCR (CLK_CTL_BASE + 0x704) |
| 119 | #define BLSP1_UART2_APPS_CMD_RCGR (CLK_CTL_BASE + 0x70C) |
| 120 | #define BLSP1_UART2_APPS_CFG_RCGR (CLK_CTL_BASE + 0x710) |
| 121 | #define BLSP1_UART2_APPS_M (CLK_CTL_BASE + 0x714) |
| 122 | #define BLSP1_UART2_APPS_N (CLK_CTL_BASE + 0x718) |
| 123 | #define BLSP1_UART2_APPS_D (CLK_CTL_BASE + 0x71C) |
| 124 | |
| 125 | #define APCS_CLOCK_BRANCH_ENA_VOTE (CLK_CTL_BASE + 0x1484) |
| 126 | |
| 127 | /* USB */ |
| 128 | #define USB_HS_BCR (CLK_CTL_BASE + 0x480) |
| 129 | #define USB_HS_SYSTEM_CBCR (CLK_CTL_BASE + 0x484) |
| 130 | #define USB_HS_AHB_CBCR (CLK_CTL_BASE + 0x488) |
| 131 | #define GCC_USB_HS_INACTIVITY_TIMERS_CBCR (CLK_CTL_BASE + 0x48C) |
| 132 | #define USB_HS_SYSTEM_CMD_RCGR (CLK_CTL_BASE + 0x490) |
| 133 | #define USB_HS_SYSTEM_CFG_RCGR (CLK_CTL_BASE + 0x494) |
| 134 | |
Channagoud Kadabi | 52b92e2 | 2014-04-03 15:29:44 -0700 | [diff] [blame^] | 135 | /* USB Phy reset */ |
| 136 | #define USB3_PHY_BCR (CLK_CTL_BASE + 0x03FC) |
| 137 | #define USB3_PHY_COM_BCR (CLK_CTL_BASE + 0x1B88) |
| 138 | #define USB3PHY_PHY_BCR (CLK_CTL_BASE + 0x1B8C) |
| 139 | #define USB2B_PHY_BCR (CLK_CTL_BASE + 0x04B0) |
Channagoud Kadabi | 5a83d2f | 2014-02-04 17:00:13 -0800 | [diff] [blame] | 140 | |
| 141 | /* USB 3.0 clocks */ |
Channagoud Kadabi | 52b92e2 | 2014-04-03 15:29:44 -0700 | [diff] [blame^] | 142 | #define USB2B_PHY_SLEEP_CBCR (CLK_CTL_BASE + 0x04B4) |
Channagoud Kadabi | 5a83d2f | 2014-02-04 17:00:13 -0800 | [diff] [blame] | 143 | #define SYS_NOC_USB3_AXI_CBCR (CLK_CTL_BASE + 0x0108) |
| 144 | #define GCC_USB_30_BCR (CLK_CTL_BASE + 0x03C0) |
| 145 | #define GCC_USB_30_MISC (CLK_CTL_BASE + 0x03C4) |
| 146 | #define GCC_USB30_MASTER_CBCR (CLK_CTL_BASE + 0x03C8) |
| 147 | #define GCC_USB30_SLEEP_CBCR (CLK_CTL_BASE + 0x03CC) |
| 148 | #define GCC_USB30_MOCK_UTMI_CBCR (CLK_CTL_BASE + 0x03D0) |
| 149 | #define GCC_USB30_MASTER_CMD_RCGR (CLK_CTL_BASE + 0x03D4) |
| 150 | #define GCC_USB30_MASTER_CFG_RCGR (CLK_CTL_BASE + 0x03D8) |
| 151 | #define GCC_USB30_MASTER_M (CLK_CTL_BASE + 0x03DC) |
| 152 | #define GCC_USB30_MASTER_N (CLK_CTL_BASE + 0x03E0) |
| 153 | #define GCC_USB30_MASTER_D (CLK_CTL_BASE + 0x03E4) |
| 154 | #define GCC_USB30_GDSCR (CLK_CTL_BASE + 0x1B80) |
| 155 | |
| 156 | /* USB30 base */ |
| 157 | #define USB3_PIPE_CMD_RCGR (CLK_CTL_BASE + 0x1B98) |
| 158 | #define USB3_PIPE_CFG_RCGR (CLK_CTL_BASE + 0x1B9C) |
| 159 | #define USB3_PIPE_CBCR (CLK_CTL_BASE + 0x1B90) |
| 160 | #define USB3_AUX_CMD_RCGR (CLK_CTL_BASE + 0x1BC0) |
| 161 | #define USB3_AUX_CBCR (CLK_CTL_BASE + 0x1B94) |
| 162 | #define USB_PHY_CFG_AHB_CBCR (CLK_CTL_BASE + 0x1B84) |
| 163 | #define USB3_AUX_CFG_RCGR (CLK_CTL_BASE + 0x1BC4) |
| 164 | #define USB3_AUX_M (CLK_CTL_BASE + 0x1BC8) |
| 165 | #define USB3_AUX_N (CLK_CTL_BASE + 0x1BCC) |
| 166 | #define USB3_AUX_D (CLK_CTL_BASE + 0x1BD0) |
| 167 | |
| 168 | /* QMP register offsets */ |
| 169 | #define PCIE_USB3_PHY_POWER_DOWN_CONTROL 0x604 |
| 170 | |
| 171 | #define QSERDES_COM_SYSCLK_EN_SEL_TXBAND 0x48 |
| 172 | #define QSERDES_COM_DEC_START1 0xA4 |
| 173 | #define QSERDES_COM_DEC_START2 0x104 |
| 174 | #define QSERDES_COM_DIV_FRAC_START1 0xF8 |
| 175 | #define QSERDES_COM_DIV_FRAC_START2 0xFC |
| 176 | #define QSERDES_COM_DIV_FRAC_START3 0x100 |
| 177 | #define QSERDES_COM_PLLLOCK_CMP_EN 0x94 |
| 178 | #define QSERDES_COM_PLLLOCK_CMP1 0x88 |
| 179 | #define QSERDES_COM_PLLLOCK_CMP2 0x8C |
| 180 | #define QSERDES_COM_PLL_CRCTRL 0x10C |
| 181 | #define QSERDES_COM_PLL_CP_SETI 0x34 |
| 182 | #define QSERDES_COM_PLL_IP_SETP 0x38 |
| 183 | #define QSERDES_COM_PLL_CP_SETP 0x3C |
| 184 | #define QSERDES_COM_PLL_IP_SETI 0x24 |
| 185 | #define QSERDES_COM_IE_TRIM 0xC |
| 186 | #define QSERDES_COM_IP_TRIM 0x10 |
| 187 | #define QSERDES_COM_PLL_CNTRL 0x14 |
| 188 | #define QSERDES_RX_CDR_CONTROL1 0x400 |
| 189 | #define QSERDES_RX_CDR_CONTROL2 0x404 |
| 190 | #define QSERDES_COM_RESETSM_CNTRL 0x4C |
| 191 | #define QSERDES_COM_RESETSM_CNTRL2 0x50 |
| 192 | #define QSERDES_COM_RES_CODE_START_SEG1 0xD8 |
| 193 | #define QSERDES_COM_RES_CODE_CAL_CSR 0xE0 |
| 194 | #define QSERDES_COM_RES_TRIM_CONTROL 0xE8 |
| 195 | #define QSERDES_TX_RCV_DETECT_LVL 0x268 |
| 196 | #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2 0x4BC |
| 197 | #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL3 0x4C0 |
| 198 | #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4 0x4C4 |
| 199 | #define QSERDES_RX_SIGDET_ENABLES 0x4F8 |
| 200 | #define QSERDES_RX_SIGDET_CNTRL 0x500 |
| 201 | #define QSERDES_RX_SIGDET_DEGLITCH_CNTRL 0x504 |
| 202 | #define PCIE_USB3_PHY_RX_IDLE_DTCT_CNTRL 0x64C |
| 203 | #define QSERDES_COM_SSC_EN_CENTER 0xAC |
| 204 | #define QSERDES_COM_SSC_ADJ_PER1 0xB0 |
| 205 | #define QSERDES_COM_SSC_PER1 0xB8 |
| 206 | #define QSERDES_COM_SSC_PER2 0xBC |
| 207 | #define QSERDES_COM_SSC_STEP_SIZE1 0xC0 |
| 208 | #define QSERDES_COM_SSC_STEP_SIZE2 0xC4 |
| 209 | #define PCIE_USB3_PHY_POWER_STATE_CONFIG2 0x654 |
| 210 | #define PCIE_USB3_PHY_RCVR_DTCT_DLY_P1U2_L 0x5C |
| 211 | #define PCIE_USB3_PHY_RCVR_DTCT_DLY_P1U2_H 0x60 |
| 212 | #define PCIE_USB3_PHY_SW_RESET 0x600 |
| 213 | #define PCIE_USB3_PHY_START 0x608 |
| 214 | |
| 215 | /* USB3.0 Mux selector */ |
| 216 | #define TCSR_PHSS_USB2_PHY_SEL 0xFD4AB000 |
| 217 | #define PERIPH_SS_AHB2PHY_TOP_CFG 0xF9B3E010 |
| 218 | |
Sundarajan Srinivasan | 4bbce72 | 2013-07-03 11:13:31 -0700 | [diff] [blame] | 219 | #endif |