Attention is currently required from: ChrisEric1 CECL.
Thomas Heijligen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/72057 )
Change subject: Add support for VIA VL805 USB controller flashing ......................................................................
Patch Set 23:
(1 comment)
Patchset:
PS23:
I found the problem with your chip. The code fails when readcnt != 4 […]
I've dug much deeper into this programmer and here is an update:
A lot of the names are misleading. * Only `0x43`, `0x50`, `0x78` and `0x7c` are real PCI registers. * All `VL805_REG_*` defines are commands send via the `0x78` register. * The values for the command are passed via the `0x7c` register.
The values calculated and written as SPI_TRANSACTION value are for the most cases not correct. Only with 4 bytes in and out it is successful. That's the reason why it works with a `RDID4` patched W25x10 flash and SFDP compatible chips.
Random findings: * The CMD_SPI_CS=0 mussed be send after CMD_SPI_TRANSACTION
```
REG_MCU 0x43 - Reserved register REG_FWV 0x50 - Firmware Version (This is the only documented one) REG_CMD 0x78 - XHCI Optional Bits Configuration Address (19:0) REG_DAT 0x7c - XHCI Optional Bits Configuration Data (31:0)
CMD_MAGIC_30004 0x00030004 - 0x200, unknown magic value CMD_SPOP_POLLING 0x0004000c - (1|0), currently not sure what's for CMD_PCI_WB_EN 0x00040020 - 0xffffff01 - not a clue what this is exactly for CMD_SPI_OUTDATA 0x000400d0 - <spi commands> + <content> CMD_SPI_INDATA 0x000400e0 - <content> CMD_SPI_TRANSACTION 0x000400f0 - 0x5__ Here lies the problem! CMD_CLK_DIVIDER 0x000400f8 - Default can be used, need external measurement CMD_SPI_CS 0x000400fc - (1|0) voltage on SPI CS Pin, needs confirmation
```
So for now the right values for `CMD_SPI_TRANSACTION` is the missing mystery that needs to be solved.
HELP NEEDED: If someone has a Raspberry Pi 4, I'm very interested on a strace of their vl805, closed source, update tool https://github.com/raspberrypi/rpi-eeprom It would be really helpful to get a `strace -x vl805 -d` log of an read, write and verify operation.