target/adi_v5_xxx: use ADIV5_DP_SELECT_APBANK 39/7539/4
authorTomas Vanek <vanekt@fbl.cz>
Tue, 14 Mar 2023 13:31:30 +0000 (14:31 +0100)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 23 Sep 2023 14:37:22 +0000 (14:37 +0000)
and DP_SELECT_DPBANK.
Use the defined symbols instead of magic numbers.

Change-Id: I19c86b183e57e42b96f76eed180c0492cd67bee1
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7539
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
src/target/adi_v5_jtag.c
src/target/adi_v5_swd.c

index 9f66adc6880ae785898c9ab7f1bc77e6e05b0bc6..afdc0e577595f44ac74bf357adb04a82d8e29f2d 100644 (file)
@@ -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 &&
@@ -775,7 +775,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;
index 5f40588d2f82b263995264b82157dca8d598523b..1b743657c231427abfad10fe0b95e6f365d945b2 100644 (file)
@@ -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;
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)