openocd/src
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
..
flash flash/atsame5: use COMMAND_PARSE_NUMBER in command handlers 2021-08-22 13:19:16 +00:00
helper jep106: use packed jedec manufacturer code 2021-08-22 20:26:06 +00:00
jtag jep106: use packed jedec manufacturer code 2021-08-22 20:26:06 +00:00
pld openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
rtos rtos/riot: fix out-of-bounds writes when target is corrupted 2021-08-22 20:21:47 +00:00
rtt openocd: fix doxygen parameters of functions 2021-01-13 11:33:53 +00:00
server Call poll at a fixed interval. 2021-07-31 10:08:47 +01:00
svf openocd: fix Yoda conditions with checkpatch 2021-07-24 10:38:31 +01:00
target jep106: use packed jedec manufacturer code 2021-08-22 20:26:06 +00:00
transport openocd: remove NULL comparisons with checkpatch [1/2] 2021-07-24 10:38:00 +01:00
xsvf openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
hello.c openocd: fix simple cases of Yoda condition 2021-07-20 14:55:24 +01:00
hello.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
main.c Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
Makefile.am build: Fix out-of-tree with --disable-dependency-tracking configure flag 2021-04-05 23:24:14 +01:00
openocd.c openocd: fix cleanup order: cti before dap 2021-08-14 13:30:56 +01:00
openocd.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00