OpenOCD
|
Go to the source code of this file.
Functions | |
COMMAND_HELPER (nand_command_get_device, unsigned name_index, struct nand_device **nand) | |
helper for parsing a nand device command argument string More... | |
static struct nand_device * | get_nand_device_by_name (const char *name) |
Returns the flash bank specified by name, which matches the driver name and a suffix (option) specify the driver-specific bank number. More... | |
struct nand_device * | get_nand_device_by_num (int num) |
int | nand_build_bbt (struct nand_device *nand, int first, int last) |
void | nand_device_add (struct nand_device *c) |
int | nand_erase (struct nand_device *nand, int first_block, int last_block) |
int | nand_page_command (struct nand_device *nand, uint32_t page, uint8_t cmd, bool oob_only) |
static int | nand_poll_ready (struct nand_device *nand, int timeout) |
int | nand_probe (struct nand_device *nand) |
int | nand_read_data_page (struct nand_device *nand, uint8_t *data, uint32_t size) |
int | nand_read_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
int | nand_read_page_raw (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
int | nand_read_status (struct nand_device *nand, uint8_t *status) |
int | nand_write_data_page (struct nand_device *nand, uint8_t *data, uint32_t size) |
int | nand_write_finish (struct nand_device *nand) |
int | nand_write_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
int | nand_write_page_raw (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
Variables | |
struct nand_device * | nand_devices |
static struct nand_info | nand_flash_ids [] |
static struct nand_manufacturer | nand_manuf_ids [] |
COMMAND_HELPER | ( | nand_command_get_device | , |
unsigned | name_index, | ||
struct nand_device ** | nand | ||
) |
helper for parsing a nand device command argument string
Definition at line 197 of file flash/nand/core.c.
References CMD, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_nand_device_by_name(), and get_nand_device_by_num().
|
static |
Returns the flash bank specified by name, which matches the driver name and a suffix (option) specify the driver-specific bank number.
The suffix consists of the '.' and the driver-specific bank number: when two davinci banks are defined, then 'davinci.1' refers to the second (e.g. DM355EVM).
Definition at line 166 of file flash/nand/core.c.
References nand_device::controller, flash_driver_name_matches(), get_flash_name_index(), nand_device::name, nand_flash_controller::name, name, nand_devices, nand_device::next, and NULL.
Referenced by COMMAND_HELPER().
struct nand_device* get_nand_device_by_num | ( | int | num | ) |
Definition at line 184 of file flash/nand/core.c.
References nand_devices, nand_device::next, and NULL.
Referenced by COMMAND_HANDLER(), and COMMAND_HELPER().
int nand_build_bbt | ( | struct nand_device * | nand, |
int | first, | ||
int | last | ||
) |
Definition at line 215 of file flash/nand/core.c.
References nand_device::blocks, nand_device::device, nand_device::erase_size, ERROR_OK, nand_block::is_bad, LOG_WARNING, NAND_BUSWIDTH_16, nand_read_page(), NULL, nand_device::num_blocks, nand_info::options, and nand_device::page_size.
Referenced by COMMAND_HANDLER(), and nand_erase().
void nand_device_add | ( | struct nand_device * | c | ) |
Definition at line 20 of file flash/nand/core.c.
References nand_devices, and nand_device::next.
Referenced by COMMAND_HELPER().
int nand_erase | ( | struct nand_device * | nand, |
int | first_block, | ||
int | last_block | ||
) |
Definition at line 502 of file flash/nand/core.c.
References nand_flash_controller::address, nand_device::address_cycles, nand_device::blocks, nand_flash_controller::command, nand_device::controller, nand_device::device, nand_device::erase_size, ERROR_COMMAND_SYNTAX_ERROR, ERROR_NAND_DEVICE_NOT_PROBED, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_TIMEOUT, ERROR_OK, nand_block::is_bad, nand_block::is_erased, LOG_ERROR, nand_build_bbt(), NAND_CMD_ERASE1, NAND_CMD_ERASE2, nand_poll_ready(), nand_read_status(), nand_flash_controller::nand_ready, nand_device::num_blocks, nand_device::page_size, and status.
Referenced by COMMAND_HANDLER().
int nand_page_command | ( | struct nand_device * | nand, |
uint32_t | page, | ||
uint8_t | cmd, | ||
bool | oob_only | ||
) |
Definition at line 693 of file flash/nand/core.c.
References nand_flash_controller::address, nand_device::address_cycles, alive_sleep(), cmd, nand_flash_controller::command, nand_device::controller, nand_device::device, ERROR_NAND_DEVICE_NOT_PROBED, ERROR_NAND_OPERATION_TIMEOUT, ERROR_OK, NAND_CMD_READ0, NAND_CMD_READOOB, NAND_CMD_READSTART, nand_flash_controller::nand_ready, and nand_device::page_size.
Referenced by at91sam9_read_page(), at91sam9_write_page(), lpc3180_read_page(), lpc3180_write_page(), lpc32xx_read_page_slc(), lpc32xx_write_page_slc(), nand_read_page_raw(), and nand_write_page_raw().
|
static |
Definition at line 271 of file flash/nand/core.c.
References alive_sleep(), nand_flash_controller::command, nand_device::controller, nand_device::device, NAND_BUSWIDTH_16, NAND_CMD_STATUS, NAND_STATUS_READY, nand_info::options, nand_flash_controller::read_data, and status.
Referenced by nand_erase(), and nand_write_finish().
int nand_probe | ( | struct nand_device * | nand | ) |
Definition at line 291 of file flash/nand/core.c.
References nand_flash_controller::address, nand_device::address_cycles, nand_device::blocks, nand_device::bus_width, nand_info::chip_size, nand_flash_controller::command, nand_device::controller, nand_device::device, nand_device::erase_size, nand_info::erase_size, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_NOT_SUPPORTED, ERROR_OK, nand_manufacturer::id, nand_flash_controller::init, nand_block::is_bad, nand_block::is_erased, LOG_DEBUG, LOG_ERROR, nand_device::manufacturer, nand_manufacturer::name, nand_info::name, NAND_BUSWIDTH_16, NAND_CMD_READID, NAND_CMD_RESET, nand_flash_ids, nand_manuf_ids, NULL, nand_device::num_blocks, nand_block::offset, nand_info::options, nand_device::page_size, nand_info::page_size, nand_flash_controller::read_data, nand_flash_controller::reset, and nand_block::size.
Referenced by COMMAND_HANDLER().
int nand_read_data_page | ( | struct nand_device * | nand, |
uint8_t * | data, | ||
uint32_t | size | ||
) |
Definition at line 757 of file flash/nand/core.c.
References nand_device::controller, nand_device::device, ERROR_NAND_NO_BUFFER, ERROR_OK, NAND_BUSWIDTH_16, nand_info::options, nand_flash_controller::read_block_data, nand_flash_controller::read_data, and size.
Referenced by at91sam9_read_page(), and nand_read_page_raw().
int nand_read_page | ( | struct nand_device * | nand, |
uint32_t | page, | ||
uint8_t * | data, | ||
uint32_t | data_size, | ||
uint8_t * | oob, | ||
uint32_t | oob_size | ||
) |
Definition at line 680 of file flash/nand/core.c.
References nand_device::controller, nand_device::device, ERROR_NAND_DEVICE_NOT_PROBED, nand_read_page_raw(), nand_flash_controller::read_page, and nand_device::use_raw.
Referenced by COMMAND_HANDLER(), and nand_build_bbt().
int nand_read_page_raw | ( | struct nand_device * | nand, |
uint32_t | page, | ||
uint8_t * | data, | ||
uint32_t | data_size, | ||
uint8_t * | oob, | ||
uint32_t | oob_size | ||
) |
Definition at line 778 of file flash/nand/core.c.
References ERROR_OK, NAND_CMD_READ0, nand_page_command(), and nand_read_data_page().
Referenced by lpc3180_read_page(), and nand_read_page().
int nand_read_status | ( | struct nand_device * | nand, |
uint8_t * | status | ||
) |
Definition at line 249 of file flash/nand/core.c.
References alive_sleep(), nand_flash_controller::command, nand_device::controller, nand_device::device, ERROR_NAND_DEVICE_NOT_PROBED, ERROR_OK, NAND_BUSWIDTH_16, NAND_CMD_STATUS, nand_info::options, nand_flash_controller::read_data, and status.
Referenced by davinci_writepage_tail(), lpc3180_write_page(), lpc32xx_write_page_mlc(), nand_erase(), and nand_write_finish().
int nand_write_data_page | ( | struct nand_device * | nand, |
uint8_t * | data, | ||
uint32_t | size | ||
) |
Definition at line 797 of file flash/nand/core.c.
References nand_device::controller, nand_device::device, ERROR_NAND_NO_BUFFER, ERROR_OK, le_to_h_u16(), NAND_BUSWIDTH_16, nand_info::options, size, nand_flash_controller::write_block_data, write_data(), and nand_flash_controller::write_data.
Referenced by at91sam9_write_page(), and nand_write_page_raw().
int nand_write_finish | ( | struct nand_device * | nand | ) |
Definition at line 827 of file flash/nand/core.c.
References nand_flash_controller::command, nand_device::controller, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_TIMEOUT, ERROR_OK, LOG_ERROR, NAND_CMD_PAGEPROG, nand_poll_ready(), nand_read_status(), nand_flash_controller::nand_ready, NAND_STATUS_FAIL, and status.
Referenced by at91sam9_write_page(), lpc3180_write_page(), lpc32xx_write_page_slc(), and nand_write_page_raw().
int nand_write_page | ( | struct nand_device * | nand, |
uint32_t | page, | ||
uint8_t * | data, | ||
uint32_t | data_size, | ||
uint8_t * | oob, | ||
uint32_t | oob_size | ||
) |
Definition at line 661 of file flash/nand/core.c.
References nand_device::blocks, nand_device::controller, nand_device::device, nand_device::erase_size, ERROR_NAND_DEVICE_NOT_PROBED, nand_block::is_erased, nand_write_page_raw(), nand_device::page_size, nand_device::use_raw, and nand_flash_controller::write_page.
Referenced by COMMAND_HANDLER().
int nand_write_page_raw | ( | struct nand_device * | nand, |
uint32_t | page, | ||
uint8_t * | data, | ||
uint32_t | data_size, | ||
uint8_t * | oob, | ||
uint32_t | oob_size | ||
) |
Definition at line 855 of file flash/nand/core.c.
References ERROR_OK, LOG_ERROR, NAND_CMD_SEQIN, nand_page_command(), nand_write_data_page(), and nand_write_finish().
Referenced by lpc3180_write_page(), lpc32xx_write_page(), and nand_write_page().
struct nand_device* nand_devices |
Definition at line 18 of file flash/nand/core.c.
Referenced by COMMAND_HANDLER(), get_nand_device_by_name(), get_nand_device_by_num(), nand_device_add(), and nand_init().
|
static |
Definition at line 20 of file flash/nand/core.c.
Referenced by nand_probe().
|
static |
Definition at line 20 of file flash/nand/core.c.
Referenced by nand_probe().