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 11:
(4 comments)
https://review.coreboot.org/c/flashrom/+/40477/8/ft2232_spi.c
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/40477/8/ft2232_spi.c@471
PS8, Line 471: static unsigned char *buf = NULL;
> Just make this an array: […]
This is related to Line 481.
FTDI_HW_BUFFER_SIZE = 4096
Done
https://review.coreboot.org/c/flashrom/+/40477/8/ft2232_spi.c@473
PS8, Line 473: static
> Why is `i` static now?
This is related to Line 541 and following lines. It is explained (shortly) in Line 542.
If there is a WREN command this will not be send immediately to the FTDI chip but is saved in buf. Then WREN command will be send together with the next WR ore ERASE command (the command which made WREN necessary).
The FTDI goes through it´s buffer and will first send WREN and then the next cmd. So the data send to the flash are the same but this saves one time consuming FTDI call every PROGRAM or ERASE command.
To not overwrite the WREN in buf 'i' must be static and only set to '0' after send_buf/FTDI call.
https://review.coreboot.org/c/flashrom/+/40477/8/ft2232_spi.c@481
PS8, Line 481: 4096
> Please #define this magic number somewhere
s. Line 471
https://review.coreboot.org/c/flashrom/+/40477/8/ft2232_spi.c@542
PS8, Line 542: /* Return to get second op (Program or Erase) without resetting buf nor i*/
> Why?
s Line 473
--
To view, visit https://review.coreboot.org/c/flashrom/+/40477
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
Gerrit-Change-Number: 40477
Gerrit-PatchSet: 11
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Tue, 26 May 2020 10:27:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment