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

-- gerrit

commit 0d0b74b001373717b226684fd2c07752a74da469
Author: Daniel Goehring <[email protected]>
Date:   Mon Jul 14 20:56:58 2025 -0600

    target/arm: add nested AP DAP 'apsel' cmd support
    
    Add nested AP support to the DAP 'apsel' command.
    
    Change-Id: I60fb9331dd9057a18081e24b1d595b74ad0b28e8
    Signed-off-by: Daniel Goehring <[email protected]>

diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index adf43bd1aa..5c491ae413 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -2808,10 +2808,14 @@ COMMAND_HANDLER(dap_apsel_command)
 {
        struct adiv5_dap *dap = adiv5_get_dap(CMD_DATA);
        uint64_t apsel;
+       uint64_t apsel_gateway = DP_APSEL_INVALID;
 
        switch (CMD_ARGC) {
        case 0:
-               command_print(CMD, "0x%" PRIx64, dap->apsel);
+               if (dap->apsel_gateway == DP_APSEL_INVALID)
+                       command_print(CMD, "AP 0x%" PRIx64, dap->apsel);
+               else
+                       command_print(CMD, "AP 0x%" PRIx64 ", GW 0x%" PRIx64, 
dap->apsel, dap->apsel_gateway);
                return ERROR_OK;
        case 1:
                COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], apsel);
@@ -2820,11 +2824,25 @@ COMMAND_HANDLER(dap_apsel_command)
                        return ERROR_COMMAND_ARGUMENT_INVALID;
                }
                break;
+       case 2:
+               COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], apsel);
+               if (!is_ap_num_valid(dap, apsel)) {
+                       command_print(CMD, "Invalid AP number");
+                       return ERROR_COMMAND_ARGUMENT_INVALID;
+               }
+               COMMAND_PARSE_NUMBER(u64, CMD_ARGV[1], apsel_gateway);
+               if (!is_ap_num_valid(dap, apsel_gateway)) {
+                       command_print(CMD, "Invalid AP_GATEWAY number");
+                       return ERROR_COMMAND_ARGUMENT_INVALID;
+               }
+               break;
        default:
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        dap->apsel = apsel;
+       dap->apsel_gateway = apsel_gateway;
+
        return ERROR_OK;
 }
 
@@ -3201,7 +3219,7 @@ const struct command_registration dap_instance_commands[] 
= {
                .mode = COMMAND_ANY,
                .help = "Set the currently selected AP (default 0) "
                        "and display the result",
-               .usage = "[ap_num]",
+               .usage = "[ap_num [ap_num_gateway]]",
        },
        {
                .name = "apcsw",

-- 

Reply via email to