OpenOCD
nrf54.c File Reference
Include dependency graph for nrf54.c:

Go to the source code of this file.

Data Structures

struct  nrf54_ficr_info
 
struct  nrf54_info
 

Macros

#define NRF54_FICR_BASE_ADDR   0x00FFC000
 
#define NRF54_FICR_INFO_PACKAGE_REG   0x324
 
#define NRF54_FICR_INFO_PART_REG   0x31c
 
#define NRF54_FICR_INFO_RAM_REG   0x328
 
#define NRF54_FICR_INFO_RRAM_REG   0x32C
 
#define NRF54_FICR_INFO_VARIANT_REG   0x320
 
#define NRF54_RRAM_BASE_ADDR   0x00000000
 
#define NRF54_RRAMC_BASE_ADDR   0x5004B000
 
#define NRF54_RRAMC_CONFIG_WEN   BIT(0)
 
#define NRF54_RRAMC_REG_CONFIG   0x500
 
#define NRF54_RRAMC_REG_READY   0x400
 

Functions

 FLASH_BANK_COMMAND_HANDLER (nrf54_flash_bank_command)
 
static int nrf54_auto_probe (struct flash_bank *bank)
 
static bool nrf54_get_chip_type_str (const struct nrf54_info *info, char *buf, size_t size)
 
static const char * nrf54_get_part_name (uint32_t id)
 
static int nrf54_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static int nrf54_probe (struct flash_bank *bank)
 
static int nrf54_read_ficr_info (struct target *target, struct nrf54_ficr_info *info)
 
static void nrf54_u32_to_str (uint32_t data, char *str)
 
static int nrf54_wait_until_ready (struct target *target, uint32_t timeout)
 
static int nrf54_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 

Variables

static const struct command_registration nrf54_command_handlers []
 
const struct flash_driver nrf54_flash
 
struct {
   uint32_t   id
 
   const char *   name
 
} nrf54_part_names []
 

Macro Definition Documentation

◆ NRF54_FICR_BASE_ADDR

#define NRF54_FICR_BASE_ADDR   0x00FFC000

Definition at line 25 of file nrf54.c.

◆ NRF54_FICR_INFO_PACKAGE_REG

#define NRF54_FICR_INFO_PACKAGE_REG   0x324

Definition at line 29 of file nrf54.c.

◆ NRF54_FICR_INFO_PART_REG

#define NRF54_FICR_INFO_PART_REG   0x31c

Definition at line 27 of file nrf54.c.

◆ NRF54_FICR_INFO_RAM_REG

#define NRF54_FICR_INFO_RAM_REG   0x328

Definition at line 30 of file nrf54.c.

◆ NRF54_FICR_INFO_RRAM_REG

#define NRF54_FICR_INFO_RRAM_REG   0x32C

Definition at line 31 of file nrf54.c.

◆ NRF54_FICR_INFO_VARIANT_REG

#define NRF54_FICR_INFO_VARIANT_REG   0x320

Definition at line 28 of file nrf54.c.

◆ NRF54_RRAM_BASE_ADDR

#define NRF54_RRAM_BASE_ADDR   0x00000000

Definition at line 33 of file nrf54.c.

◆ NRF54_RRAMC_BASE_ADDR

#define NRF54_RRAMC_BASE_ADDR   0x5004B000

Definition at line 35 of file nrf54.c.

◆ NRF54_RRAMC_CONFIG_WEN

#define NRF54_RRAMC_CONFIG_WEN   BIT(0)

Definition at line 40 of file nrf54.c.

◆ NRF54_RRAMC_REG_CONFIG

#define NRF54_RRAMC_REG_CONFIG   0x500

Definition at line 37 of file nrf54.c.

◆ NRF54_RRAMC_REG_READY

#define NRF54_RRAMC_REG_READY   0x400

Definition at line 38 of file nrf54.c.

Function Documentation

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( nrf54_flash_bank_command  )

◆ nrf54_auto_probe()

static int nrf54_auto_probe ( struct flash_bank *  bank)
static

Definition at line 197 of file nrf54.c.

References bank, ERROR_OK, info, and nrf54_probe().

◆ nrf54_get_chip_type_str()

static bool nrf54_get_chip_type_str ( const struct nrf54_info *  info,
char *  buf,
size_t  size 
)
static

Definition at line 127 of file nrf54.c.

References info, nrf54_u32_to_str(), nrf54_ficr_info::package, size, and nrf54_ficr_info::variant.

Referenced by nrf54_info().

◆ nrf54_get_part_name()

static const char* nrf54_get_part_name ( uint32_t  id)
static

Definition at line 108 of file nrf54.c.

References ARRAY_SIZE, nrf54_part_names, and NULL.

Referenced by nrf54_probe().

◆ nrf54_info()

static int nrf54_info ( struct flash_bank *  bank,
struct command_invocation *  cmd 
)
static

◆ nrf54_probe()

◆ nrf54_read_ficr_info()

static int nrf54_read_ficr_info ( struct target *  target,
struct nrf54_ficr_info *  info 
)
static

◆ nrf54_u32_to_str()

static void nrf54_u32_to_str ( uint32_t  data,
char *  str 
)
static

Definition at line 118 of file nrf54.c.

References h_u32_to_be().

Referenced by nrf54_get_chip_type_str().

◆ nrf54_wait_until_ready()

static int nrf54_wait_until_ready ( struct target *  target,
uint32_t  timeout 
)
static

◆ nrf54_write()

static int nrf54_write ( struct flash_bank *  bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  count 
)
static

Variable Documentation

◆ id

◆ name

const char* name

Definition at line 44 of file nrf54.c.

◆ nrf54_command_handlers

const struct command_registration nrf54_command_handlers[]
static
Initial value:
= {
{
.name = "nrf54",
.mode = COMMAND_ANY,
.help = "nrf54 flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:256
@ COMMAND_ANY
Definition: command.h:42

Definition at line 328 of file nrf54.c.

◆ nrf54_flash

const struct flash_driver nrf54_flash
Initial value:
= {
.name = "nrf54",
.flash_bank_command = nrf54_flash_bank_command,
.info = nrf54_info,
.write = nrf54_write,
.probe = nrf54_probe,
.auto_probe = nrf54_auto_probe,
.erase_check = default_flash_blank_check,
.free_driver_priv = default_flash_free_driver_priv,
}
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.
static int nrf54_auto_probe(struct flash_bank *bank)
Definition: nrf54.c:197
static const struct command_registration nrf54_command_handlers[]
Definition: nrf54.c:348
static int nrf54_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: nrf54.c:149
static int nrf54_probe(struct flash_bank *bank)
Definition: nrf54.c:165
static int nrf54_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: nrf54.c:239

Definition at line 328 of file nrf54.c.

◆ 

struct { ... } nrf54_part_names[]
Initial value:
= {
{ 0x00054B15, "nRF54L15" },
{ 0x00054B10, "nRF54L10" },
{ 0x00054B05, "nRF54L05" },
}

Referenced by nrf54_get_part_name().