arm_adi_v5: add option 'root' to 'dap info' command

On ADIv6 the system root ROM table is found by reading the DAP DP
registers BASEPTR0 and BASEPTR1.

Add option 'root' to the commands 'dap info' to let it retrieve
the system root ROM table's AP from DAP DP, then use such AP for
following dump.

Change-Id: I1789457a005faa3870c5d14f763378d2f6a5f095
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6462
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2021-08-09 15:31:10 +02:00
parent 3f4bc6ce7f
commit 8c1d518232
4 changed files with 66 additions and 8 deletions

View File

@@ -86,6 +86,9 @@
#define DP_DPIDR1_ASIZE_MASK (0x7F)
#define DP_DPIDR1_ERRMODE BIT(7)
/* Fields of register DP_BASEPTR0 */
#define DP_BASEPTR0_VALID BIT(0)
/* Fields of the DP's CTRL/STAT register */
#define CORUNDETECT (1UL << 0)
#define SSTICKYORUN (1UL << 1)
@@ -692,6 +695,9 @@ int mem_ap_init(struct adiv5_ap *ap);
/* Invalidate cached DP select and cached TAR and CSW of all APs */
void dap_invalidate_cache(struct adiv5_dap *dap);
/* read ADIv6 baseptr register */
int adiv6_dap_read_baseptr(struct command_invocation *cmd, struct adiv5_dap *dap, target_addr_t *baseptr);
/* test if ap_num is valid, based on current knowledge of dap */
bool is_ap_num_valid(struct adiv5_dap *dap, uint64_t ap_num);