aboutsummaryrefslogtreecommitdiff
path: root/src/target/mips32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/mips32.c')
-rw-r--r--src/target/mips32.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/target/mips32.c b/src/target/mips32.c
index b05a563..795efdd 100644
--- a/src/target/mips32.c
+++ b/src/target/mips32.c
@@ -536,10 +536,15 @@ int mips32_configure_break_unit(struct target *target)
if (retval != ERROR_OK)
return retval;
- /* EJTAG 2.0 does not specify EJTAG_DCR_IB and EJTAG_DCR_DB bits,
- * assume IB and DB registers are always present. */
- if (ejtag_info->ejtag_version == EJTAG_VERSION_20)
- dcr |= EJTAG_DCR_IB | EJTAG_DCR_DB;
+ /* EJTAG 2.0 defines IB and DB bits in IMP instead of DCR.
+ * Since these DCR bits should be reserved on EJTAG 2.0, we can
+ * just remap them. */
+ if (ejtag_info->ejtag_version == EJTAG_VERSION_20) {
+ if (!(ejtag_info->impcode & EJTAG_V20_IMP_NOIB))
+ dcr |= EJTAG_DCR_IB;
+ if (!(ejtag_info->impcode & EJTAG_V20_IMP_NODB))
+ dcr |= EJTAG_DCR_DB;
+ }
if (dcr & EJTAG_DCR_IB) {
retval = mips32_configure_ibs(target);