aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Burke <kevinb@os.amperecomputing.com>2021-08-21 23:59:38 +0200
committerAntonio Borneo <borneo.antonio@gmail.com>2022-06-24 21:35:08 +0000
commit513aba19302cc6ad7bdb33390622fd5821571e8f (patch)
treefb8738cad0d2761d174e402c00ad9aa100f0e8d2
parenta6e4aabc66a2335c1bc0da1640df4eefd9a4d604 (diff)
downloadriscv-openocd-513aba19302cc6ad7bdb33390622fd5821571e8f.zip
riscv-openocd-513aba19302cc6ad7bdb33390622fd5821571e8f.tar.gz
riscv-openocd-513aba19302cc6ad7bdb33390622fd5821571e8f.tar.bz2
adiv6: read ROM Table address size
Required for parsing ADIv6 ROM tables. Split from change https://review.openocd.org/6077/ Change-Id: I849543b7b4a4455b10bd9fc7da38a37849d71700 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/+/6458 Tested-by: jenkins
-rw-r--r--src/target/arm_adi_v5.h3
-rw-r--r--src/target/arm_dap.c17
2 files changed, 20 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index 7706fc9..4cba62a 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -395,6 +395,9 @@ struct adiv5_dap {
/** Indicates ADI version (5, 6 or 0 for unknown) being used */
unsigned int adi_version;
+
+ /* ADIv6 only field indicating ROM Table address size */
+ unsigned int asize;
};
/**
diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c
index 59d577e..d2e3f99 100644
--- a/src/target/arm_dap.c
+++ b/src/target/arm_dap.c
@@ -140,6 +140,23 @@ static int dap_init_all(void)
retval = dap->ops->connect(dap);
if (retval != ERROR_OK)
return retval;
+
+ /* see if address size of ROM Table is greater than 32-bits */
+ if (is_adiv6(dap)) {
+ uint32_t dpidr1;
+
+ retval = dap->ops->queue_dp_read(dap, DP_DPIDR1, &dpidr1);
+ if (retval != ERROR_OK) {
+ LOG_ERROR("DAP read of DPIDR1 failed...");
+ return retval;
+ }
+ retval = dap_run(dap);
+ if (retval != ERROR_OK) {
+ LOG_ERROR("DAP read of DPIDR1 failed...");
+ return retval;
+ }
+ dap->asize = dpidr1 & DP_DPIDR1_ASIZE_MASK;
+ }
}
return ERROR_OK;