diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/target/arm_adi_v5.h | 3 | ||||
-rw-r--r-- | src/target/arm_dap.c | 17 |
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; |