This is an automated email from Gerrit.

"Tomas Vanek <van...@fbl.cz>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/7539

-- gerrit

commit 6c0f699db78a561a420b215756a61295d4bf3e09
Author: Tomas Vanek <van...@fbl.cz>
Date:   Tue Mar 14 14:31:30 2023 +0100

    target/adi_v5_xxx: use ADIV5_DP_SELECT_APBANK
    
    and DP_SELECT_DPBANK.
    Use the defined symbols instead of magic numbers.
    
    Change-Id: I19c86b183e57e42b96f76eed180c0492cd67bee1
    Signed-off-by: Tomas Vanek <van...@fbl.cz>

diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c
index eeb796be45..d510a9d8aa 100644
--- a/src/target/adi_v5_jtag.c
+++ b/src/target/adi_v5_jtag.c
@@ -350,7 +350,7 @@ static int adi_jtag_dp_scan_u32(struct adiv5_dap *dap,
 {
        uint8_t out_value_buf[4];
        int retval;
-       uint64_t sel = (reg_addr >> 4) & 0xf;
+       uint64_t sel = (reg_addr >> 4) & DP_SELECT_DPBANK;
 
        /* No need to change SELECT or RDBUFF as they are not banked */
        if (instr == JTAG_DP_DPACC && reg_addr != DP_SELECT && reg_addr != 
DP_RDBUFF &&
@@ -769,7 +769,7 @@ static int jtag_ap_q_bankselect(struct adiv5_ap *ap, 
unsigned reg)
        }
 
        /* ADIv5 */
-       sel = (ap->ap_num << 24) | (reg & 0x000000F0);
+       sel = (ap->ap_num << 24) | (reg & ADIV5_DP_SELECT_APBANK);
 
        if (sel == dap->select)
                return ERROR_OK;
diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c
index bc492c55f3..d0551aa607 100644
--- a/src/target/adi_v5_swd.c
+++ b/src/target/adi_v5_swd.c
@@ -523,7 +523,7 @@ static int swd_queue_ap_bankselect(struct adiv5_ap *ap, 
unsigned reg)
        }
 
        /* ADIv5 */
-       sel = (ap->ap_num << 24) | (reg & 0x000000F0);
+       sel = (ap->ap_num << 24) | (reg & ADIV5_DP_SELECT_APBANK);
        if (dap->select != DP_SELECT_INVALID)
                sel |= dap->select & DP_SELECT_DPBANK;
 

-- 

Reply via email to