OpenOCD
|
Go to the source code of this file.
Macros | |
#define | ARM920T_CP15_PHYS_ADDR(x, y, z) ((x << 5) | (y << 1) << (z)) |
#define | CP15PHYS_CACHETYPE ARM920T_CP15_PHYS_ADDR(0, 0x0, 1) |
#define | CP15PHYS_CTRL ARM920T_CP15_PHYS_ADDR(0, 0x1, 0) |
#define | CP15PHYS_DCACHE ARM920T_CP15_PHYS_ADDR(1, 0x2, 1) |
#define | CP15PHYS_DCACHE_IDX ARM920T_CP15_PHYS_ADDR(1, 0xe, 1) |
#define | CP15PHYS_ICACHE ARM920T_CP15_PHYS_ADDR(1, 0x1, 1) |
#define | CP15PHYS_ICACHE_IDX ARM920T_CP15_PHYS_ADDR(1, 0xd, 1) |
#define | CP15PHYS_PID ARM920T_CP15_PHYS_ADDR(0, 0xd, 0) |
#define | CP15PHYS_TESTSTATE ARM920T_CP15_PHYS_ADDR(0, 0xf, 0) |
Functions | |
static int | arm920_mmu (struct target *target, int *enabled) |
static int | arm920_virt2phys (struct target *target, target_addr_t virt, target_addr_t *phys) |
int | arm920t_arch_state (struct target *target) |
Logs summary of ARM920 state for a halted target. More... | |
static void | arm920t_deinit_target (struct target *target) |
int | arm920t_disable_mmu_caches (struct target *target, int mmu, int d_u_cache, int i_cache) |
int | arm920t_enable_mmu_caches (struct target *target, int mmu, int d_u_cache, int i_cache) |
static int | arm920t_execute_cp15 (struct target *target, uint32_t cp15_opcode, uint32_t arm_opcode) |
int | arm920t_get_ttb (struct target *target, uint32_t *result) |
static int | arm920t_init_arch_info (struct target *target, struct arm920t_common *arm920t, struct jtag_tap *tap) |
static int | arm920t_mcr (struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t value) |
static int | arm920t_mrc (struct target *target, int cpnum, uint32_t op1, uint32_t op2, uint32_t crn, uint32_t crm, uint32_t *value) |
int | arm920t_post_debug_entry (struct target *target) |
void | arm920t_pre_restore_context (struct target *target) |
static int | arm920t_read_cp15_interpreted (struct target *target, uint32_t cp15_opcode, uint32_t address, uint32_t *value) |
static int | arm920t_read_cp15_physical (struct target *target, int reg_addr, uint32_t *value) |
int | arm920t_read_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
Reads a buffer, in the specified word size, with current MMU settings. More... | |
static int | arm920t_read_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer) |
int | arm920t_soft_reset_halt (struct target *target) |
static int | arm920t_target_create (struct target *target, Jim_Interp *interp) |
static int | arm920t_verify_pointer (struct command_invocation *cmd, struct arm920t_common *arm920t) |
static int | arm920t_write_cp15_interpreted (struct target *target, uint32_t cp15_opcode, uint32_t value, uint32_t address) |
static int | arm920t_write_cp15_physical (struct target *target, int reg_addr, uint32_t value) |
int | arm920t_write_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
Writes a buffer, in the specified word size, with current MMU settings. More... | |
static int | arm920t_write_phys_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer) |
COMMAND_HANDLER (arm920t_handle_cache_info_command) | |
COMMAND_HANDLER (arm920t_handle_cp15_command) | |
COMMAND_HANDLER (arm920t_handle_read_cache_command) | |
COMMAND_HANDLER (arm920t_handle_read_mmu_command) | |
Variables | |
static const char | arm920_not [] = "target is not an ARM920" |
const struct command_registration | arm920t_command_handlers [] |
static const struct command_registration | arm920t_exec_command_handlers [] |
struct target_type | arm920t_target |
Holds methods for ARM920 targets. More... | |
#define ARM920T_CP15_PHYS_ADDR | ( | x, | |
y, | |||
z | |||
) | ((x << 5) | (y << 1) << (z)) |
#define CP15PHYS_CACHETYPE ARM920T_CP15_PHYS_ADDR(0, 0x0, 1) |
#define CP15PHYS_CTRL ARM920T_CP15_PHYS_ADDR(0, 0x1, 0) |
#define CP15PHYS_DCACHE ARM920T_CP15_PHYS_ADDR(1, 0x2, 1) |
#define CP15PHYS_DCACHE_IDX ARM920T_CP15_PHYS_ADDR(1, 0xe, 1) |
#define CP15PHYS_ICACHE ARM920T_CP15_PHYS_ADDR(1, 0x1, 1) |
#define CP15PHYS_ICACHE_IDX ARM920T_CP15_PHYS_ADDR(1, 0xd, 1) |
#define CP15PHYS_PID ARM920T_CP15_PHYS_ADDR(0, 0xd, 0) |
#define CP15PHYS_TESTSTATE ARM920T_CP15_PHYS_ADDR(0, 0xf, 0) |
|
static |
Definition at line 533 of file arm920t.c.
References arm920t_common::armv4_5_mmu, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_TARGET_ERROR, armv4_5_mmu_common::mmu_enabled, target::state, TARGET_HALTED, and target_to_arm920().
|
static |
Definition at line 544 of file arm920t.c.
References arm920t_common::armv4_5_mmu, armv4_5_mmu_translate_va(), ERROR_OK, and target_to_arm920().
int arm920t_arch_state | ( | struct target * | target | ) |
Logs summary of ARM920 state for a halted target.
Definition at line 511 of file arm920t.c.
References arm920_not, ARM920T_COMMON_MAGIC, arm_arch_state(), armv4_5_mmu_common::armv4_5_cache, arm920t_common::armv4_5_mmu, arm920t_common::common_magic, armv4_5_cache_common::d_u_cache_enabled, ERROR_OK, ERROR_TARGET_INVALID, armv4_5_cache_common::i_cache_enabled, LOG_ERROR, LOG_USER, armv4_5_mmu_common::mmu_enabled, state, and target_to_arm920().
|
static |
Definition at line 844 of file arm920t.c.
References arm7_9_deinit(), arm_free_reg_cache(), target_to_arm(), and target_to_arm920().
int arm920t_disable_mmu_caches | ( | struct target * | target, |
int | mmu, | ||
int | d_u_cache, | ||
int | i_cache | ||
) |
Definition at line 342 of file arm920t.c.
References arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), CP15PHYS_CTRL, ERROR_OK, and jtag_execute_queue().
Referenced by arm920t_init_arch_info(), arm920t_soft_reset_halt(), and fa526_init_arch_info().
int arm920t_enable_mmu_caches | ( | struct target * | target, |
int | mmu, | ||
int | d_u_cache, | ||
int | i_cache | ||
) |
Definition at line 370 of file arm920t.c.
References arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), CP15PHYS_CTRL, ERROR_OK, and jtag_execute_queue().
Referenced by arm920t_init_arch_info(), and fa526_init_arch_info().
|
static |
Definition at line 177 of file arm920t.c.
References arm920t_common::arm7_9_common, arm7_9_execute_sys_speed(), arm9tdmi_clock_out(), arm_jtag_scann(), arm_jtag_set_instr(), ARMV4_5_NOP, buf_set_u32(), ERROR_OK, scan_field::in_value, arm_jtag::intest_instr, jtag_add_dr_scan(), jtag_execute_queue(), arm7_9_common::jtag_info, LOG_ERROR, NULL, scan_field::num_bits, scan_field::out_value, arm_jtag::tap, TAP_IDLE, and target_to_arm920().
Referenced by arm920t_read_cp15_interpreted(), arm920t_write_cp15_interpreted(), and COMMAND_HANDLER().
int arm920t_get_ttb | ( | struct target * | target, |
uint32_t * | result | ||
) |
Definition at line 326 of file arm920t.c.
References arm920t_read_cp15_interpreted(), and ERROR_OK.
Referenced by arm920t_init_arch_info(), and fa526_init_arch_info().
|
static |
Definition at line 798 of file arm920t.c.
References arm7_9_common::arm, arm920t_common::arm7_9_common, arm7_9_read_memory(), arm7_9_write_memory(), ARM920T_COMMON_MAGIC, arm920t_disable_mmu_caches(), arm920t_enable_mmu_caches(), arm920t_get_ttb(), arm920t_mcr(), arm920t_mrc(), arm920t_post_debug_entry(), arm920t_pre_restore_context(), arm920t_write_memory(), arm9tdmi_init_arch_info(), armv4_5_mmu_common::armv4_5_cache, arm920t_common::armv4_5_mmu, arm920t_common::common_magic, armv4_5_cache_common::ctype, armv4_5_mmu_common::disable_mmu_caches, armv4_5_mmu_common::enable_mmu_caches, ERROR_OK, armv4_5_mmu_common::get_ttb, arm7_9_common::has_single_step, armv4_5_mmu_common::has_tiny_pages, arm::mcr, armv4_5_mmu_common::mmu_enabled, arm::mrc, arm7_9_common::post_debug_entry, arm7_9_common::pre_restore_context, arm920t_common::preserve_cache, armv4_5_mmu_common::read_memory, arm7_9_common::write_memory, and armv4_5_mmu_common::write_memory.
Referenced by arm920t_target_create().
|
static |
Definition at line 1534 of file arm920t.c.
Referenced by arm920t_init_arch_info().
|
static |
Definition at line 1518 of file arm920t.c.
References arm920t_read_cp15_interpreted(), ARMV4_5_MRC, ERROR_FAIL, and LOG_ERROR.
Referenced by arm920t_init_arch_info().
int arm920t_post_debug_entry | ( | struct target * | target | ) |
Definition at line 398 of file arm920t.c.
References arm920t_read_cp15_interpreted(), arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), armv4_5_mmu_common::armv4_5_cache, armv4_5_identify_cache(), arm920t_common::armv4_5_mmu, arm920t_common::cp15_control_reg, CP15PHYS_CACHETYPE, CP15PHYS_CTRL, CP15PHYS_TESTSTATE, armv4_5_cache_common::ctype, arm920t_common::d_far, arm920t_common::d_fsr, armv4_5_cache_common::d_u_cache_enabled, ERROR_OK, armv4_5_cache_common::i_cache_enabled, arm920t_common::i_far, arm920t_common::i_fsr, jtag_execute_queue(), LOG_DEBUG, armv4_5_mmu_common::mmu_enabled, arm920t_common::preserve_cache, and target_to_arm920().
Referenced by arm920t_init_arch_info(), and fa526_init_arch_info().
void arm920t_pre_restore_context | ( | struct target * | target | ) |
Definition at line 474 of file arm920t.c.
References arm920t_read_cp15_physical(), arm920t_write_cp15_interpreted(), arm920t_write_cp15_physical(), CP15PHYS_TESTSTATE, arm920t_common::d_far, arm920t_common::d_fsr, arm920t_common::i_far, arm920t_common::i_fsr, jtag_execute_queue(), arm920t_common::preserve_cache, and target_to_arm920().
Referenced by arm920t_init_arch_info(), and fa526_init_arch_info().
|
static |
Definition at line 233 of file arm920t.c.
References arm920t_execute_cp15(), arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), arm9tdmi_read_core_regs(), arm9tdmi_write_core_regs(), ARMV4_5_LDR, arm::core_cache, arm::core_mode, CP15PHYS_TESTSTATE, reg::dirty, ERROR_FAIL, ERROR_OK, is_arm_mode(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, reg_cache::reg_list, regs, target_to_arm(), and reg::value.
Referenced by arm920t_get_ttb(), arm920t_mrc(), and arm920t_post_debug_entry().
|
static |
Definition at line 70 of file arm920t.c.
References arm920t_common::arm7_9_common, arm_jtag_scann(), arm_jtag_set_instr(), arm_le_to_h_u32(), ERROR_OK, scan_field::in_value, arm_jtag::intest_instr, jtag_add_callback(), jtag_add_dr_scan(), jtag_execute_queue(), arm7_9_common::jtag_info, LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, arm_jtag::tap, TAP_IDLE, and target_to_arm920().
Referenced by arm920t_disable_mmu_caches(), arm920t_enable_mmu_caches(), arm920t_post_debug_entry(), arm920t_pre_restore_context(), arm920t_read_cp15_interpreted(), arm920t_write_cp15_interpreted(), and COMMAND_HANDLER().
int arm920t_read_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
uint8_t * | buffer | ||
) |
|
static |
Definition at line 571 of file arm920t.c.
References arm920t_common::armv4_5_mmu, armv4_5_mmu_read_physical(), buffer, count, size, and target_to_arm920().
int arm920t_soft_reset_halt | ( | struct target * | target | ) |
Definition at line 731 of file arm920t.c.
References alive_sleep(), arm7_9_common::arm, arm920t_disable_mmu_caches(), arm_set_cpsr(), armv4_5_mmu_common::armv4_5_cache, arm920t_common::armv4_5_mmu, buf_get_u32(), buf_set_u32(), arm::cpsr, armv4_5_cache_common::d_u_cache_enabled, debug_level, reg::dirty, arm7_9_common::eice_cache, EICE_DBG_STAT, EICE_DBG_STATUS_DBGACK, embeddedice_read_reg(), ERROR_OK, ERROR_TARGET_TIMEOUT, armv4_5_cache_common::i_cache_enabled, jtag_execute_queue(), keep_alive(), LOG_ERROR, armv4_5_mmu_common::mmu_enabled, arm::pc, reg_cache::reg_list, target::state, target_call_event_callbacks(), TARGET_EVENT_HALTED, target_halt(), TARGET_HALTED, target_to_arm7_9(), target_to_arm920(), timeval_ms(), reg::valid, and reg::value.
|
static |
Definition at line 836 of file arm920t.c.
References arm920t_init_arch_info(), and target::tap.
|
static |
Definition at line 499 of file arm920t.c.
References arm920_not, ARM920T_COMMON_MAGIC, cmd, command_print(), arm920t_common::common_magic, ERROR_OK, and ERROR_TARGET_INVALID.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 282 of file arm920t.c.
References arm920t_execute_cp15(), arm920t_read_cp15_physical(), arm920t_write_cp15_physical(), arm9tdmi_write_core_regs(), ARMV4_5_STR, arm::core_cache, arm::core_mode, CP15PHYS_TESTSTATE, reg::dirty, ERROR_FAIL, ERROR_OK, is_arm_mode(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, reg_cache::reg_list, regs, target_to_arm(), and reg::value.
Referenced by arm920t_pre_restore_context(), and arm920t_write_memory().
|
static |
Definition at line 122 of file arm920t.c.
References arm920t_common::arm7_9_common, arm_jtag_scann(), arm_jtag_set_instr(), buf_set_u32(), ERROR_OK, scan_field::in_value, arm_jtag::intest_instr, jtag_add_dr_scan(), arm7_9_common::jtag_info, LOG_DEBUG, NULL, scan_field::num_bits, scan_field::out_value, arm_jtag::tap, TAP_IDLE, and target_to_arm920().
Referenced by arm920t_disable_mmu_caches(), arm920t_enable_mmu_caches(), arm920t_post_debug_entry(), arm920t_pre_restore_context(), arm920t_read_cp15_interpreted(), arm920t_write_cp15_interpreted(), and COMMAND_HANDLER().
int arm920t_write_memory | ( | struct target * | target, |
target_addr_t | address, | ||
uint32_t | size, | ||
uint32_t | count, | ||
const uint8_t * | buffer | ||
) |
Writes a buffer, in the specified word size, with current MMU settings.
Definition at line 592 of file arm920t.c.
References arm7_9_write_memory(), arm920t_write_cp15_interpreted(), armv4_5_mmu_common::armv4_5_cache, ARMV4_5_MCR, arm920t_common::armv4_5_mmu, armv4_5_mmu_translate_va(), armv4_5_mmu_write_physical(), buffer, count, armv4_5_cache_common::d_u_cache_enabled, ERROR_OK, armv4_5_cache_common::i_cache_enabled, LOG_DEBUG, armv4_5_mmu_common::mmu_enabled, size, target_read_memory(), and target_to_arm920().
Referenced by arm920t_init_arch_info(), and fa526_init_arch_info_2().
|
static |
Definition at line 581 of file arm920t.c.
References arm920t_common::armv4_5_mmu, armv4_5_mmu_write_physical(), buffer, count, size, and target_to_arm920().
COMMAND_HANDLER | ( | arm920t_handle_cache_info_command | ) |
Definition at line 1503 of file arm920t.c.
References arm920t_verify_pointer(), armv4_5_mmu_common::armv4_5_cache, armv4_5_handle_cache_info_command(), arm920t_common::armv4_5_mmu, CMD, CMD_CTX, ERROR_OK, get_current_target(), and target_to_arm920().
COMMAND_HANDLER | ( | arm920t_handle_cp15_command | ) |
Definition at line 1447 of file arm920t.c.
References arm920t_read_cp15_physical(), arm920t_verify_pointer(), arm920t_write_cp15_physical(), CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, CMD_NAME, COMMAND_PARSE_NUMBER, command_print(), ERROR_OK, ERROR_TARGET_NOT_HALTED, get_current_target(), jtag_execute_queue(), target::state, TARGET_HALTED, and target_to_arm920().
COMMAND_HANDLER | ( | arm920t_handle_read_cache_command | ) |
Definition at line 854 of file arm920t.c.
References arm7_9_common::arm, arm920t_execute_cp15(), arm920t_read_cp15_physical(), arm920t_verify_pointer(), arm920t_write_cp15_physical(), arm9tdmi_read_core_regs(), arm9tdmi_write_core_regs(), arm_reg_current(), armv4_5_mmu_common::armv4_5_cache, ARMV4_5_D_U_CACHE_ENABLED, ARMV4_5_I_CACHE_ENABLED, ARMV4_5_LDMIA, ARMV4_5_LDR, ARMV4_5_MCR, arm920t_common::armv4_5_mmu, ARMV4_5_MMU_ENABLED, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, command_print(), arm::core_cache, arm::core_mode, CP15PHYS_CTRL, CP15PHYS_DCACHE_IDX, CP15PHYS_ICACHE_IDX, CP15PHYS_TESTSTATE, armv4_5_cache_common::d_u_size, reg::dirty, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_current_target(), is_arm_mode(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, armv4_5_cachesize::nsets, output, reg_cache::reg_list, regs, target_to_arm7_9(), target_to_arm920(), and reg::valid.
COMMAND_HANDLER | ( | arm920t_handle_read_mmu_command | ) |
Definition at line 1135 of file arm920t.c.
References arm7_9_common::arm, arm920t_execute_cp15(), arm920t_read_cp15_physical(), arm920t_verify_pointer(), arm920t_write_cp15_physical(), arm9tdmi_read_core_regs(), arm9tdmi_write_core_regs(), arm_reg_current(), ARMV4_5_D_U_CACHE_ENABLED, ARMV4_5_I_CACHE_ENABLED, ARMV4_5_LDMIA, ARMV4_5_LDR, ARMV4_5_MCR, ARMV4_5_MMU_ENABLED, ARMV4_5_MRC, ARMV4_5_STR, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, command_print(), arm::core_cache, arm::core_mode, CP15PHYS_CTRL, CP15PHYS_TESTSTATE, reg::dirty, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, get_current_target(), is_arm_mode(), jtag_execute_queue(), LOG_DEBUG, LOG_ERROR, output, arm920t_tlb_entry::ram1, arm920t_tlb_entry::ram2, reg_cache::reg_list, regs, target_to_arm7_9(), target_to_arm920(), and reg::valid.
|
static |
Definition at line 497 of file arm920t.c.
Referenced by arm920t_arch_state(), and arm920t_verify_pointer().
const struct command_registration arm920t_command_handlers[] |
|
static |
struct target_type arm920t_target |