25 #define NRF54_FICR_BASE_ADDR 0x00FFC000
27 #define NRF54_FICR_INFO_PART_REG 0x31c
28 #define NRF54_FICR_INFO_VARIANT_REG 0x320
29 #define NRF54_FICR_INFO_PACKAGE_REG 0x324
30 #define NRF54_FICR_INFO_RAM_REG 0x328
31 #define NRF54_FICR_INFO_RRAM_REG 0x32C
33 #define NRF54_RRAM_BASE_ADDR 0x00000000
35 #define NRF54_RRAMC_BASE_ADDR 0x5004B000
37 #define NRF54_RRAMC_REG_CONFIG 0x500
38 #define NRF54_RRAMC_REG_READY 0x400
40 #define NRF54_RRAMC_CONFIG_WEN BIT(0)
46 { 0x00054B15,
"nRF54L15" },
47 { 0x00054B10,
"nRF54L10" },
48 { 0x00054B05,
"nRF54L05" },
128 char *buf,
size_t size)
137 int res = snprintf(buf,
size,
"%s-%c%c%c%c",
143 if ((
size_t)res >=
size)
155 LOG_ERROR(
"Failed to build chip type string");
160 chip_type,
info->ficr_info.rram_size,
info->ficr_info.sram_size);
173 LOG_ERROR(
"Failed to load FICR from device");
180 LOG_ERROR(
"Unknown device with part number 0x%08" PRIx32,
191 bank->write_start_alignment = 0;
192 bank->write_end_alignment = 0;
250 const uint32_t write_buffer_size = 32;
267 const uint32_t
buffer_size = (write_buffer_size == 0) ?
268 4 : write_buffer_size * 16;
291 LOG_ERROR(
"Failed to read write-buffer status");
296 LOG_DEBUG(
"Commit data from write-buffer to RRAM");
300 LOG_ERROR(
"Failed to start write-buffer commit task");
306 LOG_ERROR(
"Timed out during write-buffer commit task");
352 .help =
"nrf54 flash command group",
361 .flash_bank_command = nrf54_flash_bank_command,
Support functions to access arbitrary bits in a byte array.
void command_print_sameline(struct command_invocation *cmd, const char *format,...)
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
uint64_t buffer
Pointer to data buffer to send over SPI.
uint32_t size
Size of dw_spi_transaction::buffer.
uint32_t buffer_size
Size of dw_spi_program::buffer.
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.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
static int nrf54_read_ficr_info(struct target *target, struct nrf54_ficr_info *info)
#define NRF54_FICR_INFO_VARIANT_REG
static int nrf54_auto_probe(struct flash_bank *bank)
#define NRF54_FICR_INFO_RAM_REG
const struct flash_driver nrf54_flash
#define NRF54_RRAMC_BASE_ADDR
static const struct command_registration nrf54_command_handlers[]
#define NRF54_RRAMC_CONFIG_WEN
static bool nrf54_get_chip_type_str(const struct nrf54_info *info, char *buf, size_t size)
static int nrf54_info(struct flash_bank *bank, struct command_invocation *cmd)
struct @15 nrf54_part_names[]
#define NRF54_FICR_INFO_PART_REG
#define NRF54_FICR_INFO_RRAM_REG
#define NRF54_FICR_INFO_PACKAGE_REG
static int nrf54_probe(struct flash_bank *bank)
#define NRF54_RRAMC_REG_CONFIG
static int nrf54_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
static int nrf54_wait_until_ready(struct target *target, uint32_t timeout)
#define NRF54_RRAMC_REG_READY
#define NRF54_RRAM_BASE_ADDR
FLASH_BANK_COMMAND_HANDLER(nrf54_flash_bank_command)
static const char * nrf54_get_part_name(uint32_t id)
#define NRF54_FICR_BASE_ADDR
static void nrf54_u32_to_str(uint32_t data, char *str)
When run_command is called, a new instance will be created on the stack, filled with the proper value...
Provides details of a flash bank, available either on-chip or through a major interface.
Provides the implementation-independent structure that defines all of the callbacks required by OpenO...
const char * name
Gives a human-readable name of this flash driver, This field is used to select and initialize the dri...
struct nrf54_ficr_info ficr_info
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
int target_write_u32(struct target *target, target_addr_t address, uint32_t value)
int target_read_u32(struct target *target, target_addr_t address, uint32_t *value)
#define ERROR_TARGET_NOT_HALTED
static void h_u32_to_be(uint8_t *buf, uint32_t val)
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
static struct ublast_lowlevel_priv info