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

Go to the source code of this file.

Data Structures

struct  eneispif_flash_bank
 

Macros

#define CFG_READ   0x372
 
#define CFG_WRITE   0x371
 
#define ISPI_CTRL_BASE   0x50101000
 
#define ISPIADDR   0x0008
 
#define ISPICFG   0x0000
 
#define ISPICMD   0x000C
 
#define ISPIDAT   0x0100
 
#define ISPISTS   0x0004
 
#define ISPISTS_BUSY   BIT(0)
 
#define STATUS1_QE   BIT(1)
 

Functions

static int eneispi_erase_sector (struct flash_bank *bank, int sector)
 
static int eneispif_auto_probe (struct flash_bank *bank)
 
static int eneispif_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int eneispif_probe (struct flash_bank *bank)
 
static int eneispif_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last)
 
static int eneispif_protect_check (struct flash_bank *bank)
 
static int eneispif_read_flash_id (struct flash_bank *bank, uint32_t *id)
 
static int eneispif_read_reg (struct flash_bank *bank, uint32_t *value, target_addr_t address)
 
static int eneispif_wait (struct flash_bank *bank)
 
static int eneispif_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int eneispif_write_reg (struct flash_bank *bank, target_addr_t address, uint32_t value)
 
 FLASH_BANK_COMMAND_HANDLER (eneispif_flash_bank_command)
 
static int get_eneispif_info (struct flash_bank *bank, struct command_invocation *cmd)
 

Variables

struct flash_device ene_flash_device
 
const struct flash_driver eneispif_flash
 

Macro Definition Documentation

◆ CFG_READ

#define CFG_READ   0x372

Definition at line 28 of file eneispif.c.

◆ CFG_WRITE

#define CFG_WRITE   0x371

Definition at line 29 of file eneispif.c.

◆ ISPI_CTRL_BASE

#define ISPI_CTRL_BASE   0x50101000

Definition at line 31 of file eneispif.c.

◆ ISPIADDR

#define ISPIADDR   0x0008

Definition at line 21 of file eneispif.c.

◆ ISPICFG

#define ISPICFG   0x0000

Definition at line 19 of file eneispif.c.

◆ ISPICMD

#define ISPICMD   0x000C

Definition at line 22 of file eneispif.c.

◆ ISPIDAT

#define ISPIDAT   0x0100

Definition at line 23 of file eneispif.c.

◆ ISPISTS

#define ISPISTS   0x0004

Definition at line 20 of file eneispif.c.

◆ ISPISTS_BUSY

#define ISPISTS_BUSY   BIT(0)

Definition at line 25 of file eneispif.c.

◆ STATUS1_QE

#define STATUS1_QE   BIT(1)

Definition at line 26 of file eneispif.c.

Function Documentation

◆ eneispi_erase_sector()

static int eneispi_erase_sector ( struct flash_bank bank,
int  sector 
)
static

◆ eneispif_auto_probe()

static int eneispif_auto_probe ( struct flash_bank bank)
static

Definition at line 388 of file eneispif.c.

References bank, eneispif_probe(), ERROR_OK, and eneispif_flash_bank::probed.

◆ eneispif_erase()

◆ eneispif_probe()

◆ eneispif_protect()

static int eneispif_protect ( struct flash_bank bank,
int  set,
unsigned int  first,
unsigned int  last 
)
static

Definition at line 202 of file eneispif.c.

References bank, and ERROR_OK.

◆ eneispif_protect_check()

static int eneispif_protect_check ( struct flash_bank bank)
static

Definition at line 396 of file eneispif.c.

References ERROR_OK.

◆ eneispif_read_flash_id()

◆ eneispif_read_reg()

static int eneispif_read_reg ( struct flash_bank bank,
uint32_t *  value,
target_addr_t  address 
)
static

◆ eneispif_wait()

static int eneispif_wait ( struct flash_bank bank)
static

◆ eneispif_write()

◆ eneispif_write_reg()

static int eneispif_write_reg ( struct flash_bank bank,
target_addr_t  address,
uint32_t  value 
)
static

◆ FLASH_BANK_COMMAND_HANDLER()

◆ get_eneispif_info()

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

Definition at line 402 of file eneispif.c.

Variable Documentation

◆ ene_flash_device

struct flash_device ene_flash_device
Initial value:
=
FLASH_ID("ISPI flash", 0x03, 0x00, 0x02, 0x20, 0x60, 0x00132085, 0x100, 0x1000, 0x80000)
#define FLASH_ID(n, re, qr, pp, es, ces, id, psize, ssize, size)
Definition: spi.h:33

Definition at line 1 of file eneispif.c.

Referenced by eneispif_probe().

◆ eneispif_flash

const struct flash_driver eneispif_flash
Initial value:
= {
.name = "eneispif",
.usage = "flash bank <name> 'eneispif' <base_address> <size> 0 0 <target> <ctrl_base>",
.flash_bank_command = eneispif_flash_bank_command,
.erase = eneispif_erase,
.protect = eneispif_protect,
.write = eneispif_write,
.probe = eneispif_probe,
.auto_probe = eneispif_auto_probe,
.erase_check = default_flash_blank_check,
.protect_check = eneispif_protect_check,
.free_driver_priv = default_flash_free_driver_priv,
}
static int eneispif_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: eneispif.c:210
static int eneispif_probe(struct flash_bank *bank)
Definition: eneispif.c:329
static int eneispif_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: eneispif.c:160
static int eneispif_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
Definition: eneispif.c:202
static int get_eneispif_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: eneispif.c:402
static int eneispif_protect_check(struct flash_bank *bank)
Definition: eneispif.c:396
static int eneispif_auto_probe(struct flash_bank *bank)
Definition: eneispif.c:388
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.

Definition at line 402 of file eneispif.c.