aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.h
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2018-09-05 15:37:15 +0200
committerMatthias Welwarsky <matthias@welwarsky.de>2018-09-07 08:17:42 +0100
commit11019a824d0273012e9b253fd63ddda6a2468c83 (patch)
treedc25aa14d80f44ff5b62d1aef954a8e8f5aa3d1f /src/target/arm_adi_v5.h
parent2a3b709aa5d1ab83faed1dc7c296ffc117022d62 (diff)
downloadriscv-openocd-11019a824d0273012e9b253fd63ddda6a2468c83.zip
riscv-openocd-11019a824d0273012e9b253fd63ddda6a2468c83.tar.gz
riscv-openocd-11019a824d0273012e9b253fd63ddda6a2468c83.tar.bz2
adi_v5: enforce check on AP number value
The AP number value is restricted in 8 bits unsigned by ADI-v5 specification. Nevertheless, an "invalid" value is used by target cortex-m to force an automatic detection of the AP. Replace magic numbers by using new macros for AP max number and for the value of AP invalid. Check the value passed through -ap-num flag during configuration. Change-Id: Ic19a367db0ab11c0ebd070750eca0647d25279a5 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/4668 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/target/arm_adi_v5.h')
-rw-r--r--src/target/arm_adi_v5.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index 883ac8b..a340b76 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -136,6 +136,9 @@
#define DP_SELECT_DPBANK 0x0000000F
#define DP_SELECT_INVALID 0x00FFFF00 /* Reserved bits one */
+#define DP_APSEL_MAX (255)
+#define DP_APSEL_INVALID (-1)
+
/**
* This represents an ARM Debug Interface (v5) Access Port (AP).
* Most common is a MEM-AP, for memory access.