aboutsummaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.h
diff options
context:
space:
mode:
authorKevin Burke <kevinb@os.amperecomputing.com>2021-08-06 15:01:34 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-06-24 21:34:30 +0000
commit1fe82f9f1db62f0ab59471e1cdaf02643bf7a66c (patch)
treeea5880adac4a5584c19894a3308f0a3cdab0a732 /src/target/arm_adi_v5.h
parent35a503b08d145edbd81519f9471b480292062bb5 (diff)
downloadriscv-openocd-1fe82f9f1db62f0ab59471e1cdaf02643bf7a66c.zip
riscv-openocd-1fe82f9f1db62f0ab59471e1cdaf02643bf7a66c.tar.gz
riscv-openocd-1fe82f9f1db62f0ab59471e1cdaf02643bf7a66c.tar.bz2
adiv6: add dap flags -adiv5 and -adiv6
Add flags to 'dap create' command and set the field adi_version in struct adiv5_dap. Actually only ADIv5 is functional. Other patches are needed to get ADIv6 working. Split from change https://review.openocd.org/6077/ Change-Id: I63d3902f99a7f139c15ee4e07c19eae9ed4534b9 Signed-off-by: Kevin Burke <kevinb@os.amperecomputing.com> Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6456 Tested-by: jenkins
Diffstat (limited to 'src/target/arm_adi_v5.h')
-rw-r--r--src/target/arm_adi_v5.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index c7ffe7b..d7824ce 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -353,6 +353,9 @@ struct adiv5_dap {
* Record if enter in SWD required passing through DORMANT
*/
bool switch_through_dormant;
+
+ /** Indicates ADI version (5, 6 or 0 for unknown) being used */
+ unsigned int adi_version;
};
/**
@@ -427,6 +430,18 @@ static inline bool is_64bit_ap(struct adiv5_ap *ap)
}
/**
+ * Check if DAP is ADIv6
+ *
+ * @param dap The DAP to test
+ *
+ * @return true for ADIv6, false for either ADIv5 or unknown version
+ */
+static inline bool is_adiv6(const struct adiv5_dap *dap)
+{
+ return dap->adi_version == 6;
+}
+
+/**
* Send an adi-v5 sequence to the DAP.
*
* @param dap The DAP used for reading.