Just a try to show what effect the change has:

To do one PageProgram the Flash needs the following cmds/information (PROG=PageProgramCmd):
Flash-Cmds: JEDEC_WREN + PROG + ADDR + DATA

As flashrom communicates with the FTDI, there are additional FTDI-cmds necessary, of course.
This gives the following calls:


ft2232_spi_send_command(XX, XX, ['JEDEC_WREN'], XX)
before: -> send_buf(XX, [FTDI-CMD + 'JEDEC_WREN' + FTDI-CMD], 10)
now: -> save i and buf as they are static, no further function call; buf = [FTDI-CMD + 'JEDEC_WREN' + FTDI-CMD]

ft2232_spi_send_command(XX, XX, ['PROG', 'ADDR', 'DATA'], XX)
before: -> send_buf(XX, [FTDI-CMD + 'PROG' + 'ADDR' + 'DATA' + FTDI-CMD], 270)
now: -> send_buf(XX, [FTDI-CMD + 'JEDEC_WREN' + FTDI-CMD + FTDI-CMD + 'PROG' + 'ADDR' + 'DATA' + FTDI-CMD], 280)

=> saves one send_buf/ftdi_write_data call every page-program or erase action.

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: 14
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Patrick Georgi <pgeorgi@google.com>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Mon, 27 Jul 2020 14:16:39 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment