openocd/src/jtag
Antonio Borneo 7a61a006de jep106: use packed jedec manufacturer code
JEP106 encodes JEDEC-assigned manufacture code as:
a) a sequence of zero or more escape codes 0x7f;
b) an odd-parity bit of the next 7 bits;
c) 7 bits.

The same code is often represented as a single value composed by
the logical OR between:
- the number of escape codes in a), shifted left by 7 positions;
- the 7 bits in c).
This is the preferred packed representation used by this change.

Currently there are only two uses of JEP106 in openocd to get the
manufacturer name:
- to decode the JTAG IDCODE of each TAP, where the JEP106 code is
  already packed as in the preferred representation above in bits
  IDCODE[11:1];
- to decode the ARM CoreSight PIDR register, where the JEP106 code
  is split in 3 parts:
  = PIDR3[3:0], corresponding to bits [10:7] of the packed code;
  = PIDR2[2:0], corresponding to bits [6:4] of the packed code;
  = PIDR1[7:4], corresponding to bits [3:0] of the packed code.

Wrap the existing JEP106 decode function in a simpler API using
the packed code.
Simplify the callers by skipping the bit unpacking.
Change the manufacturer code in CoreSight table dap_partnums[] to
match the packed representation, by removing the always-one bit 7
erroneously taken from PIDR bit JEDEC and included in the former
table.

Change-Id: I63eb4da9e6801fab25e330f1f6b792d2fd619493
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6418
Tested-by: jenkins
2021-08-22 20:26:06 +00:00
..
aice jtag/aice: fix build with clang on MacOS 2021-07-31 10:06:36 +01:00
drivers stlink: fix SWIM mode on stlink-v3 2021-08-22 20:22:34 +00:00
hla openocd: remove NULL comparisons with checkpatch [1/2] 2021-07-24 10:38:00 +01:00
Makefile.am jtag: remove minidriver code and minidriver-dummy 2021-03-19 21:56:06 +00:00
adapter.c openocd: remove NULL comparisons with checkpatch [2/2] 2021-07-24 10:38:11 +01:00
commands.c openocd: remove NULL comparisons with checkpatch [2/2] 2021-07-24 10:38:11 +01:00
commands.h jtag: make cmd_queue_scan_field_clone public 2018-10-16 11:58:17 +01:00
core.c jep106: use packed jedec manufacturer code 2021-08-22 20:26:06 +00:00
driver.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
interface.c coding style: prototype of functions with no parameters 2020-05-09 14:39:59 +01:00
interface.h armv7m_trace: get rid of the old tpiu code 2021-03-10 21:34:04 +00:00
interfaces.c jtag: remove minidriver code and minidriver-dummy 2021-03-19 21:56:06 +00:00
interfaces.h jtag: remove unused function adapter_driver_modules_load() 2020-05-02 15:41:21 +01:00
jtag.h Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
minidriver.h jtag: fix some minor typo 2021-05-22 10:06:38 +01:00
startup.tcl drivers/ft232r: Group adapter commands 2021-08-14 13:37:36 +01:00
swd.h jtag/swd: rename CamelCase macros 2021-07-02 17:10:31 +01:00
swim.c swim: add new transport 2020-05-24 21:32:05 +01:00
swim.h swim: fix adapter speed handling 2020-05-24 21:31:21 +01:00
tcl.c openocd: remove NULL comparisons with checkpatch [1/2] 2021-07-24 10:38:00 +01:00
tcl.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00