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

Go to the source code of this file.

Data Structures

struct  mrvlqspi_flash_bank
 

Macros

#define ADDR   0x14
 
#define BLOCK_ERASE_TIMEOUT   (1000)
 
#define CHIP_ERASE_TIMEOUT   (10000)
 
#define CNTL   0x0 /* QSPI_BASE + 0x0 */
 
#define CONF   0x4
 
#define CONF_MASK   (0x7)
 
#define CONF_OFFSET   (10)
 
#define DIN   0xc
 
#define DINCNT   0x20
 
#define DOUT   0x8
 
#define FIFO_FLUSH   (1 << 9)
 
#define FIFO_FLUSH_TIMEOUT   (1000)
 
#define HDRCNT   0x1c
 
#define INS_PAGE_PROGRAM   0x02
 
#define INS_READ_STATUS   0x05
 
#define INS_WRITE_DISABLE   0x04
 
#define INS_WRITE_ENABLE   0x06
 
#define INSTR   0x10
 
#define QSPI_R_EN   (0x0)
 
#define QSPI_SS_DISABLE   (0x0)
 
#define QSPI_SS_ENABLE   (0x1)
 
#define QSPI_TIMEOUT   (1000)
 
#define QSPI_W_EN   (0x1)
 
#define RDMODE   0x18
 
#define RFIFO_EMPTY   (1 << 4)
 
#define RW_EN   (1 << 13)
 
#define SS_EN   (1 << 0)
 
#define WFIFO_EMPTY   (1 << 6)
 
#define WFIFO_FULL   (1 << 7)
 
#define WRITE_DISABLE   (0x0)
 
#define WRITE_ENABLE   (0x1)
 
#define XFER_RDY   (1 << 1)
 
#define XFER_START   (1 << 15)
 
#define XFER_STOP   (1 << 14)
 

Functions

 FLASH_BANK_COMMAND_HANDLER (mrvlqspi_flash_bank_command)
 
static int mrvlqspi_auto_probe (struct flash_bank *bank)
 
static int mrvlqspi_block_erase (struct flash_bank *bank, uint32_t offset)
 
static int mrvlqspi_bulk_erase (struct flash_bank *bank)
 
static int mrvlqspi_fifo_flush (struct flash_bank *bank, int timeout)
 
static int mrvlqspi_flash_busy_status (struct flash_bank *bank, int timeout)
 
static int mrvlqspi_flash_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int mrvlqspi_flash_erase_check (struct flash_bank *bank)
 
static int mrvlqspi_flash_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int mrvlqspi_flash_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int mrvlqspi_get_info (struct flash_bank *bank, struct command_invocation *cmd)
 
static uint32_t mrvlqspi_get_reg (struct flash_bank *bank, uint32_t reg)
 
static int mrvlqspi_probe (struct flash_bank *bank)
 
static int mrvlqspi_read_byte (struct flash_bank *bank, uint8_t *data)
 
static int mrvlqspi_read_id (struct flash_bank *bank, uint32_t *id)
 
static int mrvlqspi_set_addr (struct flash_bank *bank, uint32_t addr)
 
static int mrvlqspi_set_conf (struct flash_bank *bank, uint32_t conf_val)
 
static int mrvlqspi_set_din_cnt (struct flash_bank *bank, uint32_t count)
 
static int mrvlqspi_set_hdr_cnt (struct flash_bank *bank, uint32_t hdr_cnt)
 
static int mrvlqspi_set_instr (struct flash_bank *bank, uint32_t instr)
 
static int mrvlqspi_set_ss_state (struct flash_bank *bank, bool state, int timeout)
 
static int mrvlqspi_set_write_status (struct flash_bank *bank, bool mode)
 
static int mrvlqspi_start_transfer (struct flash_bank *bank, bool rw_mode)
 
static int mrvlqspi_stop_transfer (struct flash_bank *bank)
 

Variables

const struct flash_driver mrvlqspi_flash
 

Macro Definition Documentation

◆ ADDR

#define ADDR   0x14

Definition at line 59 of file mrvlqspi.c.

◆ BLOCK_ERASE_TIMEOUT

#define BLOCK_ERASE_TIMEOUT   (1000)

Definition at line 34 of file mrvlqspi.c.

◆ CHIP_ERASE_TIMEOUT

#define CHIP_ERASE_TIMEOUT   (10000)

Definition at line 35 of file mrvlqspi.c.

◆ CNTL

#define CNTL   0x0 /* QSPI_BASE + 0x0 */

Definition at line 54 of file mrvlqspi.c.

◆ CONF

#define CONF   0x4

Definition at line 55 of file mrvlqspi.c.

◆ CONF_MASK

#define CONF_MASK   (0x7)

Definition at line 46 of file mrvlqspi.c.

◆ CONF_OFFSET

#define CONF_OFFSET   (10)

Definition at line 47 of file mrvlqspi.c.

◆ DIN

#define DIN   0xc

Definition at line 57 of file mrvlqspi.c.

◆ DINCNT

#define DINCNT   0x20

Definition at line 62 of file mrvlqspi.c.

◆ DOUT

#define DOUT   0x8

Definition at line 56 of file mrvlqspi.c.

◆ FIFO_FLUSH

#define FIFO_FLUSH   (1 << 9)

Definition at line 42 of file mrvlqspi.c.

◆ FIFO_FLUSH_TIMEOUT

#define FIFO_FLUSH_TIMEOUT   (1000)

Definition at line 33 of file mrvlqspi.c.

◆ HDRCNT

#define HDRCNT   0x1c

Definition at line 61 of file mrvlqspi.c.

◆ INS_PAGE_PROGRAM

#define INS_PAGE_PROGRAM   0x02

Definition at line 52 of file mrvlqspi.c.

◆ INS_READ_STATUS

#define INS_READ_STATUS   0x05

Definition at line 51 of file mrvlqspi.c.

◆ INS_WRITE_DISABLE

#define INS_WRITE_DISABLE   0x04

Definition at line 50 of file mrvlqspi.c.

◆ INS_WRITE_ENABLE

#define INS_WRITE_ENABLE   0x06

Definition at line 49 of file mrvlqspi.c.

◆ INSTR

#define INSTR   0x10

Definition at line 58 of file mrvlqspi.c.

◆ QSPI_R_EN

#define QSPI_R_EN   (0x0)

Definition at line 25 of file mrvlqspi.c.

◆ QSPI_SS_DISABLE

#define QSPI_SS_DISABLE   (0x0)

Definition at line 27 of file mrvlqspi.c.

◆ QSPI_SS_ENABLE

#define QSPI_SS_ENABLE   (0x1)

Definition at line 28 of file mrvlqspi.c.

◆ QSPI_TIMEOUT

#define QSPI_TIMEOUT   (1000)

Definition at line 32 of file mrvlqspi.c.

◆ QSPI_W_EN

#define QSPI_W_EN   (0x1)

Definition at line 26 of file mrvlqspi.c.

◆ RDMODE

#define RDMODE   0x18

Definition at line 60 of file mrvlqspi.c.

◆ RFIFO_EMPTY

#define RFIFO_EMPTY   (1 << 4)

Definition at line 39 of file mrvlqspi.c.

◆ RW_EN

#define RW_EN   (1 << 13)

Definition at line 43 of file mrvlqspi.c.

◆ SS_EN

#define SS_EN   (1 << 0)

Definition at line 37 of file mrvlqspi.c.

◆ WFIFO_EMPTY

#define WFIFO_EMPTY   (1 << 6)

Definition at line 40 of file mrvlqspi.c.

◆ WFIFO_FULL

#define WFIFO_FULL   (1 << 7)

Definition at line 41 of file mrvlqspi.c.

◆ WRITE_DISABLE

#define WRITE_DISABLE   (0x0)

Definition at line 29 of file mrvlqspi.c.

◆ WRITE_ENABLE

#define WRITE_ENABLE   (0x1)

Definition at line 30 of file mrvlqspi.c.

◆ XFER_RDY

#define XFER_RDY   (1 << 1)

Definition at line 38 of file mrvlqspi.c.

◆ XFER_START

#define XFER_START   (1 << 15)

Definition at line 45 of file mrvlqspi.c.

◆ XFER_STOP

#define XFER_STOP   (1 << 14)

Definition at line 44 of file mrvlqspi.c.

Function Documentation

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( mrvlqspi_flash_bank_command  )

◆ mrvlqspi_auto_probe()

static int mrvlqspi_auto_probe ( struct flash_bank bank)
static

Definition at line 892 of file mrvlqspi.c.

References bank, ERROR_OK, mrvlqspi_probe(), and mrvlqspi_flash_bank::probed.

◆ mrvlqspi_block_erase()

◆ mrvlqspi_bulk_erase()

◆ mrvlqspi_fifo_flush()

static int mrvlqspi_fifo_flush ( struct flash_bank bank,
int  timeout 
)
static

◆ mrvlqspi_flash_busy_status()

◆ mrvlqspi_flash_erase()

◆ mrvlqspi_flash_erase_check()

static int mrvlqspi_flash_erase_check ( struct flash_bank bank)
static

Definition at line 900 of file mrvlqspi.c.

References ERROR_OK.

◆ mrvlqspi_flash_read()

◆ mrvlqspi_flash_write()

◆ mrvlqspi_get_info()

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

◆ mrvlqspi_get_reg()

◆ mrvlqspi_probe()

◆ mrvlqspi_read_byte()

static int mrvlqspi_read_byte ( struct flash_bank bank,
uint8_t *  data 
)
static

◆ mrvlqspi_read_id()

◆ mrvlqspi_set_addr()

static int mrvlqspi_set_addr ( struct flash_bank bank,
uint32_t  addr 
)
inlinestatic

Definition at line 84 of file mrvlqspi.c.

References ADDR, addr, bank, mrvlqspi_get_reg(), and target_write_u32().

Referenced by mrvlqspi_block_erase(), and mrvlqspi_flash_read().

◆ mrvlqspi_set_conf()

static int mrvlqspi_set_conf ( struct flash_bank bank,
uint32_t  conf_val 
)
static

◆ mrvlqspi_set_din_cnt()

static int mrvlqspi_set_din_cnt ( struct flash_bank bank,
uint32_t  count 
)
inlinestatic

◆ mrvlqspi_set_hdr_cnt()

static int mrvlqspi_set_hdr_cnt ( struct flash_bank bank,
uint32_t  hdr_cnt 
)
inlinestatic

◆ mrvlqspi_set_instr()

static int mrvlqspi_set_instr ( struct flash_bank bank,
uint32_t  instr 
)
inlinestatic

◆ mrvlqspi_set_ss_state()

static int mrvlqspi_set_ss_state ( struct flash_bank bank,
bool  state,
int  timeout 
)
static

◆ mrvlqspi_set_write_status()

static int mrvlqspi_set_write_status ( struct flash_bank bank,
bool  mode 
)
static

◆ mrvlqspi_start_transfer()

◆ mrvlqspi_stop_transfer()

Variable Documentation

◆ mrvlqspi_flash

const struct flash_driver mrvlqspi_flash
Initial value:
= {
.name = "mrvlqspi",
.flash_bank_command = mrvlqspi_flash_bank_command,
.probe = mrvlqspi_probe,
.auto_probe = mrvlqspi_auto_probe,
.free_driver_priv = default_flash_free_driver_priv,
}
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
static int mrvlqspi_flash_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: mrvlqspi.c:753
static int mrvlqspi_flash_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: mrvlqspi.c:578
static int mrvlqspi_flash_erase_check(struct flash_bank *bank)
Definition: mrvlqspi.c:900
static int mrvlqspi_flash_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: mrvlqspi.c:519
static int mrvlqspi_get_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: mrvlqspi.c:906
static int mrvlqspi_probe(struct flash_bank *bank)
Definition: mrvlqspi.c:818
static int mrvlqspi_auto_probe(struct flash_bank *bank)
Definition: mrvlqspi.c:892

Definition at line 922 of file mrvlqspi.c.