OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | samv_flash_bank |
Macros | |
#define | OFFSET_EFC_FCR 4 |
#define | OFFSET_EFC_FMR 0 |
#define | OFFSET_EFC_FRR 12 |
#define | OFFSET_EFC_FSR 8 |
#define | REG_NAME_WIDTH (12) |
#define | SAMV_CHIPID_CIDR (0x400E0940) |
#define | SAMV_CONTROLLER_ADDR (0x400e0c00) |
#define | SAMV_EFC_FCMD_CFB (0xC) /* (EFC) Clear Fuse Bit */ |
#define | SAMV_EFC_FCMD_CLB (0x9) /* (EFC) Clear Lock Bit */ |
#define | SAMV_EFC_FCMD_EA (0x5) /* (EFC) Erase All */ |
#define | SAMV_EFC_FCMD_EPA (0x7) /* (EFC) Erase pages */ |
#define | SAMV_EFC_FCMD_EWP (0x3) /* (EFC) Erase Page and Write Page */ |
#define | SAMV_EFC_FCMD_EWPL (0x4) /* (EFC) Erase Page, Write Page then Lock*/ |
#define | SAMV_EFC_FCMD_GETD (0x0) /* (EFC) Get Flash Descriptor */ |
#define | SAMV_EFC_FCMD_GFB (0xD) /* (EFC) Get Fuse Bit */ |
#define | SAMV_EFC_FCMD_GLB (0xA) /* (EFC) Get Lock Bit */ |
#define | SAMV_EFC_FCMD_SFB (0xB) /* (EFC) Set Fuse Bit */ |
#define | SAMV_EFC_FCMD_SLB (0x8) /* (EFC) Set Lock Bit */ |
#define | SAMV_EFC_FCMD_WP (0x1) /* (EFC) Write Page */ |
#define | SAMV_EFC_FCMD_WPL (0x2) /* (EFC) Write Page and Lock */ |
#define | SAMV_FLASH_BASE 0x00400000 |
#define | SAMV_NUM_GPNVM_BITS 9 |
#define | SAMV_PAGE_SIZE 512 |
#define | SAMV_SECTOR_SIZE 16384 |
Functions | |
COMMAND_HANDLER (samv_handle_gpnvm_command) | |
FLASH_BANK_COMMAND_HANDLER (samv_flash_bank_command) | |
static int | samv_auto_probe (struct flash_bank *bank) |
static int | samv_clear_gpnvm (struct target *target, unsigned gpnvm) |
static int | samv_efc_get_result (struct target *target, uint32_t *v) |
static int | samv_efc_get_status (struct target *target, uint32_t *v) |
static int | samv_efc_perform_command (struct target *target, unsigned command, unsigned argument, uint32_t *status) |
static int | samv_efc_start_command (struct target *target, unsigned command, unsigned argument) |
static int | samv_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | samv_erase_pages (struct target *target, int first_page, int num_pages, uint32_t *status) |
static int | samv_flash_lock (struct target *target, unsigned start_sector, unsigned end_sector) |
static int | samv_flash_unlock (struct target *target, unsigned start_sector, unsigned end_sector) |
static int | samv_get_device_id (struct flash_bank *bank, uint32_t *device_id) |
static int | samv_get_gpnvm (struct target *target, unsigned gpnvm, unsigned *out) |
static int | samv_get_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | samv_page_read (struct target *target, unsigned page_num, uint8_t *buf) |
static int | samv_page_write (struct target *target, unsigned pagenum, const uint8_t *buf) |
static int | samv_probe (struct flash_bank *bank) |
static int | samv_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | samv_protect_check (struct flash_bank *bank) |
static int | samv_set_gpnvm (struct target *target, unsigned gpnvm) |
static int | samv_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const struct command_registration | atsamv_command_handlers [] |
static const struct command_registration | atsamv_exec_command_handlers [] |
const struct flash_driver | atsamv_flash |
#define SAMV_EFC_FCMD_EWP (0x3) /* (EFC) Erase Page and Write Page */ |
#define SAMV_EFC_FCMD_EWPL (0x4) /* (EFC) Erase Page, Write Page then Lock*/ |
#define SAMV_EFC_FCMD_GETD (0x0) /* (EFC) Get Flash Descriptor */ |
#define SAMV_EFC_FCMD_WPL (0x2) /* (EFC) Write Page and Lock */ |
FLASH_BANK_COMMAND_HANDLER | ( | samv_flash_bank_command | ) |
|
static |
Definition at line 360 of file atsamv.c.
References bank, ERROR_OK, samv_flash_bank::probed, and samv_probe().
Referenced by samv_erase().
|
static |
Definition at line 195 of file atsamv.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, NULL, SAMV_EFC_FCMD_CFB, samv_efc_perform_command(), samv_get_gpnvm(), and SAMV_NUM_GPNVM_BITS.
|
static |
Definition at line 77 of file atsamv.c.
References OFFSET_EFC_FRR, SAMV_CONTROLLER_ADDR, and target_read_u32().
Referenced by samv_get_gpnvm(), and samv_protect_check().
|
static |
Definition at line 71 of file atsamv.c.
References OFFSET_EFC_FSR, SAMV_CONTROLLER_ADDR, and target_read_u32().
Referenced by samv_efc_perform_command(), and samv_efc_start_command().
|
static |
Definition at line 104 of file atsamv.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, samv_efc_get_status(), samv_efc_start_command(), status, and timeval_ms().
Referenced by samv_clear_gpnvm(), samv_erase(), samv_erase_pages(), samv_flash_lock(), samv_flash_unlock(), samv_get_gpnvm(), samv_page_write(), samv_protect_check(), and samv_set_gpnvm().
|
static |
Definition at line 86 of file atsamv.c.
References ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, OFFSET_EFC_FCR, SAMV_CONTROLLER_ADDR, samv_efc_get_status(), and target_write_u32().
Referenced by samv_efc_perform_command().
|
static |
Definition at line 368 of file atsamv.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, LOG_INFO, NULL, samv_auto_probe(), SAMV_EFC_FCMD_EA, samv_efc_perform_command(), samv_erase_pages(), status, and TARGET_HALTED.
|
static |
Definition at line 138 of file atsamv.c.
References SAMV_EFC_FCMD_EPA, samv_efc_perform_command(), and status.
Referenced by samv_erase().
|
static |
Definition at line 255 of file atsamv.c.
References ERROR_OK, SAMV_EFC_FCMD_SLB, samv_efc_perform_command(), SAMV_PAGE_SIZE, SAMV_SECTOR_SIZE, and status.
Referenced by samv_protect().
|
static |
Definition at line 235 of file atsamv.c.
References ERROR_OK, SAMV_EFC_FCMD_CLB, samv_efc_perform_command(), SAMV_PAGE_SIZE, SAMV_SECTOR_SIZE, and status.
Referenced by samv_protect().
|
static |
Definition at line 304 of file atsamv.c.
References bank, SAMV_CHIPID_CIDR, and target_read_u32().
Referenced by samv_probe().
|
static |
Definition at line 171 of file atsamv.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, NULL, SAMV_EFC_FCMD_GFB, samv_efc_get_result(), samv_efc_perform_command(), and SAMV_NUM_GPNVM_BITS.
Referenced by samv_clear_gpnvm(), and samv_set_gpnvm().
|
static |
Definition at line 569 of file atsamv.c.
References bank, cmd, command_print_sameline(), ERROR_OK, samv_flash_bank::probed, and samv_probe().
|
static |
Definition at line 423 of file atsamv.c.
References addr, ERROR_OK, LOG_ERROR, SAMV_FLASH_BASE, SAMV_PAGE_SIZE, and target_read_memory().
Referenced by samv_write().
|
static |
Definition at line 434 of file atsamv.c.
References addr, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, SAMV_EFC_FCMD_WP, samv_efc_perform_command(), SAMV_FLASH_BASE, SAMV_PAGE_SIZE, status, and target_write_memory().
Referenced by samv_write().
|
static |
Definition at line 309 of file atsamv.c.
References bank, eproc, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_INFO, samv_flash_bank::probed, SAMV_FLASH_BASE, samv_get_device_id(), samv_protect_check(), SAMV_SECTOR_SIZE, and samv_flash_bank::size_bytes.
Referenced by samv_auto_probe(), and samv_get_info().
|
static |
Definition at line 406 of file atsamv.c.
References bank, ERROR_TARGET_NOT_HALTED, LOG_ERROR, samv_flash_lock(), samv_flash_unlock(), and TARGET_HALTED.
|
static |
Definition at line 275 of file atsamv.c.
References bank, ERROR_OK, NULL, SAMV_EFC_FCMD_GLB, samv_efc_get_result(), and samv_efc_perform_command().
Referenced by samv_probe().
|
static |
Definition at line 214 of file atsamv.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, NULL, SAMV_EFC_FCMD_SFB, samv_efc_perform_command(), samv_get_gpnvm(), and SAMV_NUM_GPNVM_BITS.
|
static |
Definition at line 462 of file atsamv.c.
References bank, buffer, count, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, offset, samv_page_read(), SAMV_PAGE_SIZE, samv_page_write(), and TARGET_HALTED.
|
static |
|
static |
const struct flash_driver atsamv_flash |