OpenOCD
|
This file implements support for the Direct memory access to CoreSight Access Ports (APs) or emulate the same to access CoreSight debug registers directly. More...
Go to the source code of this file.
Data Structures | |
struct | dmem_emu_ap_info |
Macros | |
#define | ARM_APB_PADDR31 BIT(31) |
#define | DMEM_DEV_PATH_DEFAULT "/dev/mem" |
#define | DMEM_MAX_EMULATE_APS 5 |
Functions | |
COMMAND_HANDLER (dmem_dap_ap_offset_command) | |
COMMAND_HANDLER (dmem_dap_base_address_command) | |
COMMAND_HANDLER (dmem_dap_config_info_command) | |
COMMAND_HANDLER (dmem_dap_device_command) | |
COMMAND_HANDLER (dmem_dap_max_aps_command) | |
COMMAND_HANDLER (dmem_emu_ap_list_command) | |
COMMAND_HANDLER (dmem_emu_base_address_command) | |
static int | dmem_ap_q_abort (struct adiv5_dap *dap, uint8_t *ack) |
static int | dmem_ap_q_read (struct adiv5_ap *ap, unsigned int reg, uint32_t *data) |
static int | dmem_ap_q_write (struct adiv5_ap *ap, unsigned int reg, uint32_t data) |
static int | dmem_connect (struct adiv5_dap *dap) |
static int | dmem_dap_init (void) |
static int | dmem_dap_khz (int khz, int *jtag_speed) |
static int | dmem_dap_quit (void) |
static int | dmem_dap_reset (int req_trst, int req_srst) |
static int | dmem_dap_speed (int speed) |
static int | dmem_dap_speed_div (int speed, int *khz) |
static int | dmem_dp_q_read (struct adiv5_dap *dap, unsigned int reg, uint32_t *data) |
static int | dmem_dp_q_write (struct adiv5_dap *dap, unsigned int reg, uint32_t data) |
static int | dmem_dp_run (struct adiv5_dap *dap) |
static int | dmem_emu_ap_q_read (unsigned int ap_idx, unsigned int reg, uint32_t *data) |
static int | dmem_emu_ap_q_write (unsigned int ap_idx, unsigned int reg, uint32_t data) |
static uint32_t | dmem_emu_get_ap_reg (uint64_t addr) |
static void | dmem_emu_set_ap_reg (uint64_t addr, uint32_t val) |
static uint32_t | dmem_get_ap_reg (struct adiv5_ap *ap, unsigned int reg) |
static uint32_t | dmem_get_ap_reg_offset (struct adiv5_ap *ap, unsigned int reg) |
static bool | dmem_is_emulated_ap (struct adiv5_ap *ap, unsigned int *idx) |
static uint32_t | dmem_memap_tar_inc (uint32_t csw) |
static void | dmem_set_ap_reg (struct adiv5_ap *ap, unsigned int reg, uint32_t val) |
Variables | |
struct adapter_driver | dmem_dap_adapter_driver |
static uint32_t | dmem_dap_ap_offset = 0x100 |
static uint64_t | dmem_dap_base_address |
static const struct command_registration | dmem_dap_command_handlers [] |
static unsigned int | dmem_dap_max_aps = 1 |
static const struct dap_ops | dmem_dap_ops |
static int | dmem_dap_retval = ERROR_OK |
static const struct command_registration | dmem_dap_subcommand_handlers [] |
static const char *const | dmem_dap_transport [] = { "dapdirect_swd", NULL } |
static char * | dmem_dev_path |
static unsigned int | dmem_emu_ap_count |
static struct dmem_emu_ap_info | dmem_emu_ap_list [DMEM_MAX_EMULATE_APS] |
static uint64_t | dmem_emu_base_address |
static void * | dmem_emu_map_base |
static size_t | dmem_emu_mapped_size |
static uint64_t | dmem_emu_size |
static void * | dmem_emu_virt_base_addr |
static void * | dmem_map_base |
static size_t | dmem_mapped_size |
static void * | dmem_virt_base_addr |
This file implements support for the Direct memory access to CoreSight Access Ports (APs) or emulate the same to access CoreSight debug registers directly.
Definition in file dmem.c.
COMMAND_HANDLER | ( | dmem_dap_ap_offset_command | ) |
Definition at line 359 of file dmem.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, dmem_dap_ap_offset, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_dap_base_address_command | ) |
Definition at line 339 of file dmem.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, dmem_dap_base_address, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_dap_config_info_command | ) |
Definition at line 397 of file dmem.c.
References dmem_emu_ap_info::ap_num, CMD, CMD_ARGC, command_print(), dmem_dap_ap_offset, dmem_dap_base_address, dmem_dap_max_aps, dmem_dev_path, DMEM_DEV_PATH_DEFAULT, dmem_emu_ap_count, dmem_emu_ap_list, dmem_emu_base_address, dmem_emu_size, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_dap_device_command | ) |
Definition at line 328 of file dmem.c.
References CMD_ARGC, CMD_ARGV, dmem_dev_path, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_dap_max_aps_command | ) |
Definition at line 349 of file dmem.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, dmem_dap_max_aps, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_emu_ap_list_command | ) |
Definition at line 380 of file dmem.c.
References dmem_emu_ap_info::ap_num, CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, dmem_emu_ap_count, dmem_emu_ap_list, DMEM_MAX_EMULATE_APS, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
COMMAND_HANDLER | ( | dmem_emu_base_address_command | ) |
Definition at line 369 of file dmem.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, dmem_emu_base_address, dmem_emu_size, ERROR_COMMAND_SYNTAX_ERROR, and ERROR_OK.
|
static |
|
static |
Definition at line 262 of file dmem.c.
References adiv5_ap::dap, dmem_emu_ap_q_read(), dmem_get_ap_reg(), dmem_is_emulated_ap(), ERROR_FAIL, ERROR_OK, is_adiv6(), and LOG_ERROR.
|
static |
Definition at line 285 of file dmem.c.
References adiv5_ap::dap, dmem_emu_ap_q_write(), dmem_is_emulated_ap(), dmem_set_ap_reg(), ERROR_FAIL, ERROR_OK, is_adiv6(), and LOG_ERROR.
|
static |
|
static |
Definition at line 485 of file dmem.c.
References ALIGN_DOWN, ALIGN_UP, dmem_dap_ap_offset, dmem_dap_base_address, dmem_dap_max_aps, dmem_dev_path, DMEM_DEV_PATH_DEFAULT, dmem_emu_ap_count, dmem_emu_base_address, dmem_emu_map_base, dmem_emu_mapped_size, dmem_emu_size, dmem_emu_virt_base_addr, dmem_map_base, dmem_mapped_size, dmem_virt_base_addr, ERROR_FAIL, ERROR_OK, LOG_ERROR, and NULL.
|
static |
|
static |
Definition at line 562 of file dmem.c.
References dmem_emu_ap_count, dmem_emu_map_base, dmem_emu_mapped_size, dmem_map_base, dmem_mapped_size, ERROR_OK, and LOG_ERROR.
|
static |
|
static |
|
static |
|
static |
Definition at line 239 of file dmem.c.
References CDBGPWRUPACK, CSYSPWRUPACK, DP_CTRL_STAT, and ERROR_OK.
|
static |
|
static |
Definition at line 313 of file dmem.c.
References dmem_dap_retval, and ERROR_OK.
|
static |
Definition at line 114 of file dmem.c.
References addr, ADIV5_AP_REG_IDR, ADIV5_MEM_AP_REG_BASE, ADIV5_MEM_AP_REG_BD0, ADIV5_MEM_AP_REG_BD1, ADIV5_MEM_AP_REG_BD2, ADIV5_MEM_AP_REG_BD3, ADIV5_MEM_AP_REG_CFG, ADIV5_MEM_AP_REG_CSW, ADIV5_MEM_AP_REG_DRW, ADIV5_MEM_AP_REG_TAR, dmem_emu_ap_info::apbap_csw, dmem_emu_ap_info::apbap_tar, dmem_dap_retval, dmem_emu_ap_list, dmem_emu_get_ap_reg(), dmem_memap_tar_inc(), ERROR_FAIL, ERROR_OK, and LOG_INFO.
Referenced by dmem_ap_q_read().
|
static |
Definition at line 165 of file dmem.c.
References addr, ADIV5_AP_REG_IDR, ADIV5_MEM_AP_REG_BASE, ADIV5_MEM_AP_REG_BD0, ADIV5_MEM_AP_REG_BD1, ADIV5_MEM_AP_REG_BD2, ADIV5_MEM_AP_REG_BD3, ADIV5_MEM_AP_REG_CFG, ADIV5_MEM_AP_REG_CSW, ADIV5_MEM_AP_REG_DRW, ADIV5_MEM_AP_REG_TAR, dmem_emu_ap_info::apbap_csw, dmem_emu_ap_info::apbap_tar, CSW_32BIT, CSW_SIZE_MASK, dmem_dap_retval, dmem_emu_ap_list, dmem_emu_set_ap_reg(), dmem_memap_tar_inc(), ERROR_OK, and LOG_INFO.
Referenced by dmem_ap_q_write().
|
static |
Definition at line 103 of file dmem.c.
References addr, ARM_APB_PADDR31, and dmem_emu_virt_base_addr.
Referenced by dmem_emu_ap_q_read().
|
static |
Definition at line 96 of file dmem.c.
References addr, ARM_APB_PADDR31, and dmem_emu_virt_base_addr.
Referenced by dmem_emu_ap_q_write().
|
static |
Definition at line 233 of file dmem.c.
References dmem_get_ap_reg_offset(), and dmem_virt_base_addr.
Referenced by dmem_ap_q_read().
|
static |
Definition at line 222 of file dmem.c.
References adiv5_ap::ap_num, and dmem_dap_ap_offset.
Referenced by dmem_get_ap_reg(), and dmem_set_ap_reg().
|
static |
Definition at line 85 of file dmem.c.
References dmem_emu_ap_info::ap_num, adiv5_ap::ap_num, dmem_emu_ap_count, and dmem_emu_ap_list.
Referenced by dmem_ap_q_read(), and dmem_ap_q_write().
|
static |
Definition at line 67 of file dmem.c.
References CSW_ADDRINC_MASK, and CSW_SIZE_MASK.
Referenced by dmem_emu_ap_q_read(), and dmem_emu_ap_q_write().
|
static |
Definition at line 227 of file dmem.c.
References dmem_get_ap_reg_offset(), and dmem_virt_base_addr.
Referenced by dmem_ap_q_write().
struct adapter_driver dmem_dap_adapter_driver |
|
static |
Definition at line 49 of file dmem.c.
Referenced by COMMAND_HANDLER(), dmem_dap_init(), and dmem_get_ap_reg_offset().
|
static |
Definition at line 47 of file dmem.c.
Referenced by COMMAND_HANDLER(), and dmem_dap_init().
|
static |
|
static |
Definition at line 48 of file dmem.c.
Referenced by COMMAND_HANDLER(), and dmem_dap_init().
|
static |
|
static |
Definition at line 52 of file dmem.c.
Referenced by dmem_dp_run(), dmem_emu_ap_q_read(), and dmem_emu_ap_q_write().
|
static |
|
static |
|
static |
Definition at line 46 of file dmem.c.
Referenced by COMMAND_HANDLER(), and dmem_dap_init().
|
static |
Definition at line 60 of file dmem.c.
Referenced by COMMAND_HANDLER(), dmem_dap_init(), dmem_dap_quit(), and dmem_is_emulated_ap().
|
static |
Definition at line 60 of file dmem.c.
Referenced by COMMAND_HANDLER(), dmem_emu_ap_q_read(), dmem_emu_ap_q_write(), and dmem_is_emulated_ap().
|
static |
Definition at line 55 of file dmem.c.
Referenced by COMMAND_HANDLER(), and dmem_dap_init().
|
static |
Definition at line 57 of file dmem.c.
Referenced by dmem_dap_init(), and dmem_dap_quit().
|
static |
Definition at line 58 of file dmem.c.
Referenced by dmem_dap_init(), and dmem_dap_quit().
|
static |
Definition at line 56 of file dmem.c.
Referenced by COMMAND_HANDLER(), and dmem_dap_init().
|
static |
Definition at line 57 of file dmem.c.
Referenced by dmem_dap_init(), dmem_emu_get_ap_reg(), and dmem_emu_set_ap_reg().
|
static |
Definition at line 41 of file dmem.c.
Referenced by dmem_dap_init(), and dmem_dap_quit().
|
static |
Definition at line 42 of file dmem.c.
Referenced by dmem_dap_init(), and dmem_dap_quit().
|
static |
Definition at line 41 of file dmem.c.
Referenced by dmem_dap_init(), dmem_get_ap_reg(), and dmem_set_ap_reg().