Skip to content

Commit

Permalink
adiv5_jtag: Properly dispatch the Cortex-M33/TEALDAP PARTNO code
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux committed Jan 15, 2025
1 parent 45e4676 commit b55b6e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/target/adiv5.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@
#define JTAG_IDCODE_PARTNO_SOC400_4BIT_ERRATA 0xba01U

/*
* ARM JTAG PARTNO values from Cortex-M33 TRM (ARM document ID 100230, issue 0100)
* A.4.2.2 Identification Code register, IDCODE, Table A-13 pg98
* ARM JTAG PARTNO values from Cortex-M33 TRM (ARM document ID 100230, issue 0100_03)
* Appendix A, §A.4.2 Identification Code register, IDCODE, Table A-13 pg130
* (for TEALDAP/CM33DAP MINDP SWJ-DP/JTAG-DP)
*/
#define JTAG_IDCODE_PARTNO_SOC400_4BIT_CM33 0xba04U
Expand Down
5 changes: 2 additions & 3 deletions src/target/adiv5_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ void adiv5_jtag_dp_handler(const uint8_t dev_index)
/* Correct the LPC43xx errata PARTNO values */
if (dp->partno == JTAG_IDCODE_PARTNO_SOC400_4BIT_ERRATA)
dp->partno = JTAG_IDCODE_PARTNO_SOC400_4BIT;
/* Correct the GD32E50x PARTNO value */
else if (dp->partno == JTAG_IDCODE_PARTNO_SOC400_4BIT_CM33)
dp->partno = JTAG_IDCODE_PARTNO_SOC400_4BIT;

if (dp->partno == JTAG_IDCODE_PARTNO_SOC400_4BIT || dp->partno == JTAG_IDCODE_PARTNO_SOC400_8BIT)
dp->version = 0U;
else if (dp->partno == JTAG_IDCODE_PARTNO_SOC400_4BIT_CM33)
dp->version = 1U;
else if (dp->partno == JTAG_IDCODE_PARTNO_SOC600_4BIT || dp->partno == JTAG_IDCODE_PARTNO_SOC600_8BIT)
dp->version = 3U;
else
Expand Down

0 comments on commit b55b6e3

Please sign in to comment.