hm... anyone having time to review/merge this? I´d like to get this done...

Sorry to let you know after you went through many cycles already,
but I think this needs a re-write :-/

There is already everything in place in flashrom to avoid such
a layering violation, namely the `.multicommand` member of struct
spi_master. The biggest problem with your current implementation
is that you assume that there is always a JEDEC flash chip, but
that's not generally true.

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.

View Change

5 comments:

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: 16
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: Tue, 10 Nov 2020 11:51:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment