target: cortex-m: add support for armv8m caches

Cores like Cortex-M7, Cortex-M55 and Cortex-M85 can have either
D-Cache and/or I-Cache.
Using SW breakpoints in RAM requires handling these caches.

Detect the presence of cache at examine.
Detect cache state (enable/disable) at debug entry.
Take care of caches synchronization through the PoC (usually the
SRAM) while setting and removing SW breakpoints.
Add command 'cache_info' to check cache presence and size.

Change-Id: Ice637c215fe3042c8fff57edefbab1b86515ef4b
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9077
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2025-08-05 12:06:22 +02:00
parent 2abf8daa80
commit 04da6e2c62
7 changed files with 454 additions and 0 deletions

View File

@@ -15,6 +15,7 @@
#define OPENOCD_TARGET_ARMV7M_H
#include "arm.h"
#include "armv7m_cache.h"
#include "armv7m_trace.h"
struct adiv5_ap;
@@ -239,6 +240,8 @@ struct armv7m_common {
/* hla_target uses a high level adapter that does not support all functions */
bool is_hla_target;
struct armv7m_cache_common armv7m_cache;
struct armv7m_trace_config trace_config;
/* Direct processor core register read and writes */