diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2023-03-14 14:31:30 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-09-23 14:37:22 +0000 |
commit | 5fd4f2954d6673e5b2fd740da681439425794abc (patch) | |
tree | 163af846b63c6722984948ca448acc827bf8b400 /src | |
parent | f49bf1adb42e3ae1b63da5d6e615c6f28b49f42a (diff) | |
download | riscv-openocd-5fd4f2954d6673e5b2fd740da681439425794abc.zip riscv-openocd-5fd4f2954d6673e5b2fd740da681439425794abc.tar.gz riscv-openocd-5fd4f2954d6673e5b2fd740da681439425794abc.tar.bz2 |
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 <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7539
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/adi_v5_jtag.c | 4 | ||||
-rw-r--r-- | src/target/adi_v5_swd.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 9f66adc..afdc0e5 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 && @@ -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; diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index 5f40588..1b74365 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; |