diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 70ef302dc..53c0c4e15 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -638,6 +638,8 @@ struct adiv5_dap *dap_init(void) int i; /* Set up with safe defaults */ for (i = 0; i <= 255; i++) { + dap->ap[i].dap = dap; + dap->ap[i].ap_num = i; /* memaccess_tck max is 255 */ dap->ap[i].memaccess_tck = 255; /* Number of bits for tar autoincrement, impl. dep. at least 10 */ diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 186397e89..32b723959 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -127,6 +127,16 @@ * Most common is a MEM-AP, for memory access. */ struct adiv5_ap { + /** + * DAP this AP belongs to. + */ + struct adiv5_dap *dap; + + /** + * Number of this AP. + */ + uint8_t ap_num; + /** * Default value for (MEM-AP) AP_REG_CSW register. */