OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | archnames |
struct | sam4_bank_private |
struct | sam4_cfg |
struct | sam4_chip |
struct | sam4_chip_details |
struct | sam4_reg_list |
Macros | |
#define | AT91C_EFC_FCMD_CFB (0xC) /* (EFC) Clear Fuse Bit */ |
#define | AT91C_EFC_FCMD_CLB (0x9) /* (EFC) Clear Lock Bit */ |
#define | AT91C_EFC_FCMD_EA (0x5) /* (EFC) Erase All */ |
#define | AT91C_EFC_FCMD_EPA (0x7) /* (EFC) Erase pages */ |
#define | AT91C_EFC_FCMD_EWP (0x3) /* (EFC) Erase Page and Write Page */ |
#define | AT91C_EFC_FCMD_EWPL (0x4) /* (EFC) Erase Page and Write Page then Lock */ |
#define | AT91C_EFC_FCMD_GETD (0x0) /* (EFC) Get Flash Descriptor */ |
#define | AT91C_EFC_FCMD_GFB (0xD) /* (EFC) Get Fuse Bit */ |
#define | AT91C_EFC_FCMD_GLB (0xA) /* (EFC) Get Lock Bit */ |
#define | AT91C_EFC_FCMD_SFB (0xB) /* (EFC) Set Fuse Bit */ |
#define | AT91C_EFC_FCMD_SLB (0x8) /* (EFC) Set Lock Bit */ |
#define | AT91C_EFC_FCMD_SPUI (0xF) /* (EFC) Stop Read Unique ID */ |
#define | AT91C_EFC_FCMD_STUI (0xE) /* (EFC) Start Read Unique ID */ |
#define | AT91C_EFC_FCMD_WP (0x1) /* (EFC) Write Page */ |
#define | AT91C_EFC_FCMD_WPL (0x2) /* (EFC) Write Page and Lock */ |
#define | FLASH_BANK0_BASE_C32 FLASH_BANK_BASE_C |
#define | FLASH_BANK0_BASE_SD FLASH_BANK_BASE_S |
#define | FLASH_BANK1_BASE_1024K_SD (FLASH_BANK0_BASE_SD+(1024*1024/2)) |
#define | FLASH_BANK1_BASE_2048K_SD (FLASH_BANK0_BASE_SD+(2048*1024/2)) |
#define | FLASH_BANK1_BASE_C32 (FLASH_BANK_BASE_C+(2048*1024/2)) |
#define | FLASH_BANK_BASE_C 0x01000000 |
#define | FLASH_BANK_BASE_S 0x00400000 |
#define | nvpsize2 nvpsize /* these two tables are identical */ |
#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 | SAM4_CHIPID_CIDR (0x400E0740) |
#define | SAM4_CHIPID_EXID (0x400E0744) |
#define | SAM4_CKGR_MCFR (SAM4_PMC_BASE + 0x0024) |
#define | SAM4_CKGR_MOR (SAM4_PMC_BASE + 0x0020) |
#define | SAM4_CKGR_PLLAR (SAM4_PMC_BASE + 0x0028) |
#define | SAM4_CKGR_UCKR (SAM4_PMC_BASE + 0x001c) |
#define | SAM4_ENTRY(NAME, FUNC) |
#define | SAM4_MAX_FLASH_BANKS 2 |
#define | SAM4_N_NVM_BITS 3 |
#define | SAM4_PMC_BASE (0x400E0400) |
#define | SAM4_PMC_FSMR (SAM4_PMC_BASE + 0x0070) |
#define | SAM4_PMC_FSPR (SAM4_PMC_BASE + 0x0074) |
#define | SAM4_PMC_IMR (SAM4_PMC_BASE + 0x006c) |
#define | SAM4_PMC_MCKR (SAM4_PMC_BASE + 0x0030) |
#define | SAM4_PMC_PCK0 (SAM4_PMC_BASE + 0x0040) |
#define | SAM4_PMC_PCK1 (SAM4_PMC_BASE + 0x0044) |
#define | SAM4_PMC_PCK2 (SAM4_PMC_BASE + 0x0048) |
#define | SAM4_PMC_PCSR (SAM4_PMC_BASE + 0x0018) |
#define | SAM4_PMC_SCSR (SAM4_PMC_BASE + 0x0008) |
#define | SAM4_PMC_SR (SAM4_PMC_BASE + 0x0068) |
Functions | |
static float | _tomhz (uint32_t freq_hz) |
static const char * | _yes_or_no (uint32_t v) |
COMMAND_HANDLER (sam4_handle_gpnvm_command) | |
COMMAND_HANDLER (sam4_handle_info_command) | |
COMMAND_HANDLER (sam4_handle_slowclk_command) | |
static int | efc_get_result (struct sam4_bank_private *private, uint32_t *v) |
Get the result of the last executed command. More... | |
static int | efc_get_status (struct sam4_bank_private *private, uint32_t *v) |
Get the current status of the EEFC and the value of some status bits (LOCKE, PROGE). More... | |
static int | efc_perform_command (struct sam4_bank_private *private, unsigned command, unsigned argument, uint32_t *status) |
Performs the given command and wait until its completion (or an error). More... | |
static int | efc_start_command (struct sam4_bank_private *private, unsigned command, unsigned argument) |
FLASH_BANK_COMMAND_HANDLER (sam4_flash_bank_command) | |
static int | flashd_clr_gpnvm (struct sam4_bank_private *private, unsigned gpnvm) |
Clears the selected GPNVM bit. More... | |
static int | flashd_erase_entire_bank (struct sam4_bank_private *private) |
Erases the entire flash. More... | |
static int | flashd_erase_pages (struct sam4_bank_private *private, int first_page, int num_pages, uint32_t *status) |
Erases the entire flash. More... | |
static int | flashd_get_gpnvm (struct sam4_bank_private *private, unsigned gpnvm, unsigned *puthere) |
Gets current GPNVM state. More... | |
static int | flashd_get_lock_bits (struct sam4_bank_private *private, uint32_t *v) |
Returns a bit field (at most 64) of locked regions within a page. More... | |
static int | flashd_lock (struct sam4_bank_private *private, unsigned start_sector, unsigned end_sector) |
Locks regions. More... | |
static int | flashd_read_uid (struct sam4_bank_private *private) |
Read the unique ID. More... | |
static int | flashd_set_gpnvm (struct sam4_bank_private *private, unsigned gpnvm) |
Sets the selected GPNVM bit. More... | |
static int | flashd_unlock (struct sam4_bank_private *private, unsigned start_sector, unsigned end_sector) |
Unlocks all the regions in the given address range. More... | |
static struct sam4_chip * | get_current_sam4 (struct command_invocation *cmd) |
static struct sam4_bank_private * | get_sam4_bank_private (struct flash_bank *bank) |
static int | sam4_auto_probe (struct flash_bank *bank) |
static int | sam4_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static void | sam4_explain_chipid_cidr (struct sam4_chip *chip) |
static void | sam4_explain_ckgr_mcfr (struct sam4_chip *chip) |
static void | sam4_explain_ckgr_mor (struct sam4_chip *chip) |
static void | sam4_explain_ckgr_plla (struct sam4_chip *chip) |
static void | sam4_explain_mckr (struct sam4_chip *chip) |
static void | sam4_free_driver_priv (struct flash_bank *bank) |
Remove all chips from the internal list without distinguishing which one is owned by this bank. More... | |
static int | sam4_get_details (struct sam4_bank_private *private) |
static int | sam4_get_info (struct sam4_chip *chip) |
static const struct sam4_reg_list * | sam4_get_reg (struct sam4_chip *chip, uint32_t *goes_here) |
Given a pointer to where it goes in the structure, determine the register name, address from the all registers table. More... | |
static uint32_t * | sam4_get_reg_ptr (struct sam4_cfg *cfg, const struct sam4_reg_list *list) |
static int | sam4_info (struct flash_bank *bank, struct command_invocation *cmd) |
static int | sam4_page_read (struct sam4_bank_private *private, unsigned pagenum, uint8_t *buf) |
static int | sam4_page_write (struct sam4_bank_private *private, unsigned pagenum, const uint8_t *buf) |
static int | sam4_probe (struct flash_bank *bank) |
static int | sam4_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | sam4_protect_check (struct flash_bank *bank) |
static int | sam4_read_all_regs (struct sam4_chip *chip) |
static int | sam4_read_this_reg (struct sam4_chip *chip, uint32_t *goes_here) |
static uint32_t | sam4_reg_fieldname (struct sam4_chip *chip, const char *regname, uint32_t value, unsigned shift, unsigned width) |
static int | sam4_set_wait (struct sam4_bank_private *private) |
static int | sam4_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
Variables | |
static const char *const | _rc_freq [] |
static const char | _unknown [] = "unknown" |
static struct sam4_chip * | all_sam4_chips |
static const struct sam4_chip_details | all_sam4_details [] |
static const struct archnames | archnames [] |
static const struct command_registration | at91sam4_command_handlers [] |
static const struct command_registration | at91sam4_exec_command_handlers [] |
const struct flash_driver | at91sam4_flash |
static const char *const | eproc_names [] |
static const char *const | nvpsize [] |
static const char *const | nvptype [] |
static const struct sam4_reg_list | sam4_all_regs [] |
static const char *const | sramsize [] |
#define AT91C_EFC_FCMD_CFB (0xC) /* (EFC) Clear Fuse Bit */ |
Definition at line 55 of file at91sam4.c.
#define AT91C_EFC_FCMD_CLB (0x9) /* (EFC) Clear Lock Bit */ |
Definition at line 52 of file at91sam4.c.
#define AT91C_EFC_FCMD_EA (0x5) /* (EFC) Erase All */ |
Definition at line 47 of file at91sam4.c.
#define AT91C_EFC_FCMD_EPA (0x7) /* (EFC) Erase pages */ |
Definition at line 50 of file at91sam4.c.
#define AT91C_EFC_FCMD_EWP (0x3) /* (EFC) Erase Page and Write Page */ |
Definition at line 45 of file at91sam4.c.
#define AT91C_EFC_FCMD_EWPL (0x4) /* (EFC) Erase Page and Write Page then Lock */ |
Definition at line 46 of file at91sam4.c.
#define AT91C_EFC_FCMD_GETD (0x0) /* (EFC) Get Flash Descriptor */ |
Definition at line 42 of file at91sam4.c.
#define AT91C_EFC_FCMD_GFB (0xD) /* (EFC) Get Fuse Bit */ |
Definition at line 56 of file at91sam4.c.
#define AT91C_EFC_FCMD_GLB (0xA) /* (EFC) Get Lock Bit */ |
Definition at line 53 of file at91sam4.c.
#define AT91C_EFC_FCMD_SFB (0xB) /* (EFC) Set Fuse Bit */ |
Definition at line 54 of file at91sam4.c.
#define AT91C_EFC_FCMD_SLB (0x8) /* (EFC) Set Lock Bit */ |
Definition at line 51 of file at91sam4.c.
#define AT91C_EFC_FCMD_SPUI (0xF) /* (EFC) Stop Read Unique ID */ |
Definition at line 58 of file at91sam4.c.
#define AT91C_EFC_FCMD_STUI (0xE) /* (EFC) Start Read Unique ID */ |
Definition at line 57 of file at91sam4.c.
#define AT91C_EFC_FCMD_WP (0x1) /* (EFC) Write Page */ |
Definition at line 43 of file at91sam4.c.
#define AT91C_EFC_FCMD_WPL (0x2) /* (EFC) Write Page and Lock */ |
Definition at line 44 of file at91sam4.c.
#define FLASH_BANK0_BASE_C32 FLASH_BANK_BASE_C |
Definition at line 39 of file at91sam4.c.
#define FLASH_BANK0_BASE_SD FLASH_BANK_BASE_S |
Definition at line 32 of file at91sam4.c.
#define FLASH_BANK1_BASE_1024K_SD (FLASH_BANK0_BASE_SD+(1024*1024/2)) |
Definition at line 34 of file at91sam4.c.
#define FLASH_BANK1_BASE_2048K_SD (FLASH_BANK0_BASE_SD+(2048*1024/2)) |
Definition at line 36 of file at91sam4.c.
#define FLASH_BANK1_BASE_C32 (FLASH_BANK_BASE_C+(2048*1024/2)) |
Definition at line 40 of file at91sam4.c.
#define FLASH_BANK_BASE_C 0x01000000 |
Definition at line 29 of file at91sam4.c.
#define FLASH_BANK_BASE_S 0x00400000 |
Definition at line 28 of file at91sam4.c.
#define nvpsize2 nvpsize /* these two tables are identical */ |
Definition at line 1956 of file at91sam4.c.
#define OFFSET_EFC_FCR 4 |
Definition at line 61 of file at91sam4.c.
#define OFFSET_EFC_FMR 0 |
Definition at line 60 of file at91sam4.c.
#define OFFSET_EFC_FRR 12 |
Definition at line 63 of file at91sam4.c.
#define OFFSET_EFC_FSR 8 |
Definition at line 62 of file at91sam4.c.
#define REG_NAME_WIDTH (12) |
Definition at line 25 of file at91sam4.c.
#define SAM4_CHIPID_CIDR (0x400E0740) |
Definition at line 91 of file at91sam4.c.
#define SAM4_CHIPID_EXID (0x400E0744) |
Definition at line 93 of file at91sam4.c.
#define SAM4_CKGR_MCFR (SAM4_PMC_BASE + 0x0024) |
Definition at line 105 of file at91sam4.c.
#define SAM4_CKGR_MOR (SAM4_PMC_BASE + 0x0020) |
Definition at line 103 of file at91sam4.c.
#define SAM4_CKGR_PLLAR (SAM4_PMC_BASE + 0x0028) |
Definition at line 107 of file at91sam4.c.
#define SAM4_CKGR_UCKR (SAM4_PMC_BASE + 0x001c) |
Definition at line 101 of file at91sam4.c.
#define SAM4_ENTRY | ( | NAME, | |
FUNC | |||
) |
Definition at line 2307 of file at91sam4.c.
#define SAM4_MAX_FLASH_BANKS 2 |
Definition at line 167 of file at91sam4.c.
#define SAM4_N_NVM_BITS 3 |
Definition at line 162 of file at91sam4.c.
#define SAM4_PMC_BASE (0x400E0400) |
Definition at line 96 of file at91sam4.c.
#define SAM4_PMC_FSMR (SAM4_PMC_BASE + 0x0070) |
Definition at line 121 of file at91sam4.c.
#define SAM4_PMC_FSPR (SAM4_PMC_BASE + 0x0074) |
Definition at line 123 of file at91sam4.c.
#define SAM4_PMC_IMR (SAM4_PMC_BASE + 0x006c) |
Definition at line 119 of file at91sam4.c.
#define SAM4_PMC_MCKR (SAM4_PMC_BASE + 0x0030) |
Definition at line 109 of file at91sam4.c.
#define SAM4_PMC_PCK0 (SAM4_PMC_BASE + 0x0040) |
Definition at line 111 of file at91sam4.c.
#define SAM4_PMC_PCK1 (SAM4_PMC_BASE + 0x0044) |
Definition at line 113 of file at91sam4.c.
#define SAM4_PMC_PCK2 (SAM4_PMC_BASE + 0x0048) |
Definition at line 115 of file at91sam4.c.
#define SAM4_PMC_PCSR (SAM4_PMC_BASE + 0x0018) |
Definition at line 99 of file at91sam4.c.
#define SAM4_PMC_SCSR (SAM4_PMC_BASE + 0x0008) |
Definition at line 97 of file at91sam4.c.
#define SAM4_PMC_SR (SAM4_PMC_BASE + 0x0068) |
Definition at line 117 of file at91sam4.c.
|
static |
Definition at line 67 of file at91sam4.c.
Referenced by sam4_explain_ckgr_mcfr(), sam4_explain_ckgr_plla(), sam4_explain_mckr(), and sam4_get_info().
|
static |
Definition at line 2056 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr(), sam4_explain_ckgr_mcfr(), and sam4_explain_ckgr_mor().
COMMAND_HANDLER | ( | sam4_handle_gpnvm_command | ) |
Definition at line 3100 of file at91sam4.c.
References at91sam4_flash, sam4_bank_private::bank, sam4_chip_details::bank, CMD, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, command_print(), sam4_chip::details, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, flashd_clr_gpnvm(), flashd_get_gpnvm(), flashd_set_gpnvm(), get_current_sam4(), LOG_ERROR, sam4_chip_details::n_gpnvms, flash_driver::name, sam4_bank_private::probed, sam4_auto_probe(), target::state, sam4_chip::target, and TARGET_HALTED.
COMMAND_HANDLER | ( | sam4_handle_info_command | ) |
Definition at line 3043 of file at91sam4.c.
References at91sam4_flash, sam4_bank_private::bank, sam4_chip_details::bank, CMD, command_print(), sam4_chip::details, ERROR_FAIL, ERROR_OK, get_current_sam4(), LOG_DEBUG, flash_driver::name, sam4_bank_private::present, sam4_bank_private::probed, sam4_auto_probe(), sam4_get_info(), and SAM4_MAX_FLASH_BANKS.
COMMAND_HANDLER | ( | sam4_handle_slowclk_command | ) |
Definition at line 3185 of file at91sam4.c.
|
static |
Get the result of the last executed command.
private | - info about the bank |
v | - result goes here |
Definition at line 1470 of file at91sam4.c.
References LOG_DEBUG, OFFSET_EFC_FRR, and target_read_u32().
Referenced by flashd_get_gpnvm(), and flashd_get_lock_bits().
|
static |
Get the current status of the EEFC and the value of some status bits (LOCKE, PROGE).
private | - info about the bank |
v | - result goes here |
Definition at line 1450 of file at91sam4.c.
References LOG_DEBUG, OFFSET_EFC_FSR, and target_read_u32().
Referenced by efc_perform_command(), and efc_start_command().
|
static |
Performs the given command and wait until its completion (or an error).
private | - info about the bank |
command | - Command to perform. |
argument | - Optional command argument. |
status | - put command status bits here |
Definition at line 1578 of file at91sam4.c.
References efc_get_status(), efc_start_command(), ERROR_FAIL, ERROR_OK, LOG_ERROR, status, and timeval_ms().
Referenced by flashd_clr_gpnvm(), flashd_erase_entire_bank(), flashd_erase_pages(), flashd_get_gpnvm(), flashd_get_lock_bits(), flashd_lock(), flashd_read_uid(), flashd_set_gpnvm(), flashd_unlock(), and sam4_page_write().
|
static |
Definition at line 1483 of file at91sam4.c.
References AT91C_EFC_FCMD_CFB, AT91C_EFC_FCMD_CLB, AT91C_EFC_FCMD_EA, AT91C_EFC_FCMD_EPA, AT91C_EFC_FCMD_EWP, AT91C_EFC_FCMD_EWPL, AT91C_EFC_FCMD_GETD, AT91C_EFC_FCMD_GFB, AT91C_EFC_FCMD_GLB, AT91C_EFC_FCMD_SFB, AT91C_EFC_FCMD_SLB, AT91C_EFC_FCMD_SPUI, AT91C_EFC_FCMD_STUI, AT91C_EFC_FCMD_WP, AT91C_EFC_FCMD_WPL, efc_get_status(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, OFFSET_EFC_FCR, and target_write_u32().
Referenced by efc_perform_command(), and flashd_read_uid().
FLASH_BANK_COMMAND_HANDLER | ( | sam4_flash_bank_command | ) |
Definition at line 2478 of file at91sam4.c.
References all_sam4_chips, sam4_bank_private::bank, sam4_chip_details::bank, bank, sam4_chip::cfg, sam4_bank_private::chip, sam4_chip::details, ERROR_FAIL, ERROR_OK, FLASH_BANK1_BASE_1024K_SD, FLASH_BANK1_BASE_2048K_SD, FLASH_BANK1_BASE_C32, FLASH_BANK_BASE_C, FLASH_BANK_BASE_S, LOG_ERROR, sam4_chip::next, sam4_chip::probed, sam4_cfg::slow_freq, and sam4_chip::target.
|
static |
Clears the selected GPNVM bit.
private | info about the bank |
gpnvm | GPNVM index. |
Definition at line 1762 of file at91sam4.c.
References AT91C_EFC_FCMD_CFB, efc_perform_command(), ERROR_FAIL, ERROR_OK, flashd_get_gpnvm(), sam4_chip_details::gpnvm, LOG_DEBUG, LOG_ERROR, and NULL.
Referenced by COMMAND_HANDLER().
|
static |
Erases the entire flash.
private | - the info about the bank. |
Definition at line 1662 of file at91sam4.c.
References AT91C_EFC_FCMD_EA, efc_perform_command(), LOG_DEBUG, and NULL.
Referenced by sam4_erase().
|
static |
Erases the entire flash.
private | - the info about the bank. |
first_page | |
num_pages | |
status |
Definition at line 1675 of file at91sam4.c.
References AT91C_EFC_FCMD_EPA, efc_perform_command(), LOG_DEBUG, and status.
Referenced by sam4_erase().
|
static |
Gets current GPNVM state.
private | - info about the bank. |
gpnvm | - GPNVM bit index. |
puthere | - result stored here. |
Definition at line 1721 of file at91sam4.c.
References AT91C_EFC_FCMD_GFB, efc_get_result(), efc_perform_command(), ERROR_FAIL, ERROR_OK, sam4_chip_details::gpnvm, LOG_DEBUG, LOG_ERROR, and NULL.
Referenced by COMMAND_HANDLER(), flashd_clr_gpnvm(), and flashd_set_gpnvm().
|
static |
Returns a bit field (at most 64) of locked regions within a page.
private | info about the bank |
v | where to store locked bits |
Definition at line 1828 of file at91sam4.c.
References AT91C_EFC_FCMD_GLB, efc_get_result(), efc_perform_command(), ERROR_OK, LOG_DEBUG, and NULL.
Referenced by sam4_protect_check().
|
static |
Locks regions.
private | - info about the bank |
start_sector | - first sector to lock |
end_sector | - last sector (inclusive) to lock |
Definition at line 1880 of file at91sam4.c.
References AT91C_EFC_FCMD_SLB, efc_perform_command(), ERROR_OK, and status.
Referenced by sam4_protect().
|
static |
Read the unique ID.
private | - info about the bank The unique ID is stored in the 'private' structure. |
Definition at line 1622 of file at91sam4.c.
References AT91C_EFC_FCMD_SPUI, AT91C_EFC_FCMD_STUI, efc_perform_command(), efc_start_command(), LOG_DEBUG, NULL, and target_read_u32().
Referenced by sam4_probe().
|
static |
Sets the selected GPNVM bit.
private | info about the bank |
gpnvm | GPNVM index. |
Definition at line 1794 of file at91sam4.c.
References AT91C_EFC_FCMD_SFB, efc_perform_command(), ERROR_FAIL, ERROR_OK, flashd_get_gpnvm(), sam4_chip_details::gpnvm, LOG_ERROR, and NULL.
Referenced by COMMAND_HANDLER().
|
static |
Unlocks all the regions in the given address range.
private | info about the bank |
start_sector | first sector to unlock |
end_sector | last (inclusive) to unlock |
Definition at line 1850 of file at91sam4.c.
References AT91C_EFC_FCMD_CLB, efc_perform_command(), ERROR_OK, and status.
Referenced by sam4_protect().
|
static |
Definition at line 190 of file at91sam4.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 2332 of file at91sam4.c.
References bank.
Referenced by sam4_auto_probe(), sam4_erase(), sam4_info(), sam4_probe(), sam4_protect(), sam4_protect_check(), and sam4_write().
|
static |
Definition at line 2711 of file at91sam4.c.
References bank, ERROR_OK, get_sam4_bank_private(), and sam4_probe().
Referenced by COMMAND_HANDLER(), and sam4_erase().
|
static |
Definition at line 2722 of file at91sam4.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, flashd_erase_entire_bank(), flashd_erase_pages(), get_sam4_bank_private(), LOG_DEBUG, LOG_ERROR, LOG_INFO, sam4_auto_probe(), status, and TARGET_HALTED.
|
static |
Definition at line 2112 of file at91sam4.c.
References _unknown, _yes_or_no(), sam4_chip::cfg, sam4_cfg::CHIPID_CIDR, eproc_names, LOG_USER, LOG_USER_N, archnames::name, nvpsize, nvpsize2, nvptype, sam4_reg_fieldname(), and sramsize.
Referenced by sam4_get_details().
|
static |
Definition at line 2151 of file at91sam4.c.
References _tomhz(), _yes_or_no(), sam4_chip::cfg, sam4_cfg::CKGR_MCFR, LOG_USER, sam4_cfg::mainosc_freq, sam4_reg_fieldname(), and sam4_cfg::slow_freq.
|
static |
Definition at line 2068 of file at91sam4.c.
References _rc_freq, _yes_or_no(), sam4_chip::cfg, sam4_cfg::CKGR_MOR, LOG_USER, sam4_cfg::rc_freq, sam4_reg_fieldname(), and sam4_cfg::slow_freq.
|
static |
Definition at line 2169 of file at91sam4.c.
References _tomhz(), sam4_chip::cfg, sam4_cfg::CKGR_PLLAR, LOG_USER, LOG_USER_N, sam4_cfg::mainosc_freq, sam4_cfg::plla_freq, and sam4_reg_fieldname().
|
static |
Definition at line 2189 of file at91sam4.c.
References _tomhz(), sam4_chip::cfg, sam4_cfg::CKGR_UCKR, sam4_cfg::cpu_freq, sam4_cfg::fclk_freq, LOG_USER, sam4_cfg::mainosc_freq, sam4_cfg::mclk_freq, NULL, sam4_cfg::plla_freq, sam4_cfg::PMC_MCKR, sam4_reg_fieldname(), and sam4_cfg::slow_freq.
|
static |
Remove all chips from the internal list without distinguishing which one is owned by this bank.
This simplification works only for one shot deallocation like current flash_free_all_banks()
Definition at line 2546 of file at91sam4.c.
References all_sam4_chips, sam4_chip::next, and NULL.
|
static |
Definition at line 2557 of file at91sam4.c.
References all_sam4_details, sam4_bank_private::bank, sam4_chip_details::bank, sam4_bank_private::chip, sam4_chip_details::chipid_cidr, sam4_chip::details, ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, LOG_INFO, sam4_chip_details::name, sam4_explain_chipid_cidr(), and SAM4_MAX_FLASH_BANKS.
Referenced by sam4_probe().
|
static |
Definition at line 2405 of file at91sam4.c.
References _tomhz(), sam4_chip::cfg, sam4_cfg::cpu_freq, ERROR_OK, LOG_DEBUG, LOG_USER, sam4_cfg::mainosc_freq, sam4_cfg::mclk_freq, reg::name, sam4_cfg::plla_freq, sam4_cfg::rc_freq, REG_NAME_WIDTH, sam4_all_regs, sam4_get_reg_ptr(), sam4_read_all_regs(), and sam4_cfg::unique_id.
Referenced by COMMAND_HANDLER(), and sam4_probe().
|
static |
Given a pointer to where it goes in the structure, determine the register name, address from the all registers table.
Definition at line 2341 of file at91sam4.c.
References sam4_chip::cfg, LOG_ERROR, reg::name, NULL, and sam4_all_regs.
Referenced by sam4_read_this_reg().
|
static |
Definition at line 2294 of file at91sam4.c.
Referenced by sam4_get_info(), and sam4_read_all_regs().
|
static |
Definition at line 2618 of file at91sam4.c.
References bank, cmd, command_print_sameline(), ERROR_FAIL, ERROR_OK, get_sam4_bank_private(), and TARGET_ADDR_FMT.
|
static |
Definition at line 2801 of file at91sam4.c.
References ERROR_OK, LOG_ERROR, and target_read_memory().
Referenced by sam4_write().
|
static |
Definition at line 2846 of file at91sam4.c.
References AT91C_EFC_FCMD_WP, efc_perform_command(), ERROR_FAIL, ERROR_OK, LOG_DEBUG, LOG_ERROR, status, and target_write_memory().
Referenced by sam4_write().
|
static |
Definition at line 2636 of file at91sam4.c.
References bank, ERROR_FAIL, ERROR_OK, ERROR_TARGET_NOT_HALTED, flashd_read_uid(), get_sam4_bank_private(), LOG_DEBUG, LOG_ERROR, sam4_get_details(), sam4_get_info(), SAM4_MAX_FLASH_BANKS, sam4_protect_check(), sam4_read_all_regs(), TARGET_ADDR_FMT, and TARGET_HALTED.
Referenced by sam4_auto_probe().
|
static |
Definition at line 2775 of file at91sam4.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_TARGET_NOT_HALTED, flashd_lock(), flashd_unlock(), get_sam4_bank_private(), LOG_DEBUG, LOG_ERROR, and TARGET_HALTED.
|
static |
Definition at line 2445 of file at91sam4.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, flashd_get_lock_bits(), get_sam4_bank_private(), LOG_DEBUG, LOG_ERROR, and TARGET_HALTED.
Referenced by sam4_probe().
|
static |
Definition at line 2385 of file at91sam4.c.
References sam4_chip::cfg, ERROR_OK, LOG_ERROR, reg::name, sam4_all_regs, sam4_get_reg_ptr(), and sam4_read_this_reg().
Referenced by sam4_get_info(), and sam4_probe().
|
static |
Definition at line 2368 of file at91sam4.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, reg::name, sam4_get_reg(), sam4_chip::target, and target_read_u32().
Referenced by sam4_read_all_regs().
|
static |
Definition at line 1907 of file at91sam4.c.
References LOG_USER_N, REG_NAME_WIDTH, and width.
Referenced by sam4_explain_chipid_cidr(), sam4_explain_ckgr_mcfr(), sam4_explain_ckgr_mor(), sam4_explain_ckgr_plla(), and sam4_explain_mckr().
|
static |
Definition at line 2820 of file at91sam4.c.
References ERROR_OK, LOG_DEBUG, LOG_ERROR, target_read_u32(), and target_write_u32().
Referenced by sam4_write().
|
static |
Definition at line 2890 of file at91sam4.c.
References bank, buffer, count, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, get_sam4_bank_private(), LOG_DEBUG, LOG_ERROR, NULL, offset, sam4_page_read(), sam4_page_write(), sam4_set_wait(), and TARGET_HALTED.
|
static |
Definition at line 2064 of file at91sam4.c.
Referenced by sam4_explain_ckgr_mor().
|
static |
Definition at line 1936 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr().
|
static |
Definition at line 188 of file at91sam4.c.
Referenced by FLASH_BANK_COMMAND_HANDLER(), and sam4_free_driver_priv().
|
static |
Definition at line 190 of file at91sam4.c.
Referenced by sam4_get_details().
|
static |
Definition at line 3185 of file at91sam4.c.
|
static |
Definition at line 3185 of file at91sam4.c.
const struct flash_driver at91sam4_flash |
Definition at line 3185 of file at91sam4.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1937 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr().
|
static |
Definition at line 1957 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr().
|
static |
Definition at line 2045 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr().
|
static |
Definition at line 2294 of file at91sam4.c.
Referenced by sam4_get_info(), sam4_get_reg(), and sam4_read_all_regs().
|
static |
Definition at line 1976 of file at91sam4.c.
Referenced by sam4_explain_chipid_cidr().