So, the correct way to do this is to implement `.multicommand`
instead of `.command`. I would roughly do it as follows:

    Loop
Put write part of command into buffer.
If not last command and read part is empty,
Continue with next loop iteration.
Execute buffer.
Execute read part if any.
While not last command.


I uploaded PS18 with my first draft of ft2232_spi_send_multicommand().

Having Patch 40748 in mind, I decided to pack max one read cmd into one ftdi call.
This simplifies the readback pointer management as well (readarr).
Furthermore I think the majority (all?) calls of ft2232_spi_send_multicommand() will have at most one read cmd (correct me if I´m wrong).
(To be honest I´m not sure if ft2232_spi_send_multicommand() is ever called with read cmd in the current implementation)

I´m not sure if the loop condition is safe. It´s copied from default_spi_send_multicommand().

It´s untested!! I´ll do this the next week(s).
Comments are welcome.

View Change

To view, visit change 40477. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
Gerrit-Change-Number: 40477
Gerrit-PatchSet: 19
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi@google.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Thu, 19 Nov 2020 16:08:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment