28 #define _DEBUG_INSTRUCTION_EXECUTION_
32 uint32_t out, uint32_t *in,
int instruction,
int clock_arg)
39 uint8_t instruction_buf = instruction;
70 #ifdef _DEBUG_INSTRUCTION_EXECUTION_
76 LOG_DEBUG(
"out: %8.8x, in: %8.8x, instruction: %i, clock: %i", out, *in, instruction, clock);
78 LOG_DEBUG(
"out: %8.8x, instruction: %i, clock: %i", out, instruction, clock_arg);
80 LOG_DEBUG(
"out: %8.8" PRIx32
", instruction: %i, clock: %i", out, instruction, clock_arg);
140 int mmu,
int d_u_cache,
int i_cache)
142 uint32_t cp15_control;
154 cp15_control &= ~0x1U;
156 if (d_u_cache || i_cache)
157 cp15_control &= ~0x4U;
164 int mmu,
int d_u_cache,
int i_cache)
166 uint32_t cp15_control;
178 cp15_control |= 0x1U;
180 if (d_u_cache || i_cache)
181 cp15_control |= 0x4U;
229 static const char *
state[] = {
230 "disabled",
"enabled"
244 LOG_ERROR(
"%s: target not halted", __func__);
334 LOG_ERROR(
"Failed to halt CPU after 1 sec");
380 uint32_t op1, uint32_t op2,
381 uint32_t crn, uint32_t crm,
384 uint32_t op1, uint32_t op2,
385 uint32_t crn, uint32_t crm,
424 uint32_t op1, uint32_t op2,
425 uint32_t crn, uint32_t crm,
441 uint32_t op1, uint32_t op2,
442 uint32_t crn, uint32_t crm,
static int arm720t_get_ttb(struct target *target, uint32_t *result)
static int arm720t_init_target(struct command_context *cmd_ctx, struct target *target)
static int arm720t_enable_mmu_caches(struct target *target, int mmu, int d_u_cache, int i_cache)
static int arm720t_init_arch_info(struct target *target, struct arm720t_common *arm720t, struct jtag_tap *tap)
static int arm720t_post_debug_entry(struct target *target)
static int arm720t_target_create(struct target *target, Jim_Interp *interp)
static int arm720t_write_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static int arm720_mmu(struct target *target, int *enabled)
static int arm720t_write_cp15(struct target *target, uint32_t opcode, uint32_t value)
static int arm720t_arch_state(struct target *target)
static int arm720t_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int arm720_virt2phys(struct target *target, target_addr_t virtual, target_addr_t *physical)
static int arm720t_read_cp15(struct target *target, uint32_t opcode, uint32_t *value)
static int arm720t_mcr(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t value)
struct target_type arm720t_target
Holds methods for ARM720 targets.
static int arm720t_mrc(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t *value)
static void arm720t_pre_restore_context(struct target *target)
static const struct command_registration arm720t_command_handlers[]
static int arm720t_scan_cp15(struct target *target, uint32_t out, uint32_t *in, int instruction, int clock_arg)
static int arm720t_soft_reset_halt(struct target *target)
static void arm720t_deinit_target(struct target *target)
static int arm720t_disable_mmu_caches(struct target *target, int mmu, int d_u_cache, int i_cache)
static int arm720t_read_phys_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
#define ARM720T_COMMON_MAGIC
static struct arm720t_common * target_to_arm720(struct target *target)
int arm7_9_write_memory_opt(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int arm7_9_examine(struct target *target)
Perform per-target setup that requires JTAG access.
int arm7_9_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int arm7_9_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
Add a breakpoint to an ARM7/9 target.
const struct command_registration arm7_9_command_handlers[]
int arm7_9_assert_reset(struct target *target)
Asserts the reset (SRST) on an ARM7/9 target.
int arm7_9_poll(struct target *target)
Polls an ARM7/9 target for its current status.
int arm7_9_halt(struct target *target)
Halt an ARM7/9 target.
int arm7_9_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
Removes a breakpoint from an ARM7/9 target.
int arm7_9_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
Remove a watchpoint from an ARM7/9 target.
int arm7_9_deassert_reset(struct target *target)
Deassert the reset (SRST) signal on an ARM7/9 target.
int arm7_9_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int arm7_9_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int arm7_9_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
Add a watchpoint to an ARM7/9 target.
int arm7_9_check_reset(struct target *target)
int arm7_9_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
int arm7tdmi_init_arch_info(struct target *target, struct arm7_9_common *arm7_9, struct jtag_tap *tap)
void arm7tdmi_deinit_target(struct target *target)
int arm7tdmi_init_target(struct command_context *cmd_ctx, struct target *target)
int arm_blank_check_memory(struct target *target, struct target_memory_check_block *blocks, int num_blocks, uint8_t erased_value)
Runs ARM code in the target to check whether a memory block holds all ones.
int arm_arch_state(struct target *target)
int arm_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Runs ARM code in the target to calculate a CRC32 checksum.
int arm_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
int armv4_5_run_algorithm(struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, int timeout_ms, void *arch_info)
const char * arm_get_gdb_arch(struct target *target)
void arm_set_cpsr(struct arm *arm, uint32_t cpsr)
Configures host-side ARM records to reflect the specified CPSR.
static int arm_jtag_scann(struct arm_jtag *jtag_info, uint32_t new_scan_chain, tap_state_t end_state)
static int arm_jtag_set_instr(struct jtag_tap *tap, uint32_t new_instr, void *no_verify_capture, tap_state_t end_state)
static void arm7flip32(jtag_callback_data_t arg)
Macros used to generate various ARM or Thumb opcodes.
#define ARMV4_5_MRC(cp, op1, rd, crn, crm, op2)
#define ARMV4_5_MCR(cp, op1, rd, crn, crm, op2)
int armv4_5_mmu_read_physical(struct target *target, struct armv4_5_mmu_common *armv4_5_mmu, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int armv4_5_mmu_write_physical(struct target *target, struct armv4_5_mmu_common *armv4_5_mmu, uint32_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int armv4_5_mmu_translate_va(struct target *target, struct armv4_5_mmu_common *armv4_5_mmu, uint32_t va, uint32_t *cb, uint32_t *val)
uint32_t flip_u32(uint32_t value, unsigned int num)
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned first, unsigned num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
int embeddedice_read_reg(struct reg *reg)
Queue a read for an EmbeddedICE register into the register cache, not checking the value read.
int jtag_execute_queue(void)
For software FIFO implementations, the queued commands can be executed during this call or earlier.
void jtag_add_runtest(int num_cycles, tap_state_t state)
Goes to TAP_IDLE (if we're not already there), cycle precisely num_cycles in the TAP_IDLE state,...
void jtag_add_dr_scan(struct jtag_tap *active, int in_num_fields, const struct scan_field *in_fields, tap_state_t state)
Generate a DR SCAN using the fields passed to the function.
void jtag_add_callback(jtag_callback1_t f, jtag_callback_data_t data0)
A simpler version of jtag_add_callback4().
intptr_t jtag_callback_data_t
Defines the type of data passed to the jtag_callback_t interface.
void alive_sleep(uint64_t ms)
#define LOG_USER(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
size_t size
Size of the control block search area.
unsigned int common_magic
uint32_t cp15_control_reg
struct arm7_9_common arm7_9_common
struct armv4_5_mmu_common armv4_5_mmu
Structure for items that are common between both ARM7 and ARM9 targets.
struct arm_jtag jtag_info
JTAG information for target.
struct reg_cache * eice_cache
Embedded ICE register cache.
int(* post_debug_entry)(struct target *target)
Callback function called after entering debug mode.
void(* pre_restore_context)(struct target *target)
Callback function called before restoring the processor context.
Represents a generic ARM core, with standard application registers.
enum arm_arch arch
ARM architecture version.
int(* mrc)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t *value)
Read coprocessor register.
struct reg * cpsr
Handle to the CPSR/xPSR; valid in all core modes.
struct reg * pc
Handle to the PC; valid in all core modes.
int(* mcr)(struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t value)
Write coprocessor register.
int(* write_memory)(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
int(* read_memory)(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int(* get_ttb)(struct target *target, uint32_t *result)
int(* enable_mmu_caches)(struct target *target, int mmu, int d_u_cache, int i_cache)
int(* disable_mmu_caches)(struct target *target, int mmu, int d_u_cache, int i_cache)
struct armv4_5_cache_common armv4_5_cache
const struct command_registration * chain
If non-NULL, the commands in chain will be registered in the same context and scope of this registrat...
This structure defines a single scan field in the scan.
int num_bits
The number of bits this field specifies.
uint8_t * in_value
A pointer to a 32-bit memory location for data scanned out.
const uint8_t * out_value
A pointer to value to be scanned into the device.
This holds methods shared between all instances of a given target type.
const char * name
Name of this type of target.
int target_call_event_callbacks(struct target *target, enum target_event event)
int target_halt(struct target *target)
#define ERROR_TARGET_INVALID
#define ERROR_TARGET_TIMEOUT