OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | dmac_ll |
Macros | |
#define | DATA_OFFS 0x200 |
#define | ECC_OFFS 0x120 |
#define | SPARE_OFFS 0x140 |
Functions | |
COMMAND_HANDLER (handle_lpc32xx_select_command) | |
static int | lpc32xx_address (struct nand_device *nand, uint8_t address) |
static int | lpc32xx_command (struct nand_device *nand, uint8_t command) |
static int | lpc32xx_controller_ready (struct nand_device *nand, int timeout) |
static float | lpc32xx_cycle_time (struct nand_device *nand) |
static int | lpc32xx_dma_ready (struct nand_device *nand, int timeout) |
static void | lpc32xx_dump_oob (uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_init (struct nand_device *nand) |
static int | lpc32xx_make_dma_list (uint32_t target_mem_base, uint32_t page_size, int do_read) |
static int | lpc32xx_nand_ready (struct nand_device *nand, int timeout) |
static int | lpc32xx_pll (int fclkin, uint32_t pll_ctrl) |
static int | lpc32xx_read_data (struct nand_device *nand, void *data) |
static int | lpc32xx_read_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_read_page_mlc (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_read_page_slc (struct nand_device *nand, struct working_area *pworking_area, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_reset (struct nand_device *nand) |
static int | lpc32xx_start_slc_dma (struct nand_device *nand, uint32_t count, int do_wait) |
static int | lpc32xx_tc_ready (struct nand_device *nand, int timeout) |
static int | lpc32xx_write_data (struct nand_device *nand, uint16_t data) |
static int | lpc32xx_write_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_write_page_mlc (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
static int | lpc32xx_write_page_slc (struct nand_device *nand, struct working_area *pworking_area, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
int | nand_correct_data (struct nand_device *nand, u_char *dat, u_char *read_ecc, u_char *calc_ecc) |
nand_correct_data - Detect and correct a 1 bit error for 256 byte block More... | |
NAND_DEVICE_COMMAND_HANDLER (lpc32xx_nand_device_command) | |
static uint32_t | slc_ecc_copy_to_buffer (uint8_t *spare, const uint32_t *ecc, int count) |
Variables | |
static struct dmac_ll | dmalist [(2048/256) *2+1] |
static const int | lp_ooblayout [] |
static const struct command_registration | lpc32xx_command_handler [] |
static const struct command_registration | lpc32xx_exec_command_handlers [] |
struct nand_flash_controller | lpc32xx_nand_controller |
static const int | sp_ooblayout [] |
COMMAND_HANDLER | ( | handle_lpc32xx_select_command | ) |
Definition at line 1738 of file lpc32xx.c.
References CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), nand_device::controller_priv, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_nand_device_by_num(), LPC32XX_MLC_CONTROLLER, LPC32XX_SLC_CONTROLLER, NULL, and lpc32xx_nand_controller::selected_controller.
|
static |
Definition at line 461 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 427 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 1605 of file lpc32xx.c.
References alive_sleep(), nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, status, nand_device::target, TARGET_HALTED, target_read_u32(), and target_read_u8().
Referenced by lpc32xx_read_page_mlc(), lpc32xx_reset(), and lpc32xx_write_page_mlc().
|
static |
Definition at line 118 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, lpc32xx_pll(), lpc32xx_nand_controller::osc_freq, nand_device::target, and target_read_u32().
Referenced by lpc32xx_init().
|
static |
Definition at line 953 of file lpc32xx.c.
References alive_sleep(), ERROR_OK, LOG_DEBUG, LOG_ERROR, nand_device::target, and target_read_u32().
Referenced by lpc32xx_write_page_slc().
|
static |
Definition at line 1007 of file lpc32xx.c.
References addr, and LOG_DEBUG.
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
Definition at line 179 of file lpc32xx.c.
References nand_device::address_cycles, nand_device::bus_width, nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_NOT_SUPPORTED, ERROR_OK, LOG_DEBUG, LOG_ERROR, lpc32xx_cycle_time(), LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, lpc32xx_reset(), LPC32XX_SLC_CONTROLLER, nand_device::page_size, lpc32xx_nand_controller::selected_controller, target::state, lpc32xx_nand_controller::sw_write_protection, nand_device::target, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 738 of file lpc32xx.c.
References ctrl, DATA_OFFS, dmac_ll::dma_dest, dmac_ll::dma_src, dmalist, ECC_OFFS, dmac_ll::next_ctrl, dmac_ll::next_lli, and SPARE_OFFS.
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
Definition at line 1658 of file lpc32xx.c.
References alive_sleep(), nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, status, nand_device::target, TARGET_HALTED, target_read_u32(), and target_read_u8().
|
static |
Definition at line 90 of file lpc32xx.c.
References LOG_WARNING.
Referenced by lpc32xx_cycle_time().
|
static |
Definition at line 529 of file lpc32xx.c.
References nand_device::bus_width, nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, TARGET_HALTED, target_read_u32(), and target_read_u8().
|
static |
Definition at line 1562 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_FLASH_OPERATION_FAILED, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_NOT_SUPPORTED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, lpc32xx_read_page_mlc(), lpc32xx_read_page_slc(), LPC32XX_SLC_CONTROLLER, nand_device::page_size, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, target_alloc_working_area(), target_free_working_area(), and TARGET_HALTED.
|
static |
Definition at line 1275 of file lpc32xx.c.
References nand_device::address_cycles, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, LOG_WARNING, lpc32xx_controller_ready(), NAND_CMD_READ0, NAND_CMD_READOOB, NAND_CMD_READSTART, nand_device::page_size, nand_device::target, target_read_memory(), target_read_u32(), and target_write_u32().
Referenced by lpc32xx_read_page().
|
static |
Definition at line 1431 of file lpc32xx.c.
References working_area::address, DATA_OFFS, dmalist, ECC_OFFS, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, LOG_WARNING, lp_ooblayout, lpc32xx_dump_oob(), lpc32xx_make_dma_list(), lpc32xx_start_slc_dma(), NAND_CMD_READ0, nand_correct_data(), nand_page_command(), nand_device::page_size, slc_ecc_copy_to_buffer(), sp_ooblayout, SPARE_OFFS, nand_device::target, target_read_memory(), target_write_memory(), and target_write_u32().
Referenced by lpc32xx_read_page().
|
static |
Definition at line 381 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_TIMEOUT, ERROR_OK, LOG_ERROR, lpc32xx_controller_ready(), LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, TARGET_HALTED, and target_write_u32().
Referenced by lpc32xx_init().
|
static |
Definition at line 885 of file lpc32xx.c.
References count, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, lpc32xx_tc_ready(), nand_device::target, and target_write_u32().
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
Definition at line 1712 of file lpc32xx.c.
References alive_sleep(), ERROR_OK, LOG_DEBUG, LOG_ERROR, status, nand_device::target, and target_read_u32().
Referenced by lpc32xx_start_slc_dma(), and lpc32xx_write_page_slc().
|
static |
Definition at line 495 of file lpc32xx.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, TARGET_HALTED, and target_write_u32().
|
static |
Definition at line 1211 of file lpc32xx.c.
References nand_device::controller_priv, DATA_OFFS, ERROR_FLASH_OPERATION_FAILED, ERROR_NAND_OPERATION_FAILED, ERROR_NAND_OPERATION_NOT_SUPPORTED, ERROR_OK, LOG_ERROR, LPC32XX_MLC_CONTROLLER, LPC32XX_NO_CONTROLLER, LPC32XX_SLC_CONTROLLER, lpc32xx_write_page_mlc(), lpc32xx_write_page_slc(), nand_write_page_raw(), nand_device::page_size, lpc32xx_nand_controller::selected_controller, target::state, nand_device::target, target_alloc_working_area(), target_free_working_area(), and TARGET_HALTED.
|
static |
Definition at line 579 of file lpc32xx.c.
References nand_device::address_cycles, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, lpc32xx_controller_ready(), NAND_CMD_PAGEPROG, NAND_CMD_SEQIN, nand_read_status(), NAND_STATUS_FAIL, nand_device::page_size, status, nand_device::target, target_write_memory(), and target_write_u32().
Referenced by lpc32xx_write_page().
|
static |
Definition at line 1020 of file lpc32xx.c.
References working_area::address, DATA_OFFS, dmalist, ECC_OFFS, ERROR_FLASH_OPERATION_FAILED, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, LOG_ERROR, lp_ooblayout, lpc32xx_dma_ready(), lpc32xx_dump_oob(), lpc32xx_make_dma_list(), lpc32xx_start_slc_dma(), lpc32xx_tc_ready(), NAND_CMD_SEQIN, nand_page_command(), nand_write_finish(), nand_device::page_size, slc_ecc_copy_to_buffer(), sp_ooblayout, SPARE_OFFS, nand_device::target, target_read_memory(), target_write_memory(), and target_write_u32().
Referenced by lpc32xx_write_page().
int nand_correct_data | ( | struct nand_device * | nand, |
u_char * | dat, | ||
u_char * | read_ecc, | ||
u_char * | calc_ecc | ||
) |
nand_correct_data - Detect and correct a 1 bit error for 256 byte block
Definition at line 113 of file ecc.c.
References countbits().
Referenced by lpc32xx_read_page_slc().
NAND_DEVICE_COMMAND_HANDLER | ( | lpc32xx_nand_device_command | ) |
Definition at line 63 of file lpc32xx.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_WARNING, LPC32XX_NO_CONTROLLER, lpc32xx_nand_controller::osc_freq, lpc32xx_nand_controller::selected_controller, lpc32xx_nand_controller::sw_wp_lower_bound, lpc32xx_nand_controller::sw_wp_upper_bound, and lpc32xx_nand_controller::sw_write_protection.
|
static |
Definition at line 993 of file lpc32xx.c.
References count.
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
Definition at line 45 of file lpc32xx.c.
Referenced by lpc32xx_make_dma_list(), lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
Definition at line 45 of file lpc32xx.c.
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().
|
static |
|
static |
|
static |
Definition at line 42 of file lpc32xx.c.
Referenced by lpc32xx_read_page_slc(), and lpc32xx_write_page_slc().