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

Go to the source code of this file.

Data Structures

struct  hpm_flash_info
 
struct  hpm_xpi_priv
 

Macros

#define BLOCK_SIZE   (4096U)
 
#define ERASE_CHIP_TIMEOUT_IN_MS   (100000U)
 
#define NOR_CFG_OPT_HEADER   (0xFCF90000UL)
 
#define SECTOR_ERASE_TIMEOUT_IN_MS   (100)
 
#define TIMEOUT_IN_MS   (10000U)
 
#define TYPICAL_TIMEOUT_IN_MS   (500U)
 

Functions

 COMMAND_HANDLER (hpm_xpi_handle_erase_chip_command)
 
 FLASH_BANK_COMMAND_HANDLER (hpm_xpi_flash_bank_command)
 
static int hpm_xpi_auto_probe (struct flash_bank *bank)
 
static int hpm_xpi_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int hpm_xpi_erase_chip (struct flash_bank *bank)
 
static int hpm_xpi_probe (struct flash_bank *bank)
 
static int hpm_xpi_run_algo_flash_init (struct flash_bank *bank, target_addr_t algo_entry)
 
static int hpm_xpi_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 

Variables

static uint8_t flash_algo []
 
const struct command_registration hpm_xpi_command_handlers []
 
static const struct command_registration hpm_xpi_exec_command_handlers []
 
const struct flash_driver hpm_xpi_flash
 

Macro Definition Documentation

◆ BLOCK_SIZE

#define BLOCK_SIZE   (4096U)

Definition at line 25 of file hpm_xpi.c.

◆ ERASE_CHIP_TIMEOUT_IN_MS

#define ERASE_CHIP_TIMEOUT_IN_MS   (100000U)

Definition at line 22 of file hpm_xpi.c.

◆ NOR_CFG_OPT_HEADER

#define NOR_CFG_OPT_HEADER   (0xFCF90000UL)

Definition at line 26 of file hpm_xpi.c.

◆ SECTOR_ERASE_TIMEOUT_IN_MS

#define SECTOR_ERASE_TIMEOUT_IN_MS   (100)

Definition at line 23 of file hpm_xpi.c.

◆ TIMEOUT_IN_MS

#define TIMEOUT_IN_MS   (10000U)

Definition at line 21 of file hpm_xpi.c.

◆ TYPICAL_TIMEOUT_IN_MS

#define TYPICAL_TIMEOUT_IN_MS   (500U)

Definition at line 24 of file hpm_xpi.c.

Function Documentation

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( hpm_xpi_handle_erase_chip_command  )

◆ FLASH_BANK_COMMAND_HANDLER()

◆ hpm_xpi_auto_probe()

static int hpm_xpi_auto_probe ( struct flash_bank bank)
static

Definition at line 189 of file hpm_xpi.c.

References bank, ERROR_OK, hpm_xpi_probe(), and hpm_xpi_priv::probed.

◆ hpm_xpi_erase()

◆ hpm_xpi_erase_chip()

◆ hpm_xpi_probe()

◆ hpm_xpi_run_algo_flash_init()

◆ hpm_xpi_write()

Variable Documentation

◆ flash_algo

uint8_t flash_algo[]
static
Initial value:
= {
}

Definition at line 18 of file hpm_xpi.c.

Referenced by hpm_xpi_erase(), hpm_xpi_erase_chip(), hpm_xpi_probe(), and hpm_xpi_write().

◆ hpm_xpi_command_handlers

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

Definition at line 423 of file hpm_xpi.c.

◆ hpm_xpi_exec_command_handlers

const struct command_registration hpm_xpi_exec_command_handlers[]
static
Initial value:
= {
{
.name = "mass_erase",
.handler = hpm_xpi_handle_erase_chip_command,
.mode = COMMAND_EXEC,
.usage = "bank_id",
.help = "erase entire flash device",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 423 of file hpm_xpi.c.

◆ hpm_xpi_flash

const struct flash_driver hpm_xpi_flash
Initial value:
= {
.name = "hpm_xpi",
.flash_bank_command = hpm_xpi_flash_bank_command,
.erase = hpm_xpi_erase,
.write = hpm_xpi_write,
.probe = hpm_xpi_probe,
.auto_probe = hpm_xpi_auto_probe,
.erase_check = default_flash_blank_check,
.free_driver_priv = default_flash_free_driver_priv,
}
int default_flash_verify(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Provides default verify implementation for flash memory.
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 hpm_xpi_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: hpm_xpi.c:299
static int hpm_xpi_auto_probe(struct flash_bank *bank)
Definition: hpm_xpi.c:189
static int hpm_xpi_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: hpm_xpi.c:197
static int hpm_xpi_probe(struct flash_bank *bank)
Definition: hpm_xpi.c:82
const struct command_registration hpm_xpi_command_handlers[]
Definition: hpm_xpi.c:452

Definition at line 463 of file hpm_xpi.c.