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

Go to the source code of this file.

Data Structures

struct  psoc5lp_device
 
struct  psoc5lp_eeprom_flash_bank
 
struct  psoc5lp_flash_bank
 
struct  psoc5lp_nvl_flash_bank
 

Macros

#define BLOCK_SIZE   (ROWS_PER_BLOCK * ROW_SIZE)
 
#define EEPROM_BLOCK_SIZE   (ROWS_PER_BLOCK * EEPROM_ROW_SIZE)
 
#define EEPROM_ROW_SIZE   16
 
#define EEPROM_SECTOR_SIZE   (ROWS_PER_SECTOR * EEPROM_ROW_SIZE)
 
#define NVL_3_ECCEN   (1 << 3)
 
#define NVL_META_BASE   0x90000000
 
#define PANTHER_DEVICE_ID   0x4008001C
 
#define PART_NUMBER_LEN   (17 + 1)
 
#define PHUB_CFGMEM0_CFG0   0x40007600
 
#define PHUB_CFGMEM0_CFG1   0x40007604
 
#define PHUB_CFGMEM1_CFG0   0x40007608
 
#define PHUB_CFGMEM1_CFG1   0x4000760C
 
#define PHUB_CFGMEMX_CFG0   (1 << 7)
 
#define PHUB_CH0_ACTION   0x40007014
 
#define PHUB_CH0_BASIC_CFG   0x40007010
 
#define PHUB_CH0_BASIC_STATUS   0x40007018
 
#define PHUB_CH1_ACTION   0x40007024
 
#define PHUB_CH1_BASIC_CFG   0x40007020
 
#define PHUB_CH1_BASIC_STATUS   0x40007028
 
#define PHUB_CHX_ACTION_CPU_REQ   (1 << 0)
 
#define PHUB_CHX_BASIC_CFG_EN   (1 << 0)
 
#define PHUB_CHX_BASIC_CFG_WORK_SEP   (1 << 5)
 
#define PHUB_TDMEM0_ORIG_TD0   0x40007800
 
#define PHUB_TDMEM0_ORIG_TD1   0x40007804
 
#define PHUB_TDMEM1_ORIG_TD0   0x40007808
 
#define PHUB_TDMEM1_ORIG_TD1   0x4000780C
 
#define PHUB_TDMEMX_ORIG_TD0_INC_SRC_ADDR   (1 << 24)
 
#define PHUB_TDMEMX_ORIG_TD0_NEXT_TD_PTR_LAST   (0xff << 16)
 
#define PM_ACT_CFG0   0x400043A0
 
#define PM_ACT_CFG0_EN_CLK_SPC   (1 << 3)
 
#define PM_ACT_CFG12   0x400043AC
 
#define PM_ACT_CFG12_EN_EE   (1 << 4)
 
#define PRT1_PC2   0x4000500A
 
#define ROW_ECC_SIZE   32
 
#define ROW_SIZE   256
 
#define ROWS_PER_BLOCK   256
 
#define ROWS_PER_SECTOR   64
 
#define SECTOR_SIZE   (ROWS_PER_SECTOR * ROW_SIZE)
 
#define SECTORS_PER_BLOCK   (BLOCK_SIZE / SECTOR_SIZE)
 
#define SPC_ARRAY_ALL   0x3F
 
#define SPC_ARRAY_EEPROM   0x40
 
#define SPC_ARRAY_NVL_USER   0x80
 
#define SPC_ARRAY_NVL_WO   0xF8
 
#define SPC_CPU_DATA   0x40004720
 
#define SPC_ERASE_ALL   0x09
 
#define SPC_ERASE_SECTOR   0x08
 
#define SPC_GET_CHECKSUM   0x0C
 
#define SPC_GET_TEMP   0x0E
 
#define SPC_KEY1   0xB6
 
#define SPC_KEY2   0xD3
 
#define SPC_LOAD_BYTE   0x00
 
#define SPC_LOAD_MULTI_BYTE   0x01
 
#define SPC_LOAD_ROW   0x02
 
#define SPC_OPCODE_LEN   3
 
#define SPC_PRG_ROW   0x07
 
#define SPC_PROGRAM_PROTECT_ROW   0x0B
 
#define SPC_READ_BYTE   0x03
 
#define SPC_READ_HIDDEN_ROW   0x0A
 
#define SPC_READ_MULTI_BYTE   0x04
 
#define SPC_READ_VOLATILE_BYTE   0x10
 
#define SPC_ROW_PROTECTION   0
 
#define SPC_SR   0x40004722
 
#define SPC_SR_DATA_READY   (1 << 0)
 
#define SPC_SR_IDLE   (1 << 1)
 
#define SPC_WRITE_ROW   0x05
 
#define SPC_WRITE_USER_NVL   0x06
 

Functions

 COMMAND_HANDLER (psoc5lp_handle_mass_erase_command)
 
 FLASH_BANK_COMMAND_HANDLER (psoc5lp_eeprom_flash_bank_command)
 
 FLASH_BANK_COMMAND_HANDLER (psoc5lp_flash_bank_command)
 
 FLASH_BANK_COMMAND_HANDLER (psoc5lp_nvl_flash_bank_command)
 
static int psoc5lp_auto_probe (struct flash_bank *bank)
 
static int psoc5lp_eeprom_auto_probe (struct flash_bank *bank)
 
static int psoc5lp_eeprom_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int psoc5lp_eeprom_get_info_command (struct flash_bank *bank, struct command_invocation *cmd)
 
static int psoc5lp_eeprom_probe (struct flash_bank *bank)
 
static int psoc5lp_eeprom_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
 
static int psoc5lp_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int psoc5lp_erase_check (struct flash_bank *bank)
 
static int psoc5lp_find_device (struct target *target, const struct psoc5lp_device **device)
 
static int psoc5lp_get_device_id (struct target *target, uint32_t *id)
 
static int psoc5lp_get_info_command (struct flash_bank *bank, struct command_invocation *cmd)
 
static void psoc5lp_get_part_number (const struct psoc5lp_device *dev, char *str)
 
static int psoc5lp_nvl_auto_probe (struct flash_bank *bank)
 
static int psoc5lp_nvl_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int psoc5lp_nvl_erase_check (struct flash_bank *bank)
 
static int psoc5lp_nvl_get_info_command (struct flash_bank *bank, struct command_invocation *cmd)
 
static int psoc5lp_nvl_probe (struct flash_bank *bank)
 
static int psoc5lp_nvl_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int psoc5lp_nvl_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
 
static int psoc5lp_probe (struct flash_bank *bank)
 
static int psoc5lp_protect_check (struct flash_bank *bank)
 
static int psoc5lp_spc_busy_wait_data (struct target *target)
 
static int psoc5lp_spc_busy_wait_idle (struct target *target)
 
static int psoc5lp_spc_enable_clock (struct target *target)
 
static int psoc5lp_spc_erase_all (struct target *target)
 
static int psoc5lp_spc_erase_sector (struct target *target, uint8_t array_id, uint8_t row_id)
 
static int psoc5lp_spc_get_temp (struct target *target, uint8_t samples, uint8_t *data)
 
static int psoc5lp_spc_load_byte (struct target *target, uint8_t array_id, uint8_t offset, uint8_t value)
 
static int psoc5lp_spc_load_row (struct target *target, uint8_t array_id, const uint8_t *data, unsigned row_size)
 
static int psoc5lp_spc_read_byte (struct target *target, uint8_t array_id, uint8_t offset, uint8_t *data)
 
static int psoc5lp_spc_read_hidden_row (struct target *target, uint8_t array_id, uint8_t row_id, uint8_t *data)
 
static int psoc5lp_spc_read_volatile_byte (struct target *target, uint8_t array_id, uint8_t offset, uint8_t *data)
 
static int psoc5lp_spc_write_opcode (struct target *target, uint8_t opcode)
 
static void psoc5lp_spc_write_opcode_buffer (struct target *target, uint8_t *buf, uint8_t opcode)
 
static int psoc5lp_spc_write_row (struct target *target, uint8_t array_id, uint16_t row_id, const uint8_t *temp)
 
static int psoc5lp_spc_write_user_nvl (struct target *target, uint8_t array_id)
 
static int psoc5lp_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
 

Variables

static const struct command_registration psoc5lp_command_handlers []
 
static const struct psoc5lp_device psoc5lp_devices []
 
const struct flash_driver psoc5lp_eeprom_flash
 
static const struct command_registration psoc5lp_exec_command_handlers []
 
const struct flash_driver psoc5lp_flash
 
const struct flash_driver psoc5lp_nvl_flash
 

Macro Definition Documentation

◆ BLOCK_SIZE

#define BLOCK_SIZE   (ROWS_PER_BLOCK * ROW_SIZE)

Definition at line 95 of file psoc5lp.c.

◆ EEPROM_BLOCK_SIZE

#define EEPROM_BLOCK_SIZE   (ROWS_PER_BLOCK * EEPROM_ROW_SIZE)

Definition at line 99 of file psoc5lp.c.

◆ EEPROM_ROW_SIZE

#define EEPROM_ROW_SIZE   16

Definition at line 97 of file psoc5lp.c.

◆ EEPROM_SECTOR_SIZE

#define EEPROM_SECTOR_SIZE   (ROWS_PER_SECTOR * EEPROM_ROW_SIZE)

Definition at line 98 of file psoc5lp.c.

◆ NVL_3_ECCEN

#define NVL_3_ECCEN   (1 << 3)

Definition at line 88 of file psoc5lp.c.

◆ NVL_META_BASE

#define NVL_META_BASE   0x90000000

Definition at line 41 of file psoc5lp.c.

◆ PANTHER_DEVICE_ID

#define PANTHER_DEVICE_ID   0x4008001C

Definition at line 36 of file psoc5lp.c.

◆ PART_NUMBER_LEN

#define PART_NUMBER_LEN   (17 + 1)

Definition at line 101 of file psoc5lp.c.

◆ PHUB_CFGMEM0_CFG0

#define PHUB_CFGMEM0_CFG0   0x40007600

Definition at line 28 of file psoc5lp.c.

◆ PHUB_CFGMEM0_CFG1

#define PHUB_CFGMEM0_CFG1   0x40007604

Definition at line 29 of file psoc5lp.c.

◆ PHUB_CFGMEM1_CFG0

#define PHUB_CFGMEM1_CFG0   0x40007608

Definition at line 30 of file psoc5lp.c.

◆ PHUB_CFGMEM1_CFG1

#define PHUB_CFGMEM1_CFG1   0x4000760C

Definition at line 31 of file psoc5lp.c.

◆ PHUB_CFGMEMX_CFG0

#define PHUB_CFGMEMX_CFG0   (1 << 7)

Definition at line 83 of file psoc5lp.c.

◆ PHUB_CH0_ACTION

#define PHUB_CH0_ACTION   0x40007014

Definition at line 23 of file psoc5lp.c.

◆ PHUB_CH0_BASIC_CFG

#define PHUB_CH0_BASIC_CFG   0x40007010

Definition at line 22 of file psoc5lp.c.

◆ PHUB_CH0_BASIC_STATUS

#define PHUB_CH0_BASIC_STATUS   0x40007018

Definition at line 24 of file psoc5lp.c.

◆ PHUB_CH1_ACTION

#define PHUB_CH1_ACTION   0x40007024

Definition at line 26 of file psoc5lp.c.

◆ PHUB_CH1_BASIC_CFG

#define PHUB_CH1_BASIC_CFG   0x40007020

Definition at line 25 of file psoc5lp.c.

◆ PHUB_CH1_BASIC_STATUS

#define PHUB_CH1_BASIC_STATUS   0x40007028

Definition at line 27 of file psoc5lp.c.

◆ PHUB_CHX_ACTION_CPU_REQ

#define PHUB_CHX_ACTION_CPU_REQ   (1 << 0)

Definition at line 81 of file psoc5lp.c.

◆ PHUB_CHX_BASIC_CFG_EN

#define PHUB_CHX_BASIC_CFG_EN   (1 << 0)

Definition at line 78 of file psoc5lp.c.

◆ PHUB_CHX_BASIC_CFG_WORK_SEP

#define PHUB_CHX_BASIC_CFG_WORK_SEP   (1 << 5)

Definition at line 79 of file psoc5lp.c.

◆ PHUB_TDMEM0_ORIG_TD0

#define PHUB_TDMEM0_ORIG_TD0   0x40007800

Definition at line 32 of file psoc5lp.c.

◆ PHUB_TDMEM0_ORIG_TD1

#define PHUB_TDMEM0_ORIG_TD1   0x40007804

Definition at line 33 of file psoc5lp.c.

◆ PHUB_TDMEM1_ORIG_TD0

#define PHUB_TDMEM1_ORIG_TD0   0x40007808

Definition at line 34 of file psoc5lp.c.

◆ PHUB_TDMEM1_ORIG_TD1

#define PHUB_TDMEM1_ORIG_TD1   0x4000780C

Definition at line 35 of file psoc5lp.c.

◆ PHUB_TDMEMX_ORIG_TD0_INC_SRC_ADDR

#define PHUB_TDMEMX_ORIG_TD0_INC_SRC_ADDR   (1 << 24)

Definition at line 86 of file psoc5lp.c.

◆ PHUB_TDMEMX_ORIG_TD0_NEXT_TD_PTR_LAST

#define PHUB_TDMEMX_ORIG_TD0_NEXT_TD_PTR_LAST   (0xff << 16)

Definition at line 85 of file psoc5lp.c.

◆ PM_ACT_CFG0

#define PM_ACT_CFG0   0x400043A0

Definition at line 17 of file psoc5lp.c.

◆ PM_ACT_CFG0_EN_CLK_SPC

#define PM_ACT_CFG0_EN_CLK_SPC   (1 << 3)

Definition at line 76 of file psoc5lp.c.

◆ PM_ACT_CFG12

#define PM_ACT_CFG12   0x400043AC

Definition at line 18 of file psoc5lp.c.

◆ PM_ACT_CFG12_EN_EE

#define PM_ACT_CFG12_EN_EE   (1 << 4)

Definition at line 43 of file psoc5lp.c.

◆ PRT1_PC2

#define PRT1_PC2   0x4000500A

Definition at line 21 of file psoc5lp.c.

◆ ROW_ECC_SIZE

#define ROW_ECC_SIZE   32

Definition at line 91 of file psoc5lp.c.

◆ ROW_SIZE

#define ROW_SIZE   256

Definition at line 90 of file psoc5lp.c.

◆ ROWS_PER_BLOCK

#define ROWS_PER_BLOCK   256

Definition at line 94 of file psoc5lp.c.

◆ ROWS_PER_SECTOR

#define ROWS_PER_SECTOR   64

Definition at line 92 of file psoc5lp.c.

◆ SECTOR_SIZE

#define SECTOR_SIZE   (ROWS_PER_SECTOR * ROW_SIZE)

Definition at line 93 of file psoc5lp.c.

◆ SECTORS_PER_BLOCK

#define SECTORS_PER_BLOCK   (BLOCK_SIZE / SECTOR_SIZE)

Definition at line 96 of file psoc5lp.c.

◆ SPC_ARRAY_ALL

#define SPC_ARRAY_ALL   0x3F

Definition at line 64 of file psoc5lp.c.

◆ SPC_ARRAY_EEPROM

#define SPC_ARRAY_EEPROM   0x40

Definition at line 65 of file psoc5lp.c.

◆ SPC_ARRAY_NVL_USER

#define SPC_ARRAY_NVL_USER   0x80

Definition at line 66 of file psoc5lp.c.

◆ SPC_ARRAY_NVL_WO

#define SPC_ARRAY_NVL_WO   0xF8

Definition at line 67 of file psoc5lp.c.

◆ SPC_CPU_DATA

#define SPC_CPU_DATA   0x40004720

Definition at line 19 of file psoc5lp.c.

◆ SPC_ERASE_ALL

#define SPC_ERASE_ALL   0x09

Definition at line 57 of file psoc5lp.c.

◆ SPC_ERASE_SECTOR

#define SPC_ERASE_SECTOR   0x08

Definition at line 56 of file psoc5lp.c.

◆ SPC_GET_CHECKSUM

#define SPC_GET_CHECKSUM   0x0C

Definition at line 60 of file psoc5lp.c.

◆ SPC_GET_TEMP

#define SPC_GET_TEMP   0x0E

Definition at line 61 of file psoc5lp.c.

◆ SPC_KEY1

#define SPC_KEY1   0xB6

Definition at line 45 of file psoc5lp.c.

◆ SPC_KEY2

#define SPC_KEY2   0xD3

Definition at line 46 of file psoc5lp.c.

◆ SPC_LOAD_BYTE

#define SPC_LOAD_BYTE   0x00

Definition at line 48 of file psoc5lp.c.

◆ SPC_LOAD_MULTI_BYTE

#define SPC_LOAD_MULTI_BYTE   0x01

Definition at line 49 of file psoc5lp.c.

◆ SPC_LOAD_ROW

#define SPC_LOAD_ROW   0x02

Definition at line 50 of file psoc5lp.c.

◆ SPC_OPCODE_LEN

#define SPC_OPCODE_LEN   3

Definition at line 71 of file psoc5lp.c.

◆ SPC_PRG_ROW

#define SPC_PRG_ROW   0x07

Definition at line 55 of file psoc5lp.c.

◆ SPC_PROGRAM_PROTECT_ROW

#define SPC_PROGRAM_PROTECT_ROW   0x0B

Definition at line 59 of file psoc5lp.c.

◆ SPC_READ_BYTE

#define SPC_READ_BYTE   0x03

Definition at line 51 of file psoc5lp.c.

◆ SPC_READ_HIDDEN_ROW

#define SPC_READ_HIDDEN_ROW   0x0A

Definition at line 58 of file psoc5lp.c.

◆ SPC_READ_MULTI_BYTE

#define SPC_READ_MULTI_BYTE   0x04

Definition at line 52 of file psoc5lp.c.

◆ SPC_READ_VOLATILE_BYTE

#define SPC_READ_VOLATILE_BYTE   0x10

Definition at line 62 of file psoc5lp.c.

◆ SPC_ROW_PROTECTION

#define SPC_ROW_PROTECTION   0

Definition at line 69 of file psoc5lp.c.

◆ SPC_SR

#define SPC_SR   0x40004722

Definition at line 20 of file psoc5lp.c.

◆ SPC_SR_DATA_READY

#define SPC_SR_DATA_READY   (1 << 0)

Definition at line 73 of file psoc5lp.c.

◆ SPC_SR_IDLE

#define SPC_SR_IDLE   (1 << 1)

Definition at line 74 of file psoc5lp.c.

◆ SPC_WRITE_ROW

#define SPC_WRITE_ROW   0x05

Definition at line 53 of file psoc5lp.c.

◆ SPC_WRITE_USER_NVL

#define SPC_WRITE_USER_NVL   0x06

Definition at line 54 of file psoc5lp.c.

Function Documentation

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( psoc5lp_handle_mass_erase_command  )

◆ FLASH_BANK_COMMAND_HANDLER() [1/3]

FLASH_BANK_COMMAND_HANDLER ( psoc5lp_eeprom_flash_bank_command  )

◆ FLASH_BANK_COMMAND_HANDLER() [2/3]

FLASH_BANK_COMMAND_HANDLER ( psoc5lp_flash_bank_command  )

◆ FLASH_BANK_COMMAND_HANDLER() [3/3]

FLASH_BANK_COMMAND_HANDLER ( psoc5lp_nvl_flash_bank_command  )

◆ psoc5lp_auto_probe()

static int psoc5lp_auto_probe ( struct flash_bank bank)
static

Definition at line 1443 of file psoc5lp.c.

References bank, and psoc5lp_probe().

◆ psoc5lp_eeprom_auto_probe()

static int psoc5lp_eeprom_auto_probe ( struct flash_bank bank)
static

Definition at line 971 of file psoc5lp.c.

References bank, ERROR_OK, psoc5lp_eeprom_flash_bank::probed, and psoc5lp_eeprom_probe().

◆ psoc5lp_eeprom_erase()

static int psoc5lp_eeprom_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)
static

Definition at line 836 of file psoc5lp.c.

References bank, ERROR_OK, psoc5lp_spc_erase_sector(), and SPC_ARRAY_EEPROM.

◆ psoc5lp_eeprom_get_info_command()

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

◆ psoc5lp_eeprom_probe()

◆ psoc5lp_eeprom_write()

static int psoc5lp_eeprom_write ( struct flash_bank bank,
const uint8_t *  buffer,
uint32_t  offset,
uint32_t  byte_count 
)
static

◆ psoc5lp_erase()

static int psoc5lp_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)
static

◆ psoc5lp_erase_check()

◆ psoc5lp_find_device()

static int psoc5lp_find_device ( struct target target,
const struct psoc5lp_device **  device 
)
static

◆ psoc5lp_get_device_id()

static int psoc5lp_get_device_id ( struct target target,
uint32_t *  id 
)
static

Definition at line 233 of file psoc5lp.c.

References ERROR_OK, PANTHER_DEVICE_ID, and target_read_u32().

Referenced by psoc5lp_find_device().

◆ psoc5lp_get_info_command()

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

◆ psoc5lp_get_part_number()

static void psoc5lp_get_part_number ( const struct psoc5lp_device dev,
char *  str 
)
static

◆ psoc5lp_nvl_auto_probe()

static int psoc5lp_nvl_auto_probe ( struct flash_bank bank)
static

Definition at line 789 of file psoc5lp.c.

References bank, ERROR_OK, psoc5lp_nvl_flash_bank::probed, and psoc5lp_nvl_probe().

◆ psoc5lp_nvl_erase()

static int psoc5lp_nvl_erase ( struct flash_bank bank,
unsigned int  first,
unsigned int  last 
)
static

Definition at line 649 of file psoc5lp.c.

References ERROR_FLASH_OPER_UNSUPPORTED, and LOG_WARNING.

◆ psoc5lp_nvl_erase_check()

static int psoc5lp_nvl_erase_check ( struct flash_bank bank)
static

Definition at line 656 of file psoc5lp.c.

References bank, and ERROR_OK.

◆ psoc5lp_nvl_get_info_command()

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

◆ psoc5lp_nvl_probe()

static int psoc5lp_nvl_probe ( struct flash_bank bank)
static

◆ psoc5lp_nvl_read()

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

◆ psoc5lp_nvl_write()

◆ psoc5lp_probe()

◆ psoc5lp_protect_check()

◆ psoc5lp_spc_busy_wait_data()

static int psoc5lp_spc_busy_wait_data ( struct target target)
static

◆ psoc5lp_spc_busy_wait_idle()

◆ psoc5lp_spc_enable_clock()

static int psoc5lp_spc_enable_clock ( struct target target)
static

◆ psoc5lp_spc_erase_all()

static int psoc5lp_spc_erase_all ( struct target target)
static

Definition at line 511 of file psoc5lp.c.

References ERROR_OK, psoc5lp_spc_busy_wait_idle(), psoc5lp_spc_write_opcode(), and SPC_ERASE_ALL.

Referenced by COMMAND_HANDLER().

◆ psoc5lp_spc_erase_sector()

static int psoc5lp_spc_erase_sector ( struct target target,
uint8_t  array_id,
uint8_t  row_id 
)
static

◆ psoc5lp_spc_get_temp()

static int psoc5lp_spc_get_temp ( struct target target,
uint8_t  samples,
uint8_t *  data 
)
static

◆ psoc5lp_spc_load_byte()

static int psoc5lp_spc_load_byte ( struct target target,
uint8_t  array_id,
uint8_t  offset,
uint8_t  value 
)
static

◆ psoc5lp_spc_load_row()

static int psoc5lp_spc_load_row ( struct target target,
uint8_t  array_id,
const uint8_t *  data,
unsigned  row_size 
)
static

◆ psoc5lp_spc_read_byte()

static int psoc5lp_spc_read_byte ( struct target target,
uint8_t  array_id,
uint8_t  offset,
uint8_t *  data 
)
static

◆ psoc5lp_spc_read_hidden_row()

static int psoc5lp_spc_read_hidden_row ( struct target target,
uint8_t  array_id,
uint8_t  row_id,
uint8_t *  data 
)
static

◆ psoc5lp_spc_read_volatile_byte()

static int psoc5lp_spc_read_volatile_byte ( struct target target,
uint8_t  array_id,
uint8_t  offset,
uint8_t *  data 
)
static

◆ psoc5lp_spc_write_opcode()

◆ psoc5lp_spc_write_opcode_buffer()

static void psoc5lp_spc_write_opcode_buffer ( struct target target,
uint8_t *  buf,
uint8_t  opcode 
)
static

Definition at line 304 of file psoc5lp.c.

References SPC_KEY1, and SPC_KEY2.

Referenced by psoc5lp_write().

◆ psoc5lp_spc_write_row()

static int psoc5lp_spc_write_row ( struct target target,
uint8_t  array_id,
uint16_t  row_id,
const uint8_t *  temp 
)
static

◆ psoc5lp_spc_write_user_nvl()

static int psoc5lp_spc_write_user_nvl ( struct target target,
uint8_t  array_id 
)
static

◆ psoc5lp_write()

Variable Documentation

◆ psoc5lp_command_handlers

const struct command_registration psoc5lp_command_handlers[]
static
Initial value:
= {
{
.name = "psoc5lp",
.mode = COMMAND_ANY,
.help = "PSoC 5LP flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:247
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration psoc5lp_exec_command_handlers[]
Definition: psoc5lp.c:1485

Definition at line 1469 of file psoc5lp.c.

◆ psoc5lp_devices

const struct psoc5lp_device psoc5lp_devices[]
static

Definition at line 1 of file psoc5lp.c.

Referenced by psoc5lp_find_device().

◆ psoc5lp_eeprom_flash

const struct flash_driver psoc5lp_eeprom_flash
Initial value:
= {
.name = "psoc5lp_eeprom",
.flash_bank_command = psoc5lp_eeprom_flash_bank_command,
.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 psoc5lp_eeprom_probe(struct flash_bank *bank)
Definition: psoc5lp.c:922
static int psoc5lp_eeprom_get_info_command(struct flash_bank *bank, struct command_invocation *cmd)
Definition: psoc5lp.c:910
static int psoc5lp_eeprom_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: psoc5lp.c:836
static int psoc5lp_eeprom_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
Definition: psoc5lp.c:851
static int psoc5lp_eeprom_auto_probe(struct flash_bank *bank)
Definition: psoc5lp.c:971

Definition at line 981 of file psoc5lp.c.

◆ psoc5lp_exec_command_handlers

const struct command_registration psoc5lp_exec_command_handlers[]
static
Initial value:
= {
{
.name = "mass_erase",
.handler = psoc5lp_handle_mass_erase_command,
.mode = COMMAND_EXEC,
.usage = "bank_id",
.help = "Erase all flash data and ECC/configuration bytes, "
"all flash protection rows, "
"and all row latches in all flash arrays on the device.",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 1469 of file psoc5lp.c.

◆ psoc5lp_flash

const struct flash_driver psoc5lp_flash
Initial value:
= {
.name = "psoc5lp",
.flash_bank_command = psoc5lp_flash_bank_command,
.probe = psoc5lp_probe,
.auto_probe = psoc5lp_auto_probe,
.protect_check = psoc5lp_protect_check,
.erase = psoc5lp_erase,
.erase_check = psoc5lp_erase_check,
.write = psoc5lp_write,
.free_driver_priv = default_flash_free_driver_priv,
}
static int psoc5lp_probe(struct flash_bank *bank)
Definition: psoc5lp.c:1371
static int psoc5lp_protect_check(struct flash_bank *bank)
Definition: psoc5lp.c:1306
static const struct command_registration psoc5lp_command_handlers[]
Definition: psoc5lp.c:1498
static int psoc5lp_auto_probe(struct flash_bank *bank)
Definition: psoc5lp.c:1443
static int psoc5lp_get_info_command(struct flash_bank *bank, struct command_invocation *cmd)
Definition: psoc5lp.c:1357
static int psoc5lp_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: psoc5lp.c:1024
static int psoc5lp_erase_check(struct flash_bank *bank)
Definition: psoc5lp.c:1056
static int psoc5lp_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
Definition: psoc5lp.c:1119

Definition at line 1469 of file psoc5lp.c.

◆ psoc5lp_nvl_flash

const struct flash_driver psoc5lp_nvl_flash
Initial value:
= {
.name = "psoc5lp_nvl",
.flash_bank_command = psoc5lp_nvl_flash_bank_command,
.auto_probe = psoc5lp_nvl_auto_probe,
.erase_check = psoc5lp_nvl_erase_check,
.free_driver_priv = default_flash_free_driver_priv,
}
static int psoc5lp_nvl_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: psoc5lp.c:627
static int psoc5lp_nvl_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: psoc5lp.c:649
static int psoc5lp_nvl_auto_probe(struct flash_bank *bank)
Definition: psoc5lp.c:789
static int psoc5lp_nvl_probe(struct flash_bank *bank)
Definition: psoc5lp.c:757
static int psoc5lp_nvl_get_info_command(struct flash_bank *bank, struct command_invocation *cmd)
Definition: psoc5lp.c:744
static int psoc5lp_nvl_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
Definition: psoc5lp.c:664
static int psoc5lp_nvl_erase_check(struct flash_bank *bank)
Definition: psoc5lp.c:656

Definition at line 799 of file psoc5lp.c.