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/+/9252

-- gerrit

commit 67ab3419ae8737197e61f1d60b21b996101aec45
Author: Daniel Goehring <[email protected]>
Date:   Mon Jul 14 19:35:48 2025 -0600

    target/arm: add nested AP DAP base support
    
    For the DAP structure, add nested AP base support.
    
    This framework provides nested AP base support for the DAP info,
    baseaddr, memaccess, apsel, apcsw, apid, and apreg commands.
    
    Change-Id: I96fb8487b7fa87ef79cef2f4064680ace70c47e0
    Signed-off-by: Daniel Goehring <[email protected]>

diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h
index 27fa5a2784..bbf38c90b0 100644
--- a/src/target/arm_adi_v5.h
+++ b/src/target/arm_adi_v5.h
@@ -370,6 +370,7 @@ struct adiv5_dap {
 
        /* The current manually selected AP by the "dap apsel" command */
        uint64_t apsel;
+       uint64_t apsel_gateway;
 
        /** Cache for DP SELECT and SELECT1 (ADIv6) register. */
        uint64_t select;
diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c
index 55f2c99150..91d8c9066b 100644
--- a/src/target/arm_dap.c
+++ b/src/target/arm_dap.c
@@ -435,7 +435,9 @@ COMMAND_HANDLER(handle_dap_info_command)
        struct target *target = get_current_target(CMD_CTX);
        struct arm *arm = target_to_arm(target);
        struct adiv5_dap *dap = arm->dap;
+       struct adiv5_ap *ap;
        uint64_t apsel;
+       uint64_t apsel_gateway = DP_APSEL_INVALID;
 
        if (!dap) {
                LOG_ERROR("DAP instance not available. Probably a HLA 
target...");
@@ -445,6 +447,7 @@ COMMAND_HANDLER(handle_dap_info_command)
        switch (CMD_ARGC) {
        case 0:
                apsel = dap->apsel;
+               apsel_gateway = dap->apsel_gateway;
                break;
        case 1:
                if (!strcmp(CMD_ARGV[0], "root")) {
@@ -463,11 +466,23 @@ COMMAND_HANDLER(handle_dap_info_command)
                if (!is_ap_num_valid(dap, apsel))
                        return ERROR_COMMAND_SYNTAX_ERROR;
                break;
+       case 2:
+               COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], apsel);
+               if (!is_ap_num_valid(dap, apsel))
+                       return ERROR_COMMAND_SYNTAX_ERROR;
+               COMMAND_PARSE_NUMBER(u64, CMD_ARGV[1], apsel_gateway);
+               if (!is_ap_num_valid(dap, apsel_gateway))
+                       return ERROR_COMMAND_SYNTAX_ERROR;
+               break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       struct adiv5_ap *ap = dap_get_ap(dap, apsel);
+       if (apsel_gateway == DP_APSEL_INVALID)
+               ap = dap_get_ap(dap, apsel);
+       else
+               ap = dap_get_ap_gateway(dap, apsel, apsel_gateway);
+
        if (!ap) {
                command_print(CMD, "Cannot get AP");
                return ERROR_FAIL;
@@ -505,7 +520,7 @@ static const struct command_registration 
dap_subcommand_handlers[] = {
                .mode = COMMAND_EXEC,
                .help = "display ROM table for specified MEM-AP (default MEM-AP 
of current target) "
                        "or the ADIv6 root ROM table of current target's DAP",
-               .usage = "[ap_num | 'root']",
+               .usage = "[ap_num [ap_num_gateway] | 'root']",
        },
        COMMAND_REGISTRATION_DONE
 };

-- 

Reply via email to