mips32.c: fix IB and DB bits check for EJTAG v2.0

Change-Id: I4e28dddc1d5d9c2b923ae17beacdd7f73591b1d0
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: http://openocd.zylin.com/1931
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
__archive__
Oleksij Rempel 2014-01-21 20:48:14 +01:00 committed by Spencer Oliver
parent 91bfd9dbf2
commit c13ca4de40
1 changed files with 9 additions and 4 deletions

View File

@ -536,10 +536,15 @@ int mips32_configure_break_unit(struct target *target)
if (retval != ERROR_OK) if (retval != ERROR_OK)
return retval; return retval;
/* EJTAG 2.0 does not specify EJTAG_DCR_IB and EJTAG_DCR_DB bits, /* EJTAG 2.0 defines IB and DB bits in IMP instead of DCR.
* assume IB and DB registers are always present. */ * Since these DCR bits should be reserved on EJTAG 2.0, we can
if (ejtag_info->ejtag_version == EJTAG_VERSION_20) * just remap them. */
dcr |= EJTAG_DCR_IB | EJTAG_DCR_DB; 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) { if (dcr & EJTAG_DCR_IB) {
retval = mips32_configure_ibs(target); retval = mips32_configure_ibs(target);