Simon Buhrow has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/40477 )
Change subject: ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call ......................................................................
Patch Set 14:
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.