RTEMS 6.1-rc5
|
NAND MLC controller API. More...
Go to the source code of this file.
Data Structures | |
struct | lpc32xx_mlc_config |
MLC NAND controller configuration. More... | |
Macros | |
#define | MLC_SMALL_PAGES 0x1U |
Selects small pages (512 Bytes user data and 16 Bytes spare data) or large pages (2048 Bytes user data and 64 Bytes spare data) if not set. | |
#define | MLC_MANY_ADDRESS_CYCLES 0x2U |
#define | MLC_NORMAL_BLOCKS 0x4U |
Selects 64 pages per block or 128 pages per block if not set. | |
#define | MLC_IO_WIDTH_16_BIT 0x8U |
Selects 16-bit IO width or 8-bit IO width if not set. | |
MLC NAND Flash Dimensions | |
#define | MLC_SMALL_PAGE_SIZE 528 |
#define | MLC_SMALL_DATA_SIZE 512 |
#define | MLC_SMALL_SPARE_SIZE 16 |
#define | MLC_SMALL_USER_SPARE_SIZE 6 |
#define | MLC_SMALL_ECC_SPARE_SIZE 10 |
#define | MLC_SMALL_DATA_WORD_COUNT (MLC_SMALL_DATA_SIZE / 4) |
#define | MLC_SMALL_SPARE_WORD_COUNT (MLC_SMALL_SPARE_SIZE / 4) |
#define | MLC_SMALL_PAGES_PER_LARGE_PAGE 4 |
#define | MLC_LARGE_PAGE_SIZE (MLC_SMALL_PAGES_PER_LARGE_PAGE * MLC_SMALL_PAGE_SIZE) |
#define | MLC_LARGE_DATA_SIZE (MLC_SMALL_PAGES_PER_LARGE_PAGE * MLC_SMALL_DATA_SIZE) |
#define | MLC_LARGE_SPARE_SIZE (MLC_SMALL_PAGES_PER_LARGE_PAGE * MLC_SMALL_SPARE_SIZE) |
#define | MLC_LARGE_DATA_WORD_COUNT (MLC_LARGE_DATA_SIZE / 4) |
#define | MLC_LARGE_SPARE_WORD_COUNT (MLC_LARGE_SPARE_SIZE / 4) |
NAND Flash Clock Control Register (FLASHCLK_CTRL) | |
#define | FLASHCLK_IRQ_MLC BSP_BIT32(5) |
#define | FLASHCLK_MLC_DMA_RNB BSP_BIT32(4) |
#define | FLASHCLK_MLC_DMA_INT BSP_BIT32(3) |
#define | FLASHCLK_SELECT_SLC BSP_BIT32(2) |
#define | FLASHCLK_MLC_CLK_ENABLE BSP_BIT32(1) |
#define | FLASHCLK_SLC_CLK_ENABLE BSP_BIT32(0) |
MLC NAND Timing Register (MLC_TIME_REG) | |
#define | MLC_TIME_WR_LOW(val) BSP_FLD32(val, 0, 3) |
#define | MLC_TIME_WR_HIGH(val) BSP_FLD32(val, 4, 7) |
#define | MLC_TIME_RD_LOW(val) BSP_FLD32(val, 8, 11) |
#define | MLC_TIME_RD_HIGH(val) BSP_FLD32(val, 12, 15) |
#define | MLC_TIME_NAND_TA(val) BSP_FLD32(val, 16, 18) |
#define | MLC_TIME_BUSY_DELAY(val) BSP_FLD32(val, 19, 23) |
#define | MLC_TIME_TCEA_DELAY(val) BSP_FLD32(val, 24, 25) |
MLC NAND Lock Protection Register (MLC_LOCK_PR) | |
#define | MLC_UNLOCK_PROT 0xa25e |
MLC NAND Status Register (MLC_ISR) | |
#define | MLC_ISR_DECODER_FAILURE BSP_BIT32(6) |
#define | MLC_ISR_SYMBOL_ERRORS(reg) BSP_FLD32GET(reg, 4, 5) |
#define | MLC_ISR_ERRORS_DETECTED BSP_BIT32(3) |
#define | MLC_ISR_ECC_READY BSP_BIT32(2) |
#define | MLC_ISR_CONTROLLER_READY BSP_BIT32(1) |
#define | MLC_ISR_NAND_READY BSP_BIT32(0) |
MLC NAND Controller Configuration Register (MLC_ICR) | |
#define | MLC_ICR_SOFT_WRITE_PROT BSP_BIT32(3) |
#define | MLC_ICR_LARGE_PAGES BSP_BIT32(2) |
#define | MLC_ICR_ADDR_WORD_COUNT_4_5 BSP_BIT32(1) |
#define | MLC_ICR_IO_BUS_16 BSP_BIT32(0) |
MLC NAND Auto Encode Register (MLC_ECC_AUTO_ENC) | |
#define | MLC_ECC_AUTO_ENC_PROGRAM BSP_BIT32(8) |
NAND Status Register | |
#define | NAND_STATUS_ERROR (1U << 0) |
#define | NAND_STATUS_READY (1U << 6) |
#define | NAND_STATUS_NOT_PROTECTED (1U << 7) |
Typedefs | |
typedef bool(* | lpc32xx_mlc_read_process) (void *process_arg, uint32_t page_index, uint32_t page_size, uint32_t page_data[MLC_LARGE_DATA_WORD_COUNT], uint32_t page_spare[MLC_LARGE_SPARE_WORD_COUNT]) |
Read blocks process function type. | |
Functions | |
void | lpc32xx_mlc_init (const lpc32xx_mlc_config *cfg) |
Initializes the MLC NAND controller according to cfg. | |
uint32_t | lpc32xx_mlc_page_size (void) |
uint32_t | lpc32xx_mlc_pages_per_block (void) |
uint32_t | lpc32xx_mlc_block_count (void) |
uint32_t | lpc32xx_mlc_io_width (void) |
void | lpc32xx_mlc_write_protection (uint32_t page_index_low, uint32_t page_index_high) |
void | lpc32xx_mlc_read_id (uint8_t *id, size_t n) |
rtems_status_code | lpc32xx_mlc_read_page (uint32_t page_index, void *data, void *spare, uint32_t *symbol_error_count) |
Reads the page with index page_index. | |
rtems_status_code | lpc32xx_mlc_is_valid_block (uint32_t block_index) |
Checks if the block with index block_index is valid. | |
rtems_status_code | lpc32xx_mlc_erase_block (uint32_t block_index) |
Erases the block with index block_index. | |
rtems_status_code | lpc32xx_mlc_erase_block_safe (uint32_t block_index) |
Erases the block with index block_index. | |
rtems_status_code | lpc32xx_mlc_erase_block_safe_3 (uint32_t block_index, uint32_t page_begin, uint32_t page_end) |
Erases the block with index block_index. | |
void | lpc32xx_mlc_zero_pages (uint32_t page_begin, uint32_t page_end) |
Writes zero values to the pages specified by page_begin and page_end. | |
rtems_status_code | lpc32xx_mlc_write_page_with_ecc (uint32_t page_index, const void *data, const void *spare) |
Writes the page with index page_index. | |
rtems_status_code | lpc32xx_mlc_write_blocks (uint32_t block_begin, uint32_t block_end, const void *src, size_t src_size, uint32_t page_buffer[MLC_LARGE_DATA_WORD_COUNT]) |
Writes src_size Bytes from src to the flash area specified by block_begin and block_end. | |
rtems_status_code | lpc32xx_mlc_read_blocks (uint32_t block_begin, uint32_t block_end, lpc32xx_mlc_read_process process, void *process_arg, uint32_t page_buffer_0[MLC_LARGE_DATA_WORD_COUNT], uint32_t page_buffer_1[MLC_LARGE_DATA_WORD_COUNT]) |
Reads the pages of block block_begin up to and excluding block_end. | |
NAND MLC controller API.