From: openocd-gerrit <ope...@us...> - 2023-12-29 14:35:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bfc12522395af86ba634aa8e085a8051ca6fd43c (commit) from ee3fb5a0eacb42e8e881239194485d79d128d246 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bfc12522395af86ba634aa8e085a8051ca6fd43c Author: Tomas Vanek <va...@fb...> Date: Wed Mar 15 13:58:52 2023 +0100 target/arm_adi_v5,arm_dap: introduce pre_connect_init() dap operation SWD multidrop requires some initialization once before connecting all daps. Provide an optional pre-connect dap operation. Change-Id: I778215c512c56423a425dda80ab19a739f22f285 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/7542 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index e07b577af..fc7fdafd8 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -420,6 +420,9 @@ struct adiv5_dap { * available until run(). */ struct dap_ops { + /** Optional; called once on the first enabled dap before connecting */ + int (*pre_connect_init)(struct adiv5_dap *dap); + /** connect operation for SWD */ int (*connect)(struct adiv5_dap *dap); diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c index 84cc6c743..9f4afae74 100644 --- a/src/target/arm_dap.c +++ b/src/target/arm_dap.c @@ -91,6 +91,7 @@ static int dap_init_all(void) { struct arm_dap_object *obj; int retval; + bool pre_connect = true; LOG_DEBUG("Initializing all DAPs ..."); @@ -123,6 +124,14 @@ static int dap_init_all(void) is_adiv6(dap) ? "ADIv6" : "ADIv5"); } + if (pre_connect && dap->ops->pre_connect_init) { + retval = dap->ops->pre_connect_init(dap); + if (retval != ERROR_OK) + return retval; + + pre_connect = false; + } + retval = dap->ops->connect(dap); if (retval != ERROR_OK) return retval; ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.h | 3 +++ src/target/arm_dap.c | 9 +++++++++ 2 files changed, 12 insertions(+) hooks/post-receive -- Main OpenOCD repository |