arm_adi_v5: make dap_lookup_cs_component() traverse subtables and handle multicore

When looking for a debug base address of a core, one should search
through all the ROM tables, not just the top-level one.

This code also assumes that the first found entry (in a depth-first
search) will correspond to core 0, the second to core 1 etc.

The patch is supposed to be an alternative implementation of
http://openocd.zylin.com/#/c/1313/.

Change-Id: Ifc88971a02fe3d9c00d9bf72a822ade5804d4e09
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1920
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
This commit is contained in:
Paul Fertser
2014-02-03 01:19:00 +04:00
committed by Spencer Oliver
parent 9c47dc9e8e
commit ec9ccaa288
3 changed files with 35 additions and 8 deletions

View File

@@ -470,7 +470,7 @@ int dap_find_ap(struct adiv5_dap *dap,
/* Lookup CoreSight component */
int dap_lookup_cs_component(struct adiv5_dap *dap, int ap,
uint32_t dbgbase, uint8_t type, uint32_t *addr);
uint32_t dbgbase, uint8_t type, uint32_t *addr, int32_t *idx);
struct target;