target/cortex_m: support DWT version 2.1 for Archv8_M

According to Arm®v8-M Architecture Reference Manual:
section D1.2.59 DWT_DEVARCH, DWT Device Architecture Register,
the field REVISION bits [19:16] defines two DWT architectures revision

Signed-off-by: Fedi Bouzazi <fedi.bouzazi@st.com>
Change-Id: I948dae0710ac921a7f0fbcef3ccacdae99184fe4
Reviewed-on: https://review.openocd.org/c/openocd/+/7800
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Fedi Bouzazi 2023-08-14 13:03:31 +01:00 committed by Antonio Borneo
parent 8bbbff185f
commit fb52ba4fa1
2 changed files with 4 additions and 2 deletions

View File

@ -1959,7 +1959,8 @@ static int cortex_m_set_watchpoint(struct target *target, struct watchpoint *wat
target_write_u32(target, comparator->dwt_comparator_address + 0,
comparator->comp);
if ((cortex_m->dwt_devarch & 0x1FFFFF) != DWT_DEVARCH_ARMV8M) {
if ((cortex_m->dwt_devarch & 0x1FFFFF) != DWT_DEVARCH_ARMV8M_V2_0
&& (cortex_m->dwt_devarch & 0x1FFFFF) != DWT_DEVARCH_ARMV8M_V2_1) {
uint32_t mask = 0, temp;
/* watchpoint params were validated earlier */

View File

@ -92,7 +92,8 @@ struct cortex_m_part_info {
#define DWT_FUNCTION0 0xE0001028
#define DWT_DEVARCH 0xE0001FBC
#define DWT_DEVARCH_ARMV8M 0x101A02
#define DWT_DEVARCH_ARMV8M_V2_0 0x101A02
#define DWT_DEVARCH_ARMV8M_V2_1 0x111A02
#define FP_CTRL 0xE0002000
#define FP_REMAP 0xE0002004