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

Go to the source code of this file.

Data Structures

struct  str9xpec_flash_controller
 

Macros

#define ISC_ADDRESS_SHIFT   0x11
 
#define ISC_BLANK_CHECK   0x60
 
#define ISC_CLR_STATUS   0x13
 
#define ISC_CONFIGURATION   0x07
 
#define ISC_DISABLE   0x0F
 
#define ISC_ENABLE   0x0C
 
#define ISC_ERASE   0x30
 
#define ISC_IDCODE   0xFE
 
#define ISC_MFG_READ   0x4C
 
#define ISC_NOOP   0x10
 
#define ISC_PROGRAM   0x20
 
#define ISC_PROGRAM_SECURITY   0x22
 
#define ISC_PROGRAM_UC   0x23
 
#define ISC_READ   0x50
 
#define ISC_STATUS_BUSY   0x04
 
#define ISC_STATUS_ERROR   0x03
 
#define ISC_STATUS_INT_ERROR   0x30
 
#define ISC_STATUS_MODE   0x08
 
#define ISC_STATUS_SECURITY   0x40
 
#define STR9XPEC_OPT_CSMAPBIT   48
 
#define STR9XPEC_OPT_LVDSELBIT   50
 
#define STR9XPEC_OPT_LVDTHRESBIT   49
 
#define STR9XPEC_OPT_LVDWARNBIT   51
 
#define STR9XPEC_OPT_OTPBIT   63
 

Enumerations

enum  str9xpec_status_codes { STR9XPEC_INVALID_COMMAND = 1 , STR9XPEC_ISC_SUCCESS = 2 , STR9XPEC_ISC_DISABLED = 3 , STR9XPEC_ISC_INTFAIL = 32 }
 

Functions

 COMMAND_HANDLER (str9xpec_handle_flash_disable_turbo_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_enable_turbo_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_lock_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_cmap_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_lvdsel_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_lvdthd_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_lvdwarn_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_read_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_options_write_command)
 
 COMMAND_HANDLER (str9xpec_handle_flash_unlock_command)
 
 COMMAND_HANDLER (str9xpec_handle_part_id_command)
 
 FLASH_BANK_COMMAND_HANDLER (str9xpec_flash_bank_command)
 
static int str9xpec_blank_check (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int str9xpec_build_block_list (struct flash_bank *bank)
 
static int str9xpec_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int str9xpec_erase_area (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int str9xpec_erase_check (struct flash_bank *bank)
 
static int str9xpec_isc_disable (struct flash_bank *bank)
 
static int str9xpec_isc_enable (struct flash_bank *bank)
 
static uint8_t str9xpec_isc_status (struct jtag_tap *tap)
 
static int str9xpec_lock_device (struct flash_bank *bank)
 
static int str9xpec_probe (struct flash_bank *bank)
 
static int str9xpec_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last)
 
static int str9xpec_protect_check (struct flash_bank *bank)
 
static int str9xpec_read_config (struct flash_bank *bank)
 
static int str9xpec_set_address (struct flash_bank *bank, uint8_t sector)
 
static int str9xpec_set_instr (struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
 
static int str9xpec_unlock_device (struct flash_bank *bank)
 
static int str9xpec_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int str9xpec_write_options (struct flash_bank *bank)
 

Variables

static const struct command_registration str9xpec_command_handlers []
 
static const struct command_registration str9xpec_config_command_handlers []
 
const struct flash_driver str9xpec_flash
 

Macro Definition Documentation

◆ ISC_ADDRESS_SHIFT

#define ISC_ADDRESS_SHIFT   0x11

Definition at line 26 of file str9xpec.c.

◆ ISC_BLANK_CHECK

#define ISC_BLANK_CHECK   0x60

Definition at line 33 of file str9xpec.c.

◆ ISC_CLR_STATUS

#define ISC_CLR_STATUS   0x13

Definition at line 27 of file str9xpec.c.

◆ ISC_CONFIGURATION

#define ISC_CONFIGURATION   0x07

Definition at line 22 of file str9xpec.c.

◆ ISC_DISABLE

#define ISC_DISABLE   0x0F

Definition at line 24 of file str9xpec.c.

◆ ISC_ENABLE

#define ISC_ENABLE   0x0C

Definition at line 23 of file str9xpec.c.

◆ ISC_ERASE

#define ISC_ERASE   0x30

Definition at line 31 of file str9xpec.c.

◆ ISC_IDCODE

#define ISC_IDCODE   0xFE

Definition at line 20 of file str9xpec.c.

◆ ISC_MFG_READ

#define ISC_MFG_READ   0x4C

Definition at line 21 of file str9xpec.c.

◆ ISC_NOOP

#define ISC_NOOP   0x10

Definition at line 25 of file str9xpec.c.

◆ ISC_PROGRAM

#define ISC_PROGRAM   0x20

Definition at line 28 of file str9xpec.c.

◆ ISC_PROGRAM_SECURITY

#define ISC_PROGRAM_SECURITY   0x22

Definition at line 29 of file str9xpec.c.

◆ ISC_PROGRAM_UC

#define ISC_PROGRAM_UC   0x23

Definition at line 30 of file str9xpec.c.

◆ ISC_READ

#define ISC_READ   0x50

Definition at line 32 of file str9xpec.c.

◆ ISC_STATUS_BUSY

#define ISC_STATUS_BUSY   0x04

Definition at line 40 of file str9xpec.c.

◆ ISC_STATUS_ERROR

#define ISC_STATUS_ERROR   0x03

Definition at line 41 of file str9xpec.c.

◆ ISC_STATUS_INT_ERROR

#define ISC_STATUS_INT_ERROR   0x30

Definition at line 38 of file str9xpec.c.

◆ ISC_STATUS_MODE

#define ISC_STATUS_MODE   0x08

Definition at line 39 of file str9xpec.c.

◆ ISC_STATUS_SECURITY

#define ISC_STATUS_SECURITY   0x40

Definition at line 37 of file str9xpec.c.

◆ STR9XPEC_OPT_CSMAPBIT

#define STR9XPEC_OPT_CSMAPBIT   48

Definition at line 45 of file str9xpec.c.

◆ STR9XPEC_OPT_LVDSELBIT

#define STR9XPEC_OPT_LVDSELBIT   50

Definition at line 47 of file str9xpec.c.

◆ STR9XPEC_OPT_LVDTHRESBIT

#define STR9XPEC_OPT_LVDTHRESBIT   49

Definition at line 46 of file str9xpec.c.

◆ STR9XPEC_OPT_LVDWARNBIT

#define STR9XPEC_OPT_LVDWARNBIT   51

Definition at line 48 of file str9xpec.c.

◆ STR9XPEC_OPT_OTPBIT

#define STR9XPEC_OPT_OTPBIT   63

Definition at line 49 of file str9xpec.c.

Enumeration Type Documentation

◆ str9xpec_status_codes

Enumerator
STR9XPEC_INVALID_COMMAND 
STR9XPEC_ISC_SUCCESS 
STR9XPEC_ISC_DISABLED 
STR9XPEC_ISC_INTFAIL 

Definition at line 51 of file str9xpec.c.

Function Documentation

◆ COMMAND_HANDLER() [1/11]

◆ COMMAND_HANDLER() [2/11]

◆ COMMAND_HANDLER() [3/11]

COMMAND_HANDLER ( str9xpec_handle_flash_lock_command  )

◆ COMMAND_HANDLER() [4/11]

COMMAND_HANDLER ( str9xpec_handle_flash_options_cmap_command  )

◆ COMMAND_HANDLER() [5/11]

COMMAND_HANDLER ( str9xpec_handle_flash_options_lvdsel_command  )

◆ COMMAND_HANDLER() [6/11]

COMMAND_HANDLER ( str9xpec_handle_flash_options_lvdthd_command  )

◆ COMMAND_HANDLER() [7/11]

COMMAND_HANDLER ( str9xpec_handle_flash_options_lvdwarn_command  )

◆ COMMAND_HANDLER() [8/11]

◆ COMMAND_HANDLER() [9/11]

COMMAND_HANDLER ( str9xpec_handle_flash_options_write_command  )

◆ COMMAND_HANDLER() [10/11]

COMMAND_HANDLER ( str9xpec_handle_flash_unlock_command  )

◆ COMMAND_HANDLER() [11/11]

◆ FLASH_BANK_COMMAND_HANDLER()

◆ str9xpec_blank_check()

◆ str9xpec_build_block_list()

static int str9xpec_build_block_list ( struct flash_bank bank)
static

Definition at line 198 of file str9xpec.c.

References bank, ERROR_OK, LOG_ERROR, offset, and str9xpec_flash_controller::sector_bits.

Referenced by FLASH_BANK_COMMAND_HANDLER().

◆ str9xpec_erase()

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

◆ str9xpec_erase_area()

◆ str9xpec_erase_check()

static int str9xpec_erase_check ( struct flash_bank bank)
static

Definition at line 745 of file str9xpec.c.

References bank, and str9xpec_blank_check().

◆ str9xpec_isc_disable()

◆ str9xpec_isc_enable()

◆ str9xpec_isc_status()

◆ str9xpec_lock_device()

◆ str9xpec_probe()

static int str9xpec_probe ( struct flash_bank bank)
static

Definition at line 701 of file str9xpec.c.

References ERROR_OK.

◆ str9xpec_protect()

◆ str9xpec_protect_check()

◆ str9xpec_read_config()

◆ str9xpec_set_address()

static int str9xpec_set_address ( struct flash_bank bank,
uint8_t  sector 
)
static

◆ str9xpec_set_instr()

◆ str9xpec_unlock_device()

static int str9xpec_unlock_device ( struct flash_bank bank)
static

Definition at line 488 of file str9xpec.c.

References bank, status, and str9xpec_erase_area().

Referenced by COMMAND_HANDLER(), and str9xpec_protect().

◆ str9xpec_write()

◆ str9xpec_write_options()

Variable Documentation

◆ str9xpec_command_handlers

const struct command_registration str9xpec_command_handlers[]
static
Initial value:
= {
{
.name = "str9xpec",
.mode = COMMAND_ANY,
.help = "str9xpec 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 str9xpec_config_command_handlers[]
Definition: str9xpec.c:1096

Definition at line 1065 of file str9xpec.c.

◆ str9xpec_config_command_handlers

const struct command_registration str9xpec_config_command_handlers[]
static

Definition at line 1065 of file str9xpec.c.

◆ str9xpec_flash

const struct flash_driver str9xpec_flash
Initial value:
= {
.name = "str9xpec",
.flash_bank_command = str9xpec_flash_bank_command,
.erase = str9xpec_erase,
.protect = str9xpec_protect,
.write = str9xpec_write,
.probe = str9xpec_probe,
.auto_probe = str9xpec_probe,
.erase_check = str9xpec_erase_check,
.protect_check = str9xpec_protect_check,
.free_driver_priv = default_flash_free_driver_priv,
}
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 str9xpec_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: str9xpec.c:556
static int str9xpec_protect_check(struct flash_bank *bank)
Definition: str9xpec.c:357
static int str9xpec_erase_check(struct flash_bank *bank)
Definition: str9xpec.c:745
static const struct command_registration str9xpec_command_handlers[]
Definition: str9xpec.c:1177
static int str9xpec_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
Definition: str9xpec.c:497
static int str9xpec_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: str9xpec.c:436
static int str9xpec_probe(struct flash_bank *bank)
Definition: str9xpec.c:701

Definition at line 1065 of file str9xpec.c.