OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | at91sam7_flash_bank |
Macros | |
#define | CGPB 0x0D |
#define | CKGR_MCFR 0xFFFFFC24 |
#define | CKGR_MCFR_MAINRDY 0x10000 |
#define | CKGR_MOR 0xFFFFFC20 |
#define | CKGR_PLLR 0xFFFFFC2c |
#define | CKGR_PLLR_DIV 0xff |
#define | CKGR_PLLR_MUL 0x07ff0000 |
#define | CLB 0x04 |
#define | DBGU_CIDR 0xFFFFF240 |
#define | EA 0x08 |
#define | FLASH_SIZE_1024KB 12 |
#define | FLASH_SIZE_128KB 7 |
#define | FLASH_SIZE_16KB 2 |
#define | FLASH_SIZE_2048KB 14 |
#define | FLASH_SIZE_256KB 9 |
#define | FLASH_SIZE_32KB 3 |
#define | FLASH_SIZE_512KB 10 |
#define | FLASH_SIZE_64KB 5 |
#define | FLASH_SIZE_8KB 1 |
#define | FMR_TIMING_FLASH 2 |
#define | FMR_TIMING_NONE 0 |
#define | FMR_TIMING_NVBITS 1 |
#define | MC_FSR_EOL 2 |
#define | MC_FSR_FRDY 1 |
#define | PMC_MCKR 0xFFFFFC30 |
#define | PMC_MCKR_CSS 0x03 |
#define | PMC_MCKR_PRES 0x1c |
#define | RC_FREQ 32000 |
#define | SGPB 0x0B |
#define | SLB 0x02 |
#define | SSB 0x0F |
#define | WP 0x01 |
#define | WPL 0x03 |
Functions | |
static int | at91sam7_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static int | at91sam7_erase_check (struct flash_bank *bank) |
static int | at91sam7_flash_command (struct flash_bank *bank, uint8_t cmd, uint16_t pagen) |
static uint32_t | at91sam7_get_flash_status (struct target *target, int bank_number) |
static int | at91sam7_probe (struct flash_bank *bank) |
static int | at91sam7_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | at91sam7_protect_check (struct flash_bank *bank) |
static void | at91sam7_read_clock_info (struct flash_bank *bank) |
static int | at91sam7_read_part_info (struct flash_bank *bank) |
static void | at91sam7_set_flash_mode (struct flash_bank *bank, int mode) |
static uint32_t | at91sam7_wait_status_busy (struct flash_bank *bank, uint32_t waitbits, int timeout) |
static int | at91sam7_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
COMMAND_HANDLER (at91sam7_handle_gpnvm_command) | |
FLASH_BANK_COMMAND_HANDLER (at91sam7_flash_bank_command) | |
static int | get_at91sam7_info (struct flash_bank *bank, struct command_invocation *cmd) |
Variables | |
static const struct command_registration | at91sam7_command_handlers [] |
static const struct command_registration | at91sam7_exec_command_handlers [] |
const struct flash_driver | at91sam7_flash |
static const char * | eproc [8] |
static const uint32_t | mc_fcr [4] = { 0xFFFFFF64, 0xFFFFFF74, 0xFFFFFF84, 0xFFFFFF94 } |
static const uint32_t | mc_fmr [4] = { 0xFFFFFF60, 0xFFFFFF70, 0xFFFFFF80, 0xFFFFFF90 } |
static const uint32_t | mc_fsr [4] = { 0xFFFFFF68, 0xFFFFFF78, 0xFFFFFF88, 0xFFFFFF98 } |
#define CGPB 0x0D |
Definition at line 61 of file at91sam7.c.
#define CKGR_MCFR 0xFFFFFC24 |
Definition at line 44 of file at91sam7.c.
#define CKGR_MCFR_MAINRDY 0x10000 |
Definition at line 46 of file at91sam7.c.
#define CKGR_MOR 0xFFFFFC20 |
Definition at line 45 of file at91sam7.c.
#define CKGR_PLLR 0xFFFFFC2c |
Definition at line 47 of file at91sam7.c.
#define CKGR_PLLR_DIV 0xff |
Definition at line 48 of file at91sam7.c.
#define CKGR_PLLR_MUL 0x07ff0000 |
Definition at line 49 of file at91sam7.c.
#define CLB 0x04 |
Definition at line 58 of file at91sam7.c.
#define DBGU_CIDR 0xFFFFF240 |
Definition at line 43 of file at91sam7.c.
#define EA 0x08 |
Definition at line 59 of file at91sam7.c.
#define FLASH_SIZE_1024KB 12 |
Definition at line 84 of file at91sam7.c.
#define FLASH_SIZE_128KB 7 |
Definition at line 81 of file at91sam7.c.
#define FLASH_SIZE_16KB 2 |
Definition at line 78 of file at91sam7.c.
#define FLASH_SIZE_2048KB 14 |
Definition at line 85 of file at91sam7.c.
#define FLASH_SIZE_256KB 9 |
Definition at line 82 of file at91sam7.c.
#define FLASH_SIZE_32KB 3 |
Definition at line 79 of file at91sam7.c.
#define FLASH_SIZE_512KB 10 |
Definition at line 83 of file at91sam7.c.
#define FLASH_SIZE_64KB 5 |
Definition at line 80 of file at91sam7.c.
#define FLASH_SIZE_8KB 1 |
Definition at line 77 of file at91sam7.c.
#define FMR_TIMING_FLASH 2 |
Definition at line 74 of file at91sam7.c.
#define FMR_TIMING_NONE 0 |
Definition at line 72 of file at91sam7.c.
#define FMR_TIMING_NVBITS 1 |
Definition at line 73 of file at91sam7.c.
#define MC_FSR_EOL 2 |
Definition at line 66 of file at91sam7.c.
#define MC_FSR_FRDY 1 |
Definition at line 65 of file at91sam7.c.
#define PMC_MCKR 0xFFFFFC30 |
Definition at line 50 of file at91sam7.c.
#define PMC_MCKR_CSS 0x03 |
Definition at line 51 of file at91sam7.c.
#define PMC_MCKR_PRES 0x1c |
Definition at line 52 of file at91sam7.c.
#define RC_FREQ 32000 |
Definition at line 69 of file at91sam7.c.
#define SGPB 0x0B |
Definition at line 60 of file at91sam7.c.
#define SLB 0x02 |
Definition at line 56 of file at91sam7.c.
#define SSB 0x0F |
Definition at line 62 of file at91sam7.c.
#define WP 0x01 |
Definition at line 55 of file at91sam7.c.
#define WPL 0x03 |
Definition at line 57 of file at91sam7.c.
|
static |
Definition at line 782 of file at91sam7.c.
References at91sam7_flash_command(), at91sam7_read_clock_info(), at91sam7_set_flash_mode(), at91sam7_write(), bank, buffer, at91sam7_flash_bank::cidr, EA, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FMR_TIMING_FLASH, LOG_ERROR, and TARGET_HALTED.
|
static |
Definition at line 627 of file at91sam7.c.
References at91sam7_read_clock_info(), at91sam7_set_flash_mode(), bank, default_flash_blank_check(), ERROR_TARGET_NOT_HALTED, FMR_TIMING_FLASH, LOG_ERROR, and TARGET_HALTED.
|
static |
Definition at line 314 of file at91sam7.c.
References at91sam7_wait_status_busy(), bank, at91sam7_flash_bank::cidr_arch, CLB, cmd, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, LOG_DEBUG, mc_fcr, MC_FSR_EOL, MC_FSR_FRDY, SLB, and target_write_u32().
Referenced by at91sam7_erase(), at91sam7_protect(), and at91sam7_write().
|
static |
Definition at line 168 of file at91sam7.c.
References mc_fsr, and target_read_u32().
Referenced by at91sam7_protect_check(), and at91sam7_wait_status_busy().
|
static |
Definition at line 943 of file at91sam7.c.
References at91sam7_read_part_info(), bank, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, and TARGET_HALTED.
|
static |
Definition at line 834 of file at91sam7.c.
References at91sam7_flash_command(), at91sam7_protect_check(), at91sam7_read_clock_info(), at91sam7_set_flash_mode(), bank, at91sam7_flash_bank::cidr, CLB, cmd, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_OPERATION_FAILED, ERROR_FLASH_SECTOR_INVALID, ERROR_OK, ERROR_TARGET_NOT_HALTED, FMR_TIMING_NVBITS, LOG_ERROR, at91sam7_flash_bank::pages_per_sector, SLB, and TARGET_HALTED.
|
static |
Definition at line 641 of file at91sam7.c.
References at91sam7_get_flash_status(), bank, at91sam7_flash_bank::cidr, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, at91sam7_flash_bank::lockbits, LOG_ERROR, at91sam7_flash_bank::num_lockbits_on, at91sam7_flash_bank::num_nvmbits, at91sam7_flash_bank::num_nvmbits_on, at91sam7_flash_bank::nvmbits, at91sam7_flash_bank::securitybit, status, and TARGET_HALTED.
Referenced by at91sam7_protect(), and at91sam7_read_part_info().
|
static |
Definition at line 177 of file at91sam7.c.
References bank, CKGR_MCFR, CKGR_MCFR_MAINRDY, CKGR_MOR, CKGR_PLLR, CKGR_PLLR_DIV, CKGR_PLLR_MUL, at91sam7_flash_bank::ext_freq, at91sam7_flash_bank::mck_freq, at91sam7_flash_bank::mck_valid, PMC_MCKR, PMC_MCKR_CSS, PMC_MCKR_PRES, RC_FREQ, and target_read_u32().
Referenced by at91sam7_erase(), at91sam7_erase_check(), at91sam7_protect(), at91sam7_read_part_info(), and at91sam7_write().
|
static |
Definition at line 341 of file at91sam7.c.
References at91sam7_protect_check(), at91sam7_read_clock_info(), at91sam7_set_flash_mode(), bank, flash_bank::bank_number, flash_bank::base, at91sam7_flash_bank::cidr, at91sam7_flash_bank::cidr_arch, at91sam7_flash_bank::cidr_eproc, at91sam7_flash_bank::cidr_ext, at91sam7_flash_bank::cidr_nvpsiz, at91sam7_flash_bank::cidr_nvpsiz2, at91sam7_flash_bank::cidr_nvptyp, at91sam7_flash_bank::cidr_sramsiz, at91sam7_flash_bank::cidr_version, DBGU_CIDR, flash_bank::driver, flash_bank::driver_priv, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, at91sam7_flash_bank::ext_freq, at91sam7_flash_bank::flash_autodetection, FLASH_SIZE_1024KB, FLASH_SIZE_128KB, FLASH_SIZE_16KB, FLASH_SIZE_2048KB, FLASH_SIZE_256KB, FLASH_SIZE_32KB, FLASH_SIZE_512KB, FLASH_SIZE_64KB, FLASH_SIZE_8KB, at91sam7_flash_bank::flashmode, FMR_TIMING_NONE, flash_sector::is_erased, flash_sector::is_protected, LOG_DEBUG, LOG_ERROR, LOG_WARNING, flash_bank::name, flash_bank::next, NULL, at91sam7_flash_bank::num_nvmbits, at91sam7_flash_bank::num_nvmbits_on, flash_bank::num_sectors, flash_sector::offset, at91sam7_flash_bank::pages_per_sector, at91sam7_flash_bank::pagesize, flash_bank::sectors, flash_sector::size, flash_bank::size, flash_bank::target, target, at91sam7_flash_bank::target_name, and target_read_u32().
Referenced by at91sam7_probe().
|
static |
Definition at line 247 of file at91sam7.c.
References bank, at91sam7_flash_bank::cidr_arch, at91sam7_flash_bank::flashmode, FMR_TIMING_FLASH, FMR_TIMING_NVBITS, LOG_DEBUG, mc_fmr, at91sam7_flash_bank::mck_freq, mode, and target_write_u32().
Referenced by at91sam7_erase(), at91sam7_erase_check(), at91sam7_protect(), at91sam7_read_part_info(), and at91sam7_write().
|
static |
Definition at line 288 of file at91sam7.c.
References alive_sleep(), at91sam7_get_flash_status(), bank, LOG_DEBUG, LOG_ERROR, and status.
Referenced by at91sam7_flash_command().
|
static |
Definition at line 876 of file at91sam7.c.
References at91sam7_flash_command(), at91sam7_read_clock_info(), at91sam7_set_flash_mode(), bank, buffer, at91sam7_flash_bank::cidr, at91sam7_flash_bank::cidr_arch, count, DIV_ROUND_UP, ERROR_FLASH_BANK_NOT_PROBED, ERROR_FLASH_DST_BREAKS_ALIGNMENT, ERROR_FLASH_DST_OUT_OF_BANK, ERROR_FLASH_OPERATION_FAILED, ERROR_OK, ERROR_TARGET_NOT_HALTED, FMR_TIMING_FLASH, LOG_DEBUG, LOG_ERROR, LOG_WARNING, offset, at91sam7_flash_bank::pagesize, TARGET_HALTED, target_write_memory(), and WP.
Referenced by at91sam7_erase().
COMMAND_HANDLER | ( | at91sam7_handle_gpnvm_command | ) |
Definition at line 1010 of file at91sam7.c.
FLASH_BANK_COMMAND_HANDLER | ( | at91sam7_flash_bank_command | ) |
Definition at line 682 of file at91sam7.c.
References bank, flash_bank::bank_number, flash_bank::base, at91sam7_flash_bank::cidr, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, flash_bank::driver, flash_bank::driver_priv, ERROR_OK, at91sam7_flash_bank::ext_freq, at91sam7_flash_bank::flash_autodetection, at91sam7_flash_bank::flashmode, freq, flash_sector::is_erased, flash_sector::is_protected, flash_bank::name, flash_bank::next, NULL, at91sam7_flash_bank::num_nvmbits, at91sam7_flash_bank::num_nvmbits_on, flash_bank::num_sectors, flash_sector::offset, at91sam7_flash_bank::pages_per_sector, at91sam7_flash_bank::pagesize, flash_bank::sectors, flash_sector::size, flash_bank::size, flash_bank::target, target, and at91sam7_flash_bank::target_name.
|
static |
Definition at line 961 of file at91sam7.c.
References bank, at91sam7_flash_bank::cidr, at91sam7_flash_bank::cidr_arch, at91sam7_flash_bank::cidr_eproc, at91sam7_flash_bank::cidr_version, cmd, command_print_sameline(), eproc, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, at91sam7_flash_bank::ext_freq, at91sam7_flash_bank::lockbits, at91sam7_flash_bank::mck_freq, at91sam7_flash_bank::num_lockbits_on, at91sam7_flash_bank::num_nvmbits, at91sam7_flash_bank::num_nvmbits_on, at91sam7_flash_bank::nvmbits, at91sam7_flash_bank::pages_per_sector, at91sam7_flash_bank::pagesize, at91sam7_flash_bank::securitybit, and at91sam7_flash_bank::target_name.
|
static |
Definition at line 1010 of file at91sam7.c.
|
static |
Definition at line 1010 of file at91sam7.c.
const struct flash_driver at91sam7_flash |
Definition at line 1010 of file at91sam7.c.
|
static |
Definition at line 100 of file at91sam7.c.
Referenced by get_at91sam7_info(), and samv_probe().
|
static |
Definition at line 97 of file at91sam7.c.
Referenced by at91sam7_flash_command().
|
static |
Definition at line 96 of file at91sam7.c.
Referenced by at91sam7_set_flash_mode().
|
static |
Definition at line 98 of file at91sam7.c.
Referenced by at91sam7_get_flash_status().