OpenOCD
|
Go to the source code of this file.
Macros | |
#define | nfc_is_v1() |
#define | nfc_is_v2() |
#define | OOB_SIZE 64 |
Functions | |
static uint32_t | align_address_v2 (struct nand_device *nand, uint32_t addr) |
COMMAND_HANDLER (handle_mxc_biswap_command) | |
static int | do_data_output (struct nand_device *nand) |
static int | ecc_status_v1 (struct nand_device *nand) |
static int | ecc_status_v2 (struct nand_device *nand) |
static int | get_next_byte_from_sram_buffer (struct nand_device *nand, uint8_t *value) |
static int | get_next_halfword_from_sram_buffer (struct nand_device *nand, uint16_t *value) |
static int | initialize_nf_controller (struct nand_device *nand) |
static int | mxc_address (struct nand_device *nand, uint8_t address) |
static int | mxc_command (struct nand_device *nand, uint8_t command) |
static int | mxc_init (struct nand_device *nand) |
static int | mxc_nand_ready (struct nand_device *nand, int tout) |
static int | mxc_read_data (struct nand_device *nand, void *data) |
static int | mxc_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 | mxc_reset (struct nand_device *nand) |
static int | mxc_write_data (struct nand_device *nand, uint16_t data) |
static int | mxc_write_page (struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size) |
NAND_DEVICE_COMMAND_HANDLER (mxc_nand_device_command) | |
static int | poll_for_complete_op (struct nand_device *nand, const char *text) |
static int | validate_target_state (struct nand_device *nand) |
Variables | |
static const char | data_block_size_err_msg [] |
static const char | get_status_register_err_msg [] = "can't get NAND status" |
static uint32_t | in_sram_address |
static const struct command_registration | mxc_nand_command_handler [] |
struct nand_flash_controller | mxc_nand_flash_controller |
static const struct command_registration | mxc_sub_command_handlers [] |
static unsigned char | sign_of_sequental_byte_read |
static const char | sram_buffer_bounds_err_msg [] |
static const char | target_not_halted_err_msg [] |
#define nfc_is_v1 | ( | ) |
#define nfc_is_v2 | ( | ) |
|
static |
Definition at line 683 of file mxc.c.
References addr, nand_device::controller_priv, mxc_nf_controller::mxc_base_addr, MXC_NF_SPARE_BUFFER_LEN, MXC_NF_SPARE_BUFFER_MAX, MXC_NF_V2_SPARE_BUFFER0, and nand_device::page_size.
Referenced by get_next_byte_from_sram_buffer(), get_next_halfword_from_sram_buffer(), mxc_read_page(), and mxc_write_page().
COMMAND_HANDLER | ( | handle_mxc_biswap_command | ) |
Definition at line 139 of file mxc.c.
References mxc_nf_flags::biswap_enabled, CALL_COMMAND_HANDLER, CMD, CMD_ARGC, CMD_ARGV, command_print(), nand_device::controller_priv, ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, mxc_nf_controller::flags, nand_device::name, and NULL.
|
static |
Definition at line 901 of file mxc.c.
References nand_device::controller_priv, ecc_status_v1(), ecc_status_v2(), ERROR_OK, mxc_nf_controller::fin, mxc_nf_controller::flags, mxc_nf_flags::hw_ecc_enabled, MXC_NF_BIT_DATAOUT_TYPE, MXC_NF_CFG2, MXC_NF_DATAOUT_PAGE, MXC_NF_FIN_DATAOUT, MXC_NF_FIN_NONE, nfc_is_v1, mxc_nf_controller::optype, poll_for_complete_op(), nand_device::target, and target_write_u16().
Referenced by mxc_init(), mxc_read_data(), mxc_read_page(), and mxc_write_page().
|
static |
Definition at line 852 of file mxc.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_INFO, MXC_NF_ECCSTATUS, nand_device::target, and target_read_u16().
Referenced by do_data_output().
|
static |
Definition at line 878 of file mxc.c.
References nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_INFO, MXC_NF_ECCSTATUS, nand_device::page_size, nand_device::target, and target_read_u16().
Referenced by do_data_output().
|
static |
Definition at line 768 of file mxc.c.
References align_address_v2(), nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, in_sram_address, LOG_ERROR, MXC_NF_V1_LAST_BUFFADDR, MXC_NF_V2_LAST_BUFFADDR, nfc_is_v1, nfc_is_v2, sign_of_sequental_byte_read, sram_buffer_bounds_err_msg, nand_device::target, and target_read_u16().
Referenced by mxc_read_data().
|
static |
Definition at line 804 of file mxc.c.
References align_address_v2(), nand_device::controller_priv, ERROR_NAND_OPERATION_FAILED, ERROR_OK, in_sram_address, LOG_ERROR, MXC_NF_V1_LAST_BUFFADDR, MXC_NF_V2_LAST_BUFFADDR, nfc_is_v1, nfc_is_v2, sram_buffer_bounds_err_msg, nand_device::target, and target_read_u16().
Referenced by mxc_read_data().
|
static |
Definition at line 695 of file mxc.c.
References nand_device::controller_priv, target::endianness, nand_device::erase_size, ERROR_FAIL, ERROR_OK, mxc_nf_controller::flags, mxc_nf_flags::hw_ecc_enabled, in_sram_address, LOG_DEBUG, LOG_ERROR, MXC_NF_BIT_BE_EN, MXC_NF_BIT_ECC_4BIT, MXC_NF_BIT_ECC_EN, MXC_NF_BIT_INT_DIS, MXC_NF_BIT_RESET_EN, MXC_NF_BUFADDR, MXC_NF_BUFCFG, MXC_NF_CFG1, MXC_NF_FWP, MXC_NF_MAIN_BUFFER0, MXC_NF_V1_UNLOCKEND, MXC_NF_V1_UNLOCKSTART, MXC_NF_V2_CFG1_PPB, MXC_NF_V2_SPAS, MXC_NF_V2_UNLOCKEND0, MXC_NF_V2_UNLOCKEND1, MXC_NF_V2_UNLOCKEND2, MXC_NF_V2_UNLOCKEND3, MXC_NF_V2_UNLOCKSTART0, MXC_NF_V2_UNLOCKSTART1, MXC_NF_V2_UNLOCKSTART2, MXC_NF_V2_UNLOCKSTART3, mxc_nf_controller::mxc_version, MXC_VERSION_MX27, nfc_is_v1, nfc_is_v2, OOB_SIZE, nand_device::page_size, sign_of_sequental_byte_read, nand_device::target, TARGET_BIG_ENDIAN, target_read_u16(), and target_write_u16().
Referenced by mxc_init(), and mxc_reset().
|
static |
Definition at line 399 of file mxc.c.
References nand_device::controller_priv, ERROR_OK, MXC_NF_BIT_OP_FAI, MXC_NF_CFG2, MXC_NF_FADDR, poll_for_complete_op(), nand_device::target, target_write_u16(), and validate_target_state().
Referenced by mxc_init(), mxc_read_page(), and mxc_write_page().
|
static |
Definition at line 327 of file mxc.c.
References nand_device::controller_priv, ERROR_OK, mxc_nf_controller::fin, in_sram_address, MXC_NF_BIT_OP_FCI, MXC_NF_BUFADDR, MXC_NF_CFG2, MXC_NF_DATAOUT_NANDID, MXC_NF_DATAOUT_NANDSTATUS, MXC_NF_DATAOUT_PAGE, MXC_NF_FCMD, MXC_NF_FIN_DATAOUT, MXC_NF_MAIN_BUFFER0, MXC_NF_V1_SPARE_BUFFER0, MXC_NF_V2_SPARE_BUFFER0, NAND_CMD_READ0, NAND_CMD_READ1, NAND_CMD_READID, NAND_CMD_READOOB, NAND_CMD_STATUS, nfc_is_v1, mxc_nf_controller::optype, nand_device::page_size, poll_for_complete_op(), sign_of_sequental_byte_read, nand_device::target, target_write_u16(), and validate_target_state().
Referenced by mxc_init(), mxc_read_page(), and mxc_write_page().
|
static |
Definition at line 191 of file mxc.c.
References nand_device::bus_width, nand_device::controller_priv, do_data_output(), ERROR_FAIL, ERROR_OK, mxc_nf_controller::flags, get_status_register_err_msg, initialize_nf_controller(), LOG_DEBUG, LOG_ERROR, LOG_INFO, MX25_RCSR, MX25_RCSR_NF_16BIT_SEL, MX25_RCSR_NF_FMS, MX2_FMCR, MX2_FMCR_NF_16BIT_SEL, MX2_FMCR_NF_FMS, MX35_RCSR, MX35_RCSR_NF_16BIT_SEL, MX35_RCSR_NF_4K, MX35_RCSR_NF_FMS, MX3_PCSR, MX3_PCSR_NF_16BIT_SEL, MX3_PCSR_NF_FMS, mxc_address(), mxc_command(), MXC_NF_BUFSIZ, MXC_NF_MAIN_BUFFER0, mxc_nf_controller::mxc_version, MXC_VERSION_MX25, MXC_VERSION_MX31, MXC_VERSION_MX35, NAND_CMD_STATUS, mxc_nf_flags::nand_readonly, nfc_is_v1, nfc_is_v2, mxc_nf_flags::one_kb_sram, nand_device::page_size, nand_device::target, target_read_u16(), target_read_u32(), target_write_u32(), and validate_target_state().
|
static |
Definition at line 424 of file mxc.c.
References alive_sleep(), nand_device::controller_priv, ERROR_OK, MXC_NF_BIT_OP_DONE, MXC_NF_CFG2, nand_device::target, target_read_u16(), and validate_target_state().
Referenced by poll_for_complete_op().
|
static |
Definition at line 279 of file mxc.c.
References nand_device::bus_width, do_data_output(), ERROR_OK, get_next_byte_from_sram_buffer(), get_next_halfword_from_sram_buffer(), LOG_ERROR, and validate_target_state().
|
static |
Definition at line 577 of file mxc.c.
References addr, align_address_v2(), mxc_nf_flags::biswap_enabled, nand_device::controller_priv, data_block_size_err_msg, do_data_output(), ERROR_NAND_OPERATION_FAILED, ERROR_OK, mxc_nf_controller::fin, mxc_nf_controller::flags, LOG_ERROR, LOG_INFO, MIN, mxc_address(), mxc_command(), MXC_NF_BUFADDR, MXC_NF_FIN_DATAOUT, MXC_NF_MAIN_BUFFER0, MXC_NF_MAIN_BUFFER3, MXC_NF_SPARE_BUFFER_LEN, MXC_NF_V1_SPARE_BUFFER0, MXC_NF_V1_SPARE_BUFFER3, MXC_NF_V2_SPARE_BUFFER0, MXC_NF_V2_SPARE_BUFFER3, NAND_CMD_READ0, NAND_CMD_READSTART, nfc_is_v1, nand_device::page_size, nand_device::target, target_read_buffer(), target_read_u16(), target_write_u16(), and validate_target_state().
|
static |
Definition at line 314 of file mxc.c.
References ERROR_OK, initialize_nf_controller(), and validate_target_state().
|
static |
Definition at line 308 of file mxc.c.
References ERROR_NAND_OPERATION_FAILED, and LOG_ERROR.
|
static |
Definition at line 448 of file mxc.c.
References addr, align_address_v2(), mxc_nf_flags::biswap_enabled, nand_device::controller_priv, data_block_size_err_msg, do_data_output(), ERROR_NAND_OPERATION_FAILED, ERROR_OK, mxc_nf_controller::fin, mxc_nf_controller::flags, get_status_register_err_msg, mxc_nf_flags::hw_ecc_enabled, in_sram_address, LOG_DEBUG, LOG_ERROR, LOG_INFO, MIN, mxc_address(), mxc_command(), MXC_NF_BIT_OP_FDI, MXC_NF_BUFADDR, MXC_NF_CFG2, MXC_NF_DATAOUT_NANDSTATUS, MXC_NF_FIN_DATAOUT, MXC_NF_MAIN_BUFFER0, MXC_NF_MAIN_BUFFER3, MXC_NF_SPARE_BUFFER_LEN, MXC_NF_V1_SPARE_BUFFER0, MXC_NF_V1_SPARE_BUFFER3, MXC_NF_V2_SPARE_BUFFER0, MXC_NF_V2_SPARE_BUFFER3, NAND_CMD_PAGEPROG, NAND_CMD_SEQIN, NAND_CMD_STATUS, nfc_is_v1, mxc_nf_controller::optype, nand_device::page_size, poll_for_complete_op(), sign_of_sequental_byte_read, nand_device::target, target_read_u16(), target_write_buffer(), target_write_u16(), and validate_target_state().
NAND_DEVICE_COMMAND_HANDLER | ( | mxc_nand_device_command | ) |
Definition at line 75 of file mxc.c.
References mxc_nf_flags::biswap_enabled, CMD_ARGC, CMD_ARGV, ERROR_FAIL, ERROR_OK, mxc_nf_controller::fin, mxc_nf_controller::flags, mxc_nf_flags::hw_ecc_enabled, LOG_DEBUG, LOG_ERROR, mxc_nf_controller::mxc_base_addr, MXC_NF_DATAOUT_PAGE, MXC_NF_FIN_NONE, mxc_nf_controller::mxc_regs_addr, mxc_nf_controller::mxc_version, MXC_VERSION_MX25, MXC_VERSION_MX27, MXC_VERSION_MX31, MXC_VERSION_MX35, mxc_nf_controller::optype, mxc_nf_flags::target_little_endian, and TARGET_LITTLE_ENDIAN.
|
static |
Definition at line 823 of file mxc.c.
References ERROR_NAND_OPERATION_FAILED, ERROR_OK, LOG_ERROR, and mxc_nand_ready().
Referenced by do_data_output(), mxc_address(), mxc_command(), and mxc_write_page().
|
static |
Definition at line 832 of file mxc.c.
References nand_device::controller_priv, target::endianness, ERROR_NAND_OPERATION_FAILED, ERROR_OK, mxc_nf_controller::flags, LOG_ERROR, target::state, nand_device::target, TARGET_HALTED, mxc_nf_flags::target_little_endian, TARGET_LITTLE_ENDIAN, and target_not_halted_err_msg.
Referenced by mxc_address(), mxc_command(), mxc_init(), mxc_nand_ready(), mxc_read_data(), mxc_read_page(), mxc_reset(), and mxc_write_page().
|
static |
Definition at line 56 of file mxc.c.
Referenced by mxc_read_page(), and mxc_write_page().
|
static |
Definition at line 60 of file mxc.c.
Referenced by mxc_init(), and mxc_write_page().
|
static |
Definition at line 61 of file mxc.c.
Referenced by get_next_byte_from_sram_buffer(), get_next_halfword_from_sram_buffer(), initialize_nf_controller(), mxc_command(), and mxc_write_page().
|
static |
struct nand_flash_controller mxc_nand_flash_controller |
|
static |
|
static |
Definition at line 62 of file mxc.c.
Referenced by get_next_byte_from_sram_buffer(), initialize_nf_controller(), mxc_command(), and mxc_write_page().
|
static |
Definition at line 58 of file mxc.c.
Referenced by get_next_byte_from_sram_buffer(), and get_next_halfword_from_sram_buffer().
|
static |
Definition at line 54 of file mxc.c.
Referenced by validate_target_state().