target/arm_adi_v5: add helper to get mem_ap spot in configure/cget

This is somehow an extension of existing adiv5_jim_configure(),
but includes the 'address' in the mem_ap.
Rewrite adiv5_jim_configure() using the new helper.

Change-Id: Ia7effeeece044004d459b45126ed4961a98b8568
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5857
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2020-10-12 00:11:07 +02:00
parent 80a5285ea6
commit 080fab2ecd
2 changed files with 135 additions and 85 deletions

View File

@@ -601,4 +601,14 @@ struct adiv5_private_config {
extern int adiv5_verify_config(struct adiv5_private_config *pc);
extern int adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi);
struct adiv5_mem_ap_spot {
struct adiv5_dap *dap;
int ap_num;
uint32_t base;
};
extern int adiv5_mem_ap_spot_init(struct adiv5_mem_ap_spot *p);
extern int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
Jim_GetOptInfo *goi);
#endif /* OPENOCD_TARGET_ARM_ADI_V5_H */