RTEMS 6.1-rc6
Loading...
Searching...
No Matches
xnandpsu_hw.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (C) 2015 - 2022 Xilinx, Inc. All rights reserved.
3* SPDX-License-Identifier: MIT
4******************************************************************************/
5
6/*****************************************************************************/
34#ifndef XNANDPSU_HW_H /* prevent circular inclusions */
35#define XNANDPSU_HW_H /* by using protection macros */
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/***************************** Include Files *********************************/
42#ifndef __rtems__
43#include "xil_io.h"
44#else
45#include <bsp/xil-compat.h>
46#endif
47
48/************************** Constant Definitions *****************************/
49
50/************************** Register Offset Definitions **********************/
51
52#define XNANDPSU_PKT_OFFSET 0x00U
53#define XNANDPSU_MEM_ADDR1_OFFSET 0x04U
55#define XNANDPSU_MEM_ADDR2_OFFSET 0x08U
57#define XNANDPSU_CMD_OFFSET 0x0CU
58#define XNANDPSU_PROG_OFFSET 0x10U
59#define XNANDPSU_INTR_STS_EN_OFFSET 0x14U
61#define XNANDPSU_INTR_SIG_EN_OFFSET 0x18U
63#define XNANDPSU_INTR_STS_OFFSET 0x1CU
65#define XNANDPSU_READY_BUSY_OFFSET 0x20U
67#define XNANDPSU_FLASH_STS_OFFSET 0x28U
68#define XNANDPSU_TIMING_OFFSET 0x2CU
69#define XNANDPSU_BUF_DATA_PORT_OFFSET 0x30U
71#define XNANDPSU_ECC_OFFSET 0x34U
72#define XNANDPSU_ECC_ERR_CNT_OFFSET 0x38U
74#define XNANDPSU_ECC_SPR_CMD_OFFSET 0x3CU
76#define XNANDPSU_ECC_CNT_1BIT_OFFSET 0x40U
78#define XNANDPSU_ECC_CNT_2BIT_OFFSET 0x44U
80#define XNANDPSU_ECC_CNT_3BIT_OFFSET 0x48U
82#define XNANDPSU_ECC_CNT_4BIT_OFFSET 0x4CU
84#define XNANDPSU_CPU_REL_OFFSET 0x58U
85#define XNANDPSU_ECC_CNT_5BIT_OFFSET 0x5CU
87#define XNANDPSU_ECC_CNT_6BIT_OFFSET 0x60U
89#define XNANDPSU_ECC_CNT_7BIT_OFFSET 0x64U
91#define XNANDPSU_ECC_CNT_8BIT_OFFSET 0x68U
93#define XNANDPSU_DATA_INTF_OFFSET 0x6CU
94#define XNANDPSU_DMA_SYS_ADDR0_OFFSET 0x50U
96#define XNANDPSU_DMA_SYS_ADDR1_OFFSET 0x24U
98#define XNANDPSU_DMA_BUF_BND_OFFSET 0x54U
100#define XNANDPSU_SLV_DMA_CONF_OFFSET 0x80U
106#define XNANDPSU_PKT_PKT_SIZE_MASK 0x000007FFU
107#define XNANDPSU_PKT_PKT_CNT_MASK 0x00FFF000U
108#define XNANDPSU_PKT_PKT_CNT_SHIFT 12U
109/* @} */
110
114#define XNANDPSU_MEM_ADDR1_COL_ADDR_MASK 0x0000FFFFU
116#define XNANDPSU_MEM_ADDR1_PG_ADDR_MASK 0xFFFF0000U
118#define XNANDPSU_MEM_ADDR1_PG_ADDR_SHIFT 16U
119/* @} */
120
124#define XNANDPSU_MEM_ADDR2_MEM_ADDR_MASK 0x000000FFU
126#define XNANDPSU_MEM_ADDR2_BUS_WIDTH_MASK 0x01000000U
127#define XNANDPSU_MEM_ADDR2_NFC_BCH_MODE_MASK 0x0E000000U
129#define XNANDPSU_MEM_ADDR2_MODE_MASK 0x30000000U
131#define XNANDPSU_MEM_ADDR2_CHIP_SEL_MASK 0xC0000000U
132#define XNANDPSU_MEM_ADDR2_CHIP_SEL_SHIFT 30U
134#define XNANDPSU_MEM_ADDR2_BUS_WIDTH_SHIFT 24U
135#define XNANDPSU_MEM_ADDR2_NFC_BCH_MODE_SHIFT 25U
136/* @} */
137
141#define XNANDPSU_CMD_CMD1_MASK 0x000000FFU
143#define XNANDPSU_CMD_CMD2_MASK 0x0000FF00U
145#define XNANDPSU_CMD_PG_SIZE_MASK 0x03800000U
146#define XNANDPSU_CMD_DMA_EN_MASK 0x0C000000U
148#define XNANDPSU_CMD_ADDR_CYCLES_MASK 0x70000000U
150#define XNANDPSU_CMD_ECC_ON_MASK 0x80000000U
151#define XNANDPSU_CMD_CMD2_SHIFT 8U
153#define XNANDPSU_CMD_PG_SIZE_SHIFT 23U
154#define XNANDPSU_CMD_DMA_EN_SHIFT 26U
155#define XNANDPSU_CMD_ADDR_CYCLES_SHIFT 28U
157#define XNANDPSU_CMD_ECC_ON_SHIFT 31U
158/* @} */
159
163#define XNANDPSU_PROG_RD_MASK 0x00000001U
164#define XNANDPSU_PROG_MUL_DIE_MASK 0x00000002U
165#define XNANDPSU_PROG_BLK_ERASE_MASK 0x00000004U
166#define XNANDPSU_PROG_RD_STS_MASK 0x00000008U
167#define XNANDPSU_PROG_PG_PROG_MASK 0x00000010U
168#define XNANDPSU_PROG_MUL_DIE_RD_MASK 0x00000020U
169#define XNANDPSU_PROG_RD_ID_MASK 0x00000040U
170#define XNANDPSU_PROG_RD_PRM_PG_MASK 0x00000080U
172#define XNANDPSU_PROG_RST_MASK 0x00000100U
173#define XNANDPSU_PROG_GET_FEATURES_MASK 0x00000200U
174#define XNANDPSU_PROG_SET_FEATURES_MASK 0x00000400U
175#define XNANDPSU_PROG_RD_UNQ_ID_MASK 0x00000800U
177#define XNANDPSU_PROG_RD_STS_ENH_MASK 0x00001000U
179#define XNANDPSU_PROG_RD_INTRLVD_MASK 0x00002000U
181#define XNANDPSU_PROG_CHNG_RD_COL_ENH_MASK 0x00004000U
184#define XNANDPSU_PROG_COPY_BACK_INTRLVD_MASK 0x00008000U
186#define XNANDPSU_PROG_RD_CACHE_START_MASK 0x00010000U
188#define XNANDPSU_PROG_RD_CACHE_SEQ_MASK 0x00020000U
190#define XNANDPSU_PROG_RD_CACHE_RAND_MASK 0x00040000U
192#define XNANDPSU_PROG_RD_CACHE_END_MASK 0x00080000U
194#define XNANDPSU_PROG_SMALL_DATA_MOVE_MASK 0x00100000U
196#define XNANDPSU_PROG_CHNG_ROW_ADDR_MASK 0x00200000U
198#define XNANDPSU_PROG_CHNG_ROW_ADDR_END_MASK 0x00400000U
200#define XNANDPSU_PROG_RST_LUN_MASK 0x00800000U
201#define XNANDPSU_PROG_PGM_PG_CLR_MASK 0x01000000U
204#define XNANDPSU_PROG_VOL_SEL_MASK 0x02000000U
205#define XNANDPSU_PROG_ODT_CONF_MASK 0x04000000U
206/* @} */
207
211#define XNANDPSU_INTR_STS_EN_BUFF_WR_RDY_STS_EN_MASK 0x00000001U
215#define XNANDPSU_INTR_STS_EN_BUFF_RD_RDY_STS_EN_MASK 0x00000002U
219#define XNANDPSU_INTR_STS_EN_TRANS_COMP_STS_EN_MASK 0x00000004U
223#define XNANDPSU_INTR_STS_EN_MUL_BIT_ERR_STS_EN_MASK 0x00000008U
227#define XNANDPSU_INTR_STS_EN_ERR_INTR_STS_EN_MASK 0x00000010U
235#define XNANDPSU_INTR_STS_EN_DMA_INT_STS_EN_MASK 0x00000040U
238#define XNANDPSU_INTR_STS_EN_ERR_AHB_STS_EN_MASK 0x00000080U
241/* @} */
242
246#define XNANDPSU_INTR_SIG_EN_BUFF_WR_RDY_STS_EN_MASK 0x00000001U
250#define XNANDPSU_INTR_SIG_EN_BUFF_RD_RDY_STS_EN_MASK 0x00000002U
254#define XNANDPSU_INTR_SIG_EN_TRANS_COMP_STS_EN_MASK 0x00000004U
258#define XNANDPSU_INTR_SIG_EN_MUL_BIT_ERR_STS_EN_MASK 0x00000008U
262#define XNANDPSU_INTR_SIG_EN_ERR_INTR_STS_EN_MASK 0x00000010U
270#define XNANDPSU_INTR_SIG_EN_DMA_INT_STS_EN_MASK 0x00000040U
273#define XNANDPSU_INTR_SIG_EN_ERR_AHB_STS_EN_MASK 0x00000080U
276/* @} */
277
281#define XNANDPSU_INTR_STS_BUFF_WR_RDY_STS_EN_MASK 0x00000001U
284#define XNANDPSU_INTR_STS_BUFF_RD_RDY_STS_EN_MASK 0x00000002U
287#define XNANDPSU_INTR_STS_TRANS_COMP_STS_EN_MASK 0x00000004U
289#define XNANDPSU_INTR_STS_MUL_BIT_ERR_STS_EN_MASK 0x00000008U
291#define XNANDPSU_INTR_STS_ERR_INTR_STS_EN_MASK 0x00000010U
295#define XNANDPSU_INTR_STS_DMA_INT_STS_EN_MASK 0x00000040U
298#define XNANDPSU_INTR_STS_ERR_AHB_STS_EN_MASK 0x00000080U
300/* @} */
301
305#define XNANDPSU_INTR_BUFF_WR_RDY_STS_EN_MASK 0x00000001U
308#define XNANDPSU_INTR_BUFF_RD_RDY_STS_EN_MASK 0x00000002U
311#define XNANDPSU_INTR_TRANS_COMP_STS_EN_MASK 0x00000004U
314#define XNANDPSU_INTR_MUL_BIT_ERR_STS_EN_MASK 0x00000008U
316#define XNANDPSU_INTR_ERR_INTR_STS_EN_MASK 0x00000010U
320#define XNANDPSU_INTR_DMA_INT_STS_EN_MASK 0x00000040U
322#define XNANDPSU_INTR_ERR_AHB_STS_EN_MASK 0x00000080U
324/* @} */
325
329#define XNANDPSU_ID2_DEVICE_ID2_MASK 0x000000FFU
330/* @} */
331
335#define XNANDPSU_FLASH_STS_FLASH_STS_MASK 0x0000FFFFU
337/* @} */
338
342#define XNANDPSU_TIMING_TCCS_TIME_MASK 0x00000003U
344#define XNANDPSU_TIMING_SLOW_FAST_TCAD_MASK 0x00000004U
346#define XNANDPSU_TIMING_DQS_BUFF_SEL_MASK 0x00000078U
349#define XNANDPSU_TIMING_TADL_TIME_MASK 0x00007F80U
352/* @} */
353
357#define XNANDPSU_ECC_ADDR_MASK 0x0000FFFFU
358#define XNANDPSU_ECC_SIZE_MASK 0x01FF0000U
359#define XNANDPSU_ECC_HAMMING_BCH_MASK 0x02000000U
361/* @} */
362
366#define XNANDPSU_ECC_ERR_CNT_PKT_BND_ERR_CNT_MASK 0x000000FFU
369#define XNANDPSU_ECC_ERR_CNT_PG_BND_ERR_CNT_MASK 0x0000FF00U
372/* @} */
373
377#define XNANDPSU_ECC_SPR_CMD_SPR_CMD_MASK 0x000000FFU
380#define XNANDPSU_ECC_SPR_CMD_ECC_ADDR_CYCLES_MASK 0x70000000U
385/* @} */
386
390#define XNANDPSU_DATA_INTF_SDR_MASK 0x00000007U
391#define XNANDPSU_DATA_INTF_NVDDR_MASK 0x00000038U
392#define XNANDPSU_DATA_INTF_NVDDR2_MASK 0x000001C0U
393#define XNANDPSU_DATA_INTF_DATA_INTF_MASK 0x00000600U
395#define XNANDPSU_DATA_INTF_NVDDR_SHIFT 3U
396#define XNANDPSU_DATA_INTF_DATA_INTF_SHIFT 9U
397/* @} */
398
402#define XNANDPSU_DMA_BUF_BND_BND_MASK 0x00000007U
404#define XNANDPSU_DMA_BUF_BND_4K 0x0U
405#define XNANDPSU_DMA_BUF_BND_8K 0x1U
406#define XNANDPSU_DMA_BUF_BND_16K 0x2U
407#define XNANDPSU_DMA_BUF_BND_32K 0x3U
408#define XNANDPSU_DMA_BUF_BND_64K 0x4U
409#define XNANDPSU_DMA_BUF_BND_128K 0x5U
410#define XNANDPSU_DMA_BUF_BND_256K 0x6U
411#define XNANDPSU_DMA_BUF_BND_512K 0x7U
412/* @} */
413
417#define XNANDPSU_SLV_DMA_CONF_SDMA_TX_RX_MASK 0x00000001U
422#define XNANDPSU_SLV_DMA_CONF_DMA_TRANS_CNT_MASK 0x001FFFFEU
426#define XNANDPSU_SLV_DMA_CONF_DMA_BURST_SIZE_MASK 0x00E00000U
430#define XNANDPSU_SLV_DMA_CONF_DMA_TMOUT_CNT_VAL_MASK 0x0F000000U
434#define XNANDPSU_SLV_DMA_CONF_SDMA_EN_MASK 0x10000000U
437/* @} */
438
439/**************************** Type Definitions *******************************/
440
441/***************** Macros (Inline Functions) Definitions *********************/
442
443/****************************************************************************/
457#define XNandPsu_ReadReg(BaseAddress, RegOffset) \
458 Xil_In32((BaseAddress) + (RegOffset))
459
460/****************************************************************************/
475#define XNandPsu_WriteReg(BaseAddress, RegOffset, Data) \
476 Xil_Out32(((BaseAddress) + (RegOffset)), (Data))
477
478/************************** Function Prototypes ******************************/
479
480/************************** Variable Definitions *****************************/
481
482#ifdef __cplusplus
483}
484#endif
485
486#endif /* XNANDPSU_HW_H end of protection macro */