1 /******************************************************************************
3 * Copyright (C) 2013 - 2014 Xilinx, Inc. All rights reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * Use of the Software is limited solely to applications:
16 * (a) running on a Xilinx device, or
17 * (b) that interact with a Xilinx device through a bus or interconnect.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * Except as contained in this notice, the name of the Xilinx shall not be used
28 * in advertising or otherwise to promote the sale, use or other dealings in
29 * this Software without prior written authorization from Xilinx.
31 ******************************************************************************/
32 /*****************************************************************************/
34 * @file xil_misc_psreset_api.h
36 * This file contains the various register defintions and function prototypes for
37 * implementing the reset functionality of zynq ps devices
39 * MODIFICATION HISTORY:
41 * Ver Who Date Changes
42 * ----- ---- -------- -------------------------------------------------------
43 * 1.00b kpc 03/07/13 First release.
46 ******************************************************************************/
48 #ifndef XIL_MISC_RESET_H /* prevent circular inclusions */
49 #define XIL_MISC_RESET_H /* by using protection macros */
56 /***************************** Include Files *********************************/
57 #include "xil_types.h"
60 /************************** Constant Definitions *****************************/
61 #define XDDRC_CTRL_BASEADDR 0xF8006000
62 #define XSLCR_BASEADDR 0xF8000000
63 /**< OCM configuration register */
64 #define XSLCR_OCM_CFG_ADDR (XSLCR_BASEADDR + 0x910)
65 /**< SLCR unlock register */
66 #define XSLCR_UNLOCK_ADDR (XSLCR_BASEADDR + 0x8)
67 /**< SLCR GEM0 rx clock control register */
68 #define XSLCR_GEM0_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x138)
69 /**< SLCR GEM1 rx clock control register */
70 #define XSLCR_GEM1_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x13C)
71 /**< SLCR GEM0 clock control register */
72 #define XSLCR_GEM0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x140)
73 /**< SLCR GEM1 clock control register */
74 #define XSLCR_GEM1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x144)
75 /**< SLCR SMC clock control register */
76 #define XSLCR_SMC_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x148)
77 /**< SLCR GEM reset control register */
78 #define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x214)
79 /**< SLCR USB0 clock control register */
80 #define XSLCR_USB0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x130)
81 /**< SLCR USB1 clock control register */
82 #define XSLCR_USB1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x134)
83 /**< SLCR USB1 reset control register */
84 #define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x210)
85 /**< SLCR SMC reset control register */
86 #define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x234)
87 /**< SLCR Level shifter enable register */
88 #define XSLCR_LVL_SHFTR_EN_ADDR (XSLCR_BASEADDR + 0x900)
89 /**< SLCR ARM pll control register */
90 #define XSLCR_ARM_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x100)
91 /**< SLCR DDR pll control register */
92 #define XSLCR_DDR_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x104)
93 /**< SLCR IO pll control register */
94 #define XSLCR_IO_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x108)
95 /**< SLCR ARM pll configuration register */
96 #define XSLCR_ARM_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x110)
97 /**< SLCR DDR pll configuration register */
98 #define XSLCR_DDR_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x114)
99 /**< SLCR IO pll configuration register */
100 #define XSLCR_IO_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x118)
101 /**< SLCR ARM clock control register */
102 #define XSLCR_ARM_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x120)
103 /**< SLCR DDR clock control register */
104 #define XSLCR_DDR_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x124)
105 /**< SLCR MIO pin address register */
106 #define XSLCR_MIO_PIN_00_ADDR (XSLCR_BASEADDR + 0x700)
107 /**< SLCR DMAC reset control address register */
108 #define XSLCR_DMAC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x20C)
109 /**< SLCR USB reset control address register */
110 #define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x210)
111 /**< SLCR GEM reset control address register */
112 #define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x214)
113 /**< SLCR SDIO reset control address register */
114 #define XSLCR_SDIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x218)
115 /**< SLCR SPI reset control address register */
116 #define XSLCR_SPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x21C)
117 /**< SLCR CAN reset control address register */
118 #define XSLCR_CAN_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x220)
119 /**< SLCR I2C reset control address register */
120 #define XSLCR_I2C_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x224)
121 /**< SLCR UART reset control address register */
122 #define XSLCR_UART_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x228)
123 /**< SLCR GPIO reset control address register */
124 #define XSLCR_GPIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x22C)
125 /**< SLCR LQSPI reset control address register */
126 #define XSLCR_LQSPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x230)
127 /**< SLCR SMC reset control address register */
128 #define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x234)
129 /**< SLCR OCM reset control address register */
130 #define XSLCR_OCM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x238)
132 /**< SMC mem controller clear config register */
133 #define XSMC_MEMC_CLR_CONFIG_OFFSET 0x0C
134 /**< SMC idlecount configuration register */
135 #define XSMC_REFRESH_PERIOD_0_OFFSET 0x20
136 #define XSMC_REFRESH_PERIOD_1_OFFSET 0x24
137 /**< SMC ECC configuration register */
138 #define XSMC_ECC_MEMCFG1_OFFSET 0x404
139 /**< SMC ECC command 1 register */
140 #define XSMC_ECC_MEMCMD1_OFFSET 0x404
141 /**< SMC ECC command 2 register */
142 #define XSMC_ECC_MEMCMD2_OFFSET 0x404
144 /**< SLCR unlock code */
145 #define XSLCR_UNLOCK_CODE 0x0000DF0D
147 /**< SMC mem clear configuration mask */
148 #define XSMC_MEMC_CLR_CONFIG_MASK 0x5F
149 /**< SMC ECC memconfig 1 reset value */
150 #define XSMC_ECC_MEMCFG1_RESET_VAL 0x43
151 /**< SMC ECC memcommand 1 reset value */
152 #define XSMC_ECC_MEMCMD1_RESET_VAL 0x01300080
153 /**< SMC ECC memcommand 2 reset value */
154 #define XSMC_ECC_MEMCMD2_RESET_VAL 0x01E00585
156 /**< DDR controller reset bit mask */
157 #define XDDRPS_CTRL_RESET_MASK 0x1
158 /**< SLCR OCM configuration reset value*/
159 #define XSLCR_OCM_CFG_RESETVAL 0x8
160 /**< SLCR OCM bank selection mask*/
161 #define XSLCR_OCM_CFG_HIADDR_MASK 0xF
162 /**< SLCR level shifter enable mask*/
163 #define XSLCR_LVL_SHFTR_EN_MASK 0xF
165 /**< SLCR PLL register reset values */
166 #define XSLCR_ARM_PLL_CTRL_RESET_VAL 0x0001A008
167 #define XSLCR_DDR_PLL_CTRL_RESET_VAL 0x0001A008
168 #define XSLCR_IO_PLL_CTRL_RESET_VAL 0x0001A008
169 #define XSLCR_ARM_PLL_CFG_RESET_VAL 0x00177EA0
170 #define XSLCR_DDR_PLL_CFG_RESET_VAL 0x00177EA0
171 #define XSLCR_IO_PLL_CFG_RESET_VAL 0x00177EA0
172 #define XSLCR_ARM_CLK_CTRL_RESET_VAL 0x1F000400
173 #define XSLCR_DDR_CLK_CTRL_RESET_VAL 0x18400003
175 /**< SLCR MIO register default values */
176 #define XSLCR_MIO_PIN_00_RESET_VAL 0x00001601
177 #define XSLCR_MIO_PIN_02_RESET_VAL 0x00000601
179 /**< SLCR Reset control registers default values */
180 #define XSLCR_DMAC_RST_CTRL_VAL 0x1
181 #define XSLCR_GEM_RST_CTRL_VAL 0xF3
182 #define XSLCR_USB_RST_CTRL_VAL 0x3
183 #define XSLCR_I2C_RST_CTRL_VAL 0x3
184 #define XSLCR_SPI_RST_CTRL_VAL 0xF
185 #define XSLCR_UART_RST_CTRL_VAL 0xF
186 #define XSLCR_QSPI_RST_CTRL_VAL 0x3
187 #define XSLCR_GPIO_RST_CTRL_VAL 0x1
188 #define XSLCR_SMC_RST_CTRL_VAL 0x3
189 #define XSLCR_OCM_RST_CTRL_VAL 0x1
190 #define XSLCR_SDIO_RST_CTRL_VAL 0x33
191 #define XSLCR_CAN_RST_CTRL_VAL 0x3
192 /**************************** Type Definitions *******************************/
194 /* the following data type is used to hold a null terminated version string
195 * consisting of the following format, "X.YYX"
199 /***************** Macros (Inline Functions) Definitions *********************/
202 /************************** Function Prototypes ******************************/
204 * Performs reset operation to the ddr interface
208 * Map the ocm region to post bootrom state
212 * Performs the smc interface reset
214 void XSmc_ResetHw(u32 BaseAddress);
216 * updates the MIO registers with reset values
218 void XSlcr_MioWriteResetValues();
220 * updates the PLL and clock registers with reset values
222 void XSlcr_PllWriteResetValues();
224 * Disables the level shifters
226 void XSlcr_DisableLevelShifters();
228 * provides softreset to the GPIO interface
230 void XSlcr_GpioPsReset(void);
232 * provides softreset to the DMA interface
234 void XSlcr_DmaPsReset(void);
236 * provides softreset to the SMC interface
238 void XSlcr_SmcPsReset(void);
240 * provides softreset to the CAN interface
242 void XSlcr_CanPsReset(void);
244 * provides softreset to the Uart interface
246 void XSlcr_UartPsReset(void);
248 * provides softreset to the I2C interface
250 void XSlcr_I2cPsReset(void);
252 * provides softreset to the SPI interface
254 void XSlcr_SpiPsReset(void);
256 * provides softreset to the QSPI interface
258 void XSlcr_QspiPsReset(void);
260 * provides softreset to the USB interface
262 void XSlcr_UsbPsReset(void);
264 * provides softreset to the GEM interface
266 void XSlcr_EmacPsReset(void);
268 * provides softreset to the OCM interface
270 void XSlcr_OcmReset(void);
277 #endif /* XIL_MISC_RESET_H */