Detailed description
There are some devices who have possibly random/non-deterministic garbage in their IR register after reset, on power cycle, or other operations. In these cases, bmp has no way to properly deal with them and will always error out because the jtag_ir_quirks.ir_value is incorrect.
This PR co-opts the highest bit in the jtag_ir_quirks.ir_length field to signal to the jtag_read_irs machinery that the value coming back from the IR scan-out should be ignored and not validated.
This is safe as the longest supported IR length is currently 32 bits, and even if we need to bump it up, that still would allow an IR up to 127, and if there is ever a case where a longer IR than that is needed then I suspect a lot of BMD internals would need to be changed anyway, so the rework would be justified.
Some example usage for this would be:
{
.idcode = 0x00190043U,
.idmask = 0x0fffefffU,
#if ENABLE_DEBUG == 1
.descr = "ispCLOCK",
#endif
.handler = lattice_isp_clock_handler,
.ir_quirks =
{
.ir_length = BMP_QUIRK_IGNORE_IR_VALUE(8U),
.ir_value = 0U,
},
},
Your checklist for this pull request
## Detailed description
There are some devices who have possibly random/non-deterministic garbage in their IR register after reset, on power cycle, or other operations. In these cases, bmp has no way to properly deal with them and will always error out because the `jtag_ir_quirks.ir_value` is incorrect.
This PR co-opts the highest bit in the `jtag_ir_quirks.ir_length` field to signal to the `jtag_read_irs` machinery that the value coming back from the IR scan-out should be ignored and not validated.
This is safe as the longest supported IR length is currently 32 bits, and even if we need to bump it up, that still would allow an IR up to 127, and if there is ever a case where a longer IR than that is needed then I suspect a lot of BMD internals would need to be changed anyway, so the rework would be justified.
Some example usage for this would be:
```c
{
.idcode = 0x00190043U,
.idmask = 0x0fffefffU,
#if ENABLE_DEBUG == 1
.descr = "ispCLOCK",
#endif
.handler = lattice_isp_clock_handler,
.ir_quirks =
{
.ir_length = BMP_QUIRK_IGNORE_IR_VALUE(8U),
.ir_value = 0U,
},
},
```
## Your checklist for this pull request
* [x] I've read the [Code of Conduct](https://codeberg.org/blackmagic-debug/blackmagic/src/CODE_OF_CONDUCT.md)
* [x] I've read the [guidelines for contributing](https://codeberg.org/blackmagic-debug/blackmagic/src/CONTRIBUTING.md) to this repository
* [x] It builds for hardware native (see [Building the firmware](https://codeberg.org/blackmagic-debug/blackmagic?tab=readme-ov-file#building-the-firmware))
* [x] It builds as BMDA (see [Building the BMDA](https://codeberg.org/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app))
* [x] I've tested it to the best of my ability
* [x] My commit messages provide a useful short description of what the commits do