Common definition of NAND Flash.
This file contains some common definition for NAND Flash module.
Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
#define NAND_COMMAND_COPYBACK_PROGRAM_1 0x85 |
Referenced by copy_page().
#define NAND_COMMAND_COPYBACK_PROGRAM_2 0x10 |
Referenced by copy_page().
#define NAND_COMMAND_COPYBACK_READ_1 0x00 |
Referenced by copy_page().
#define NAND_COMMAND_COPYBACK_READ_2 0x35 |
Referenced by copy_page().
#define NAND_COMMAND_ERASE_1 0x60 |
Referenced by erase_block().
#define NAND_COMMAND_ERASE_2 0xD0 |
Referenced by erase_block().
#define NAND_COMMAND_RANDOM_IN 0x85 |
#define NAND_COMMAND_RANDOM_OUT 0x05 |
#define NAND_COMMAND_RANDOM_OUT_2 0xE0 |
#define NAND_COMMAND_READ_1 0x00 |
Referenced by nand_flash_raw_read_page().
#define NAND_COMMAND_READ_2 0x30 |
Referenced by nand_flash_raw_read_page().
#define NAND_COMMAND_READ_A 0x00 |
Referenced by nand_flash_raw_read_page().
#define NAND_COMMAND_READ_C 0x50 |
#define NAND_COMMAND_READID 0x90 |
Referenced by nand_flash_raw_read_id().
#define NAND_COMMAND_RESET 0xFF |
Referenced by nand_flash_raw_reset().
#define NAND_COMMAND_STATUS 0x70 |
Referenced by check_status().
#define NAND_COMMAND_WRITE_1 0x80 |
Referenced by write_page().
#define NAND_COMMAND_WRITE_2 0x10 |
Referenced by write_page().
#define NAND_COMMON_ERROR_BADBLOCK 12 |
#define NAND_COMMON_ERROR_BLOCKNOTMAPPED 2 |
#define NAND_COMMON_ERROR_CANNOTCOPY 14 |
Referenced by copy_page().
#define NAND_COMMON_ERROR_CANNOTERASE 13 |
Referenced by erase_block().
#define NAND_COMMON_ERROR_CANNOTREAD 6 |
#define NAND_COMMON_ERROR_CANNOTWRITE 7 |
Referenced by copy_page(), and write_page().
#define NAND_COMMON_ERROR_CORRUPTEDDATA 9 |
Referenced by nand_flash_ecc_read_page().
#define NAND_COMMON_ERROR_ECC_NOT_COMPATIBLE 15 |
#define NAND_COMMON_ERROR_MAPPINGNOTFOUND 5 |
#define NAND_COMMON_ERROR_NOBLOCKFOUND 4 |
#define NAND_COMMON_ERROR_NOMAPPING 11 |
#define NAND_COMMON_ERROR_NOMOREBLOCKS 1 |
NAND Flash error codes NAND Flash API methods return either 0 (indicating that there was no error), or one of the following error codes:
#define NAND_COMMON_ERROR_OUTOFBOUNDS 3 |
Referenced by nand_flash_model_translate_access().
#define NAND_COMMON_ERROR_UNKNOWNMODEL 8 |
Referenced by nand_flash_model_find(), and nand_flash_raw_initialize().
#define NAND_COMMON_ERROR_WRONGSTATUS 10 |
#define NAND_COMMON_MAX_BLOCK_NUMBER 2048 |
NAND Flash maximum supported values Since no memory allocation is available, limits have been set on various characteristics of a NAND Flash chip:
Maximums
#define NAND_COMMON_MAX_PAGE_SIZE 4096 |
Referenced by copy_page().
#define NAND_COMMON_MAX_PAGE_SPARE_SIZE 128 |
Referenced by copy_page(), nand_flash_ecc_read_page(), and nand_flash_ecc_write_page().
#define NAND_COMMON_MAX_PAGES_PER_BLOCK 256 |
#define NAND_COMMON_MAX_SPARE_ECC_BYTES 48 |
Referenced by nand_flash_ecc_read_page(), and nand_flash_ecc_write_page().
#define NAND_COMMON_MAX_SPARE_EXTRA_BYTES 78 |
#define NAND_STATUS_ERROR (1 << 0) |
Referenced by check_status().
#define NAND_STATUS_READY (1 << 6) |
Referenced by check_status().