![]() |
nandps
Vitis Drivers API Documentation
|
This file contains a design example using the NAND driver (XNandPs).
This example tests NAND page cache read and write commands. The page cache commands are not supported by OnDie ECC flash since ECC is enabled by default. Tested Spansion S34ML04G100TFI00 flash with this example.
This example tests the block erase, block read and block write features. The flash blocks are erased and written. The data is read back and compared with the data written for correctness. The bad blocks are not erased/programmed.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00 nm 04/25/2013 First release. ms 04/10/17 Modified Comment lines to follow doxygen rules 2.8 akm 07/06/23 Add support for system device-tree flow.
Macros | |
#define | NAND_TEST_START_BLOCK 64 |
Starting block to test. More... | |
#define | NAND_TEST_NUM_BLOCKS 16 |
Number of blocks to test. More... | |
#define | NAND_TEST_BLOCK_SIZE 0x20000 |
Test Block Size, must be same as the flash block size. More... | |
Functions | |
int | NandReadWriteCacheExample (u32 NandDeviceId) |
This function runs a test on the NAND flash device using the basic driver functions. More... | |
int | main (void) |
Main function to execute the Nand Flash read write example. More... | |
Variables | |
u8 | ReadBuffer [NAND_TEST_BLOCK_SIZE] |
Block sized Read buffer. More... | |
u8 | WriteBuffer [NAND_TEST_BLOCK_SIZE] |
Block sized write buffer. More... | |
#define NAND_TEST_BLOCK_SIZE 0x20000 |
Test Block Size, must be same as the flash block size.
Referenced by NandReadWriteCacheExample().
#define NAND_TEST_NUM_BLOCKS 16 |
Number of blocks to test.
Referenced by NandReadWriteCacheExample().
#define NAND_TEST_START_BLOCK 64 |
Starting block to test.
Referenced by NandReadWriteCacheExample().
int main | ( | void | ) |
Main function to execute the Nand Flash read write example.
References NandReadWriteCacheExample().
int NandReadWriteCacheExample | ( | u32 | NandDeviceId | ) |
This function runs a test on the NAND flash device using the basic driver functions.
The function does the following tasks:
NandDeviceId | is is the XPAR_<NAND_instance>_DEVICE_ID value from xparameters.h. |
References XNandPs_Geometry::BlockSize, XNandPs_Config::FlashBase, XNandPsTag::Geometry, NAND_TEST_BLOCK_SIZE, NAND_TEST_NUM_BLOCKS, NAND_TEST_START_BLOCK, ReadBuffer, XNandPs_Config::SmcBase, WriteBuffer, XNandPs_CfgInitialize(), XNandPs_EraseBlock(), XNandPs_IsBlockBad(), XNandPs_LookupConfig(), XNandPs_ReadCache(), and XNandPs_WriteCache().
Referenced by main().
u8 ReadBuffer[NAND_TEST_BLOCK_SIZE] |
Block sized Read buffer.
Referenced by NandReadWriteCacheExample(), NandReadWriteExample(), and NandSkipBlockExample().
u8 WriteBuffer[NAND_TEST_BLOCK_SIZE] |
Block sized write buffer.
Referenced by NandReadWriteCacheExample(), NandReadWriteExample(), and NandSkipBlockExample().