aboutsummaryrefslogtreecommitdiff
path: root/src/target/armv7m.h
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2019-02-05 09:39:11 +0100
committerTomas Vanek <vanekt@fbl.cz>2021-11-18 21:09:34 +0000
commit88f429ead019fd6df96ec15f0d897385f3cef0d0 (patch)
tree440bbcfde629b8a2020b6c2234ab3c371f57cabf /src/target/armv7m.h
parent65d7629183288595177301ce262dac4ba716618b (diff)
downloadriscv-openocd-88f429ead019fd6df96ec15f0d897385f3cef0d0.zip
riscv-openocd-88f429ead019fd6df96ec15f0d897385f3cef0d0.tar.gz
riscv-openocd-88f429ead019fd6df96ec15f0d897385f3cef0d0.tar.bz2
target/cortex_m: faster reading of all CPU registers
Without the change cortex_m_debug_entry() reads all registers calling cortex_m_load_core_reg_u32() for each register with a poor usage of JTAG/SWD queue. It is time consuming, especially on an USB FS based adapter. Moreover if target_request debugmsgs are enabled, DCB_DCRDR is saved and restored on each register read. This change introduces cortex_m_fast_read_all_regs() which queues all register reads and a single dap_run() transaction does all work. cortex_m_fast_read_all_regs() reads all registers unconditionally regardless register cache is valid or not. This is a difference from the original cortex_m_debug_entry() code. cortex_m_debug_entry times from -d3 log, Cortex-M4F and CMSIS-DAP (Kinetis K28F-FRDM kit) target_request | time [ms] debugmsgs | without the change | with the change ---------------+--------------------+----------------- disable | 186 | 27 enable | 232 | 29 Added checking of DHCSR.S_REGRDY flag. If "not ready" is seen, cortex_m->slow_register_read is set and fallback to the old register read method cortex_m_slow_read_all_regs() is used instead of cortex_m_fast_read_all_regs(). Change-Id: I0665d94b97ede217394640871dc451ec93410254 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/5321 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/armv7m.h')
-rw-r--r--src/target/armv7m.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/target/armv7m.h b/src/target/armv7m.h
index 2816a91..d33e574 100644
--- a/src/target/armv7m.h
+++ b/src/target/armv7m.h
@@ -309,6 +309,11 @@ int armv7m_invalidate_core_regs(struct target *target);
int armv7m_restore_context(struct target *target);
+uint32_t armv7m_map_id_to_regsel(unsigned int arm_reg_id);
+
+bool armv7m_map_reg_packing(unsigned int arm_reg_id,
+ unsigned int *reg32_id, uint32_t *offset);
+
int armv7m_checksum_memory(struct target *target,
target_addr_t address, uint32_t count, uint32_t *checksum);
int armv7m_blank_check_memory(struct target *target,