nandps: xnandps.h File Reference

| nandps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Enumerations | Functions
xnandps.h File Reference

## Data Structures
struct | XNandPs_Config
| This typedef contains configuration information for the flash device. More...
struct | XNandPs_Geometry
| Flash geometry. More...
struct | XNandPs_Features
| ONFI Features and Optional commands supported See parameter page byte 6-7 and 8-9. More...
struct | XNandPs_BbtDesc
| Bad block table descriptor. More...
struct | XNandPs_BadBlockPattern
| Bad block pattern. More...
struct | XNandPs_EccConfig
| ECC configuration structure. More...
struct | XNandPsTag
| The XNandPs driver instance data. More...
struct | XNandPs_CommandFormat
| NAND Command format structures. More...

## Macros
#define | XNANDPS_MAX_TARGETS 1
| Max number of targets supported. More...
#define | XNANDPS_MAX_BLOCKS 32768
| Max number of Blocks. More...
#define | XNANDPS_MAX_PAGE_SIZE 16384
| Max page size of NAND flash. More...
#define | XNANDPS_MAX_SPARE_SIZE 512
| Max spare bytes of a NAND flash page. More...
#define | XNANDPS_ECC_BLOCK_SIZE 512
| ECC block size. More...
#define | XNANDPS_ECC_BYTES 3
| ECC bytes per ECC block. More...
#define | XNANDPS_PAGE_SIZE_512 512
| Page size 512. More...
#define | XNANDPS_PAGE_SIZE_1024 1024
| Page size 1024. More...
#define | XNANDPS_PAGE_SIZE_2048 2048
| Page size 2048. More...
#define | XNANDPS_PAGE_SIZE_4096 4096
| Page size 4096. More...
#define | XNANDPS_PAGE_SIZE_8192 8192
| Page size 8192. More...
#define | XNANDPS_SPARE_SIZE_8 8
| Spare bytes size 8. More...
#define | XNANDPS_SPARE_SIZE_16 16
| Spare bytes size 16. More...
#define | XNANDPS_SPARE_SIZE_32 32
| Spare bytes size 32. More...
#define | XNANDPS_SPARE_SIZE_64 64
| Spare bytes size 64. More...
#define | XNANDPS_SPARE_SIZE_128 128
| Spare bytes size 128. More...
#define | XNANDPS_SPARE_SIZE_256 256
| Spare bytes size 256. More...
#define | XNANDPS_FLASH_WIDTH_8 8
| NAND Flash width 8-bit. More...
#define | XNANDPS_FLASH_WIDTH_16 16
| NAND Flash width 16-bit. More...
#define | XNANDPS_END_CMD_NONE 0
| No End command. More...
#define | XNANDPS_END_CMD_INVALID 0
| End command invalid. More...
#define | XNANDPS_CMD_PHASE 1
| End command in command phase. More...
#define | XNANDPS_DATA_PHASE 2
| End command in data phase. More...
#define | XNANDPS_PAGE_NOT_VALID -1
| Page is not valid in command phase. More...
#define | XNANDPS_COLUMN_NOT_VALID -1
| Column is not valid in command phase. More...
#define | XNANDPS_AXI_DATA_WIDTH 4
| AXI Data width for last transaction while reading and writing. More...
#define | XNANDPS_START_CMD_SHIFT 3
| Start command shift. More...
#define | XNANDPS_END_CMD_SHIFT 11
| End command shift. More...
#define | XNANDPS_END_CMD_VALID_SHIFT 20
| End command valid shift. More...
#define | XNANDPS_ADDR_CYCLES_SHIFT 21
| Address cycles shift. More...
#define | XNANDPS_CHIP_ADDR_SHIFT 24
| Chip address shift. More...
#define | XNANDPS_ECC_LAST_SHIFT 10
| Ecc last shift. More...
#define | XNANDPS_CLEAR_CS_SHIFT 21
| clear chip select shift More...
#define | XNANDPS_COMMAND_PHASE_MASK 0x00000000
| Command phase mask. More...
#define | XNANDPS_DATA_PHASE_MASK 0x00080000
| Data phase mask. More...
#define | XNANDPS_ECC_CORRECT_BYTE_MASK 0x1FF
| ECC error correction byte position mask, bits[11:3] of error code. More...
#define | XNANDPS_ECC_CORRECT_BIT_MASK 0x7
| ECC error correction bit position mask, bits[0:2] of error code. More...
#define | XNANDPS_CLR_CONFIG
| Interrupt settings. More...
#define | XNANDPS_ECC_MEMCFG
| ECC memory configuration settings. More...
#define | XNANDPS_ECC_CMD1
| ECC command 1 settings. More...
#define | XNANDPS_ECC_CMD2
| ECC command 2 settings. More...
#define | XNANDPS_CLR_CS (0x1 << XNANDPS_CLEAR_CS_SHIFT)
| set Clear chip select More...
#define | XNANDPS_ECC_LAST (0x1 << XNANDPS_ECC_LAST_SHIFT)
| set Ecc last More...
#define | OneHot(Value) (!((Value) & (Value - 1)))
| OneHot is used to check if one and only one bit is set. More...

## Typedefs
typedef struct XNandPsTag | XNandPs
| The XNandPs driver instance data. More...

## Enumerations
enum | XNandPs_EccMode { XNANDPS_ECC_NONE = 0, XNANDPS_ECC_SW, XNANDPS_ECC_HW, XNANDPS_ECC_ONDIE }

## Functions
XNandPs_Config * | XNandPs_LookupConfig (u16 DeviceId)
| This function looks up the device configuration based on the unique device ID. More...
int | XNandPs_CfgInitialize (XNandPs *InstancePtr, XNandPs_Config *ConfigPtr, u32 SmcBaseAddr, u32 FlashBaseAddr)
| This function initializes a specific XNandPs device/instance. More...
int | XNandPs_Read (XNandPs *InstancePtr, u64 Offset, u32 Length, void *DestPtr, u8 *UserSparePtr)
| This function reads the data from the Flash device and copies it into the specified user buffer. More...
int | XNandPs_ReadCache (XNandPs *InstancePtr, u64 Offset, u32 Length, void *DestPtr, u8 *UserSparePtr)
| This function reads the data from the Flash device using read page cache command and copies it into the specified user buffer. More...
int | XNandPs_Write (XNandPs *InstancePtr, u64 Offset, u32 Length, void *SrcPtr, u8 *UserSparePtr)
| This function programs the flash device(s) with data specified in the user buffer. More...
int | XNandPs_WriteCache (XNandPs *InstancePtr, u64 Offset, u32 Length, void *SrcPtr, u8 *UserSparePtr)
| This function programs the flash device(s) with data specified in the user buffer using program cache command. More...
int | XNandPs_ReadSpareBytes (XNandPs *InstancePtr, u32 Page, u8 *Buf)
| This function reads the spare area of a page. More...
int | XNandPs_WriteSpareBytes (XNandPs *InstancePtr, u32 Page, u8 *Buf)
| This function write to the spare area of a page. More...
int | XNandPs_EraseBlock (XNandPs *InstancePtr, u32 BlockNum)
| This function erases a specific block in the NAND device. More...