OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | rp2xxx_flash_bank |
struct | rp2xxx_rom_call_batch_record |
Functions | |
static void | cleanup_after_raw_flash_cmd (struct target *target, struct rp2xxx_flash_bank *priv) |
COMMAND_HANDLER (rp2xxx_rom_api_call_handler) | |
COMMAND_HANDLER (rp2xxx_switch_target_handler) | |
FLASH_BANK_COMMAND_HANDLER (rp2xxx_flash_bank_command) | |
static int | rp2040_lookup_rom_symbol (struct target *target, uint16_t tag, uint16_t flags, uint16_t *symbol_out) |
static int | rp2040_spi_tx_rx (struct target *target, const uint8_t *tx, unsigned int tx_len, unsigned int dummy_len, uint8_t *rx, unsigned int rx_len) |
static int | rp2040_ssel_active (struct target *target, bool active) |
static int | rp2350_a0_lookup_symbol (struct target *target, uint16_t tag, uint16_t flags, uint16_t *symbol_out) |
static int | rp2350_init_accessctrl (struct target *target) |
static int | rp2350_init_arm_core0 (struct target *target, struct rp2xxx_flash_bank *priv) |
static int | rp2350_lookup_rom_symbol (struct target *target, uint32_t ptr_to_entry, uint16_t tag, uint16_t flags, uint16_t *symbol_out) |
static int | rp2350_spi_tx_rx (struct target *target, const uint8_t *tx, unsigned int tx_len, unsigned int dummy_len, uint8_t *rx, unsigned int rx_len) |
static int | rp2xxx_call_rom_func (struct target *target, struct rp2xxx_flash_bank *priv, uint16_t func_offset, uint32_t argdata[], unsigned int n_args) |
static int | rp2xxx_call_rom_func_batch (struct target *target, struct rp2xxx_flash_bank *priv, struct rp2xxx_rom_call_batch_record *calls, unsigned int n_calls) |
static int | rp2xxx_flash_auto_probe (struct flash_bank *bank) |
static int | rp2xxx_flash_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | rp2xxx_flash_probe (struct flash_bank *bank) |
static int | rp2xxx_flash_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | rp2xxx_invalidate_cache_restore_xip (struct target *target, struct rp2xxx_flash_bank *priv) |
static int | rp2xxx_lookup_rom_symbol (struct target *target, uint16_t tag, uint16_t flags, uint16_t *symbol_out) |
static int | rp2xxx_populate_rom_pointer_cache (struct target *target, struct rp2xxx_flash_bank *priv) |
static int | rp2xxx_read_sfdp_block (struct flash_bank *bank, uint32_t addr, unsigned int words, uint32_t *buffer) |
static int | rp2xxx_spi_tx_rx (struct flash_bank *bank, const uint8_t *tx, unsigned int tx_len, unsigned int dummy_len, uint8_t *rx, unsigned int rx_len) |
static int | setup_for_raw_flash_cmd (struct target *target, struct rp2xxx_flash_bank *priv) |
Variables | |
static const uint8_t | rcp_init_code [] |
static const int | rcp_init_code_bkpt_offset = 24 |
static const struct command_registration | rp2xxx_command_handler [] |
static const struct command_registration | rp2xxx_exec_command_handlers [] |
const struct flash_driver | rp2xxx_flash |
static const uint8_t | rp2xxx_rom_call_batch_algo_armv6m [ROM_CALL_BATCH_ALGO_SIZE_BYTES] |
static const uint8_t | rp2xxx_rom_call_batch_algo_armv8m [ROM_CALL_BATCH_ALGO_SIZE_BYTES] |
static const int | rp2xxx_rom_call_batch_algo_bkpt_offset = ROM_CALL_BATCH_ALGO_SIZE_BYTES - 2 |
static const uint8_t | rp2xxx_rom_call_batch_algo_riscv [ROM_CALL_BATCH_ALGO_SIZE_BYTES] |
#define IS_RP2040 | ( | id | ) | (RP2XXX_CHIP_ID_PART_MANUFACTURER(id) == RP2XXX_MK_PART(RP2040_CHIP_ID_PART)) |
#define IS_RP2350 | ( | id | ) | (RP2XXX_CHIP_ID_PART_MANUFACTURER(id) == RP2XXX_MK_PART(RP2350_CHIP_ID_PART)) |
#define RP2XXX_MK_PART | ( | part | ) | (((part) << 12) | (RP2XXX_CHIP_ID_MANUFACTURER << 1) | 1) |
|
static |
Definition at line 836 of file rp2xxx.c.
References LOG_DEBUG, priv, and target_free_working_area().
Referenced by COMMAND_HANDLER(), rp2xxx_flash_erase(), rp2xxx_flash_probe(), and rp2xxx_flash_write().
COMMAND_HANDLER | ( | rp2xxx_rom_api_call_handler | ) |
Definition at line 1298 of file rp2xxx.c.
References ARRAY_SIZE, bank, cleanup_after_raw_flash_cmd(), CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, flash_bank_list(), get_current_target(), is_arm(), LOG_INFO, MAKE_TAG, priv, rp2xxx_call_rom_func(), rp2xxx_flash, rp2xxx_flash_auto_probe(), rp2xxx_lookup_rom_symbol(), RT_FLAG_FUNC_ARM_SEC, RT_FLAG_FUNC_RISCV, setup_for_raw_flash_cmd(), target::state, TARGET_HALTED, target_name(), and target_to_arm().
COMMAND_HANDLER | ( | rp2xxx_switch_target_handler | ) |
Definition at line 1366 of file rp2xxx.c.
References bank, CMD, CMD_ARGC, CMD_ARGV, command_print(), ERROR_COMMAND_ARGUMENT_INVALID, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, flash_bank_list(), get_target(), priv, and rp2xxx_flash.
FLASH_BANK_COMMAND_HANDLER | ( | rp2xxx_flash_bank_command | ) |
|
static |
Definition at line 218 of file rp2xxx.c.
References BOOTROM_MAGIC_ADDR, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_ROM_SYMBOL_DEBUG, RT_FLAG_DATA, RT_FLAG_FUNC_ARM_SEC, and target_read_u16().
Referenced by rp2xxx_lookup_rom_symbol().
|
static |
Definition at line 1014 of file rp2xxx.c.
References dr, ERROR_OK, LOG_ERROR, rp2040_ssel_active(), RP2040_SSI_DR0, target_read_u32(), and target_write_u32().
Referenced by rp2xxx_spi_tx_rx().
|
static |
Definition at line 996 of file rp2xxx.c.
References ERROR_OK, RP2040_QSPI_CTRL, RP2040_QSPI_CTRL_OUTOVER_HIGH, RP2040_QSPI_CTRL_OUTOVER_LOW, RP2040_QSPI_CTRL_OUTOVER_MASK, state, target_read_u32(), and target_write_u32().
Referenced by rp2040_spi_tx_rx().
|
static |
Definition at line 255 of file rp2xxx.c.
References BOOTROM_MAGIC_ADDR, ERROR_FAIL, ERROR_OK, LOG_ROM_SYMBOL_DEBUG, LOG_WARNING, RT_FLAG_FUNC_ARM_SEC, RT_FLAG_FUNC_RISCV, and target_read_u16().
Referenced by rp2xxx_lookup_rom_symbol().
|
static |
Definition at line 602 of file rp2xxx.c.
References ACCESSCTRL_CFGRESET_OFFSET, ACCESSCTRL_LOCK_DEBUG_BITS, ACCESSCTRL_LOCK_OFFSET, ACCESSCTRL_WRITE_PASSWORD, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, target_read_u32(), and target_write_u32().
Referenced by setup_for_raw_flash_cmd().
|
static |
Definition at line 627 of file rp2xxx.c.
References ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, DCB_DSCSR, DSCSR_CDS, DSCSR_CDSKEY, ERROR_BUF_TOO_SMALL, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, LOG_TARGET_DEBUG, NULL, priv, rcp_init_code, rcp_init_code_bkpt_offset, TARGET_ADDR_FMT, target_read_u32(), target_run_algorithm(), target_write_memory(), and target_write_u32().
Referenced by setup_for_raw_flash_cmd().
|
static |
Definition at line 300 of file rp2xxx.c.
References ERROR_FAIL, ERROR_OK, LOG_ROM_SYMBOL_DEBUG, RT_FLAG_FUNC_RISCV, and target_read_u16().
Referenced by rp2xxx_lookup_rom_symbol().
|
static |
Definition at line 1065 of file rp2xxx.c.
References dr, ERROR_OK, LOG_ERROR, RP2350_QMI_DIRECT_CSR, RP2350_QMI_DIRECT_CSR_ASSERT_CS0N, RP2350_QMI_DIRECT_CSR_EN, RP2350_QMI_DIRECT_RX, RP2350_QMI_DIRECT_TX, RP2350_QMI_DIRECT_TX_NOPUSH, RP2350_QMI_DIRECT_TX_OE, target_read_u32(), and target_write_u32().
Referenced by rp2xxx_spi_tx_rx().
|
static |
Definition at line 581 of file rp2xxx.c.
References rp2xxx_rom_call_batch_record::args, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_ERROR, rp2xxx_rom_call_batch_record::pc, priv, and rp2xxx_call_rom_func_batch().
Referenced by COMMAND_HANDLER(), rp2xxx_flash_erase(), rp2xxx_flash_write(), and setup_for_raw_flash_cmd().
|
static |
Definition at line 471 of file rp2xxx.c.
References rp2xxx_rom_call_batch_record::args, ARM_ARCH_V8M, ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, ERROR_BUF_TOO_SMALL, ERROR_FAIL, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, is_arm(), LOG_DEBUG, LOG_ERROR, LOG_ROM_SYMBOL_DEBUG, LOG_TARGET_DEBUG, NULL, rp2xxx_rom_call_batch_record::pc, priv, ROM_CALL_BATCH_ALGO_SIZE_BYTES, rp2xxx_populate_rom_pointer_cache(), rp2xxx_rom_call_batch_algo_armv6m, rp2xxx_rom_call_batch_algo_armv8m, rp2xxx_rom_call_batch_algo_bkpt_offset, rp2xxx_rom_call_batch_algo_riscv, sp, target_buffer_set_u32(), target_buffer_set_u32_array(), target_run_algorithm(), target_to_arm(), and target_write_buffer().
Referenced by rp2xxx_call_rom_func(), rp2xxx_invalidate_cache_restore_xip(), and setup_for_raw_flash_cmd().
|
static |
Definition at line 1272 of file rp2xxx.c.
References bank, ERROR_OK, priv, and rp2xxx_flash_probe().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 920 of file rp2xxx.c.
References ARRAY_SIZE, bank, cleanup_after_raw_flash_cmd(), ERROR_OK, ERROR_TARGET_NOT_HALTED, keep_alive(), length, LOG_CUSTOM_LEVEL, LOG_DEBUG, LOG_ERROR, LOG_LVL_DEBUG, LOG_LVL_INFO, priv, rp2xxx_call_rom_func(), rp2xxx_invalidate_cache_restore_xip(), setup_for_raw_flash_cmd(), target::state, and TARGET_HALTED.
|
static |
Definition at line 1176 of file rp2xxx.c.
References alloc_block_array(), bank, cleanup_after_raw_flash_cmd(), cmd, ERROR_FAIL, ERROR_FLASH_BANK_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, flash_devices, IS_RP2040, IS_RP2350, le_to_h_u24(), LOG_DEBUG, LOG_ERROR, LOG_INFO, flash_device::name, priv, RP2XXX_CHIP_ID_REVISION, rp2xxx_populate_rom_pointer_cache(), rp2xxx_read_sfdp_block(), RP2XXX_ROM_API_FIXED_FLASH_PAGE, RP2XXX_ROM_API_FIXED_FLASH_SECTOR, rp2xxx_spi_tx_rx(), RP2XXX_SYSINFO_CHIP_ID, setup_for_raw_flash_cmd(), spi_sfdp(), SPIFLASH_READ_ID, target::state, TARGET_HALTED, and target_read_u32().
Referenced by rp2xxx_flash_auto_probe().
|
static |
Definition at line 853 of file rp2xxx.c.
References working_area::address, ARRAY_SIZE, bank, buffer, cleanup_after_raw_flash_cmd(), count, ERROR_OK, ERROR_TARGET_NOT_HALTED, keep_alive(), LOG_DEBUG, LOG_ERROR, MAX, MIN, NULL, offset, priv, rp2xxx_call_rom_func(), rp2xxx_invalidate_cache_restore_xip(), RP2XXX_ROM_API_FIXED_FLASH_PAGE, setup_for_raw_flash_cmd(), target::state, TARGET_ADDR_FMT, target_alloc_working_area(), target_free_working_area(), target_get_working_area_avail(), TARGET_HALTED, and target_write_buffer().
|
static |
Definition at line 800 of file rp2xxx.c.
References ERROR_OK, IS_RP2040, LOG_DEBUG, LOG_ERROR, rp2xxx_rom_call_batch_record::pc, priv, and rp2xxx_call_rom_func_batch().
Referenced by rp2xxx_flash_erase(), and rp2xxx_flash_write().
|
static |
Definition at line 364 of file rp2xxx.c.
References BOOTROM_MAGIC_ADDR, BOOTROM_MAGIC_MASK, BOOTROM_RP2040_MAGIC, BOOTROM_RP2350_MAGIC, ERROR_FAIL, ERROR_OK, LOG_ERROR, rp2040_lookup_rom_symbol(), rp2350_a0_lookup_symbol(), rp2350_lookup_rom_symbol(), target_read_u16(), and target_read_u32().
Referenced by COMMAND_HANDLER(), and rp2xxx_populate_rom_pointer_cache().
|
static |
Definition at line 394 of file rp2xxx.c.
References ERROR_OK, FUNC_BOOTROM_SET_STACK, FUNC_BOOTROM_STATE_RESET, FUNC_CONNECT_INTERNAL_FLASH, FUNC_FLASH_ENTER_CMD_XIP, FUNC_FLASH_EXIT_XIP, FUNC_FLASH_FLUSH_CACHE, FUNC_FLASH_RANGE_ERASE, FUNC_FLASH_RANGE_PROGRAM, FUNC_FLASH_RESET_ADDRESS_TRANS, is_arm(), IS_RP2040, LOG_ERROR, LOG_WARNING, priv, rp2xxx_lookup_rom_symbol(), RT_FLAG_FUNC_ARM_SEC, RT_FLAG_FUNC_RISCV, and target_to_arm().
Referenced by rp2xxx_call_rom_func_batch(), and rp2xxx_flash_probe().
|
static |
Definition at line 1145 of file rp2xxx.c.
References addr, bank, buffer, cmd, ERROR_OK, h_u24_to_be(), le_to_h_u32(), priv, rp2xxx_spi_tx_rx(), SFDP_MAGIC, and SPIFLASH_READ_SFDP.
Referenced by rp2xxx_flash_probe().
|
static |
Definition at line 1129 of file rp2xxx.c.
References bank, ERROR_FAIL, IS_RP2040, IS_RP2350, priv, rp2040_spi_tx_rx(), and rp2350_spi_tx_rx().
Referenced by rp2xxx_flash_probe(), and rp2xxx_read_sfdp_block().
|
static |
Definition at line 694 of file rp2xxx.c.
References working_area::address, ARRAY_SIZE, BOOTROM_STATE_RESET_CURRENT_CORE, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, is_arm(), IS_RP2350, LOG_DEBUG, LOG_ERROR, LOG_WARNING, rp2xxx_rom_call_batch_record::pc, priv, rp2350_init_accessctrl(), rp2350_init_arm_core0(), rp2xxx_call_rom_func(), rp2xxx_call_rom_func_batch(), RP2XXX_MAX_ALGO_STACK_USAGE, RP2XXX_MAX_RAM_ALGO_SIZE, target_alloc_working_area(), target_free_working_area(), target_to_arm(), and target_write_u32().
Referenced by COMMAND_HANDLER(), rp2xxx_flash_erase(), rp2xxx_flash_probe(), and rp2xxx_flash_write().
|
static |
Definition at line 93 of file rp2xxx.c.
Referenced by rp2350_init_arm_core0().
|
static |
Definition at line 92 of file rp2xxx.c.
Referenced by rp2350_init_arm_core0().
|
static |
|
static |
const struct flash_driver rp2xxx_flash |
Definition at line 1366 of file rp2xxx.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 118 of file rp2xxx.c.
Referenced by rp2xxx_call_rom_func_batch().
|
static |
Definition at line 142 of file rp2xxx.c.
Referenced by rp2xxx_call_rom_func_batch().
|
static |
Definition at line 117 of file rp2xxx.c.
Referenced by rp2xxx_call_rom_func_batch().
|
static |
Definition at line 164 of file rp2xxx.c.
Referenced by rp2xxx_call_rom_func_batch().