1 /******************************************************************************
3 * (c) Copyright 2013 Xilinx, Inc. All rights reserved.
5 * This file contains confidential and proprietary information of Xilinx, Inc.
6 * and is protected under U.S. and international copyright and other
7 * intellectual property laws.
10 * This disclaimer is not a license and does not grant any rights to the
11 * materials distributed herewith. Except as otherwise provided in a valid
12 * license issued to you by Xilinx, and to the maximum extent permitted by
13 * applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL
14 * FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,
15 * IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
16 * MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;
17 * and (2) Xilinx shall not be liable (whether in contract or tort, including
18 * negligence, or under any other theory of liability) for any loss or damage
19 * of any kind or nature related to, arising under or in connection with these
20 * materials, including for any direct, or any indirect, special, incidental,
21 * or consequential loss or damage (including loss of data, profits, goodwill,
22 * or any type of loss or damage suffered as a result of any action brought by
23 * a third party) even if such damage or loss was reasonably foreseeable or
24 * Xilinx had been advised of the possibility of the same.
26 * CRITICAL APPLICATIONS
27 * Xilinx products are not designed or intended to be fail-safe, or for use in
28 * any application requiring fail-safe performance, such as life-support or
29 * safety devices or systems, Class III medical devices, nuclear facilities,
30 * applications related to the deployment of airbags, or any other applications
31 * that could lead to death, personal injury, or severe property or
32 * environmental damage (individually and collectively, "Critical
33 * Applications"). Customer assumes the sole risk and liability of any use of
34 * Xilinx products in Critical Applications, subject only to applicable laws
35 * and regulations governing limitations on product liability.
37 * THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE
40 ******************************************************************************/
41 /*****************************************************************************/
43 * @file xil_misc_psreset_api.h
45 * This file contains the various register defintions and function prototypes for
46 * implementing the reset functionality of zynq ps devices
48 * MODIFICATION HISTORY:
50 * Ver Who Date Changes
51 * ----- ---- -------- -------------------------------------------------------
52 * 1.00b kpc 03/07/13 First release.
55 ******************************************************************************/
57 #ifndef XIL_MISC_RESET_H /* prevent circular inclusions */
58 #define XIL_MISC_RESET_H /* by using protection macros */
65 /***************************** Include Files *********************************/
66 #include "xil_types.h"
69 /************************** Constant Definitions *****************************/
70 #define XDDRC_CTRL_BASEADDR 0xF8006000
71 #define XSLCR_BASEADDR 0xF8000000
72 /**< OCM configuration register */
73 #define XSLCR_OCM_CFG_ADDR (XSLCR_BASEADDR + 0x910)
74 /**< SLCR unlock register */
75 #define XSLCR_UNLOCK_ADDR (XSLCR_BASEADDR + 0x8)
76 /**< SLCR GEM0 rx clock control register */
77 #define XSLCR_GEM0_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x138)
78 /**< SLCR GEM1 rx clock control register */
79 #define XSLCR_GEM1_RCLK_CTRL_ADDR (XSLCR_BASEADDR + 0x13C)
80 /**< SLCR GEM0 clock control register */
81 #define XSLCR_GEM0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x140)
82 /**< SLCR GEM1 clock control register */
83 #define XSLCR_GEM1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x144)
84 /**< SLCR SMC clock control register */
85 #define XSLCR_SMC_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x148)
86 /**< SLCR GEM reset control register */
87 #define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x214)
88 /**< SLCR USB0 clock control register */
89 #define XSLCR_USB0_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x130)
90 /**< SLCR USB1 clock control register */
91 #define XSLCR_USB1_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x134)
92 /**< SLCR USB1 reset control register */
93 #define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x210)
94 /**< SLCR SMC reset control register */
95 #define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x234)
96 /**< SLCR Level shifter enable register */
97 #define XSLCR_LVL_SHFTR_EN_ADDR (XSLCR_BASEADDR + 0x900)
98 /**< SLCR ARM pll control register */
99 #define XSLCR_ARM_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x100)
100 /**< SLCR DDR pll control register */
101 #define XSLCR_DDR_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x104)
102 /**< SLCR IO pll control register */
103 #define XSLCR_IO_PLL_CTRL_ADDR (XSLCR_BASEADDR + 0x108)
104 /**< SLCR ARM pll configuration register */
105 #define XSLCR_ARM_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x110)
106 /**< SLCR DDR pll configuration register */
107 #define XSLCR_DDR_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x114)
108 /**< SLCR IO pll configuration register */
109 #define XSLCR_IO_PLL_CFG_ADDR (XSLCR_BASEADDR + 0x118)
110 /**< SLCR ARM clock control register */
111 #define XSLCR_ARM_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x120)
112 /**< SLCR DDR clock control register */
113 #define XSLCR_DDR_CLK_CTRL_ADDR (XSLCR_BASEADDR + 0x124)
114 /**< SLCR MIO pin address register */
115 #define XSLCR_MIO_PIN_00_ADDR (XSLCR_BASEADDR + 0x700)
116 /**< SLCR DMAC reset control address register */
117 #define XSLCR_DMAC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x20C)
118 /**< SLCR USB reset control address register */
119 #define XSLCR_USB_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x210)
120 /**< SLCR GEM reset control address register */
121 #define XSLCR_GEM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x214)
122 /**< SLCR SDIO reset control address register */
123 #define XSLCR_SDIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x218)
124 /**< SLCR SPI reset control address register */
125 #define XSLCR_SPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x21C)
126 /**< SLCR CAN reset control address register */
127 #define XSLCR_CAN_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x220)
128 /**< SLCR I2C reset control address register */
129 #define XSLCR_I2C_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x224)
130 /**< SLCR UART reset control address register */
131 #define XSLCR_UART_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x228)
132 /**< SLCR GPIO reset control address register */
133 #define XSLCR_GPIO_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x22C)
134 /**< SLCR LQSPI reset control address register */
135 #define XSLCR_LQSPI_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x230)
136 /**< SLCR SMC reset control address register */
137 #define XSLCR_SMC_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x234)
138 /**< SLCR OCM reset control address register */
139 #define XSLCR_OCM_RST_CTRL_ADDR (XSLCR_BASEADDR + 0x238)
141 /**< SMC mem controller clear config register */
142 #define XSMC_MEMC_CLR_CONFIG_OFFSET 0x0C
143 /**< SMC idlecount configuration register */
144 #define XSMC_REFRESH_PERIOD_0_OFFSET 0x20
145 #define XSMC_REFRESH_PERIOD_1_OFFSET 0x24
146 /**< SMC ECC configuration register */
147 #define XSMC_ECC_MEMCFG1_OFFSET 0x404
148 /**< SMC ECC command 1 register */
149 #define XSMC_ECC_MEMCMD1_OFFSET 0x404
150 /**< SMC ECC command 2 register */
151 #define XSMC_ECC_MEMCMD2_OFFSET 0x404
153 /**< SLCR unlock code */
154 #define XSLCR_UNLOCK_CODE 0x0000DF0D
156 /**< SMC mem clear configuration mask */
157 #define XSMC_MEMC_CLR_CONFIG_MASK 0x5F
158 /**< SMC ECC memconfig 1 reset value */
159 #define XSMC_ECC_MEMCFG1_RESET_VAL 0x43
160 /**< SMC ECC memcommand 1 reset value */
161 #define XSMC_ECC_MEMCMD1_RESET_VAL 0x01300080
162 /**< SMC ECC memcommand 2 reset value */
163 #define XSMC_ECC_MEMCMD2_RESET_VAL 0x01E00585
165 /**< DDR controller reset bit mask */
166 #define XDDRPS_CTRL_RESET_MASK 0x1
167 /**< SLCR OCM configuration reset value*/
168 #define XSLCR_OCM_CFG_RESETVAL 0x8
169 /**< SLCR OCM bank selection mask*/
170 #define XSLCR_OCM_CFG_HIADDR_MASK 0xF
171 /**< SLCR level shifter enable mask*/
172 #define XSLCR_LVL_SHFTR_EN_MASK 0xF
174 /**< SLCR PLL register reset values */
175 #define XSLCR_ARM_PLL_CTRL_RESET_VAL 0x0001A008
176 #define XSLCR_DDR_PLL_CTRL_RESET_VAL 0x0001A008
177 #define XSLCR_IO_PLL_CTRL_RESET_VAL 0x0001A008
178 #define XSLCR_ARM_PLL_CFG_RESET_VAL 0x00177EA0
179 #define XSLCR_DDR_PLL_CFG_RESET_VAL 0x00177EA0
180 #define XSLCR_IO_PLL_CFG_RESET_VAL 0x00177EA0
181 #define XSLCR_ARM_CLK_CTRL_RESET_VAL 0x1F000400
182 #define XSLCR_DDR_CLK_CTRL_RESET_VAL 0x18400003
184 /**< SLCR MIO register default values */
185 #define XSLCR_MIO_PIN_00_RESET_VAL 0x00001601
186 #define XSLCR_MIO_PIN_02_RESET_VAL 0x00000601
188 /**< SLCR Reset control registers default values */
189 #define XSLCR_DMAC_RST_CTRL_VAL 0x1
190 #define XSLCR_GEM_RST_CTRL_VAL 0xF3
191 #define XSLCR_USB_RST_CTRL_VAL 0x3
192 #define XSLCR_I2C_RST_CTRL_VAL 0x3
193 #define XSLCR_SPI_RST_CTRL_VAL 0xF
194 #define XSLCR_UART_RST_CTRL_VAL 0xF
195 #define XSLCR_QSPI_RST_CTRL_VAL 0x3
196 #define XSLCR_GPIO_RST_CTRL_VAL 0x1
197 #define XSLCR_SMC_RST_CTRL_VAL 0x3
198 #define XSLCR_OCM_RST_CTRL_VAL 0x1
199 #define XSLCR_SDIO_RST_CTRL_VAL 0x33
200 #define XSLCR_CAN_RST_CTRL_VAL 0x3
201 /**************************** Type Definitions *******************************/
203 /* the following data type is used to hold a null terminated version string
204 * consisting of the following format, "X.YYX"
208 /***************** Macros (Inline Functions) Definitions *********************/
211 /************************** Function Prototypes ******************************/
213 * Performs reset operation to the ddr interface
217 * Map the ocm region to post bootrom state
221 * Performs the smc interface reset
223 void XSmc_ResetHw(u32 BaseAddress);
225 * updates the MIO registers with reset values
227 void XSlcr_MioWriteResetValues();
229 * updates the PLL and clock registers with reset values
231 void XSlcr_PllWriteResetValues();
233 * Disables the level shifters
235 void XSlcr_DisableLevelShifters();
237 * provides softreset to the GPIO interface
239 void XSlcr_GpioPsReset(void);
241 * provides softreset to the DMA interface
243 void XSlcr_DmaPsReset(void);
245 * provides softreset to the SMC interface
247 void XSlcr_SmcPsReset(void);
249 * provides softreset to the CAN interface
251 void XSlcr_CanPsReset(void);
253 * provides softreset to the Uart interface
255 void XSlcr_UartPsReset(void);
257 * provides softreset to the I2C interface
259 void XSlcr_I2cPsReset(void);
261 * provides softreset to the SPI interface
263 void XSlcr_SpiPsReset(void);
265 * provides softreset to the QSPI interface
267 void XSlcr_QspiPsReset(void);
269 * provides softreset to the USB interface
271 void XSlcr_UsbPsReset(void);
273 * provides softreset to the GEM interface
275 void XSlcr_EmacPsReset(void);
277 * provides softreset to the OCM interface
279 void XSlcr_OcmReset(void);
286 #endif /* XIL_MISC_RESET_H */