OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | sh_qspi_flash_bank |
struct | sh_qspi_target |
Macros | |
#define | SH_QSPI_DUMMY0 0x0f |
#define | SH_QSPI_DUMMY1 0x19 |
#define | SH_QSPI_SPBDCR 0x1a |
#define | SH_QSPI_SPBFCR 0x18 |
#define | SH_QSPI_SPBMUL0 0x1c |
#define | SH_QSPI_SPBMUL1 0x20 |
#define | SH_QSPI_SPBMUL2 0x24 |
#define | SH_QSPI_SPBMUL3 0x28 |
#define | SH_QSPI_SPBR 0x0a |
#define | SH_QSPI_SPCKD 0x0c |
#define | SH_QSPI_SPCMD0 0x10 |
#define | SH_QSPI_SPCMD1 0x12 |
#define | SH_QSPI_SPCMD2 0x14 |
#define | SH_QSPI_SPCMD3 0x16 |
#define | SH_QSPI_SPCR 0x00 |
#define | SH_QSPI_SPDCR 0x0b |
#define | SH_QSPI_SPDR 0x04 |
#define | SH_QSPI_SPND 0x0e |
#define | SH_QSPI_SPPCR 0x02 |
#define | SH_QSPI_SPSCR 0x08 |
#define | SH_QSPI_SPSR 0x03 |
#define | SH_QSPI_SPSSR 0x09 |
#define | SH_QSPI_SSLND 0x0d |
#define | SH_QSPI_SSLP 0x01 |
#define | SPBDCR_RXBC0 BIT(0) |
#define | SPBFCR_RXRST BIT(6) |
#define | SPBFCR_RXTRG 0x07 |
#define | SPBFCR_TXRST BIT(7) |
#define | SPBFCR_TXTRG 0x30 |
#define | SPCMD_BRDV0 BIT(2) |
#define | SPCMD_INIT1 |
#define | SPCMD_INIT2 |
#define | SPCMD_SCKDEN BIT(15) |
#define | SPCMD_SLNDEN BIT(14) |
#define | SPCMD_SPNDEN BIT(13) |
#define | SPCMD_SSLKP BIT(7) |
#define | SPCR_MSTR 0x08 |
#define | SPCR_SPE 0x40 |
#define | SPPCR_IO1FV 0x01 |
#define | SPPCR_IO2FV 0x02 |
#define | SPPCR_IO3FV 0x04 |
#define | SPSR_SPRFF 0x80 |
#define | SPSR_SPTEF 0x20 |
Functions | |
FLASH_BANK_COMMAND_HANDLER (sh_qspi_flash_bank_command) | |
static int | read_flash_id (struct flash_bank *bank, uint32_t *id) |
static int | read_status_reg (struct flash_bank *bank, uint32_t *status) |
static int | sh_qspi_auto_probe (struct flash_bank *bank) |
static int | sh_qspi_cs_activate (struct flash_bank *bank) |
static int | sh_qspi_cs_deactivate (struct flash_bank *bank) |
static int | sh_qspi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | sh_qspi_erase_sector (struct flash_bank *bank, int sector) |
static int | sh_qspi_flash_blank_check (struct flash_bank *bank) |
static int | sh_qspi_get_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | sh_qspi_init (struct flash_bank *bank) |
static int | sh_qspi_probe (struct flash_bank *bank) |
static int | sh_qspi_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | sh_qspi_protect_check (struct flash_bank *bank) |
static int | sh_qspi_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | sh_qspi_upload_helper (struct flash_bank *bank) |
static int | sh_qspi_wait_for_bit (struct flash_bank *bank, uint8_t reg, uint32_t mask, bool set, unsigned long timeout) |
static int | sh_qspi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | sh_qspi_write_enable (struct flash_bank *bank) |
static int | sh_qspi_xfer_common (struct flash_bank *bank, const uint8_t *dout, unsigned int outlen, uint8_t *din, unsigned int inlen, bool xfer_start, bool xfer_end) |
static int | wait_till_ready (struct flash_bank *bank, int timeout) |
Variables | |
const struct flash_driver | sh_qspi_flash |
static const struct sh_qspi_target | target_devices [] |
#define SPCMD_INIT1 |
#define SPCMD_INIT2 |
FLASH_BANK_COMMAND_HANDLER | ( | sh_qspi_flash_bank_command | ) |
|
static |
Definition at line 661 of file sh_qspi.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, sh_qspi_xfer_common(), SPIFLASH_READ_ID, target::state, and TARGET_HALTED.
Referenced by sh_qspi_probe().
|
static |
Definition at line 374 of file sh_qspi.c.
References bank, ERROR_OK, sh_qspi_xfer_common(), SPIFLASH_READ_STATUS, and status.
Referenced by wait_till_ready().
|
static |
|
static |
Definition at line 191 of file sh_qspi.c.
References bank, ERROR_OK, info, SH_QSPI_SPBFCR, SH_QSPI_SPCMD0, SH_QSPI_SPCR, SH_QSPI_SPSCR, SPBFCR_RXRST, SPBFCR_TXRST, SPCMD_INIT1, SPCR_MSTR, SPCR_SPE, target_read_u8(), target_write_u16(), and target_write_u8().
Referenced by sh_qspi_xfer_common().
|
static |
Definition at line 246 of file sh_qspi.c.
References bank, ERROR_OK, info, SH_QSPI_SPCR, SPCR_SPE, target_read_u8(), and target_write_u8().
Referenced by sh_qspi_xfer_common().
|
static |
Definition at line 441 of file sh_qspi.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, info, keep_alive(), LOG_DEBUG, LOG_ERROR, sh_qspi_erase_sector(), target::state, and TARGET_HALTED.
|
static |
Definition at line 413 of file sh_qspi.c.
References bank, ERROR_OK, info, NULL, sh_qspi_write_enable(), sh_qspi_xfer_common(), and wait_till_ready().
Referenced by sh_qspi_erase().
|
static |
|
static |
|
static |
Definition at line 99 of file sh_qspi.c.
References bank, ERROR_OK, info, SH_QSPI_SPBFCR, SH_QSPI_SPBR, SH_QSPI_SPCKD, SH_QSPI_SPCMD0, SH_QSPI_SPCR, SH_QSPI_SPDCR, SH_QSPI_SPND, SH_QSPI_SPPCR, SH_QSPI_SPSCR, SH_QSPI_SSLND, SH_QSPI_SSLP, SPBFCR_RXRST, SPBFCR_TXRST, SPCMD_INIT2, SPCR_MSTR, SPCR_SPE, SPPCR_IO2FV, SPPCR_IO3FV, target_read_u8(), target_write_u16(), and target_write_u8().
Referenced by sh_qspi_probe().
|
static |
Definition at line 749 of file sh_qspi.c.
References bank, ERROR_FAIL, ERROR_OK, flash_devices, jtag_tap::idcode, info, sh_qspi_target::io_base, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_WARNING, sh_qspi_target::name, flash_device::name, NULL, flash_sector::offset, read_flash_id(), sh_qspi_init(), sh_qspi_upload_helper(), flash_sector::size, target::tap, sh_qspi_target::tap_idcode, TARGET_ADDR_FMT, and target_devices.
Referenced by sh_qspi_auto_probe().
|
static |
|
static |
|
static |
Definition at line 589 of file sh_qspi.c.
References ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_STATE_ARM, bank, buf_set_u32(), buffer, arm_algorithm::common_magic, arm_algorithm::core_mode, arm_algorithm::core_state, count, destroy_reg_param(), ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, info, init_reg_param(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, offset, PARAM_OUT, target::state, TARGET_HALTED, target_read_buffer(), and target_run_algorithm().
|
static |
Definition at line 696 of file sh_qspi.c.
References bank, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, info, LOG_WARNING, target_alloc_working_area(), target_alloc_working_area_try(), target_free_working_area(), and target_write_buffer().
Referenced by sh_qspi_probe().
|
static |
Definition at line 263 of file sh_qspi.c.
References alive_sleep(), bank, ERROR_OK, ERROR_TIMEOUT_REACHED, info, LOG_ERROR, mask, target_read_u8(), and timeval_ms().
Referenced by sh_qspi_xfer_common().
|
static |
Definition at line 485 of file sh_qspi.c.
References ARM_COMMON_MAGIC, ARM_MODE_SVC, ARM_STATE_ARM, bank, buf_set_u32(), buffer, arm_algorithm::common_magic, arm_algorithm::core_mode, arm_algorithm::core_state, count, destroy_reg_param(), ERROR_FAIL, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, info, init_reg_param(), flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_WARNING, NULL, flash_sector::offset, offset, PARAM_OUT, flash_sector::size, target::state, TARGET_HALTED, target_run_algorithm(), and target_write_buffer().
|
static |
Definition at line 366 of file sh_qspi.c.
References bank, NULL, sh_qspi_xfer_common(), and SPIFLASH_WRITE_ENABLE.
Referenced by sh_qspi_erase_sector().
|
static |
Definition at line 292 of file sh_qspi.c.
References bank, ERROR_OK, info, sh_qspi_cs_activate(), sh_qspi_cs_deactivate(), SH_QSPI_SPBFCR, SH_QSPI_SPBMUL0, SH_QSPI_SPDR, SH_QSPI_SPSR, sh_qspi_wait_for_bit(), SPBFCR_RXTRG, SPBFCR_TXTRG, SPSR_SPRFF, SPSR_SPTEF, target_read_u8(), target_write_u32(), and target_write_u8().
Referenced by read_flash_id(), read_status_reg(), sh_qspi_erase_sector(), and sh_qspi_write_enable().
|
static |
Definition at line 391 of file sh_qspi.c.
References alive_sleep(), bank, ERROR_OK, ERROR_TIMEOUT_REACHED, LOG_ERROR, read_status_reg(), SPIFLASH_BSY_BIT, status, and timeval_ms().
Referenced by sh_qspi_erase_sector().
const struct flash_driver sh_qspi_flash |
|
static |