OpenOCD
cortex_a.c File Reference
Include dependency graph for cortex_a.c:

Go to the source code of this file.

Functions

 COMMAND_HANDLER (cortex_a_handle_cache_info_command)
 
 COMMAND_HANDLER (cortex_a_handle_dbginit_command)
 
 COMMAND_HANDLER (cortex_a_handle_smp_off_command)
 
 COMMAND_HANDLER (cortex_a_handle_smp_on_command)
 
 COMMAND_HANDLER (cortex_a_handle_smp_gdb_command)
 
 COMMAND_HANDLER (handle_cortex_a_mask_interrupts_command)
 
 COMMAND_HANDLER (handle_cortex_a_dacrfixup_command)
 
static int cortex_a_add_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_add_context_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_add_hybrid_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_assert_reset (struct target *target)
 
static int cortex_a_bpwp_disable (struct arm_dpm *dpm, unsigned index_t)
 
static int cortex_a_bpwp_enable (struct arm_dpm *dpm, unsigned index_t, uint32_t addr, uint32_t control)
 
static int cortex_a_dap_read_coreregister_u32 (struct target *target, uint32_t *value, int regnum)
 
static int cortex_a_dap_write_coreregister_u32 (struct target *target, uint32_t value, int regnum)
 
static int cortex_a_dap_write_memap_register_u32 (struct target *target, uint32_t address, uint32_t value)
 
static int cortex_a_deassert_reset (struct target *target)
 
static int cortex_a_debug_entry (struct target *target)
 
static void cortex_a_deinit_target (struct target *target)
 
static int cortex_a_dfsr_to_error_code (uint32_t dfsr)
 
static int cortex_a_dpm_finish (struct arm_dpm *dpm)
 
static int cortex_a_dpm_prepare (struct arm_dpm *dpm)
 
static int cortex_a_dpm_setup (struct cortex_a_common *a, uint32_t didr)
 
static int cortex_a_examine (struct target *target)
 
static int cortex_a_examine_first (struct target *target)
 
static int cortex_a_exec_opcode (struct target *target, uint32_t opcode, uint32_t *dscr_p)
 
static int cortex_a_halt (struct target *target)
 
static int cortex_a_halt_smp (struct target *target)
 
static int cortex_a_handle_target_request (void *priv)
 
static int cortex_a_init_arch_info (struct target *target, struct cortex_a_common *cortex_a, struct jtag_tap *tap)
 
static int cortex_a_init_debug_access (struct target *target)
 
static int cortex_a_init_target (struct command_context *cmd_ctx, struct target *target)
 
static int cortex_a_instr_cpsr_sync (struct arm_dpm *dpm)
 
static int cortex_a_instr_read_data_dcc (struct arm_dpm *dpm, uint32_t opcode, uint32_t *data)
 
static int cortex_a_instr_read_data_r0 (struct arm_dpm *dpm, uint32_t opcode, uint32_t *data)
 
static int cortex_a_instr_write_data_dcc (struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
 
static int cortex_a_instr_write_data_r0 (struct arm_dpm *dpm, uint32_t opcode, uint32_t data)
 
static int cortex_a_internal_restart (struct target *target)
 
static int cortex_a_internal_restore (struct target *target, int current, target_addr_t *address, int handle_breakpoints, int debug_execution)
 
static int cortex_a_mmu (struct target *target, int *enabled)
 
static int cortex_a_mmu_modify (struct target *target, int enable)
 
static int cortex_a_poll (struct target *target)
 
static int cortex_a_post_debug_entry (struct target *target)
 
static int cortex_a_post_memaccess (struct target *target, int phys_access)
 
static int cortex_a_prep_memaccess (struct target *target, int phys_access)
 
static int cortex_a_read_buffer (struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
 
static int cortex_a_read_copro (struct target *target, uint32_t opcode, uint32_t *data, uint32_t *dscr)
 
static int cortex_a_read_cpu_memory (struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int cortex_a_read_cpu_memory_fast (struct target *target, uint32_t count, uint8_t *buffer, uint32_t *dscr)
 
static int cortex_a_read_cpu_memory_slow (struct target *target, uint32_t size, uint32_t count, uint8_t *buffer, uint32_t *dscr)
 
static int cortex_a_read_dcc (struct cortex_a_common *a, uint32_t *data, uint32_t *dscr_p)
 
static int cortex_a_read_dfar_dfsr (struct target *target, uint32_t *dfar, uint32_t *dfsr, uint32_t *dscr)
 
static int cortex_a_read_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int cortex_a_read_memory_ahb (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int cortex_a_read_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
static int cortex_a_read_regs_through_mem (struct target *target, uint32_t address, uint32_t *regfile)
 
static int cortex_a_remove_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_restore_context (struct target *target, bool bpwp)
 
static int cortex_a_restore_cp15_control_reg (struct target *target)
 
static int cortex_a_restore_smp (struct target *target, int handle_breakpoints)
 
static int cortex_a_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
 
static int cortex_a_set_breakpoint (struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
 
static int cortex_a_set_context_breakpoint (struct target *target, struct breakpoint *breakpoint, uint8_t matchmode)
 
static int cortex_a_set_dcc_mode (struct target *target, uint32_t mode, uint32_t *dscr)
 
int cortex_a_set_dscr_bits (struct target *target, unsigned long bit_mask, unsigned long value)
 
static int cortex_a_set_hybrid_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_step (struct target *target, int current, target_addr_t address, int handle_breakpoints)
 
static int cortex_a_target_create (struct target *target, Jim_Interp *interp)
 
static int cortex_a_unset_breakpoint (struct target *target, struct breakpoint *breakpoint)
 
static int cortex_a_virt2phys (struct target *target, target_addr_t virt, target_addr_t *phys)
 
static int cortex_a_wait_dscr_bits (struct target *target, uint32_t mask, uint32_t value, uint32_t *dscr)
 
static int cortex_a_wait_instrcmpl (struct target *target, uint32_t *dscr, bool force)
 
static int cortex_a_write_buffer (struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
 
static int cortex_a_write_copro (struct target *target, uint32_t opcode, uint32_t data, uint32_t *dscr)
 
static int cortex_a_write_cpu_memory (struct target *target, uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int cortex_a_write_cpu_memory_fast (struct target *target, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
 
static int cortex_a_write_cpu_memory_slow (struct target *target, uint32_t size, uint32_t count, const uint8_t *buffer, uint32_t *dscr)
 
static int cortex_a_write_dcc (struct cortex_a_common *a, uint32_t data)
 
static int cortex_a_write_dfar_dfsr (struct target *target, uint32_t dfar, uint32_t dfsr, uint32_t *dscr)
 
static int cortex_a_write_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int cortex_a_write_memory_ahb (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int cortex_a_write_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 
static int cortex_r4_target_create (struct target *target, Jim_Interp *interp)
 
static struct cortex_a_commondpm_to_a (struct arm_dpm *dpm)
 
static struct targetget_cortex_a (struct target *target, int32_t coreid)
 
static int update_halt_gdb (struct target *target)
 

Variables

static const struct
command_registration 
cortex_a_command_handlers []
 
static const struct
command_registration 
cortex_a_exec_command_handlers []
 
static const struct
command_registration 
cortex_r4_command_handlers []
 
static const struct
command_registration 
cortex_r4_exec_command_handlers []
 
struct target_type cortexa_target
 
struct target_type cortexr4_target
 

Function Documentation

COMMAND_HANDLER ( cortex_a_handle_cache_info_command  )
COMMAND_HANDLER ( cortex_a_handle_dbginit_command  )
COMMAND_HANDLER ( cortex_a_handle_smp_off_command  )
COMMAND_HANDLER ( cortex_a_handle_smp_on_command  )
COMMAND_HANDLER ( cortex_a_handle_smp_gdb_command  )
static int cortex_a_add_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static
static int cortex_a_add_context_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static
static int cortex_a_add_hybrid_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static
static int cortex_a_bpwp_disable ( struct arm_dpm dpm,
unsigned  index_t 
)
static
static int cortex_a_bpwp_enable ( struct arm_dpm dpm,
unsigned  index_t,
uint32_t  addr,
uint32_t  control 
)
static
static int cortex_a_dap_read_coreregister_u32 ( struct target target,
uint32_t *  value,
int  regnum 
)
static
static int cortex_a_dap_write_coreregister_u32 ( struct target target,
uint32_t  value,
int  regnum 
)
static
static int cortex_a_dap_write_memap_register_u32 ( struct target target,
uint32_t  address,
uint32_t  value 
)
static
static int cortex_a_deassert_reset ( struct target target)
static
static void cortex_a_deinit_target ( struct target target)
static
static int cortex_a_dfsr_to_error_code ( uint32_t  dfsr)
static
static int cortex_a_dpm_finish ( struct arm_dpm dpm)
static

Definition at line 577 of file cortex_a.c.

References ERROR_OK.

Referenced by cortex_a_dpm_setup().

static int cortex_a_examine ( struct target target)
static

Definition at line 3094 of file cortex_a.c.

References cortex_a_examine_first(), cortex_a_init_debug_access(), and ERROR_OK.

static int cortex_a_halt_smp ( struct target target)
static
static int cortex_a_init_debug_access ( struct target target)
static
static int cortex_a_init_target ( struct command_context cmd_ctx,
struct target target 
)
static

Definition at line 3112 of file cortex_a.c.

References arm_semihosting_init(), and ERROR_OK.

static int cortex_a_instr_cpsr_sync ( struct arm_dpm dpm)
static

Definition at line 628 of file cortex_a.c.

References arm_dpm::arm, ARMV4_5_MCR, cortex_a_exec_opcode(), DSCR_INSTR_COMP, and arm::target.

Referenced by cortex_a_dpm_setup().

static int cortex_a_instr_read_data_dcc ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t *  data 
)
static
static int cortex_a_instr_read_data_r0 ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t *  data 
)
static
static int cortex_a_instr_write_data_dcc ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t  data 
)
static
static int cortex_a_instr_write_data_r0 ( struct arm_dpm dpm,
uint32_t  opcode,
uint32_t  data 
)
static
static int cortex_a_read_buffer ( struct target target,
target_addr_t  address,
uint32_t  count,
uint8_t *  buffer 
)
static

Definition at line 2815 of file cortex_a.c.

References cortex_a_read_memory_ahb(), and ERROR_OK.

static int cortex_a_read_copro ( struct target target,
uint32_t  opcode,
uint32_t *  data,
uint32_t *  dscr 
)
static
static int cortex_a_read_dcc ( struct cortex_a_common a,
uint32_t *  data,
uint32_t *  dscr_p 
)
static
static int cortex_a_read_dfar_dfsr ( struct target target,
uint32_t *  dfar,
uint32_t *  dfsr,
uint32_t *  dscr 
)
static

Definition at line 2003 of file cortex_a.c.

References ARMV4_5_MRC, cortex_a_read_copro(), and ERROR_OK.

Referenced by cortex_a_read_cpu_memory(), and cortex_a_write_cpu_memory().

static int cortex_a_read_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)
static
static int cortex_a_read_memory_ahb ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)
static
static int cortex_a_read_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
uint8_t *  buffer 
)
static
static int cortex_a_read_regs_through_mem ( struct target target,
uint32_t  address,
uint32_t *  regfile 
)
static
static int cortex_a_remove_breakpoint ( struct target target,
struct breakpoint breakpoint 
)
static
static int cortex_a_restore_context ( struct target target,
bool  bpwp 
)
static
static int cortex_a_restore_cp15_control_reg ( struct target target)
static
static int cortex_a_restore_smp ( struct target target,
int  handle_breakpoints 
)
static
int cortex_a_set_dscr_bits ( struct target target,
unsigned long  bit_mask,
unsigned long  value 
)
static int cortex_a_target_create ( struct target target,
Jim_Interp *  interp 
)
static
static int cortex_a_write_buffer ( struct target target,
target_addr_t  address,
uint32_t  count,
const uint8_t *  buffer 
)
static

Definition at line 2849 of file cortex_a.c.

References cortex_a_write_memory_ahb(), and ERROR_OK.

static int cortex_a_write_copro ( struct target target,
uint32_t  opcode,
uint32_t  data,
uint32_t *  dscr 
)
static
static int cortex_a_write_cpu_memory_fast ( struct target target,
uint32_t  count,
const uint8_t *  buffer,
uint32_t *  dscr 
)
static
static int cortex_a_write_dcc ( struct cortex_a_common a,
uint32_t  data 
)
static
static int cortex_a_write_dfar_dfsr ( struct target target,
uint32_t  dfar,
uint32_t  dfsr,
uint32_t *  dscr 
)
static

Definition at line 2056 of file cortex_a.c.

References ARMV4_5_MCR, cortex_a_write_copro(), and ERROR_OK.

Referenced by cortex_a_read_cpu_memory(), and cortex_a_write_cpu_memory().

static int cortex_a_write_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)
static
static int cortex_a_write_memory_ahb ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)
static
static int cortex_a_write_phys_memory ( struct target target,
target_addr_t  address,
uint32_t  size,
uint32_t  count,
const uint8_t *  buffer 
)
static
static int cortex_r4_target_create ( struct target target,
Jim_Interp *  interp 
)
static
static struct target* get_cortex_a ( struct target target,
int32_t  coreid 
)
static
static int update_halt_gdb ( struct target target)
static

Variable Documentation

const struct command_registration cortex_a_command_handlers[]
static
Initial value:
= {
{
},
{
},
{
.name = "cortex_a",
.mode = COMMAND_ANY,
.help = "Cortex-A command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:222
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
Definition: command.h:218
const char * name
Definition: command.h:203
const struct command_registration armv7a_command_handlers[]
Definition: armv7a.c:787
static const struct command_registration cortex_a_exec_command_handlers[]
Definition: cortex_a.c:3363
const struct command_registration arm_command_handlers[]
Definition: armv4_5.c:1189

Definition at line 3415 of file cortex_a.c.

const struct command_registration cortex_a_exec_command_handlers[]
static

Definition at line 3363 of file cortex_a.c.

const struct command_registration cortex_r4_command_handlers[]
static
Initial value:
= {
{
},
{
},
{
.name = "cortex_r4",
.mode = COMMAND_ANY,
.help = "Cortex-R4 command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:222
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
Definition: command.h:218
const char * name
Definition: command.h:203
const struct command_registration armv7a_command_handlers[]
Definition: armv7a.c:787
static const struct command_registration cortex_r4_exec_command_handlers[]
Definition: cortex_a.c:3479
const struct command_registration arm_command_handlers[]
Definition: armv4_5.c:1189

Definition at line 3504 of file cortex_a.c.

const struct command_registration cortex_r4_exec_command_handlers[]
static
Initial value:
= {
{
.name = "cache_info",
.handler = cortex_a_handle_cache_info_command,
.mode = COMMAND_EXEC,
.help = "display information about target caches",
.usage = "",
},
{
.name = "dbginit",
.handler = cortex_a_handle_dbginit_command,
.mode = COMMAND_EXEC,
.help = "Initialize core debug",
.usage = "",
},
{
.name = "maskisr",
.handler = handle_cortex_a_mask_interrupts_command,
.mode = COMMAND_EXEC,
.help = "mask cortex_r4 interrupts",
.usage = "['on'|'off']",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:222

Definition at line 3479 of file cortex_a.c.

struct target_type cortexa_target

Definition at line 3432 of file cortex_a.c.

struct target_type cortexr4_target

Definition at line 3521 of file cortex_a.c.