diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 78489aab3..77d714115 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -333,14 +333,14 @@ static int jtag_dp_q_write(struct adiv5_dap *dap, unsigned reg, static int jtag_ap_q_bankselect(struct adiv5_ap *ap, unsigned reg) { struct adiv5_dap *dap = ap->dap; - uint32_t select = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0); + uint32_t sel = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0); - if (select == dap->select) + if (sel == dap->select) return ERROR_OK; - dap->select = select; + dap->select = sel; - return jtag_dp_q_write(dap, DP_SELECT, select); + return jtag_dp_q_write(dap, DP_SELECT, sel); } static int jtag_ap_q_read(struct adiv5_ap *ap, unsigned reg, diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index c080964d0..6990a8b9c 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -162,15 +162,15 @@ static void swd_queue_dp_bankselect(struct adiv5_dap *dap, unsigned reg) return; uint32_t select_dp_bank = (reg & 0x000000F0) >> 4; - uint32_t select = select_dp_bank + uint32_t sel = select_dp_bank | (dap->select & (DP_SELECT_APSEL | DP_SELECT_APBANK)); - if (select == dap->select) + if (sel == dap->select) return; - dap->select = select; + dap->select = sel; - swd_queue_dp_write(dap, DP_SELECT, select); + swd_queue_dp_write(dap, DP_SELECT, sel); } static int swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, @@ -210,16 +210,16 @@ static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, static void swd_queue_ap_bankselect(struct adiv5_ap *ap, unsigned reg) { struct adiv5_dap *dap = ap->dap; - uint32_t select = ((uint32_t)ap->ap_num << 24) + uint32_t sel = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0) | (dap->select & DP_SELECT_DPBANK); - if (select == dap->select) + if (sel == dap->select) return; - dap->select = select; + dap->select = sel; - swd_queue_dp_write(dap, DP_SELECT, select); + swd_queue_dp_write(dap, DP_SELECT, sel); } static int swd_queue_ap_read(struct adiv5_ap *ap, unsigned reg,