diff options
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/arm11.c | 35 | ||||
-rw-r--r-- | src/target/arm11.h | 6 | ||||
-rw-r--r-- | src/target/arm11_dbgtap.c | 10 | ||||
-rw-r--r-- | src/target/arm11_dbgtap.h | 6 |
4 files changed, 25 insertions, 32 deletions
diff --git a/src/target/arm11.c b/src/target/arm11.c index 0a54c522..cb1af7bf 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -385,7 +385,7 @@ static int arm11_on_enter_debug_state(struct arm11_common *arm11) return ERROR_OK; } -void arm11_dump_reg_changes(struct arm11_common * arm11) +static void arm11_dump_reg_changes(struct arm11_common * arm11) { if (!(debug_level >= LOG_LVL_DEBUG)) @@ -1680,6 +1680,8 @@ static int arm11_examine(struct target *target) int retval; char *type; struct arm11_common *arm11 = target_to_arm11(target); + uint32_t didr, device_id; + uint8_t implementor; /* check IDCODE */ @@ -1687,7 +1689,7 @@ static int arm11_examine(struct target *target) struct scan_field idcode_field; - arm11_setup_field(arm11, 32, NULL, &arm11->device_id, &idcode_field); + arm11_setup_field(arm11, 32, NULL, &device_id, &idcode_field); arm11_add_dr_scan_vc(1, &idcode_field, TAP_DRPAUSE); @@ -1699,14 +1701,14 @@ static int arm11_examine(struct target *target) struct scan_field chain0_fields[2]; - arm11_setup_field(arm11, 32, NULL, &arm11->didr, chain0_fields + 0); - arm11_setup_field(arm11, 8, NULL, &arm11->implementor, chain0_fields + 1); + arm11_setup_field(arm11, 32, NULL, &didr, chain0_fields + 0); + arm11_setup_field(arm11, 8, NULL, &implementor, chain0_fields + 1); arm11_add_dr_scan_vc(ARRAY_SIZE(chain0_fields), chain0_fields, TAP_IDLE); CHECK_RETVAL(jtag_execute_queue()); - switch (arm11->device_id & 0x0FFFF000) + switch (device_id & 0x0FFFF000) { case 0x07B36000: type = "ARM1136"; @@ -1724,26 +1726,25 @@ static int arm11_examine(struct target *target) } LOG_INFO("found %s", type); - arm11->debug_version = (arm11->didr >> 16) & 0x0F; - - if (arm11->debug_version != ARM11_DEBUG_V6 && - arm11->debug_version != ARM11_DEBUG_V61) - { - LOG_ERROR("Only ARMv6 v6 and v6.1 architectures supported."); + /* unlikely this could ever fail, but ... */ + switch ((didr >> 16) & 0x0F) { + case ARM11_DEBUG_V6: + case ARM11_DEBUG_V61: /* supports security extensions */ + break; + default: + LOG_ERROR("Only ARM v6 and v6.1 debug supported."); return ERROR_FAIL; } - arm11->brp = ((arm11->didr >> 24) & 0x0F) + 1; - arm11->wrp = ((arm11->didr >> 28) & 0x0F) + 1; + arm11->brp = ((didr >> 24) & 0x0F) + 1; + arm11->wrp = ((didr >> 28) & 0x0F) + 1; /** \todo TODO: reserve one brp slot if we allow breakpoints during step */ arm11->free_brps = arm11->brp; arm11->free_wrps = arm11->wrp; - LOG_DEBUG("IDCODE %08" PRIx32 " IMPLEMENTOR %02x DIDR %08" PRIx32 "", - arm11->device_id, - (int)(arm11->implementor), - arm11->didr); + LOG_DEBUG("IDCODE %08" PRIx32 " IMPLEMENTOR %02x DIDR %08" PRIx32, + device_id, implementor, didr); /* as a side-effect this reads DSCR and thus * clears the ARM11_DSCR_STICKY_PRECISE_DATA_ABORT / Sticky Precise Data Abort Flag diff --git a/src/target/arm11.h b/src/target/arm11.h index 3d7841d5..d40faa4f 100644 --- a/src/target/arm11.h +++ b/src/target/arm11.h @@ -62,15 +62,9 @@ struct arm11_common /** \name Processor type detection */ /*@{*/ - uint32_t device_id; /**< IDCODE readout */ - uint32_t didr; /**< DIDR readout (debug capabilities) */ - uint8_t implementor; /**< DIDR Implementor readout */ - size_t brp; /**< Number of Breakpoint Register Pairs from DIDR */ size_t wrp; /**< Number of Watchpoint Register Pairs from DIDR */ - enum arm11_debug_version - debug_version; /**< ARM debug architecture from DIDR */ /*@}*/ uint32_t last_dscr; /**< Last retrieved DSCR value; diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index 26de4ceb..c8d5902f 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -48,7 +48,8 @@ static const tap_state_t arm11_move_pi_to_si_via_ci[] = }; -int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields, tap_state_t state) +static int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields, + tap_state_t state) { if (cmd_queue_cur_state == TAP_IRPAUSE) jtag_add_pathmove(ARRAY_SIZE(arm11_move_pi_to_si_via_ci), arm11_move_pi_to_si_via_ci); @@ -201,7 +202,8 @@ int arm11_add_debug_SCAN_N(struct arm11_common * arm11, uint8_t chain, tap_state * * \remarks This adds to the JTAG command queue but does \em not execute it. */ -void arm11_add_debug_INST(struct arm11_common * arm11, uint32_t inst, uint8_t * flag, tap_state_t state) +static void arm11_add_debug_INST(struct arm11_common * arm11, + uint32_t inst, uint8_t * flag, tap_state_t state) { JTAG_DEBUG("INST <= 0x%08x", inst); @@ -377,7 +379,9 @@ int arm11_run_instr_data_finish(struct arm11_common * arm11) * \param count Number of opcodes to execute * */ -int arm11_run_instr_no_data(struct arm11_common * arm11, uint32_t * opcode, size_t count) +static +int arm11_run_instr_no_data(struct arm11_common * arm11, + uint32_t * opcode, size_t count) { arm11_add_IR(arm11, ARM11_ITRSEL, ARM11_TAP_DEFAULT); diff --git a/src/target/arm11_dbgtap.h b/src/target/arm11_dbgtap.h index 87b66a50..b85a138c 100644 --- a/src/target/arm11_dbgtap.h +++ b/src/target/arm11_dbgtap.h @@ -11,8 +11,6 @@ void arm11_add_IR(struct arm11_common *arm11, uint8_t instr, tap_state_t state); int arm11_add_debug_SCAN_N(struct arm11_common *arm11, uint8_t chain, tap_state_t state); -void arm11_add_debug_INST(struct arm11_common *arm11, - uint32_t inst, uint8_t *flag, tap_state_t state); int arm11_read_DSCR(struct arm11_common *arm11, uint32_t *dscr); int arm11_write_DSCR(struct arm11_common *arm11, uint32_t dscr); @@ -20,8 +18,6 @@ enum target_debug_reason arm11_get_DSCR_debug_reason(uint32_t dscr); int arm11_run_instr_data_prepare(struct arm11_common *arm11); int arm11_run_instr_data_finish(struct arm11_common *arm11); -int arm11_run_instr_no_data(struct arm11_common *arm11, - uint32_t *opcode, size_t count); int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode); int arm11_run_instr_data_to_core(struct arm11_common *arm11, uint32_t opcode, uint32_t *data, size_t count); @@ -38,8 +34,6 @@ int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11, int arm11_add_dr_scan_vc(int num_fields, struct scan_field *fields, tap_state_t state); -int arm11_add_ir_scan_vc(int num_fields, struct scan_field *fields, - tap_state_t state); /** * Used with arm11_sc7_run to make a list of read/write commands for |