- fix a regression when using cortex_m3 emulated dcc channel
git-svn-id: svn://svn.berlios.de/openocd/trunk@2659 b42882b7-edfa-0310-969c-e2dbd0fdcd60__archive__
parent
a41725c788
commit
fbf775c0b7
|
@ -105,7 +105,7 @@ int cortexm3_dap_read_coreregister_u32(swjdp_common_t *swjdp, uint32_t *value, i
|
||||||
uint32_t dcrdr;
|
uint32_t dcrdr;
|
||||||
|
|
||||||
/* because the DCB_DCRDR is used for the emulated dcc channel
|
/* because the DCB_DCRDR is used for the emulated dcc channel
|
||||||
* we gave to save/restore the DCB_DCRDR when used */
|
* we have to save/restore the DCB_DCRDR when used */
|
||||||
|
|
||||||
mem_ap_read_u32(swjdp, DCB_DCRDR, &dcrdr);
|
mem_ap_read_u32(swjdp, DCB_DCRDR, &dcrdr);
|
||||||
|
|
||||||
|
@ -119,8 +119,13 @@ int cortexm3_dap_read_coreregister_u32(swjdp_common_t *swjdp, uint32_t *value, i
|
||||||
dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRDR & 0xFFFFFFF0);
|
dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRDR & 0xFFFFFFF0);
|
||||||
dap_ap_read_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRDR & 0xC), value);
|
dap_ap_read_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRDR & 0xC), value);
|
||||||
|
|
||||||
mem_ap_write_u32(swjdp, DCB_DCRDR, dcrdr);
|
|
||||||
retval = swjdp_transaction_endcheck(swjdp);
|
retval = swjdp_transaction_endcheck(swjdp);
|
||||||
|
|
||||||
|
/* restore DCB_DCRDR - this needs to be in a seperate
|
||||||
|
* transaction otherwise the emulated DCC channel breaks */
|
||||||
|
if (retval == ERROR_OK)
|
||||||
|
retval = mem_ap_write_atomic_u32(swjdp, DCB_DCRDR, dcrdr);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +135,7 @@ int cortexm3_dap_write_coreregister_u32(swjdp_common_t *swjdp, uint32_t value, i
|
||||||
uint32_t dcrdr;
|
uint32_t dcrdr;
|
||||||
|
|
||||||
/* because the DCB_DCRDR is used for the emulated dcc channel
|
/* because the DCB_DCRDR is used for the emulated dcc channel
|
||||||
* we gave to save/restore the DCB_DCRDR when used */
|
* we have to save/restore the DCB_DCRDR when used */
|
||||||
|
|
||||||
mem_ap_read_u32(swjdp, DCB_DCRDR, &dcrdr);
|
mem_ap_read_u32(swjdp, DCB_DCRDR, &dcrdr);
|
||||||
|
|
||||||
|
@ -144,12 +149,16 @@ int cortexm3_dap_write_coreregister_u32(swjdp_common_t *swjdp, uint32_t value, i
|
||||||
dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRSR & 0xFFFFFFF0);
|
dap_setup_accessport(swjdp, CSW_32BIT | CSW_ADDRINC_OFF, DCB_DCRSR & 0xFFFFFFF0);
|
||||||
dap_ap_write_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRSR & 0xC), regnum | DCRSR_WnR);
|
dap_ap_write_reg_u32(swjdp, AP_REG_BD0 | (DCB_DCRSR & 0xC), regnum | DCRSR_WnR);
|
||||||
|
|
||||||
mem_ap_write_u32(swjdp, DCB_DCRDR, dcrdr);
|
|
||||||
retval = swjdp_transaction_endcheck(swjdp);
|
retval = swjdp_transaction_endcheck(swjdp);
|
||||||
|
|
||||||
|
/* restore DCB_DCRDR - this needs to be in a seperate
|
||||||
|
* transaction otherwise the emulated DCC channel breaks */
|
||||||
|
if (retval == ERROR_OK)
|
||||||
|
retval = mem_ap_write_atomic_u32(swjdp, DCB_DCRDR, dcrdr);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int cortex_m3_write_debug_halt_mask(target_t *target, uint32_t mask_on, uint32_t mask_off)
|
int cortex_m3_write_debug_halt_mask(target_t *target, uint32_t mask_on, uint32_t mask_off)
|
||||||
{
|
{
|
||||||
/* get pointers to arch-specific information */
|
/* get pointers to arch-specific information */
|
||||||
|
|
Loading…
Reference in New Issue