This is an automated email from Gerrit.

"Daniel Goehring <[email protected]>" just uploaded a new patch 
set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/9260

-- gerrit

commit 4fbb777427da42c8d9cfc40207e0c803bae8ca83
Author: Daniel Goehring <[email protected]>
Date:   Mon Jul 14 10:46:11 2025 -0600

    target/arm: add nested AP MEM_AP target support
    
    For the MEM_AP target, add nested AP support.
    
    Change-Id: Ic084e3c0d33fc74006d7119e3983f19348ce1f17
    Signed-off-by: Daniel Goehring <[email protected]>

diff --git a/src/target/mem_ap.c b/src/target/mem_ap.c
index c5618c9ccd..00ab1de7bf 100644
--- a/src/target/mem_ap.c
+++ b/src/target/mem_ap.c
@@ -22,6 +22,7 @@ struct mem_ap {
        struct adiv5_dap *dap;
        struct adiv5_ap *ap;
        uint64_t ap_num;
+       uint64_t ap_num_gateway;
 };
 
 static int mem_ap_target_create(struct target *target)
@@ -45,6 +46,7 @@ static int mem_ap_target_create(struct target *target)
        }
 
        mem_ap->ap_num = pc->ap_num;
+       mem_ap->ap_num_gateway = pc->ap_num_gateway;
        mem_ap->common_magic = MEM_AP_COMMON_MAGIC;
        mem_ap->dap = pc->dap;
 
@@ -137,7 +139,10 @@ static int mem_ap_examine(struct target *target)
 
        if (!target_was_examined(target)) {
                if (!mem_ap->ap) {
-                       mem_ap->ap = dap_get_ap(mem_ap->dap, mem_ap->ap_num);
+                       if (mem_ap->ap_num_gateway == DP_APSEL_INVALID)
+                               mem_ap->ap = dap_get_ap(mem_ap->dap, 
mem_ap->ap_num);
+                       else
+                               mem_ap->ap = dap_get_ap_gateway(mem_ap->dap, 
mem_ap->ap_num, mem_ap->ap_num_gateway);
                        if (!mem_ap->ap) {
                                LOG_TARGET_ERROR(target, "Cannot get AP");
                                return ERROR_FAIL;

-- 

Reply via email to