|
OpenOCD
|

Go to the source code of this file.
Data Structures | |
| struct | max32xxx_qspi_flash_bank |
Functions | |
| COMMAND_HANDLER (max32xxx_qspi_handle_mass_erase_command) | |
| COMMAND_HANDLER (max32xxx_qspi_handle_mem_mapping_setup_command) | |
| FLASH_BANK_COMMAND_HANDLER (max32xxx_qspi_flash_bank_command) | |
| static int | get_max32xxx_qspi_info (struct flash_bank *bank, struct command_invocation *cmd) |
| static int | max32xxx_qspi_auto_probe (struct flash_bank *bank) |
| static int | max32xxx_qspi_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
| static int | max32xxx_qspi_poll_we (struct target *target) |
| static int | max32xxx_qspi_poll_wip (struct target *target, unsigned int timeout) |
| static int | max32xxx_qspi_post_op (struct flash_bank *bank) |
| static int | max32xxx_qspi_pre_op (struct flash_bank *bank) |
| static int | max32xxx_qspi_probe (struct flash_bank *bank) |
| static int | max32xxx_qspi_read_bytes (struct target *target, uint8_t *data, unsigned int len, bool deass) |
| static int | max32xxx_qspi_read_rxfifo (struct target *target, uint8_t *data, unsigned int len) |
| static int | max32xxx_qspi_read_words (struct target *target, uint32_t *data, unsigned int len, bool deass) |
| static int | max32xxx_qspi_set_we (struct target *target) |
| static int | max32xxx_qspi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
| static int | max32xxx_qspi_write_block (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t len) |
| static int | max32xxx_qspi_write_bytes (struct target *target, const uint8_t *data, unsigned int len, bool deass) |
| static int | max32xxx_qspi_write_txfifo (struct target *target, const uint8_t *data, unsigned int len) |
| static int | read_sfdp_block (struct flash_bank *bank, uint32_t addr, uint32_t words, uint32_t *buffer) |
Variables | |
| static const struct command_registration | max32xxx_qspi_command_handlers [] |
| static const struct command_registration | max32xxx_qspi_exec_command_handlers [] |
| const struct flash_driver | max32xxx_qspi_flash |
| static const uint8_t | write_code [] |
| #define GCR_BASE 0x40000000 |
Definition at line 56 of file max32xxx_qspi.c.
| #define GCR_RST1 (GCR_BASE | 0x44) |
Definition at line 58 of file max32xxx_qspi.c.
| #define GCR_RST1_SPIXIP (0x1 << 5) |
Definition at line 60 of file max32xxx_qspi.c.
| #define GCR_RST1_XSPIM (0x1 << 4) |
Definition at line 59 of file max32xxx_qspi.c.
| #define GCR_SCON (GCR_BASE | 0x00) |
Definition at line 57 of file max32xxx_qspi.c.
| #define MAX32XXX_QSPI_ERASE_TIMEOUT_MS 10000 |
Definition at line 67 of file max32xxx_qspi.c.
| #define MAX32XXX_QSPI_FIFO_TIMEOUT_MS 100 |
Definition at line 69 of file max32xxx_qspi.c.
| #define MAX32XXX_QSPI_MASS_ERASE_TIMEOUT_MS 100000 |
Definition at line 66 of file max32xxx_qspi.c.
| #define MAX32XXX_QSPI_WE_TIMEOUT_MS 100 |
Definition at line 68 of file max32xxx_qspi.c.
| #define SPI_CLOCK_PERIOD 2 |
Definition at line 63 of file max32xxx_qspi.c.
| #define SPI_DUAL_MODE 0 |
Definition at line 73 of file max32xxx_qspi.c.
| #define SPI_ICC_BASE 0x4002F000 |
Definition at line 47 of file max32xxx_qspi.c.
| #define SPI_ICC_CTRL (SPI_ICC_BASE | 0x100) |
Definition at line 48 of file max32xxx_qspi.c.
| #define SPI_ICC_CTRL_EN (0x1UL << SPI_ICC_CTRL_EN_POS) |
Definition at line 52 of file max32xxx_qspi.c.
| #define SPI_ICC_CTRL_EN_POS 0 |
Definition at line 51 of file max32xxx_qspi.c.
| #define SPI_ICC_CTRL_RDY (0x1UL << SPI_ICC_CTRL_RDY_POS) |
Definition at line 54 of file max32xxx_qspi.c.
| #define SPI_ICC_CTRL_RDY_POS 16 |
Definition at line 53 of file max32xxx_qspi.c.
| #define SPI_ICC_INV (SPI_ICC_BASE | 0x700) |
Definition at line 49 of file max32xxx_qspi.c.
| #define SPIXF_BASE 0x40026000 |
Definition at line 34 of file max32xxx_qspi.c.
| #define SPIXF_BUS_IDLE (SPIXF_BASE | 0x24) |
Definition at line 42 of file max32xxx_qspi.c.
| #define SPIXF_CFG (SPIXF_BASE | 0x00) |
Definition at line 35 of file max32xxx_qspi.c.
| #define SPIXF_FETCH_CTRL (SPIXF_BASE | 0x04) |
Definition at line 36 of file max32xxx_qspi.c.
| #define SPIXF_IO_CTRL (SPIXF_BASE | 0x1C) |
Definition at line 40 of file max32xxx_qspi.c.
| #define SPIXF_MEMSECCN (SPIXF_BASE | 0x20) |
Definition at line 41 of file max32xxx_qspi.c.
| #define SPIXF_MEMSECCN_AUTH_DISABLE 0x2 |
Definition at line 45 of file max32xxx_qspi.c.
| #define SPIXF_MEMSECCN_ENC_ENABLE 0x1 |
Definition at line 44 of file max32xxx_qspi.c.
| #define SPIXF_MODE_CTRL (SPIXF_BASE | 0x08) |
Definition at line 37 of file max32xxx_qspi.c.
| #define SPIXF_MODE_DATA (SPIXF_BASE | 0x0C) |
Definition at line 38 of file max32xxx_qspi.c.
| #define SPIXF_SCLK_FB_CTRL (SPIXF_BASE | 0x10) |
Definition at line 39 of file max32xxx_qspi.c.
| #define SPIXFC_FIFO_DEPTH 16 |
Definition at line 30 of file max32xxx_qspi.c.
| #define SPIXFC_HEADER_NULL 0xF000 |
Definition at line 32 of file max32xxx_qspi.c.
| COMMAND_HANDLER | ( | max32xxx_qspi_handle_mass_erase_command | ) |
Definition at line 1038 of file max32xxx_qspi.c.
References bank, CALL_COMMAND_HANDLER, flash_device::chip_erase_cmd, CMD_ARGC, max32xxx_qspi_flash_bank::dev, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPER_UNSUPPORTED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, MAX32XXX_QSPI_MASS_ERASE_TIMEOUT_MS, max32xxx_qspi_poll_wip(), max32xxx_qspi_post_op(), max32xxx_qspi_pre_op(), max32xxx_qspi_set_we(), max32xxx_qspi_write_bytes(), max32xxx_qspi_flash_bank::probed, target::state, and TARGET_HALTED.
| COMMAND_HANDLER | ( | max32xxx_qspi_handle_mem_mapping_setup_command | ) |
Definition at line 1026 of file max32xxx_qspi.c.
References bank, CALL_COMMAND_HANDLER, ERROR_OK, and max32xxx_qspi_post_op().
| FLASH_BANK_COMMAND_HANDLER | ( | max32xxx_qspi_flash_bank_command | ) |
Definition at line 87 of file max32xxx_qspi.c.
References bank, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, info, LOG_DEBUG, and LOG_ERROR.
|
static |
Definition at line 1098 of file max32xxx_qspi.c.
References bank, flash_device::chip_erase_cmd, cmd, command_print_sameline(), max32xxx_qspi_flash_bank::dev, flash_device::device_id, flash_device::dread_cmd, flash_device::dread_dclk, flash_device::dread_mode, flash_device::erase_cmd, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, flash_device::name, flash_device::pagesize, flash_device::pprog_cmd, max32xxx_qspi_flash_bank::probed, flash_device::qread_cmd, flash_device::read_cmd, flash_device::sectorsize, and flash_device::size_in_bytes.
|
static |
Definition at line 1017 of file max32xxx_qspi.c.
References bank, ERROR_OK, max32xxx_qspi_probe(), and max32xxx_qspi_flash_bank::probed.
|
static |
Definition at line 555 of file max32xxx_qspi.c.
References addr, bank, max32xxx_qspi_flash_bank::dev, flash_device::erase_cmd, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, MAX32XXX_QSPI_ERASE_TIMEOUT_MS, max32xxx_qspi_poll_wip(), max32xxx_qspi_post_op(), max32xxx_qspi_pre_op(), max32xxx_qspi_set_we(), max32xxx_qspi_write_bytes(), target::state, and TARGET_HALTED.
Referenced by max32xxx_qspi_write().
|
static |
Definition at line 507 of file max32xxx_qspi.c.
References ERROR_OK, ERROR_TIMEOUT_REACHED, keep_alive(), LOG_ERROR, max32xxx_qspi_read_bytes(), MAX32XXX_QSPI_WE_TIMEOUT_MS, max32xxx_qspi_write_bytes(), SPIFLASH_READ_STATUS, SPIFLASH_WE_BIT, and timeval_ms().
Referenced by max32xxx_qspi_set_we().
|
static |
Definition at line 475 of file max32xxx_qspi.c.
References ERROR_OK, ERROR_TIMEOUT_REACHED, keep_alive(), LOG_ERROR, max32xxx_qspi_read_bytes(), max32xxx_qspi_write_bytes(), SPIFLASH_BSY_BIT, SPIFLASH_READ_STATUS, and timeval_ms().
Referenced by COMMAND_HANDLER(), and max32xxx_qspi_erase().
|
static |
Definition at line 129 of file max32xxx_qspi.c.
References bank, max32xxx_qspi_flash_bank::dev, flash_device::dread_cmd, flash_device::dread_dclk, flash_device::dread_mode, ERROR_OK, GCR_RST1, GCR_RST1_SPIXIP, GCR_RST1_XSPIM, GCR_SCON, LOG_DEBUG, max32xxx_qspi_flash_bank::options, OPTIONS_AUTH, OPTIONS_ENC, flash_device::read_cmd, SPI_CLOCK_PERIOD, SPI_DUAL_MODE, SPI_ICC_CTRL, SPI_ICC_CTRL_EN, SPI_ICC_CTRL_RDY, SPI_ICC_INV, SPIXF_BUS_IDLE, SPIXF_CFG, SPIXF_FETCH_CTRL, SPIXF_MEMSECCN, SPIXF_MEMSECCN_AUTH_DISABLE, SPIXF_MEMSECCN_ENC_ENABLE, SPIXF_MODE_CTRL, SPIXF_SCLK_FB_CTRL, SPIXFC_GEN_CTRL, target_read_u32(), and target_write_u32().
Referenced by COMMAND_HANDLER(), max32xxx_qspi_erase(), max32xxx_qspi_probe(), and max32xxx_qspi_write().
|
static |
Definition at line 113 of file max32xxx_qspi.c.
References bank, ERROR_OK, SPI_CLOCK_PERIOD, SPIXFC_CFG, SPIXFC_GEN_CTRL, and target_write_u32().
Referenced by COMMAND_HANDLER(), max32xxx_qspi_erase(), max32xxx_qspi_probe(), and max32xxx_qspi_write().
|
static |
Definition at line 875 of file max32xxx_qspi.c.
References bank, cmd, max32xxx_qspi_flash_bank::dev, flash_device::device_id, ERROR_FAIL, ERROR_OK, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_INFO, max32xxx_qspi_post_op(), max32xxx_qspi_pre_op(), max32xxx_qspi_read_bytes(), max32xxx_qspi_write_bytes(), flash_device::name, NULL, flash_sector::offset, max32xxx_qspi_flash_bank::options, OPTIONS_AUTH, max32xxx_qspi_flash_bank::probed, read_sfdp_block(), flash_device::sectorsize, flash_sector::size, flash_device::size_in_bytes, spi_sfdp(), SPIFLASH_READ_ID, SPIXF_BUS_IDLE, SPIXF_CFG, SPIXF_FETCH_CTRL, SPIXF_IO_CTRL, SPIXF_MEMSECCN, SPIXF_MODE_CTRL, SPIXF_MODE_DATA, SPIXF_SCLK_FB_CTRL, SPIXFC_CFG, SPIXFC_FIFO_CTRL, SPIXFC_GEN_CTRL, SPIXFC_SS_POL, and target_read_u32().
Referenced by max32xxx_qspi_auto_probe().
|
static |
Definition at line 383 of file max32xxx_qspi.c.
References ERROR_OK, max32xxx_qspi_read_rxfifo(), max32xxx_qspi_write_txfifo(), SPIXFC_HEADER_BYTE, SPIXFC_HEADER_RX, SPIXFC_HEADER_SIZE_POS, and SPIXFC_HEADER_SS_DEASS.
Referenced by max32xxx_qspi_poll_we(), max32xxx_qspi_poll_wip(), and max32xxx_qspi_probe().
|
static |
Definition at line 300 of file max32xxx_qspi.c.
References ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, keep_alive(), MAX32XXX_QSPI_FIFO_TIMEOUT_MS, SPIXFC_FIFO_CTRL, SPIXFC_FIFO_CTRL_RX_FIFO_CNT, SPIXFC_FIFO_CTRL_RX_FIFO_CNT_POS, SPIXFC_FIFO_RX, target_read_u32(), target_read_u8(), and timeval_ms().
Referenced by max32xxx_qspi_read_bytes(), and max32xxx_qspi_read_words().
|
static |
Definition at line 424 of file max32xxx_qspi.c.
References ERROR_OK, max32xxx_qspi_read_rxfifo(), max32xxx_qspi_write_txfifo(), SPIXFC_CFG, SPIXFC_CONFIG_PAGE_SIZE, SPIXFC_CONFIG_PAGE_SIZE_4_BYTES, SPIXFC_HEADER_PAGE, SPIXFC_HEADER_RX, SPIXFC_HEADER_SIZE_POS, SPIXFC_HEADER_SS_DEASS, target_read_u32(), and target_write_u32().
Referenced by read_sfdp_block().
|
static |
Definition at line 541 of file max32xxx_qspi.c.
References ERROR_OK, LOG_ERROR, max32xxx_qspi_poll_we(), max32xxx_qspi_write_bytes(), and SPIFLASH_WRITE_ENABLE.
Referenced by COMMAND_HANDLER(), max32xxx_qspi_erase(), and max32xxx_qspi_write().
|
static |
Definition at line 725 of file max32xxx_qspi.c.
References bank, buffer, count, max32xxx_qspi_flash_bank::dev, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_OK, ERROR_TARGET_NOT_HALTED, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, LOG_WARNING, max32xxx_qspi_erase(), max32xxx_qspi_post_op(), max32xxx_qspi_pre_op(), max32xxx_qspi_set_we(), max32xxx_qspi_write_block(), max32xxx_qspi_write_bytes(), offset, max32xxx_qspi_flash_bank::options, OPTIONS_AUTH, OPTIONS_ENC, flash_device::pprog_cmd, flash_device::sectorsize, SPI_WRITE_BOUNDARY, target::state, and TARGET_HALTED.
|
static |
Definition at line 620 of file max32xxx_qspi.c.
References working_area::address, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, ARRAY_SIZE, bank, buf_set_u32(), buffer, buffer_size, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), max32xxx_qspi_flash_bank::dev, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_mem_param(), init_reg_param(), LOG_DEBUG, LOG_ERROR, LOG_WARNING, offset, max32xxx_qspi_flash_bank::options, PARAM_OUT, flash_device::pprog_cmd, source, SPIX_ALGO_OPTIONS_OFFSET, SPIX_ALGO_SPI_WRITE_CMD_OFFSET, SPIX_ALGO_TAIL_SIZE, TARGET_ADDR_FMT, target_alloc_working_area(), target_free_working_area(), target_get_working_area_avail(), target_run_flash_async_algorithm(), target_write_buffer(), reg_param::value, and write_code.
Referenced by max32xxx_qspi_write().
|
static |
Definition at line 343 of file max32xxx_qspi.c.
References ERROR_OK, max32xxx_qspi_write_txfifo(), SPIXFC_HEADER_BYTE, SPIXFC_HEADER_SIZE_POS, SPIXFC_HEADER_SS_DEASS, and SPIXFC_HEADER_TX.
Referenced by COMMAND_HANDLER(), max32xxx_qspi_erase(), max32xxx_qspi_poll_we(), max32xxx_qspi_poll_wip(), max32xxx_qspi_probe(), max32xxx_qspi_set_we(), max32xxx_qspi_write(), and read_sfdp_block().
|
static |
Definition at line 248 of file max32xxx_qspi.c.
References ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, keep_alive(), MAX32XXX_QSPI_FIFO_TIMEOUT_MS, SPIXFC_FIFO_CTRL, SPIXFC_FIFO_CTRL_TX_FIFO_CNT, SPIXFC_FIFO_CTRL_TX_FIFO_CNT_POS, SPIXFC_FIFO_DEPTH, SPIXFC_FIFO_TX, SPIXFC_HEADER_NULL, target_read_u32(), target_write_u16(), timeval_ms(), and write_data().
Referenced by max32xxx_qspi_read_bytes(), max32xxx_qspi_read_words(), and max32xxx_qspi_write_bytes().
|
static |
Definition at line 848 of file max32xxx_qspi.c.
References addr, bank, buffer, ERROR_OK, max32xxx_qspi_read_words(), max32xxx_qspi_write_bytes(), and SPIFLASH_READ_SFDP.
Referenced by max32xxx_qspi_probe(), and spi_sfdp().
|
static |
Definition at line 1098 of file max32xxx_qspi.c.
|
static |
Definition at line 1098 of file max32xxx_qspi.c.
| const struct flash_driver max32xxx_qspi_flash |
Definition at line 1098 of file max32xxx_qspi.c.
|
static |
Definition at line 76 of file max32xxx_qspi.c.
Referenced by max32xxx_qspi_write_block(), max32xxx_write_block(), and xmc1xxx_write().