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

Go to the source code of this file.

Data Structures

struct  xmc1xxx_flash_bank
 

Macros

#define FLASH_BASE   0x10000000
 
#define FLASH_CS0   (FLASH_BASE + 0xf00)
 
#define NVM_BASE   0x40050000
 
#define NVM_BLOCK_SIZE   (4 * NVM_WORD_SIZE)
 
#define NVM_PAGE_SIZE   (16 * NVM_BLOCK_SIZE)
 
#define NVM_WORD_SIZE   4
 
#define NVMCONF   (NVM_BASE + 0x08)
 
#define NVMPROG   (NVM_BASE + 0x04)
 
#define NVMPROG_ACTION_IDLE   0x00
 
#define NVMPROG_ACTION_MASK   0xff
 
#define NVMPROG_ACTION_ONE_SHOT_CONTINUOUS   (2 << 4)
 
#define NVMPROG_ACTION_ONE_SHOT_ONCE   (1 << 4)
 
#define NVMPROG_ACTION_OPTYPE_IDLE_VERIFY   (0 << 0)
 
#define NVMPROG_ACTION_OPTYPE_PAGE_ERASE   (2 << 0)
 
#define NVMPROG_ACTION_OPTYPE_WRITE   (1 << 0)
 
#define NVMPROG_ACTION_VERIFY_ARRAY   (3 << 6)
 
#define NVMPROG_ACTION_VERIFY_EACH   (1 << 6)
 
#define NVMPROG_ACTION_VERIFY_NO   (2 << 6)
 
#define NVMSTATUS   (NVM_BASE + 0x00)
 
#define NVMSTATUS_BUSY   (1 << 0)
 
#define NVMSTATUS_VERR_MASK   (0x3 << 2)
 
#define PAU_BASE   0x40000000
 
#define PAU_FLSIZE   (PAU_BASE + 0x404)
 
#define SCU_BASE   0x40010000
 
#define SCU_IDCHIP   (SCU_BASE + 0x004)
 

Functions

 FLASH_BANK_COMMAND_HANDLER (xmc1xxx_flash_bank_command)
 
static int xmc1xxx_auto_probe (struct flash_bank *bank)
 
static int xmc1xxx_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int xmc1xxx_erase_check (struct flash_bank *bank)
 
static int xmc1xxx_get_info_command (struct flash_bank *bank, struct command_invocation *cmd)
 
static int xmc1xxx_nvm_check_idle (struct target *target)
 
static int xmc1xxx_nvm_set_idle (struct target *target)
 
static int xmc1xxx_probe (struct flash_bank *bank)
 
static int xmc1xxx_protect_check (struct flash_bank *bank)
 
static int xmc1xxx_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
 

Variables

const struct flash_driver xmc1xxx_flash
 

Macro Definition Documentation

◆ FLASH_BASE

#define FLASH_BASE   0x10000000

Definition at line 19 of file xmc1xxx.c.

◆ FLASH_CS0

#define FLASH_CS0   (FLASH_BASE + 0xf00)

Definition at line 24 of file xmc1xxx.c.

◆ NVM_BASE

#define NVM_BASE   0x40050000

Definition at line 22 of file xmc1xxx.c.

◆ NVM_BLOCK_SIZE

#define NVM_BLOCK_SIZE   (4 * NVM_WORD_SIZE)

Definition at line 52 of file xmc1xxx.c.

◆ NVM_PAGE_SIZE

#define NVM_PAGE_SIZE   (16 * NVM_BLOCK_SIZE)

Definition at line 53 of file xmc1xxx.c.

◆ NVM_WORD_SIZE

#define NVM_WORD_SIZE   4

Definition at line 51 of file xmc1xxx.c.

◆ NVMCONF

#define NVMCONF   (NVM_BASE + 0x08)

Definition at line 32 of file xmc1xxx.c.

◆ NVMPROG

#define NVMPROG   (NVM_BASE + 0x04)

Definition at line 31 of file xmc1xxx.c.

◆ NVMPROG_ACTION_IDLE

#define NVMPROG_ACTION_IDLE   0x00

Definition at line 48 of file xmc1xxx.c.

◆ NVMPROG_ACTION_MASK

#define NVMPROG_ACTION_MASK   0xff

Definition at line 49 of file xmc1xxx.c.

◆ NVMPROG_ACTION_ONE_SHOT_CONTINUOUS

#define NVMPROG_ACTION_ONE_SHOT_CONTINUOUS   (2 << 4)

Definition at line 42 of file xmc1xxx.c.

◆ NVMPROG_ACTION_ONE_SHOT_ONCE

#define NVMPROG_ACTION_ONE_SHOT_ONCE   (1 << 4)

Definition at line 41 of file xmc1xxx.c.

◆ NVMPROG_ACTION_OPTYPE_IDLE_VERIFY

#define NVMPROG_ACTION_OPTYPE_IDLE_VERIFY   (0 << 0)

Definition at line 37 of file xmc1xxx.c.

◆ NVMPROG_ACTION_OPTYPE_PAGE_ERASE

#define NVMPROG_ACTION_OPTYPE_PAGE_ERASE   (2 << 0)

Definition at line 39 of file xmc1xxx.c.

◆ NVMPROG_ACTION_OPTYPE_WRITE

#define NVMPROG_ACTION_OPTYPE_WRITE   (1 << 0)

Definition at line 38 of file xmc1xxx.c.

◆ NVMPROG_ACTION_VERIFY_ARRAY

#define NVMPROG_ACTION_VERIFY_ARRAY   (3 << 6)

Definition at line 46 of file xmc1xxx.c.

◆ NVMPROG_ACTION_VERIFY_EACH

#define NVMPROG_ACTION_VERIFY_EACH   (1 << 6)

Definition at line 44 of file xmc1xxx.c.

◆ NVMPROG_ACTION_VERIFY_NO

#define NVMPROG_ACTION_VERIFY_NO   (2 << 6)

Definition at line 45 of file xmc1xxx.c.

◆ NVMSTATUS

#define NVMSTATUS   (NVM_BASE + 0x00)

Definition at line 30 of file xmc1xxx.c.

◆ NVMSTATUS_BUSY

#define NVMSTATUS_BUSY   (1 << 0)

Definition at line 34 of file xmc1xxx.c.

◆ NVMSTATUS_VERR_MASK

#define NVMSTATUS_VERR_MASK   (0x3 << 2)

Definition at line 35 of file xmc1xxx.c.

◆ PAU_BASE

#define PAU_BASE   0x40000000

Definition at line 20 of file xmc1xxx.c.

◆ PAU_FLSIZE

#define PAU_FLSIZE   (PAU_BASE + 0x404)

Definition at line 26 of file xmc1xxx.c.

◆ SCU_BASE

#define SCU_BASE   0x40010000

Definition at line 21 of file xmc1xxx.c.

◆ SCU_IDCHIP

#define SCU_IDCHIP   (SCU_BASE + 0x004)

Definition at line 28 of file xmc1xxx.c.

Function Documentation

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( xmc1xxx_flash_bank_command  )

Definition at line 508 of file xmc1xxx.c.

References bank, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, and xmc1xxx_flash_bank::probed.

◆ xmc1xxx_auto_probe()

static int xmc1xxx_auto_probe ( struct flash_bank bank)
static

Definition at line 498 of file xmc1xxx.c.

References bank, ERROR_OK, xmc1xxx_flash_bank::probed, and xmc1xxx_probe().

◆ xmc1xxx_erase()

◆ xmc1xxx_erase_check()

◆ xmc1xxx_get_info_command()

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

◆ xmc1xxx_nvm_check_idle()

static int xmc1xxx_nvm_check_idle ( struct target target)
static

◆ xmc1xxx_nvm_set_idle()

static int xmc1xxx_nvm_set_idle ( struct target target)
static

◆ xmc1xxx_probe()

static int xmc1xxx_probe ( struct flash_bank bank)
static

◆ xmc1xxx_protect_check()

static int xmc1xxx_protect_check ( struct flash_bank bank)
static

◆ xmc1xxx_write()

Variable Documentation

◆ xmc1xxx_flash

const struct flash_driver xmc1xxx_flash
Initial value:
= {
.name = "xmc1xxx",
.flash_bank_command = xmc1xxx_flash_bank_command,
.probe = xmc1xxx_probe,
.auto_probe = xmc1xxx_auto_probe,
.protect_check = xmc1xxx_protect_check,
.erase = xmc1xxx_erase,
.erase_check = xmc1xxx_erase_check,
.write = xmc1xxx_write,
.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 xmc1xxx_get_info_command(struct flash_bank *bank, struct command_invocation *cmd)
Definition: xmc1xxx.c:404
static int xmc1xxx_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: xmc1xxx.c:80
static int xmc1xxx_probe(struct flash_bank *bank)
Definition: xmc1xxx.c:441
static int xmc1xxx_erase_check(struct flash_bank *bank)
Definition: xmc1xxx.c:155
static int xmc1xxx_protect_check(struct flash_bank *bank)
Definition: xmc1xxx.c:378
static int xmc1xxx_auto_probe(struct flash_bank *bank)
Definition: xmc1xxx.c:498
static int xmc1xxx_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t byte_count)
Definition: xmc1xxx.c:240

Definition at line 508 of file xmc1xxx.c.