cortex_a: faster debug init
Don't use atomic dap operations when not necessary Change-Id: Idc6dcd2bda95f7994852df4ae2a588976f4c9010 Signed-off-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com> Reviewed-on: http://openocd.zylin.com/4142 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
parent
0056037d68
commit
78a4b6607e
|
@ -206,23 +206,27 @@ static int cortex_a_init_debug_access(struct target *target)
|
||||||
|
|
||||||
/* lock memory-mapped access to debug registers to prevent
|
/* lock memory-mapped access to debug registers to prevent
|
||||||
* software interference */
|
* software interference */
|
||||||
retval = mem_ap_write_atomic_u32(armv7a->debug_ap,
|
retval = mem_ap_write_u32(armv7a->debug_ap,
|
||||||
armv7a->debug_base + CPUDBG_LOCKACCESS, 0);
|
armv7a->debug_base + CPUDBG_LOCKACCESS, 0);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* Disable cacheline fills and force cache write-through in debug state */
|
/* Disable cacheline fills and force cache write-through in debug state */
|
||||||
retval = mem_ap_write_atomic_u32(armv7a->debug_ap,
|
retval = mem_ap_write_u32(armv7a->debug_ap,
|
||||||
armv7a->debug_base + CPUDBG_DSCCR, 0);
|
armv7a->debug_base + CPUDBG_DSCCR, 0);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
/* Disable TLB lookup and refill/eviction in debug state */
|
/* Disable TLB lookup and refill/eviction in debug state */
|
||||||
retval = mem_ap_write_atomic_u32(armv7a->debug_ap,
|
retval = mem_ap_write_u32(armv7a->debug_ap,
|
||||||
armv7a->debug_base + CPUDBG_DSMCR, 0);
|
armv7a->debug_base + CPUDBG_DSMCR, 0);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
retval = dap_run(armv7a->debug_ap->dap);
|
||||||
|
if (retval != ERROR_OK)
|
||||||
|
return retval;
|
||||||
|
|
||||||
/* Enabling of instruction execution in debug mode is done in debug_entry code */
|
/* Enabling of instruction execution in debug mode is done in debug_entry code */
|
||||||
|
|
||||||
/* Resync breakpoint registers */
|
/* Resync breakpoint registers */
|
||||||
|
|
Loading…
Reference in New Issue