OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | sam4l_chip_info |
struct | sam4l_info |
Macros | |
#define | SAM4L_CHIPID 0x400E0740 /* Chip Identification */ |
#define | SAM4L_CIDR 0x00 /* Chip ID Register (RO) */ |
#define | SAM4L_EXID 0x04 /* Chip ID Extension Register (RO) */ |
#define | SAM4L_FCMD 0x04 /* Flash Command Register (RW) */ |
#define | SAM4L_FCMD_CPB 3 /* Clear Page Buffer */ |
#define | SAM4L_FCMD_EA 6 /* Erase All */ |
#define | SAM4L_FCMD_EAGPF 11 /* Erase all general-purpose fuse bits */ |
#define | SAM4L_FCMD_EGPB 8 /* Erase general-purpose fuse bit */ |
#define | SAM4L_FCMD_EP 2 /* Erase Page */ |
#define | SAM4L_FCMD_EUP 14 /* Erase user page */ |
#define | SAM4L_FCMD_HSDIS 17 /* High speed mode disable */ |
#define | SAM4L_FCMD_HSEN 16 /* High speed mode enable */ |
#define | SAM4L_FCMD_LP 4 /* Lock region containing given page */ |
#define | SAM4L_FCMD_NOP 0 /* No Operation */ |
#define | SAM4L_FCMD_PGPFB 10 /* Program general-purpose fuse byte */ |
#define | SAM4L_FCMD_QPR 12 /* Quick page read */ |
#define | SAM4L_FCMD_QPRUP 15 /* Quick page read (user page) */ |
#define | SAM4L_FCMD_SSB 9 /* Set security fuses */ |
#define | SAM4L_FCMD_UP 5 /* Unlock region containing given page */ |
#define | SAM4L_FCMD_WGPB 7 /* Write general-purpose fuse bit */ |
#define | SAM4L_FCMD_WP 1 /* Write Page */ |
#define | SAM4L_FCMD_WUP 13 /* Write user page */ |
#define | SAM4L_FCR 0x00 /* Flash Control Register (RW) */ |
#define | SAM4L_FGPFRHI 0x14 /* Flash General Purpose Register High (RO) */ |
#define | SAM4L_FGPFRLO 0x18 /* Flash General Purpose Register Low (RO) */ |
#define | SAM4L_FLASH ((uint32_t)0x00000000) /* Flash region */ |
#define | SAM4L_FLASH_USER 0x00800000 /* Flash user page region */ |
#define | SAM4L_FLASHCALW 0x400A0000 /* Flash controller */ |
#define | SAM4L_FMCD_CMDKEY 0xA5UL /* 'key' to issue commands, see 14.10.2 */ |
#define | SAM4L_FPR 0x0C /* Flash Parameter Register (RO) */ |
#define | SAM4L_FSR 0x08 /* Flash Status Register (RO) */ |
#define | SAM4L_FVR 0x10 /* Flash Version Register (RO) */ |
#define | SAM4L_NUM_SECTORS 16 |
#define | SMAP_BASE 0x400A3000 |
#define | SMAP_SCR (SMAP_BASE + 8) |
#define | SMAP_SCR_HCR (1 << 1) |
Functions | |
COMMAND_HANDLER (sam4l_handle_reset_deassert) | |
FLASH_BANK_COMMAND_HANDLER (sam4l_flash_bank_command) | |
static int | sam4l_check_page_erased (struct flash_bank *bank, uint32_t pn, bool *is_erased_p) |
static int | sam4l_erase (struct flash_bank *bank, unsigned int first, unsigned int last) |
static const struct sam4l_chip_info * | sam4l_find_chip_name (uint32_t id, uint32_t exid) |
static int | sam4l_flash_check_error (struct target *target, uint32_t *err) |
static int | sam4l_flash_command (struct target *target, uint8_t cmd, int page) |
static int | sam4l_flash_wait_until_ready (struct target *target) |
static int | sam4l_probe (struct flash_bank *bank) |
static int | sam4l_protect (struct flash_bank *bank, int set, unsigned int first, unsigned int last) |
static int | sam4l_protect_check (struct flash_bank *bank) |
static int | sam4l_write (struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count) |
static int | sam4l_write_page (struct sam4l_info *chip, struct target *target, uint32_t address, const uint8_t *buf) |
static int | sam4l_write_page_partial (struct sam4l_info *chip, struct flash_bank *bank, uint32_t address, const uint8_t *buf, uint32_t page_offset, uint32_t nb) |
Variables | |
static const struct command_registration | at91sam4l_command_handlers [] |
static const struct command_registration | at91sam4l_exec_command_handlers [] |
const struct flash_driver | at91sam4l_flash |
static const struct sam4l_chip_info | sam4l_known_chips [] |
static const uint16_t | sam4l_page_sizes [8] = { 32, 64, 128, 256, 512, 1024, 2048, 4096 } |
static const uint16_t | sam4l_ram_sizes [16] = { 48, 1, 2, 6, 24, 4, 80, 160, 8, 16, 32, 64, 128, 256, 96, 512 } |
#define SAM4L_CHIPID 0x400E0740 /* Chip Identification */ |
Definition at line 31 of file at91sam4l.c.
Definition at line 43 of file at91sam4l.c.
Definition at line 44 of file at91sam4l.c.
#define SAM4L_FCMD 0x04 /* Flash Command Register (RW) */ |
Definition at line 35 of file at91sam4l.c.
#define SAM4L_FCMD_CPB 3 /* Clear Page Buffer */ |
Definition at line 50 of file at91sam4l.c.
#define SAM4L_FCMD_EA 6 /* Erase All */ |
Definition at line 53 of file at91sam4l.c.
#define SAM4L_FCMD_EAGPF 11 /* Erase all general-purpose fuse bits */ |
Definition at line 58 of file at91sam4l.c.
#define SAM4L_FCMD_EGPB 8 /* Erase general-purpose fuse bit */ |
Definition at line 55 of file at91sam4l.c.
#define SAM4L_FCMD_EP 2 /* Erase Page */ |
Definition at line 49 of file at91sam4l.c.
#define SAM4L_FCMD_EUP 14 /* Erase user page */ |
Definition at line 61 of file at91sam4l.c.
#define SAM4L_FCMD_HSDIS 17 /* High speed mode disable */ |
Definition at line 64 of file at91sam4l.c.
#define SAM4L_FCMD_HSEN 16 /* High speed mode enable */ |
Definition at line 63 of file at91sam4l.c.
#define SAM4L_FCMD_LP 4 /* Lock region containing given page */ |
Definition at line 51 of file at91sam4l.c.
#define SAM4L_FCMD_NOP 0 /* No Operation */ |
Definition at line 47 of file at91sam4l.c.
#define SAM4L_FCMD_PGPFB 10 /* Program general-purpose fuse byte */ |
Definition at line 57 of file at91sam4l.c.
#define SAM4L_FCMD_QPR 12 /* Quick page read */ |
Definition at line 59 of file at91sam4l.c.
#define SAM4L_FCMD_QPRUP 15 /* Quick page read (user page) */ |
Definition at line 62 of file at91sam4l.c.
#define SAM4L_FCMD_SSB 9 /* Set security fuses */ |
Definition at line 56 of file at91sam4l.c.
#define SAM4L_FCMD_UP 5 /* Unlock region containing given page */ |
Definition at line 52 of file at91sam4l.c.
#define SAM4L_FCMD_WGPB 7 /* Write general-purpose fuse bit */ |
Definition at line 54 of file at91sam4l.c.
#define SAM4L_FCMD_WP 1 /* Write Page */ |
Definition at line 48 of file at91sam4l.c.
#define SAM4L_FCMD_WUP 13 /* Write user page */ |
Definition at line 60 of file at91sam4l.c.
#define SAM4L_FCR 0x00 /* Flash Control Register (RW) */ |
Definition at line 34 of file at91sam4l.c.
#define SAM4L_FGPFRHI 0x14 /* Flash General Purpose Register High (RO) */ |
Definition at line 39 of file at91sam4l.c.
#define SAM4L_FGPFRLO 0x18 /* Flash General Purpose Register Low (RO) */ |
Definition at line 40 of file at91sam4l.c.
#define SAM4L_FLASH ((uint32_t)0x00000000) /* Flash region */ |
Definition at line 28 of file at91sam4l.c.
#define SAM4L_FLASH_USER 0x00800000 /* Flash user page region */ |
Definition at line 29 of file at91sam4l.c.
#define SAM4L_FLASHCALW 0x400A0000 /* Flash controller */ |
Definition at line 30 of file at91sam4l.c.
#define SAM4L_FMCD_CMDKEY 0xA5UL /* 'key' to issue commands, see 14.10.2 */ |
Definition at line 66 of file at91sam4l.c.
#define SAM4L_FPR 0x0C /* Flash Parameter Register (RO) */ |
Definition at line 37 of file at91sam4l.c.
#define SAM4L_FSR 0x08 /* Flash Status Register (RO) */ |
Definition at line 36 of file at91sam4l.c.
#define SAM4L_FVR 0x10 /* Flash Version Register (RO) */ |
Definition at line 38 of file at91sam4l.c.
#define SAM4L_NUM_SECTORS 16 |
Definition at line 25 of file at91sam4l.c.
#define SMAP_BASE 0x400A3000 |
Definition at line 70 of file at91sam4l.c.
#define SMAP_SCR (SMAP_BASE + 8) |
Definition at line 72 of file at91sam4l.c.
#define SMAP_SCR_HCR (1 << 1) |
Definition at line 73 of file at91sam4l.c.
COMMAND_HANDLER | ( | sam4l_handle_reset_deassert | ) |
Definition at line 622 of file at91sam4l.c.
FLASH_BANK_COMMAND_HANDLER | ( | sam4l_flash_bank_command | ) |
Definition at line 193 of file at91sam4l.c.
References bank, ERROR_FAIL, ERROR_OK, LOG_ERROR, sam4l_info::probed, SAM4L_FLASH, sam4l_info::target, and TARGET_ADDR_FMT.
|
static |
Definition at line 232 of file at91sam4l.c.
References bank, ERROR_OK, LOG_ERROR, SAM4L_FCMD_QPR, sam4l_flash_command(), SAM4L_FLASHCALW, SAM4L_FSR, and target_read_u32().
Referenced by sam4l_erase().
|
static |
Definition at line 414 of file at91sam4l.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, sam4l_info::pages_per_sector, sam4l_info::probed, sam4l_check_page_erased(), SAM4L_FCMD_EA, SAM4L_FCMD_EP, sam4l_flash_command(), sam4l_probe(), and TARGET_HALTED.
|
static |
Definition at line 218 of file at91sam4l.c.
References ARRAY_SIZE, sam4l_chip_info::exid, NULL, and sam4l_known_chips.
Referenced by sam4l_probe().
|
static |
Definition at line 139 of file at91sam4l.c.
References ERROR_OK, SAM4L_FLASHCALW, SAM4L_FSR, and target_read_u32().
Referenced by sam4l_flash_command().
|
static |
Definition at line 152 of file at91sam4l.c.
References cmd, ERROR_OK, LOG_ERROR, SAM4L_FCMD, sam4l_flash_check_error(), sam4l_flash_wait_until_ready(), SAM4L_FLASHCALW, SAM4L_FMCD_CMDKEY, target_read_u32(), and target_write_u32().
Referenced by sam4l_check_page_erased(), sam4l_erase(), sam4l_protect(), and sam4l_write_page().
|
static |
Definition at line 125 of file at91sam4l.c.
References ERROR_OK, SAM4L_FLASHCALW, SAM4L_FSR, and target_read_u32().
Referenced by sam4l_flash_command().
|
static |
Definition at line 258 of file at91sam4l.c.
References bank, sam4l_info::details, ERROR_FAIL, ERROR_OK, sam4l_chip_info::exid, sam4l_info::flash_kb, id, LOG_ERROR, LOG_INFO, sam4l_chip_info::name, sam4l_info::num_pages, sam4l_info::page_size, sam4l_info::pages_per_sector, sam4l_info::probed, sam4l_info::ram_kb, SAM4L_CHIPID, SAM4L_CIDR, SAM4L_EXID, sam4l_find_chip_name(), SAM4L_FLASHCALW, SAM4L_FPR, SAM4L_NUM_SECTORS, sam4l_page_sizes, sam4l_ram_sizes, sam4l_info::sector_size, and target_read_u32().
Referenced by sam4l_erase(), sam4l_protect(), sam4l_protect_check(), and sam4l_write().
|
static |
Definition at line 374 of file at91sam4l.c.
References bank, ERROR_FAIL, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, sam4l_info::pages_per_sector, sam4l_info::probed, SAM4L_FCMD_LP, SAM4L_FCMD_UP, sam4l_flash_command(), sam4l_probe(), and TARGET_HALTED.
|
static |
Definition at line 346 of file at91sam4l.c.
References bank, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, sam4l_info::probed, SAM4L_FLASHCALW, SAM4L_FSR, sam4l_probe(), TARGET_HALTED, and target_read_u32().
|
static |
Definition at line 547 of file at91sam4l.c.
References bank, buffer, count, ERROR_FLASH_BANK_NOT_PROBED, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_DEBUG, LOG_ERROR, offset, sam4l_info::page_size, sam4l_info::probed, sam4l_probe(), sam4l_write_page(), sam4l_write_page_partial(), and TARGET_HALTED.
|
static |
Definition at line 481 of file at91sam4l.c.
References ERROR_OK, LOG_DEBUG, LOG_ERROR, sam4l_info::page_size, SAM4L_FCMD_CPB, SAM4L_FCMD_EP, SAM4L_FCMD_WP, sam4l_flash_command(), and target_write_memory().
Referenced by sam4l_write(), and sam4l_write_page_partial().
|
static |
Definition at line 515 of file at91sam4l.c.
References bank, ERROR_FAIL, ERROR_OK, LOG_DEBUG, sam4l_info::page_size, sam4l_write_page(), and target_read_memory().
Referenced by sam4l_write().
|
static |
Definition at line 622 of file at91sam4l.c.
|
static |
Definition at line 622 of file at91sam4l.c.
const struct flash_driver at91sam4l_flash |
Definition at line 622 of file at91sam4l.c.
|
static |
Definition at line 1 of file at91sam4l.c.
Referenced by sam4l_find_chip_name().
|
static |
Definition at line 108 of file at91sam4l.c.
Referenced by sam4l_probe().
|
static |
Definition at line 105 of file at91sam4l.c.
Referenced by sam4l_probe().