diff options
author | Matthias Welwarsky <matthias@welwarsky.de> | 2015-10-29 13:09:29 +0100 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2015-11-30 10:07:10 +0000 |
commit | 442e2506b1d535c9420a29066f5d9c8fb11de35a (patch) | |
tree | a78b81cecbdfbd3742b2905b5b2f0e50ae0f97e0 /src/target/cortex_a.c | |
parent | 6d7f5be6acfb275ce43f61514162fbd7798725d7 (diff) |
cortex_a: force cache and tlb bypass when cpu is in debug state
for minimal impact on the hardware state, force all memory accesses to
bypass the caches and tlbs. This may actually be the default, but ARM
recommends in DDI0406C to set proper default values on debug init.
Change-Id: If5ac097b6ee725c047b1e86c2f90eabe16b98c7b
Signed-off-by: Matthias Welwarsky <matthias@welwarsky.de>
Reviewed-on: http://openocd.zylin.com/3079
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Diffstat (limited to 'src/target/cortex_a.c')
-rw-r--r-- | src/target/cortex_a.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index 5268cf21..61a5df38 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -243,6 +243,18 @@ static int cortex_a_init_debug_access(struct target *target) if (retval != ERROR_OK) return retval; + /* Disable cacheline fills and force cache write-through in debug state */ + retval = mem_ap_sel_write_atomic_u32(swjdp, armv7a->debug_ap, + armv7a->debug_base + CPUDBG_DSCCR, 0); + if (retval != ERROR_OK) + return retval; + + /* Disable TLB lookup and refill/eviction in debug state */ + retval = mem_ap_sel_write_atomic_u32(swjdp, armv7a->debug_ap, + armv7a->debug_base + CPUDBG_DSMCR, 0); + if (retval != ERROR_OK) + return retval; + /* Enabling of instruction execution in debug mode is done in debug_entry code */ /* Resync breakpoint registers */ |