OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | fespi_flash_bank |
struct | fespi_target |
Macros | |
#define | FESPI_CMD_TIMEOUT (100) |
#define | FESPI_CSMODE_AUTO 0 |
#define | FESPI_CSMODE_HOLD 2 |
#define | FESPI_CSMODE_OFF 3 |
#define | FESPI_DIR_RX 0 |
#define | FESPI_DIR_TX 1 |
#define | FESPI_ENDIAN_LSB 1 |
#define | FESPI_ENDIAN_MSB 0 |
#define | FESPI_FCTRL_EN 0x1 |
#define | FESPI_FMT_DIR(x) (((x) & 0x1) << 3) |
#define | FESPI_FMT_ENDIAN(x) (((x) & 0x1) << 2) |
#define | FESPI_FMT_LEN(x) (((x) & 0xf) << 16) |
#define | FESPI_FMT_PROTO(x) ((x) & 0x3) |
#define | FESPI_INSN_ADDR_LEN(x) (((x) & 0x7) << 1) |
#define | FESPI_INSN_ADDR_PROTO(x) (((x) & 0x3) << 10) |
#define | FESPI_INSN_CMD_CODE(x) (((x) & 0xff) << 16) |
#define | FESPI_INSN_CMD_EN 0x1 |
#define | FESPI_INSN_CMD_PROTO(x) (((x) & 0x3) << 8) |
#define | FESPI_INSN_DATA_PROTO(x) (((x) & 0x3) << 12) |
#define | FESPI_INSN_PAD_CNT(x) (((x) & 0xf) << 4) |
#define | FESPI_INSN_PAD_CODE(x) (((x) & 0xff) << 24) |
#define | FESPI_IP_RXWM 0x2 |
#define | FESPI_IP_TXWM 0x1 |
#define | FESPI_MAX_TIMEOUT (3000) |
#define | FESPI_PROBE_TIMEOUT (100) |
#define | FESPI_PROTO_D 1 |
#define | FESPI_PROTO_Q 2 |
#define | FESPI_PROTO_S 0 |
#define | FESPI_REG_CSDEF 0x14 |
#define | FESPI_REG_CSID 0x10 |
#define | FESPI_REG_CSMODE 0x18 |
#define | FESPI_REG_DCSSCK 0x28 |
#define | FESPI_REG_DINTERCS 0x2c |
#define | FESPI_REG_DINTERXFR 0x2e |
#define | FESPI_REG_DSCKCS 0x2a |
#define | FESPI_REG_FCTRL 0x60 |
#define | FESPI_REG_FFMT 0x64 |
#define | FESPI_REG_FMT 0x40 |
#define | FESPI_REG_IE 0x70 |
#define | FESPI_REG_IP 0x74 |
#define | FESPI_REG_RXCTRL 0x54 |
#define | FESPI_REG_RXFIFO 0x4c |
#define | FESPI_REG_SCKDIV 0x00 |
#define | FESPI_REG_SCKMODE 0x04 |
#define | FESPI_REG_TXCTRL 0x50 |
#define | FESPI_REG_TXFIFO 0x48 |
#define | FESPI_RXWM(x) ((x) & 0xffff) |
#define | FESPI_SCK_PHA 0x2 |
#define | FESPI_SCK_POL 0x1 |
#define | FESPI_TXWM(x) ((x) & 0xffff) |
Functions | |
static int | fespi_auto_probe (struct flash_bank *bank) |
static int | fespi_disable_hw_mode (struct flash_bank *bank) |
static int | fespi_enable_hw_mode (struct flash_bank *bank) |
static int | fespi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | fespi_erase_sector (struct flash_bank *bank, int sector) |
static int | fespi_probe (struct flash_bank *bank) |
static int | fespi_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | fespi_protect_check (struct flash_bank *bank) |
static int | fespi_read_flash_id (struct flash_bank *bank, uint32_t *id) |
static int | fespi_read_reg (struct flash_bank *bank, uint32_t *value, target_addr_t address) |
static int | fespi_rx (struct flash_bank *bank, uint8_t *out) |
static int | fespi_set_dir (struct flash_bank *bank, bool dir) |
static int | fespi_tx (struct flash_bank *bank, uint8_t in) |
static int | fespi_txwm_wait (struct flash_bank *bank) |
static int | fespi_wip (struct flash_bank *bank, int timeout) |
static int | fespi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | fespi_write_reg (struct flash_bank *bank, target_addr_t address, uint32_t value) |
FLASH_BANK_COMMAND_HANDLER (fespi_flash_bank_command) | |
static int | get_fespi_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | slow_fespi_write_buffer (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t len) |
Variables | |
const struct flash_driver | fespi_flash |
static const uint8_t | riscv32_bin [] |
static const uint8_t | riscv64_bin [] |
static const struct fespi_target | target_devices [] |
|
static |
Definition at line 820 of file fespi.c.
References bank, ERROR_OK, fespi_probe(), and fespi_flash_bank::probed.
|
static |
Definition at line 188 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, FESPI_FCTRL_EN, fespi_read_reg(), FESPI_REG_FCTRL, and fespi_write_reg().
Referenced by fespi_erase(), fespi_probe(), and fespi_write().
|
static |
Definition at line 196 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, FESPI_FCTRL_EN, fespi_read_reg(), FESPI_REG_FCTRL, and fespi_write_reg().
Referenced by fespi_erase(), fespi_probe(), and fespi_write().
|
static |
Definition at line 356 of file fespi.c.
References bank, fespi_flash_bank::dev, flash_device::erase_cmd, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, fespi_disable_hw_mode(), fespi_enable_hw_mode(), fespi_erase_sector(), FESPI_PROBE_TIMEOUT, FESPI_REG_TXCTRL, FESPI_TXWM, fespi_txwm_wait(), fespi_wip(), fespi_write_reg(), keep_alive(), LOG_DEBUG, LOG_ERROR, fespi_flash_bank::probed, target::state, and TARGET_HALTED.
|
static |
Definition at line 311 of file fespi.c.
References bank, fespi_flash_bank::dev, flash_device::erase_cmd, ERROR_FAIL, ERROR_OK, FESPI_CSMODE_AUTO, FESPI_CSMODE_HOLD, FESPI_MAX_TIMEOUT, FESPI_REG_CSMODE, fespi_tx(), fespi_txwm_wait(), fespi_wip(), fespi_write_reg(), and SPIFLASH_WRITE_ENABLE.
Referenced by fespi_erase().
|
static |
Definition at line 723 of file fespi.c.
References bank, fespi_flash_bank::ctrl_base, fespi_target::ctrl_base, fespi_flash_bank::dev, flash_device::device_id, ERROR_FAIL, ERROR_OK, FESPI_DIR_TX, fespi_disable_hw_mode(), fespi_enable_hw_mode(), fespi_read_flash_id(), FESPI_REG_TXCTRL, fespi_set_dir(), FESPI_TXWM, fespi_write_reg(), flash_devices, jtag_tap::idcode, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, fespi_target::name, flash_device::name, NULL, flash_sector::offset, fespi_flash_bank::probed, flash_device::sectorsize, flash_sector::size, flash_device::size_in_bytes, target::tap, fespi_target::tap_idcode, TARGET_ADDR_FMT, and target_devices.
Referenced by fespi_auto_probe().
|
static |
|
static |
|
static |
Definition at line 671 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, FESPI_CSMODE_AUTO, FESPI_CSMODE_HOLD, FESPI_DIR_RX, FESPI_DIR_TX, FESPI_PROBE_TIMEOUT, FESPI_REG_CSMODE, fespi_rx(), fespi_set_dir(), fespi_tx(), fespi_txwm_wait(), fespi_wip(), fespi_write_reg(), LOG_ERROR, NULL, SPIFLASH_READ_ID, target::state, and TARGET_HALTED.
Referenced by fespi_probe().
|
static |
Definition at line 160 of file fespi.c.
References bank, fespi_flash_bank::ctrl_base, ERROR_OK, LOG_ERROR, TARGET_ADDR_FMT, and target_read_u32().
Referenced by fespi_disable_hw_mode(), fespi_enable_hw_mode(), fespi_rx(), fespi_set_dir(), fespi_tx(), and fespi_txwm_wait().
|
static |
Definition at line 254 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_TIMEOUT, fespi_read_reg(), FESPI_REG_RXFIFO, LOG_ERROR, start, and timeval_ms().
Referenced by fespi_read_flash_id(), and fespi_wip().
|
static |
Definition at line 204 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, FESPI_FMT_DIR, fespi_read_reg(), FESPI_REG_FMT, and fespi_write_reg().
Referenced by fespi_probe(), fespi_read_flash_id(), and fespi_wip().
|
static |
Definition at line 234 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_TIMEOUT, fespi_read_reg(), FESPI_REG_TXFIFO, fespi_write_reg(), LOG_ERROR, start, and timeval_ms().
Referenced by fespi_erase_sector(), fespi_read_flash_id(), fespi_wip(), and slow_fespi_write_buffer().
|
static |
Definition at line 214 of file fespi.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_TIMEOUT, FESPI_IP_TXWM, fespi_read_reg(), FESPI_REG_IP, LOG_ERROR, start, and timeval_ms().
Referenced by fespi_erase(), fespi_erase_sector(), fespi_read_flash_id(), fespi_write(), and slow_fespi_write_buffer().
|
static |
Definition at line 278 of file fespi.c.
References alive_sleep(), bank, ERROR_FAIL, ERROR_OK, FESPI_CSMODE_AUTO, FESPI_CSMODE_HOLD, FESPI_DIR_RX, FESPI_DIR_TX, FESPI_REG_CSMODE, fespi_rx(), fespi_set_dir(), fespi_tx(), fespi_write_reg(), LOG_ERROR, NULL, SPIFLASH_BSY_BIT, SPIFLASH_READ_STATUS, and timeval_ms().
Referenced by fespi_erase(), fespi_erase_sector(), fespi_read_flash_id(), and fespi_write().
|
static |
Definition at line 481 of file fespi.c.
References working_area::address, ARRAY_SIZE, bank, buf_get_u64(), buf_set_u64(), buffer, count, fespi_flash_bank::ctrl_base, fespi_flash_bank::dev, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, fespi_disable_hw_mode(), fespi_enable_hw_mode(), FESPI_PROBE_TIMEOUT, fespi_txwm_wait(), fespi_wip(), init_reg_param(), is_riscv(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, MIN, NULL, offset, flash_device::pagesize, PARAM_IN_OUT, PARAM_OUT, flash_device::pprog_cmd, riscv32_bin, riscv64_bin, riscv_info(), riscv_xlen(), flash_device::size_in_bytes, slow_fespi_write_buffer(), SPIFLASH_DEF_PAGESIZE, target::state, TARGET_ADDR_FMT, target_alloc_working_area(), target_free_working_area(), target_get_working_area_avail(), TARGET_HALTED, TARGET_PRIxADDR, target_run_algorithm(), target_write_buffer(), reg_param::value, and riscv_info::xlen.
|
static |
Definition at line 174 of file fespi.c.
References bank, fespi_flash_bank::ctrl_base, ERROR_OK, LOG_ERROR, TARGET_ADDR_FMT, and target_write_u32().
Referenced by fespi_disable_hw_mode(), fespi_enable_hw_mode(), fespi_erase(), fespi_erase_sector(), fespi_probe(), fespi_read_flash_id(), fespi_set_dir(), fespi_tx(), fespi_wip(), and slow_fespi_write_buffer().
FLASH_BANK_COMMAND_HANDLER | ( | fespi_flash_bank_command | ) |
Definition at line 133 of file fespi.c.
References bank, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ADDRESS, fespi_flash_bank::ctrl_base, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, fespi_flash_bank::probed, and TARGET_ADDR_FMT.
|
static |
|
static |
Definition at line 429 of file fespi.c.
References bank, buffer, fespi_flash_bank::dev, ERROR_FAIL, ERROR_OK, FESPI_CSMODE_AUTO, FESPI_CSMODE_HOLD, FESPI_REG_CSMODE, fespi_tx(), fespi_txwm_wait(), fespi_write_reg(), keep_alive(), offset, flash_device::pprog_cmd, and SPIFLASH_WRITE_ENABLE.
Referenced by fespi_write().
const struct flash_driver fespi_flash |
|
static |
|
static |
|
static |