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

Go to the source code of this file.

Macros

#define PRC_PHYCNT_EXDS   BIT(21)
 
#define PRC_PHYCNT_OCTA_AA   BIT(22)
 
#define PRC_PHYCNT_OCTA_SA   BIT(23)
 
#define RPC_CMNCR   0x0000 /* R/W */
 
#define RPC_CMNCR_BSZ(val)   (((val) & 0x3) << 0)
 
#define RPC_CMNCR_IO0FV(val)   (((val) & 0x3) << 8)
 
#define RPC_CMNCR_IO2FV(val)   (((val) & 0x3) << 12)
 
#define RPC_CMNCR_IO3FV(val)   (((val) & 0x3) << 14)
 
#define RPC_CMNCR_IOFV_HIZ
 
#define RPC_CMNCR_MD   BIT(31)
 
#define RPC_CMNCR_MOIIO0(val)   (((val) & 0x3) << 16)
 
#define RPC_CMNCR_MOIIO1(val)   (((val) & 0x3) << 18)
 
#define RPC_CMNCR_MOIIO2(val)   (((val) & 0x3) << 20)
 
#define RPC_CMNCR_MOIIO3(val)   (((val) & 0x3) << 22)
 
#define RPC_CMNCR_MOIIO_HIZ
 
#define RPC_CMNSR   0x0048 /* R */
 
#define RPC_CMNSR_SSLF   BIT(1)
 
#define RPC_CMNSR_TEND   BIT(0)
 
#define RPC_DRCMR   0x0010 /* R/W */
 
#define RPC_DRCMR_CMD(c)   (((c) & 0xFF) << 16)
 
#define RPC_DRCMR_OCMD(c)   (((c) & 0xFF) << 0)
 
#define RPC_DRCR   0x000C /* R/W */
 
#define RPC_DRCR_RBE   BIT(8)
 
#define RPC_DRCR_RBURST(v)   (((v) & 0x1F) << 16)
 
#define RPC_DRCR_RCF   BIT(9)
 
#define RPC_DRCR_SSLE   BIT(0)
 
#define RPC_DRCR_SSLN   BIT(24)
 
#define RPC_DRDMCR   0x0058 /* R/W */
 
#define RPC_DRDMCR_DMCYC(v)   (((v) & 0xF) << 0)
 
#define RPC_DRDRENR   0x005C /* R/W */
 
#define RPC_DRDRENR_ADDRE   BIT(8)
 
#define RPC_DRDRENR_DRDRE   BIT(0)
 
#define RPC_DRDRENR_HYPE   (0x5 << 12)
 
#define RPC_DRDRENR_OPDRE   BIT(4)
 
#define RPC_DREAR   0x0014 /* R/W */
 
#define RPC_DREAR_EAC(v)   (((v) & 0x7) << 0)
 
#define RPC_DREAR_EAV(v)   (((v) & 0xFF) << 16)
 
#define RPC_DRENR   0x001C /* R/W */
 
#define RPC_DRENR_ADB(o)   (((o) & 0x3) << 24)
 
#define RPC_DRENR_ADE(v)   (((v) & 0xF) << 8)
 
#define RPC_DRENR_CDB(o)   (uint32_t)((((o) & 0x3) << 30))
 
#define RPC_DRENR_CDE   BIT(14)
 
#define RPC_DRENR_DME   BIT(15)
 
#define RPC_DRENR_OCDB(o)   (((o) & 0x3) << 28)
 
#define RPC_DRENR_OCDE   BIT(12)
 
#define RPC_DRENR_OPDB(o)   (((o) & 0x3) << 20)
 
#define RPC_DRENR_OPDE(v)   (((v) & 0xF) << 4)
 
#define RPC_DRENR_SPIDB(o)   (((o) & 0x3) << 16)
 
#define RPC_DROPR   0x0018 /* R/W */
 
#define RPC_DROPR_OPD0(o)   (((o) & 0xFF) << 0)
 
#define RPC_DROPR_OPD1(o)   (((o) & 0xFF) << 8)
 
#define RPC_DROPR_OPD2(o)   (((o) & 0xFF) << 16)
 
#define RPC_DROPR_OPD3(o)   (((o) & 0xFF) << 24)
 
#define RPC_PHYCNT   0x007C /* R/W */
 
#define RPC_PHYCNT_CAL   BIT(31)
 
#define RPC_PHYCNT_MEM(v)   (((v) & 0x3) << 0)
 
#define RPC_PHYCNT_OCT   BIT(20)
 
#define RPC_PHYCNT_WBUF   BIT(2)
 
#define RPC_PHYCNT_WBUF2   BIT(4)
 
#define RPC_PHYINT   0x0088 /* R/W */
 
#define RPC_PHYINT_INT   BIT(0)
 
#define RPC_PHYINT_INTEN   BIT(16)
 
#define RPC_PHYINT_RST   BIT(2)
 
#define RPC_PHYINT_RSTEN   BIT(18)
 
#define RPC_PHYINT_WP   BIT(1)
 
#define RPC_PHYINT_WPEN   BIT(17)
 
#define RPC_SMADR   0x0028 /* R/W */
 
#define RPC_SMCMR   0x0024 /* R/W */
 
#define RPC_SMCMR_CMD(c)   (((c) & 0xFF) << 16)
 
#define RPC_SMCMR_OCMD(c)   (((c) & 0xFF) << 0)
 
#define RPC_SMCR   0x0020 /* R/W */
 
#define RPC_SMCR_SPIE   BIT(0)
 
#define RPC_SMCR_SPIRE   BIT(2)
 
#define RPC_SMCR_SPIWE   BIT(1)
 
#define RPC_SMCR_SSLKP   BIT(8)
 
#define RPC_SMDMCR   0x0060 /* R/W */
 
#define RPC_SMDMCR_DMCYC(v)   (((v) & 0xF) << 0)
 
#define RPC_SMDRENR   0x0064 /* R/W */
 
#define RPC_SMDRENR_ADDRE   BIT(8)
 
#define RPC_SMDRENR_HYPE   (0x5 << 12)
 
#define RPC_SMDRENR_OPDRE   BIT(4)
 
#define RPC_SMDRENR_SPIDRE   BIT(0)
 
#define RPC_SMENR   0x0030 /* R/W */
 
#define RPC_SMENR_ADB(o)   (((o) & 0x3) << 24)
 
#define RPC_SMENR_ADE(v)   (((v) & 0xF) << 8)
 
#define RPC_SMENR_CDB(o)   (((o) & 0x3) << 30)
 
#define RPC_SMENR_CDE   BIT(14)
 
#define RPC_SMENR_DME   BIT(15)
 
#define RPC_SMENR_OCDB(o)   (((o) & 0x3) << 28)
 
#define RPC_SMENR_OCDE   BIT(12)
 
#define RPC_SMENR_OPDB(o)   (((o) & 0x3) << 20)
 
#define RPC_SMENR_OPDE(v)   (((v) & 0xF) << 4)
 
#define RPC_SMENR_SPIDB(o)   (((o) & 0x3) << 16)
 
#define RPC_SMENR_SPIDE(v)   (((v) & 0xF) << 0)
 
#define RPC_SMOPR   0x002C /* R/W */
 
#define RPC_SMOPR_OPD0(o)   (((o) & 0xFF) << 0)
 
#define RPC_SMOPR_OPD1(o)   (((o) & 0xFF) << 8)
 
#define RPC_SMOPR_OPD2(o)   (((o) & 0xFF) << 16)
 
#define RPC_SMOPR_OPD3(o)   (((o) & 0xFF) << 24)
 
#define RPC_SMRDR0   0x0038 /* R */
 
#define RPC_SMRDR1   0x003C /* R */
 
#define RPC_SMWDR0   0x0040 /* R/W */
 
#define RPC_SMWDR1   0x0044 /* R/W */
 
#define RPC_SSLDR   0x0004 /* R/W */
 
#define RPC_SSLDR_SCKDL(d)   (((d) & 0x7) << 0)
 
#define RPC_SSLDR_SLNDL(d)   (((d) & 0x7) << 8)
 
#define RPC_SSLDR_SPNDL(d)   (((d) & 0x7) << 16)
 
#define RPC_WBUF   0x8000 /* R/W size=4/8/16/32/64Bytes */
 
#define RPC_WBUF_SIZE   0x100
 

Enumerations

enum  rpc_hf_size { RPC_HF_SIZE_16BIT = RPC_SMENR_SPIDE(0x8) , RPC_HF_SIZE_32BIT = RPC_SMENR_SPIDE(0xC) , RPC_HF_SIZE_64BIT = RPC_SMENR_SPIDE(0xF) }
 

Functions

static int clrsetbits_u32 (struct target *target, uint32_t reg, uint32_t clr, uint32_t set)
 
 FLASH_BANK_COMMAND_HANDLER (rpchf_flash_bank_command)
 
static int rpc_hf_mode (struct target *target, bool manual)
 
static int rpc_hf_wait_tend (struct target *target)
 
static int rpc_hf_xfer (struct target *target, target_addr_t addr, uint32_t wdata, uint32_t *rdata, enum rpc_hf_size size, bool write, const uint8_t *wbuf, unsigned int wbuf_size)
 
static int rpchf_read (struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int rpchf_spansion_write_words (struct flash_bank *bank, const uint8_t *word, uint32_t wordcount, uint32_t address)
 
static int rpchf_target_read_memory (struct flash_bank *bank, target_addr_t addr, uint32_t count, uint8_t *buffer)
 
static int rpchf_target_write_memory (struct flash_bank *bank, target_addr_t addr, uint32_t count, const uint8_t *buffer)
 
static int rpchf_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 
static int rpchf_write_words (struct flash_bank *bank, const uint8_t *word, uint32_t wordcount, uint32_t address)
 

Variables

static uint32_t mem_base = 0x08000000
 
const struct flash_driver renesas_rpchf_flash
 
static uint32_t rpc_base = 0xee200000
 

Macro Definition Documentation

◆ PRC_PHYCNT_EXDS

#define PRC_PHYCNT_EXDS   BIT(21)

Definition at line 136 of file renesas_rpchf.c.

◆ PRC_PHYCNT_OCTA_AA

#define PRC_PHYCNT_OCTA_AA   BIT(22)

Definition at line 134 of file renesas_rpchf.c.

◆ PRC_PHYCNT_OCTA_SA

#define PRC_PHYCNT_OCTA_SA   BIT(23)

Definition at line 135 of file renesas_rpchf.c.

◆ RPC_CMNCR

#define RPC_CMNCR   0x0000 /* R/W */

Definition at line 23 of file renesas_rpchf.c.

◆ RPC_CMNCR_BSZ

#define RPC_CMNCR_BSZ (   val)    (((val) & 0x3) << 0)

Definition at line 36 of file renesas_rpchf.c.

◆ RPC_CMNCR_IO0FV

#define RPC_CMNCR_IO0FV (   val)    (((val) & 0x3) << 8)

Definition at line 31 of file renesas_rpchf.c.

◆ RPC_CMNCR_IO2FV

#define RPC_CMNCR_IO2FV (   val)    (((val) & 0x3) << 12)

Definition at line 32 of file renesas_rpchf.c.

◆ RPC_CMNCR_IO3FV

#define RPC_CMNCR_IO3FV (   val)    (((val) & 0x3) << 14)

Definition at line 33 of file renesas_rpchf.c.

◆ RPC_CMNCR_IOFV_HIZ

#define RPC_CMNCR_IOFV_HIZ
Value:
RPC_CMNCR_IO3FV(3))
#define RPC_CMNCR_IO2FV(val)
Definition: renesas_rpchf.c:32
#define RPC_CMNCR_IO0FV(val)
Definition: renesas_rpchf.c:31

Definition at line 34 of file renesas_rpchf.c.

◆ RPC_CMNCR_MD

#define RPC_CMNCR_MD   BIT(31)

Definition at line 24 of file renesas_rpchf.c.

◆ RPC_CMNCR_MOIIO0

#define RPC_CMNCR_MOIIO0 (   val)    (((val) & 0x3) << 16)

Definition at line 25 of file renesas_rpchf.c.

◆ RPC_CMNCR_MOIIO1

#define RPC_CMNCR_MOIIO1 (   val)    (((val) & 0x3) << 18)

Definition at line 26 of file renesas_rpchf.c.

◆ RPC_CMNCR_MOIIO2

#define RPC_CMNCR_MOIIO2 (   val)    (((val) & 0x3) << 20)

Definition at line 27 of file renesas_rpchf.c.

◆ RPC_CMNCR_MOIIO3

#define RPC_CMNCR_MOIIO3 (   val)    (((val) & 0x3) << 22)

Definition at line 28 of file renesas_rpchf.c.

◆ RPC_CMNCR_MOIIO_HIZ

#define RPC_CMNCR_MOIIO_HIZ
Value:
RPC_CMNCR_MOIIO2(3) | RPC_CMNCR_MOIIO3(3))
#define RPC_CMNCR_MOIIO1(val)
Definition: renesas_rpchf.c:26
#define RPC_CMNCR_MOIIO3(val)
Definition: renesas_rpchf.c:28
#define RPC_CMNCR_MOIIO0(val)
Definition: renesas_rpchf.c:25

Definition at line 29 of file renesas_rpchf.c.

◆ RPC_CMNSR

#define RPC_CMNSR   0x0048 /* R */

Definition at line 110 of file renesas_rpchf.c.

◆ RPC_CMNSR_SSLF

#define RPC_CMNSR_SSLF   BIT(1)

Definition at line 111 of file renesas_rpchf.c.

◆ RPC_CMNSR_TEND

#define RPC_CMNSR_TEND   BIT(0)

Definition at line 112 of file renesas_rpchf.c.

◆ RPC_DRCMR

#define RPC_DRCMR   0x0010 /* R/W */

Definition at line 50 of file renesas_rpchf.c.

◆ RPC_DRCMR_CMD

#define RPC_DRCMR_CMD (   c)    (((c) & 0xFF) << 16)

Definition at line 51 of file renesas_rpchf.c.

◆ RPC_DRCMR_OCMD

#define RPC_DRCMR_OCMD (   c)    (((c) & 0xFF) << 0)

Definition at line 52 of file renesas_rpchf.c.

◆ RPC_DRCR

#define RPC_DRCR   0x000C /* R/W */

Definition at line 43 of file renesas_rpchf.c.

◆ RPC_DRCR_RBE

#define RPC_DRCR_RBE   BIT(8)

Definition at line 47 of file renesas_rpchf.c.

◆ RPC_DRCR_RBURST

#define RPC_DRCR_RBURST (   v)    (((v) & 0x1F) << 16)

Definition at line 45 of file renesas_rpchf.c.

◆ RPC_DRCR_RCF

#define RPC_DRCR_RCF   BIT(9)

Definition at line 46 of file renesas_rpchf.c.

◆ RPC_DRCR_SSLE

#define RPC_DRCR_SSLE   BIT(0)

Definition at line 48 of file renesas_rpchf.c.

◆ RPC_DRCR_SSLN

#define RPC_DRCR_SSLN   BIT(24)

Definition at line 44 of file renesas_rpchf.c.

◆ RPC_DRDMCR

#define RPC_DRDMCR   0x0058 /* R/W */

Definition at line 114 of file renesas_rpchf.c.

◆ RPC_DRDMCR_DMCYC

#define RPC_DRDMCR_DMCYC (   v)    (((v) & 0xF) << 0)

Definition at line 115 of file renesas_rpchf.c.

◆ RPC_DRDRENR

#define RPC_DRDRENR   0x005C /* R/W */

Definition at line 117 of file renesas_rpchf.c.

◆ RPC_DRDRENR_ADDRE

#define RPC_DRDRENR_ADDRE   BIT(8)

Definition at line 119 of file renesas_rpchf.c.

◆ RPC_DRDRENR_DRDRE

#define RPC_DRDRENR_DRDRE   BIT(0)

Definition at line 121 of file renesas_rpchf.c.

◆ RPC_DRDRENR_HYPE

#define RPC_DRDRENR_HYPE   (0x5 << 12)

Definition at line 118 of file renesas_rpchf.c.

◆ RPC_DRDRENR_OPDRE

#define RPC_DRDRENR_OPDRE   BIT(4)

Definition at line 120 of file renesas_rpchf.c.

◆ RPC_DREAR

#define RPC_DREAR   0x0014 /* R/W */

Definition at line 54 of file renesas_rpchf.c.

◆ RPC_DREAR_EAC

#define RPC_DREAR_EAC (   v)    (((v) & 0x7) << 0)

Definition at line 56 of file renesas_rpchf.c.

◆ RPC_DREAR_EAV

#define RPC_DREAR_EAV (   v)    (((v) & 0xFF) << 16)

Definition at line 55 of file renesas_rpchf.c.

◆ RPC_DRENR

#define RPC_DRENR   0x001C /* R/W */

Definition at line 64 of file renesas_rpchf.c.

◆ RPC_DRENR_ADB

#define RPC_DRENR_ADB (   o)    (((o) & 0x3) << 24)

Definition at line 67 of file renesas_rpchf.c.

◆ RPC_DRENR_ADE

#define RPC_DRENR_ADE (   v)    (((v) & 0xF) << 8)

Definition at line 73 of file renesas_rpchf.c.

◆ RPC_DRENR_CDB

#define RPC_DRENR_CDB (   o)    (uint32_t)((((o) & 0x3) << 30))

Definition at line 65 of file renesas_rpchf.c.

◆ RPC_DRENR_CDE

#define RPC_DRENR_CDE   BIT(14)

Definition at line 71 of file renesas_rpchf.c.

◆ RPC_DRENR_DME

#define RPC_DRENR_DME   BIT(15)

Definition at line 70 of file renesas_rpchf.c.

◆ RPC_DRENR_OCDB

#define RPC_DRENR_OCDB (   o)    (((o) & 0x3) << 28)

Definition at line 66 of file renesas_rpchf.c.

◆ RPC_DRENR_OCDE

#define RPC_DRENR_OCDE   BIT(12)

Definition at line 72 of file renesas_rpchf.c.

◆ RPC_DRENR_OPDB

#define RPC_DRENR_OPDB (   o)    (((o) & 0x3) << 20)

Definition at line 68 of file renesas_rpchf.c.

◆ RPC_DRENR_OPDE

#define RPC_DRENR_OPDE (   v)    (((v) & 0xF) << 4)

Definition at line 74 of file renesas_rpchf.c.

◆ RPC_DRENR_SPIDB

#define RPC_DRENR_SPIDB (   o)    (((o) & 0x3) << 16)

Definition at line 69 of file renesas_rpchf.c.

◆ RPC_DROPR

#define RPC_DROPR   0x0018 /* R/W */

Definition at line 58 of file renesas_rpchf.c.

◆ RPC_DROPR_OPD0

#define RPC_DROPR_OPD0 (   o)    (((o) & 0xFF) << 0)

Definition at line 62 of file renesas_rpchf.c.

◆ RPC_DROPR_OPD1

#define RPC_DROPR_OPD1 (   o)    (((o) & 0xFF) << 8)

Definition at line 61 of file renesas_rpchf.c.

◆ RPC_DROPR_OPD2

#define RPC_DROPR_OPD2 (   o)    (((o) & 0xFF) << 16)

Definition at line 60 of file renesas_rpchf.c.

◆ RPC_DROPR_OPD3

#define RPC_DROPR_OPD3 (   o)    (((o) & 0xFF) << 24)

Definition at line 59 of file renesas_rpchf.c.

◆ RPC_PHYCNT

#define RPC_PHYCNT   0x007C /* R/W */

Definition at line 132 of file renesas_rpchf.c.

◆ RPC_PHYCNT_CAL

#define RPC_PHYCNT_CAL   BIT(31)

Definition at line 133 of file renesas_rpchf.c.

◆ RPC_PHYCNT_MEM

#define RPC_PHYCNT_MEM (   v)    (((v) & 0x3) << 0)

Definition at line 140 of file renesas_rpchf.c.

◆ RPC_PHYCNT_OCT

#define RPC_PHYCNT_OCT   BIT(20)

Definition at line 137 of file renesas_rpchf.c.

◆ RPC_PHYCNT_WBUF

#define RPC_PHYCNT_WBUF   BIT(2)

Definition at line 139 of file renesas_rpchf.c.

◆ RPC_PHYCNT_WBUF2

#define RPC_PHYCNT_WBUF2   BIT(4)

Definition at line 138 of file renesas_rpchf.c.

◆ RPC_PHYINT

#define RPC_PHYINT   0x0088 /* R/W */

Definition at line 142 of file renesas_rpchf.c.

◆ RPC_PHYINT_INT

#define RPC_PHYINT_INT   BIT(0)

Definition at line 148 of file renesas_rpchf.c.

◆ RPC_PHYINT_INTEN

#define RPC_PHYINT_INTEN   BIT(16)

Definition at line 145 of file renesas_rpchf.c.

◆ RPC_PHYINT_RST

#define RPC_PHYINT_RST   BIT(2)

Definition at line 146 of file renesas_rpchf.c.

◆ RPC_PHYINT_RSTEN

#define RPC_PHYINT_RSTEN   BIT(18)

Definition at line 143 of file renesas_rpchf.c.

◆ RPC_PHYINT_WP

#define RPC_PHYINT_WP   BIT(1)

Definition at line 147 of file renesas_rpchf.c.

◆ RPC_PHYINT_WPEN

#define RPC_PHYINT_WPEN   BIT(17)

Definition at line 144 of file renesas_rpchf.c.

◆ RPC_SMADR

#define RPC_SMADR   0x0028 /* R/W */

Definition at line 86 of file renesas_rpchf.c.

◆ RPC_SMCMR

#define RPC_SMCMR   0x0024 /* R/W */

Definition at line 82 of file renesas_rpchf.c.

◆ RPC_SMCMR_CMD

#define RPC_SMCMR_CMD (   c)    (((c) & 0xFF) << 16)

Definition at line 83 of file renesas_rpchf.c.

◆ RPC_SMCMR_OCMD

#define RPC_SMCMR_OCMD (   c)    (((c) & 0xFF) << 0)

Definition at line 84 of file renesas_rpchf.c.

◆ RPC_SMCR

#define RPC_SMCR   0x0020 /* R/W */

Definition at line 76 of file renesas_rpchf.c.

◆ RPC_SMCR_SPIE

#define RPC_SMCR_SPIE   BIT(0)

Definition at line 80 of file renesas_rpchf.c.

◆ RPC_SMCR_SPIRE

#define RPC_SMCR_SPIRE   BIT(2)

Definition at line 78 of file renesas_rpchf.c.

◆ RPC_SMCR_SPIWE

#define RPC_SMCR_SPIWE   BIT(1)

Definition at line 79 of file renesas_rpchf.c.

◆ RPC_SMCR_SSLKP

#define RPC_SMCR_SSLKP   BIT(8)

Definition at line 77 of file renesas_rpchf.c.

◆ RPC_SMDMCR

#define RPC_SMDMCR   0x0060 /* R/W */

Definition at line 123 of file renesas_rpchf.c.

◆ RPC_SMDMCR_DMCYC

#define RPC_SMDMCR_DMCYC (   v)    (((v) & 0xF) << 0)

Definition at line 124 of file renesas_rpchf.c.

◆ RPC_SMDRENR

#define RPC_SMDRENR   0x0064 /* R/W */

Definition at line 126 of file renesas_rpchf.c.

◆ RPC_SMDRENR_ADDRE

#define RPC_SMDRENR_ADDRE   BIT(8)

Definition at line 128 of file renesas_rpchf.c.

◆ RPC_SMDRENR_HYPE

#define RPC_SMDRENR_HYPE   (0x5 << 12)

Definition at line 127 of file renesas_rpchf.c.

◆ RPC_SMDRENR_OPDRE

#define RPC_SMDRENR_OPDRE   BIT(4)

Definition at line 129 of file renesas_rpchf.c.

◆ RPC_SMDRENR_SPIDRE

#define RPC_SMDRENR_SPIDRE   BIT(0)

Definition at line 130 of file renesas_rpchf.c.

◆ RPC_SMENR

#define RPC_SMENR   0x0030 /* R/W */

Definition at line 93 of file renesas_rpchf.c.

◆ RPC_SMENR_ADB

#define RPC_SMENR_ADB (   o)    (((o) & 0x3) << 24)

Definition at line 96 of file renesas_rpchf.c.

◆ RPC_SMENR_ADE

#define RPC_SMENR_ADE (   v)    (((v) & 0xF) << 8)

Definition at line 102 of file renesas_rpchf.c.

◆ RPC_SMENR_CDB

#define RPC_SMENR_CDB (   o)    (((o) & 0x3) << 30)

Definition at line 94 of file renesas_rpchf.c.

◆ RPC_SMENR_CDE

#define RPC_SMENR_CDE   BIT(14)

Definition at line 100 of file renesas_rpchf.c.

◆ RPC_SMENR_DME

#define RPC_SMENR_DME   BIT(15)

Definition at line 99 of file renesas_rpchf.c.

◆ RPC_SMENR_OCDB

#define RPC_SMENR_OCDB (   o)    (((o) & 0x3) << 28)

Definition at line 95 of file renesas_rpchf.c.

◆ RPC_SMENR_OCDE

#define RPC_SMENR_OCDE   BIT(12)

Definition at line 101 of file renesas_rpchf.c.

◆ RPC_SMENR_OPDB

#define RPC_SMENR_OPDB (   o)    (((o) & 0x3) << 20)

Definition at line 97 of file renesas_rpchf.c.

◆ RPC_SMENR_OPDE

#define RPC_SMENR_OPDE (   v)    (((v) & 0xF) << 4)

Definition at line 103 of file renesas_rpchf.c.

◆ RPC_SMENR_SPIDB

#define RPC_SMENR_SPIDB (   o)    (((o) & 0x3) << 16)

Definition at line 98 of file renesas_rpchf.c.

◆ RPC_SMENR_SPIDE

#define RPC_SMENR_SPIDE (   v)    (((v) & 0xF) << 0)

Definition at line 104 of file renesas_rpchf.c.

◆ RPC_SMOPR

#define RPC_SMOPR   0x002C /* R/W */

Definition at line 87 of file renesas_rpchf.c.

◆ RPC_SMOPR_OPD0

#define RPC_SMOPR_OPD0 (   o)    (((o) & 0xFF) << 0)

Definition at line 88 of file renesas_rpchf.c.

◆ RPC_SMOPR_OPD1

#define RPC_SMOPR_OPD1 (   o)    (((o) & 0xFF) << 8)

Definition at line 89 of file renesas_rpchf.c.

◆ RPC_SMOPR_OPD2

#define RPC_SMOPR_OPD2 (   o)    (((o) & 0xFF) << 16)

Definition at line 90 of file renesas_rpchf.c.

◆ RPC_SMOPR_OPD3

#define RPC_SMOPR_OPD3 (   o)    (((o) & 0xFF) << 24)

Definition at line 91 of file renesas_rpchf.c.

◆ RPC_SMRDR0

#define RPC_SMRDR0   0x0038 /* R */

Definition at line 106 of file renesas_rpchf.c.

◆ RPC_SMRDR1

#define RPC_SMRDR1   0x003C /* R */

Definition at line 107 of file renesas_rpchf.c.

◆ RPC_SMWDR0

#define RPC_SMWDR0   0x0040 /* R/W */

Definition at line 108 of file renesas_rpchf.c.

◆ RPC_SMWDR1

#define RPC_SMWDR1   0x0044 /* R/W */

Definition at line 109 of file renesas_rpchf.c.

◆ RPC_SSLDR

#define RPC_SSLDR   0x0004 /* R/W */

Definition at line 38 of file renesas_rpchf.c.

◆ RPC_SSLDR_SCKDL

#define RPC_SSLDR_SCKDL (   d)    (((d) & 0x7) << 0)

Definition at line 41 of file renesas_rpchf.c.

◆ RPC_SSLDR_SLNDL

#define RPC_SSLDR_SLNDL (   d)    (((d) & 0x7) << 8)

Definition at line 40 of file renesas_rpchf.c.

◆ RPC_SSLDR_SPNDL

#define RPC_SSLDR_SPNDL (   d)    (((d) & 0x7) << 16)

Definition at line 39 of file renesas_rpchf.c.

◆ RPC_WBUF

#define RPC_WBUF   0x8000 /* R/W size=4/8/16/32/64Bytes */

Definition at line 150 of file renesas_rpchf.c.

◆ RPC_WBUF_SIZE

#define RPC_WBUF_SIZE   0x100

Definition at line 151 of file renesas_rpchf.c.

Enumeration Type Documentation

◆ rpc_hf_size

Enumerator
RPC_HF_SIZE_16BIT 
RPC_HF_SIZE_32BIT 
RPC_HF_SIZE_64BIT 

Definition at line 156 of file renesas_rpchf.c.

Function Documentation

◆ clrsetbits_u32()

static int clrsetbits_u32 ( struct target target,
uint32_t  reg,
uint32_t  clr,
uint32_t  set 
)
static

Definition at line 186 of file renesas_rpchf.c.

References ERROR_OK, target_read_u32(), and target_write_u32().

Referenced by rpc_hf_mode(), and rpc_hf_xfer().

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( rpchf_flash_bank_command  )

◆ rpc_hf_mode()

◆ rpc_hf_wait_tend()

static int rpc_hf_wait_tend ( struct target target)
static

◆ rpc_hf_xfer()

◆ rpchf_read()

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

Definition at line 611 of file renesas_rpchf.c.

◆ rpchf_spansion_write_words()

◆ rpchf_target_read_memory()

static int rpchf_target_read_memory ( struct flash_bank bank,
target_addr_t  addr,
uint32_t  count,
uint8_t *  buffer 
)
static

Definition at line 396 of file renesas_rpchf.c.

References addr, bank, buffer, count, ERROR_OK, NULL, RPC_HF_SIZE_16BIT, and rpc_hf_xfer().

Referenced by FLASH_BANK_COMMAND_HANDLER().

◆ rpchf_target_write_memory()

static int rpchf_target_write_memory ( struct flash_bank bank,
target_addr_t  addr,
uint32_t  count,
const uint8_t *  buffer 
)
static

Definition at line 381 of file renesas_rpchf.c.

References addr, bank, buffer, count, ERROR_FAIL, NULL, RPC_HF_SIZE_16BIT, and rpc_hf_xfer().

Referenced by FLASH_BANK_COMMAND_HANDLER().

◆ rpchf_write()

◆ rpchf_write_words()

static int rpchf_write_words ( struct flash_bank bank,
const uint8_t *  word,
uint32_t  wordcount,
uint32_t  address 
)
static

Definition at line 487 of file renesas_rpchf.c.

References bank, and rpchf_spansion_write_words().

Referenced by rpchf_write().

Variable Documentation

◆ mem_base

uint32_t mem_base = 0x08000000
static

Definition at line 154 of file renesas_rpchf.c.

◆ renesas_rpchf_flash

const struct flash_driver renesas_rpchf_flash
Initial value:
= {
.name = "rpchf",
.flash_bank_command = rpchf_flash_bank_command,
.erase = cfi_erase,
.protect = cfi_protect,
.write = rpchf_write,
.read = rpchf_read,
.probe = cfi_probe,
.auto_probe = cfi_auto_probe,
.erase_check = default_flash_blank_check,
.protect_check = cfi_protect_check,
.info = cfi_get_info,
.free_driver_priv = default_flash_free_driver_priv,
}
int cfi_protect_check(struct flash_bank *bank)
Definition: cfi.c:2930
int cfi_probe(struct flash_bank *bank)
Definition: cfi.c:2532
int cfi_auto_probe(struct flash_bank *bank)
Definition: cfi.c:2864
int cfi_get_info(struct flash_bank *bank, struct command_invocation *cmd)
Definition: cfi.c:2956
int cfi_protect(struct flash_bank *bank, int set, unsigned int first, unsigned int last)
Definition: cfi.c:1073
int cfi_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: cfi.c:931
int default_flash_blank_check(struct flash_bank *bank)
Provides default erased-bank check handling.
void default_flash_free_driver_priv(struct flash_bank *bank)
Deallocates bank->driver_priv.
static int rpchf_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
static int rpchf_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)

Definition at line 611 of file renesas_rpchf.c.

◆ rpc_base

uint32_t rpc_base = 0xee200000
static

Definition at line 153 of file renesas_rpchf.c.

Referenced by rpc_hf_mode(), rpc_hf_wait_tend(), and rpc_hf_xfer().