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

Go to the source code of this file.

Macros

#define SWM050_CPU_ID   0xE000ED00
 
#define SWM050_CPU_ID_VAL   0x410CC200
 
#define SWM050_DELAY   100
 
#define SWM050_FLASH_KEY   0xAAAAAAAA
 
#define SWM050_FLASH_PAGE_SIZE   0x200
 
#define SWM050_FLASH_PAGES   16
 
#define SWM050_FLASH_REG1   0x1F000000
 
#define SWM050_FLASH_REG2   0x1F000038
 
#define SWM050_SYSCTL_CFG_0   0x400F0000
 
#define SWM050_SYSCTL_DBLF   0x400F0008
 

Functions

 COMMAND_HANDLER (swm050_handle_mass_erase_command)
 
 FLASH_BANK_COMMAND_HANDLER (swm050_flash_bank_command)
 
static int swm050_erase (struct flash_bank *bank, unsigned int first, unsigned int last)
 
static int swm050_mass_erase (struct flash_bank *bank)
 
static int swm050_probe (struct flash_bank *bank)
 
static int swm050_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
 

Variables

static const struct command_registration swm050_command_handlers []
 
static const struct command_registration swm050_exec_command_handlers []
 
const struct flash_driver swm050_flash
 

Macro Definition Documentation

◆ SWM050_CPU_ID

#define SWM050_CPU_ID   0xE000ED00

Definition at line 20 of file swm050.c.

◆ SWM050_CPU_ID_VAL

#define SWM050_CPU_ID_VAL   0x410CC200

Definition at line 21 of file swm050.c.

◆ SWM050_DELAY

#define SWM050_DELAY   100

Definition at line 15 of file swm050.c.

◆ SWM050_FLASH_KEY

#define SWM050_FLASH_KEY   0xAAAAAAAA

Definition at line 25 of file swm050.c.

◆ SWM050_FLASH_PAGE_SIZE

#define SWM050_FLASH_PAGE_SIZE   0x200

Definition at line 17 of file swm050.c.

◆ SWM050_FLASH_PAGES

#define SWM050_FLASH_PAGES   16

Definition at line 18 of file swm050.c.

◆ SWM050_FLASH_REG1

#define SWM050_FLASH_REG1   0x1F000000

Definition at line 23 of file swm050.c.

◆ SWM050_FLASH_REG2

#define SWM050_FLASH_REG2   0x1F000038

Definition at line 24 of file swm050.c.

◆ SWM050_SYSCTL_CFG_0

#define SWM050_SYSCTL_CFG_0   0x400F0000

Definition at line 27 of file swm050.c.

◆ SWM050_SYSCTL_DBLF

#define SWM050_SYSCTL_DBLF   0x400F0008

Definition at line 28 of file swm050.c.

Function Documentation

◆ COMMAND_HANDLER()

COMMAND_HANDLER ( swm050_handle_mass_erase_command  )

◆ FLASH_BANK_COMMAND_HANDLER()

FLASH_BANK_COMMAND_HANDLER ( swm050_flash_bank_command  )

◆ swm050_erase()

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

◆ swm050_mass_erase()

static int swm050_mass_erase ( struct flash_bank bank)
static

◆ swm050_probe()

static int swm050_probe ( struct flash_bank bank)
static

Definition at line 91 of file swm050.c.

References ERROR_OK.

◆ swm050_write()

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

Variable Documentation

◆ swm050_command_handlers

const struct command_registration swm050_command_handlers[]
static
Initial value:
= {
{
.name = "swm050",
.mode = COMMAND_ANY,
.help = "swm050 flash command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration swm050_exec_command_handlers[]
Definition: swm050.c:164

Definition at line 146 of file swm050.c.

◆ swm050_exec_command_handlers

const struct command_registration swm050_exec_command_handlers[]
static
Initial value:
= {
{
.name = "mass_erase",
.handler = swm050_handle_mass_erase_command,
.mode = COMMAND_EXEC,
.usage = "bank_id",
.help = "Erase entire flash device.",
},
}
@ COMMAND_EXEC
Definition: command.h:40

Definition at line 146 of file swm050.c.

◆ swm050_flash

const struct flash_driver swm050_flash
Initial value:
= {
.name = "swm050",
.flash_bank_command = swm050_flash_bank_command,
.erase = swm050_erase,
.write = swm050_write,
.probe = swm050_probe,
.auto_probe = swm050_probe,
.erase_check = default_flash_blank_check,
.free_driver_priv = default_flash_free_driver_priv,
}
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.
static int swm050_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
Definition: swm050.c:63
static const struct command_registration swm050_command_handlers[]
Definition: swm050.c:175
static int swm050_probe(struct flash_bank *bank)
Definition: swm050.c:91
static int swm050_erase(struct flash_bank *bank, unsigned int first, unsigned int last)
Definition: swm050.c:30

Definition at line 146 of file swm050.c.