Go to the source code of this file.
|
| FLASH_BANK_COMMAND_HANDLER (rp2040_flash_bank_command) |
|
static int | rp2040_call_rom_func (struct target *target, struct rp2040_flash_bank *priv, uint16_t func_offset, uint32_t argdata[], unsigned int n_args, int timeout_ms) |
|
static int | rp2040_finalize_stack_free (struct flash_bank *bank) |
|
static int | rp2040_flash_auto_probe (struct flash_bank *bank) |
|
static int | rp2040_flash_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
|
static void | rp2040_flash_free_driver_priv (struct flash_bank *bank) |
|
static int | rp2040_flash_probe (struct flash_bank *bank) |
|
static int | rp2040_flash_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
|
static uint32_t | rp2040_lookup_symbol (struct target *target, uint32_t tag, uint16_t *symbol) |
|
static int | rp2040_spi_read_flash_id (struct target *target, uint32_t *devid) |
|
static int | rp2040_ssel_active (struct target *target, bool active) |
|
static int | rp2040_stack_grab_and_prep (struct flash_bank *bank) |
|
◆ BOOTROM_MAGIC
#define BOOTROM_MAGIC 0x01754d |
◆ BOOTROM_MAGIC_ADDR
#define BOOTROM_MAGIC_ADDR 0x00000010 |
◆ FUNC_CONNECT_INTERNAL_FLASH
#define FUNC_CONNECT_INTERNAL_FLASH MAKE_TAG('I', 'F') |
◆ FUNC_DEBUG_TRAMPOLINE
#define FUNC_DEBUG_TRAMPOLINE MAKE_TAG('D', 'T') |
◆ FUNC_DEBUG_TRAMPOLINE_END
#define FUNC_DEBUG_TRAMPOLINE_END MAKE_TAG('D', 'E') |
◆ FUNC_FLASH_ENTER_CMD_XIP
#define FUNC_FLASH_ENTER_CMD_XIP MAKE_TAG('C', 'X') |
◆ FUNC_FLASH_EXIT_XIP
#define FUNC_FLASH_EXIT_XIP MAKE_TAG('E', 'X') |
◆ FUNC_FLASH_FLUSH_CACHE
#define FUNC_FLASH_FLUSH_CACHE MAKE_TAG('F', 'C') |
◆ FUNC_FLASH_RANGE_ERASE
#define FUNC_FLASH_RANGE_ERASE MAKE_TAG('R', 'E') |
◆ FUNC_FLASH_RANGE_PROGRAM
#define FUNC_FLASH_RANGE_PROGRAM MAKE_TAG('R', 'P') |
◆ MAKE_TAG
#define MAKE_TAG |
( |
|
a, |
|
|
|
b |
|
) |
| (((b)<<8) | a) |
◆ FLASH_BANK_COMMAND_HANDLER()
FLASH_BANK_COMMAND_HANDLER |
( |
rp2040_flash_bank_command |
| ) |
|
◆ rp2040_call_rom_func()
static int rp2040_call_rom_func |
( |
struct target * |
target, |
|
|
struct rp2040_flash_bank * |
priv, |
|
|
uint16_t |
func_offset, |
|
|
uint32_t |
argdata[], |
|
|
unsigned int |
n_args, |
|
|
int |
timeout_ms |
|
) |
| |
|
static |
Definition at line 89 of file rp2040.c.
References ARM_MODE_THREAD, ARMV7M_COMMON_MAGIC, ARRAY_SIZE, buf_get_u32(), buf_set_u32(), armv7m_algorithm::common_magic, armv7m_algorithm::core_mode, destroy_reg_param(), ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, init_reg_param(), LOG_DEBUG, LOG_ERROR, LOG_TARGET_DEBUG, NULL, PARAM_OUT, priv, and target_run_algorithm().
Referenced by rp2040_finalize_stack_free(), rp2040_flash_erase(), rp2040_flash_write(), and rp2040_stack_grab_and_prep().
◆ rp2040_finalize_stack_free()
static int rp2040_finalize_stack_free |
( |
struct flash_bank * |
bank | ) |
|
|
static |
◆ rp2040_flash_auto_probe()
static int rp2040_flash_auto_probe |
( |
struct flash_bank * |
bank | ) |
|
|
static |
◆ rp2040_flash_erase()
static int rp2040_flash_erase |
( |
struct flash_bank * |
bank, |
|
|
unsigned int |
first, |
|
|
unsigned int |
last |
|
) |
| |
|
static |
Definition at line 274 of file rp2040.c.
References ARRAY_SIZE, bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, length, LOG_DEBUG, LOG_ERROR, priv, rp2040_call_rom_func(), rp2040_finalize_stack_free(), rp2040_stack_grab_and_prep(), target::state, and TARGET_HALTED.
◆ rp2040_flash_free_driver_priv()
static void rp2040_flash_free_driver_priv |
( |
struct flash_bank * |
bank | ) |
|
|
static |
◆ rp2040_flash_probe()
static int rp2040_flash_probe |
( |
struct flash_bank * |
bank | ) |
|
|
static |
Definition at line 375 of file rp2040.c.
References alloc_block_array(), bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, flash_devices, FUNC_CONNECT_INTERNAL_FLASH, FUNC_DEBUG_TRAMPOLINE, FUNC_DEBUG_TRAMPOLINE_END, FUNC_FLASH_ENTER_CMD_XIP, FUNC_FLASH_EXIT_XIP, FUNC_FLASH_FLUSH_CACHE, FUNC_FLASH_RANGE_ERASE, FUNC_FLASH_RANGE_PROGRAM, LOG_ERROR, LOG_INFO, flash_device::name, NULL, priv, rp2040_finalize_stack_free(), rp2040_lookup_symbol(), rp2040_spi_read_flash_id(), rp2040_stack_grab_and_prep(), target::state, TARGET_ADDR_FMT, and TARGET_HALTED.
Referenced by rp2040_flash_auto_probe().
◆ rp2040_flash_write()
static int rp2040_flash_write |
( |
struct flash_bank * |
bank, |
|
|
const uint8_t * |
buffer, |
|
|
uint32_t |
offset, |
|
|
uint32_t |
count |
|
) |
| |
|
static |
Definition at line 210 of file rp2040.c.
References working_area::address, ARRAY_SIZE, bank, buffer, count, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, MAX, MIN, NULL, offset, priv, rp2040_call_rom_func(), rp2040_finalize_stack_free(), rp2040_stack_grab_and_prep(), target::state, TARGET_ADDR_FMT, target_alloc_working_area(), target_free_working_area(), target_get_working_area_avail(), TARGET_HALTED, and target_write_buffer().
◆ rp2040_lookup_symbol()
static uint32_t rp2040_lookup_symbol |
( |
struct target * |
target, |
|
|
uint32_t |
tag, |
|
|
uint16_t * |
symbol |
|
) |
| |
|
static |
◆ rp2040_spi_read_flash_id()
static int rp2040_spi_read_flash_id |
( |
struct target * |
target, |
|
|
uint32_t * |
devid |
|
) |
| |
|
static |
◆ rp2040_ssel_active()
static int rp2040_ssel_active |
( |
struct target * |
target, |
|
|
bool |
active |
|
) |
| |
|
static |
◆ rp2040_stack_grab_and_prep()
static int rp2040_stack_grab_and_prep |
( |
struct flash_bank * |
bank | ) |
|
|
static |
Definition at line 180 of file rp2040.c.
References bank, ERROR_OK, ERROR_TARGET_RESOURCE_NOT_AVAILABLE, LOG_DEBUG, LOG_ERROR, NULL, priv, rp2040_call_rom_func(), and target_alloc_working_area().
Referenced by rp2040_flash_erase(), rp2040_flash_probe(), and rp2040_flash_write().
◆ rp2040_flash
Initial value:= {
.name = "rp2040_flash",
.flash_bank_command = rp2040_flash_bank_command,
}
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
int default_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default read implementation for flash memory.
static int rp2040_flash_auto_probe(struct flash_bank *bank)
static int rp2040_flash_probe(struct flash_bank *bank)
static int rp2040_flash_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
static int rp2040_flash_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
static void rp2040_flash_free_driver_priv(struct flash_bank *bank)
Definition at line 500 of file rp2040.c.