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
This commit is contained in:
parent
a6e4aabc66
commit
513aba1930
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue