OpenOCD
bluenrg-x.c File Reference
Include dependency graph for bluenrg-x.c:

Go to the source code of this file.

Data Structures

struct  bluenrgx_flash_bank
 
struct  flash_ctrl_priv_data
 

Macros

#define BLUENRG2_JTAG_REG   (flash_priv_data_2.jtag_idcode_reg)
 
#define BLUENRGLP_JTAG_REG   (flash_priv_data_lp.jtag_idcode_reg)
 
#define DIE_ID_REG(bluenrgx_info)   (bluenrgx_info->flash_ptr->die_id_reg)
 
#define FLASH_PAGE_SIZE(bluenrgx_info)   (bluenrgx_info->flash_ptr->flash_page_size)
 
#define FLASH_SIZE_REG_MASK   (0xFFFF)
 
#define JTAG_IDCODE_REG(bluenrgx_info)   (bluenrgx_info->flash_ptr->jtag_idcode_reg)
 

Functions

static int bluenrgx_auto_probe (struct flash_bank *bank)
 
static int bluenrgx_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static uint32_t bluenrgx_get_flash_reg (struct flash_bank *bank, uint32_t reg_offset)
 
static int bluenrgx_get_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static int bluenrgx_probe (struct flash_bank *bank)
 
static int bluenrgx_read_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t *value)
 
static int bluenrgx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int bluenrgx_write_flash_reg (struct flash_bank *bank, uint32_t reg_offset, uint32_t value)
 
 FLASH_BANK_COMMAND_HANDLER (bluenrgx_flash_bank_command)
 

Variables

const struct flash_driver bluenrgx_flash
 
static const struct flash_ctrl_priv_dataflash_ctrl []
 
static const struct flash_ctrl_priv_data flash_priv_data_1
 
static const struct flash_ctrl_priv_data flash_priv_data_2
 
static const struct flash_ctrl_priv_data flash_priv_data_lp
 
static const struct flash_ctrl_priv_data flash_priv_data_lps
 

Macro Definition Documentation

◆ BLUENRG2_JTAG_REG

#define BLUENRG2_JTAG_REG   (flash_priv_data_2.jtag_idcode_reg)

Definition at line 20 of file bluenrg-x.c.

◆ BLUENRGLP_JTAG_REG

#define BLUENRGLP_JTAG_REG   (flash_priv_data_lp.jtag_idcode_reg)

Definition at line 21 of file bluenrg-x.c.

◆ DIE_ID_REG

#define DIE_ID_REG (   bluenrgx_info)    (bluenrgx_info->flash_ptr->die_id_reg)

Definition at line 23 of file bluenrg-x.c.

◆ FLASH_PAGE_SIZE

#define FLASH_PAGE_SIZE (   bluenrgx_info)    (bluenrgx_info->flash_ptr->flash_page_size)

Definition at line 25 of file bluenrg-x.c.

◆ FLASH_SIZE_REG_MASK

#define FLASH_SIZE_REG_MASK   (0xFFFF)

Definition at line 27 of file bluenrg-x.c.

◆ JTAG_IDCODE_REG

#define JTAG_IDCODE_REG (   bluenrgx_info)    (bluenrgx_info->flash_ptr->jtag_idcode_reg)

Definition at line 24 of file bluenrg-x.c.

Function Documentation

◆ bluenrgx_auto_probe()

static int bluenrgx_auto_probe ( struct flash_bank bank)
static

Definition at line 433 of file bluenrg-x.c.

References bank, bluenrgx_probe(), ERROR_OK, and bluenrgx_flash_bank::probed.

◆ bluenrgx_erase()

◆ bluenrgx_get_flash_reg()

static uint32_t bluenrgx_get_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset 
)
inlinestatic

◆ bluenrgx_get_info()

static int bluenrgx_get_info ( struct flash_bank bank,
struct command_invocation cmd 
)
static

Definition at line 444 of file bluenrg-x.c.

◆ bluenrgx_probe()

◆ bluenrgx_read_flash_reg()

static int bluenrgx_read_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t *  value 
)
inlinestatic

Definition at line 123 of file bluenrg-x.c.

References bank, bluenrgx_get_flash_reg(), and target_read_u32().

Referenced by bluenrgx_erase(), and bluenrgx_probe().

◆ bluenrgx_write()

◆ bluenrgx_write_flash_reg()

static int bluenrgx_write_flash_reg ( struct flash_bank bank,
uint32_t  reg_offset,
uint32_t  value 
)
inlinestatic

Definition at line 128 of file bluenrg-x.c.

References bank, bluenrgx_get_flash_reg(), and target_write_u32().

Referenced by bluenrgx_erase().

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( bluenrgx_flash_bank_command  )

Variable Documentation

◆ bluenrgx_flash

const struct flash_driver bluenrgx_flash
Initial value:
= {
.name = "bluenrg-x",
.flash_bank_command = bluenrgx_flash_bank_command,
.erase = bluenrgx_erase,
.protect = NULL,
.write = bluenrgx_write,
.probe = bluenrgx_probe,
.erase_check = default_flash_blank_check,
.protect_check = NULL,
.auto_probe = bluenrgx_auto_probe,
}
static int bluenrgx_probe(struct flash_bank *bank)
Definition: bluenrg-x.c:381
static int bluenrgx_get_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: bluenrg-x.c:444
static int bluenrgx_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: bluenrg-x.c:133
static int bluenrgx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: bluenrg-x.c:232
static int bluenrgx_auto_probe(struct flash_bank *bank)
Definition: bluenrg-x.c:433
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.
#define NULL
Definition: usb.h:16

Definition at line 444 of file bluenrg-x.c.

◆ flash_ctrl

const struct flash_ctrl_priv_data* flash_ctrl[]
static
Initial value:
= {
static const struct flash_ctrl_priv_data flash_priv_data_lp
Definition: bluenrg-x.c:59
static const struct flash_ctrl_priv_data flash_priv_data_2
Definition: bluenrg-x.c:49
static const struct flash_ctrl_priv_data flash_priv_data_lps
Definition: bluenrg-x.c:69
static const struct flash_ctrl_priv_data flash_priv_data_1
Definition: bluenrg-x.c:39

Definition at line 85 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_1

const struct flash_ctrl_priv_data flash_priv_data_1
static
Initial value:
= {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
.flash_regs_base = 0x40100000,
.flash_page_size = 2048,
.jtag_idcode = 0x00000000,
.part_name = "BLUENRG-1",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_2

const struct flash_ctrl_priv_data flash_priv_data_2
static
Initial value:
= {
.die_id_reg = 0x4090001C,
.jtag_idcode_reg = 0x40900028,
.flash_base = 0x10040000,
.flash_regs_base = 0x40100000,
.flash_page_size = 2048,
.jtag_idcode = 0x0200A041,
.part_name = "BLUENRG-2",
}

Definition at line 1 of file bluenrg-x.c.

◆ flash_priv_data_lp

const struct flash_ctrl_priv_data flash_priv_data_lp
static
Initial value:
= {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
.flash_regs_base = 0x40001000,
.flash_page_size = 2048,
.jtag_idcode = 0x0201E041,
.part_name = "BLUENRG-LP",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().

◆ flash_priv_data_lps

const struct flash_ctrl_priv_data flash_priv_data_lps
static
Initial value:
= {
.die_id_reg = 0x40000000,
.jtag_idcode_reg = 0x40000004,
.flash_base = 0x10040000,
.flash_regs_base = 0x40001000,
.flash_page_size = 2048,
.jtag_idcode = 0x02028041,
.part_name = "BLUENRG-LPS",
}

Definition at line 1 of file bluenrg-x.c.

Referenced by bluenrgx_probe().