Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/40477
to look at the new patch set (#21).
Change subject: ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call
......................................................................
ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call
Every ftdi_write_data() call is quite time consuming as the ftdi-chips
seems to take always 2-3ms to respond.
This leads to what the comment already says: Minimize USB transfers
by packing as many commands as possible together.
So I packed the WREN command together with the following operation
which can be program or erase operation.
This saves about 1 minute when programming a 128MBit Flash with my
config!
I´m using ftdi-2232H chip. That´s why I put it at this place.
If anyone has a good overview about all programmers:
This could be implemented in spi_write_cmd() in case that it is
compatible to all programmers
or this principle could be transfered to other programmers which act
in a similar way.
Signed-off-by: Simon Buhrow <simon.buhrow(a)posteo.de>
Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
---
M ft2232_spi.c
1 file changed, 94 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/77/40477/21
--
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: 21
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/40477
to look at the new patch set (#20).
Change subject: ft2232_spi.c: Add ft2232_spi_send_multicommand()
......................................................................
ft2232_spi.c: Add ft2232_spi_send_multicommand()
Pack WREN and op in one ftdi_write_data() call.
Pack RD cmd and deassertion of CS# in one ftdi_write_data() call.
Every ftdi_write_data() call is quite time consuming as the ftdi-chips
seems to take always 2-3ms to respond.
This leads to what the comment already says: Minimize USB transfers
to ftdi chip by packing as many commands as possible together.
So I packed the WREN command together with the following operation
which can be program or erase operation.
Furthermore the deassertion of CS# is no longer send seperately
from a read cmd.
This saves more than 1 minute when programming a 128MBit Flash
with my config!
Signed-off-by: Simon Buhrow <simon.buhrow(a)posteo.de>
Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
---
M ft2232_spi.c
1 file changed, 91 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/77/40477/20
--
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: 20
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Simon Buhrow has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/40477 )
Change subject: ft2232_spi.c: Add ft2232_spi_send_multicommand()
......................................................................
Patch Set 19:
> 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.
--
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: 19
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Thu, 19 Nov 2020 16:08:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/40477
to look at the new patch set (#19).
Change subject: ft2232_spi.c: Add ft2232_spi_send_multicommand()
......................................................................
ft2232_spi.c: Add ft2232_spi_send_multicommand()
Pack WREN and op in one ftdi_write_data() call.
Pack RD cmd and deassertion of CS# in one ftdi_write_data() call.
Every ftdi_write_data() call is quite time consuming as the ftdi-chips
seems to take always 2-3ms to respond.
This leads to what the comment already says: Minimize USB transfers
to ftdi chip by packing as many commands as possible together.
So I packed the WREN command together with the following operation
which can be program or erase operation.
Furthermore the deassertion of CS# is no longer send seperately
from a read cmd.
This saves more than 1 minute when programming a 128MBit Flash
with my config!
Signed-off-by: Simon Buhrow <simon.buhrow(a)posteo.de>
Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
---
M ft2232_spi.c
1 file changed, 88 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/77/40477/19
--
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: 19
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins), Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/40477
to look at the new patch set (#18).
Change subject: ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call
......................................................................
ft2232_spi.c: Pack WREN and op in one ftdi_write_data() call
Every ftdi_write_data() call is quite time consuming as the ftdi-chips
seems to take always 2-3ms to respond.
This leads to what the comment already says: Minimize USB transfers
by packing as many commands as possible together.
So I packed the WREN command together with the following operation
which can be program or erase operation.
This saves about 1 minute when programming a 128MBit Flash with my
config!
I´m using ftdi-2232H chip. That´s why I put it at this place.
If anyone has a good overview about all programmers:
This could be implemented in spi_write_cmd() in case that it is
compatible to all programmers
or this principle could be transfered to other programmers which act
in a similar way.
Signed-off-by: Simon Buhrow <simon.buhrow(a)posteo.de>
Change-Id: Ie4a07499ec5ef0af23818593f45dc427285a9e8a
---
M ft2232_spi.c
1 file changed, 88 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/77/40477/18
--
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: 18
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-MessageType: newpatchset
Nico Huber 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 16:
(1 comment)
https://review.coreboot.org/c/flashrom/+/40477/16/ft2232_spi.c
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/40477/16/ft2232_spi.c@497
PS16, Line 497: bufsize = max(writecnt + 19, 261 + 19);
> What do you want to drop? Just the change from 260+9 to 261+19 or the whole max()-line?
I meant dropping the max(). Just `bufsize = writecnt + 9` (or `+ 19`) would
have worked to. The optimization is only that with the max(), you probably
get less realloc() calls. But the overhead of realloc() (so far my impres-
sion) is insignificant in a program that does USB transfers (which have
a much higher overhead). I don't know but assume that this max(), and the
fewer realloc() calls, save us about 1us per flashrom run, in the best
case. (If this were a compute intensive program, avoiding realloc() would
make sense.)
And yes, starting with 4K and only increasing the buffer on demand would
work well. But then again, realloc() really isn't that expensive.
PS. Looked at PS11 now, that would work too. But needs a check that we
never exceed the buffer ofc.
--
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: 16
Gerrit-Owner: Simon Buhrow
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-CC: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Comment-Date: Thu, 12 Nov 2020 20:46:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Simon Buhrow
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment