Attention is currently required from: Simon Buhrow, Nico Huber, Paul Menzel, Aarya.
Hello build bot (Jenkins), Simon Buhrow, Thomas Heijligen,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/66104
to look at the new patch set (#60).
Change subject: flashrom.c: Add wrapper function to use the erase algorithm
......................................................................
flashrom.c: Add wrapper function to use the erase algorithm
Add a function to call the erase algorithm.
Change-Id: I29e3f2bd796759794184b125741a5abaac6f3ce8
Signed-off-by: Aarya Chaumal <aarya.chaumal(a)gmail.com>
---
M flashrom.c
M tests/chip_wp.c
2 files changed, 145 insertions(+), 288 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/04/66104/60
--
To view, visit https://review.coreboot.org/c/flashrom/+/66104
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I29e3f2bd796759794184b125741a5abaac6f3ce8
Gerrit-Change-Number: 66104
Gerrit-PatchSet: 60
Gerrit-Owner: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-Reviewer: Simon Buhrow
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Simon Buhrow
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Aarya <aarya.chaumal(a)gmail.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Nikolai Artemiev.
Jonathon Hall has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67695 )
Change subject: drivers: Move (un)map_flash_region from programmer to par_master
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS5:
> Hey Jonathon, […]
Yeah definitely, agree that would make this more incremental which would be great. I need to rework this anyway for some of the last few comments (turns out some SPI programmers still need mappers too), just had to jump on a few other things early this week. Hoping to get a new patch up today or tomorrow, I'll rebase onto yours too.
--
To view, visit https://review.coreboot.org/c/flashrom/+/67695
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9c3df6ae260bcdb246dfb0cd8e043919609b014b
Gerrit-Change-Number: 67695
Gerrit-PatchSet: 5
Gerrit-Owner: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Wed, 28 Sep 2022 12:36:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Jonathon Hall has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66677 )
Change subject: flashrom.c: Make programmer_{un}map_flash_region() static
......................................................................
Patch Set 7: Code-Review+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/66677
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic02092ce23c5b3233aad38343b888e3fa7e5bcf9
Gerrit-Change-Number: 66677
Gerrit-PatchSet: 7
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Wed, 28 Sep 2022 12:34:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan.
Jonathon Hall has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67404 )
Change subject: drivers/: Make 'fallback_{un}map' the default unless defined
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://review.coreboot.org/c/flashrom/+/67404
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5ea7bd68f7ae2cd4af9902ef07255ab6ce0bfdb3
Gerrit-Change-Number: 67404
Gerrit-PatchSet: 3
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Jonathon Hall <jonathon.hall(a)puri.sm>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Peter Marheine <pmarheine(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Comment-Date: Wed, 28 Sep 2022 12:34:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Anastasia Klimchuk, Alexander Goncharov.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66373 )
Change subject: tree: provide flashrom context into programmer's delay
......................................................................
Patch Set 7: Code-Review+1
(3 comments)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/c1d99fe9_c5be536f
PS5, Line 220: void programmer_delay(const struct flashctx *flash, unsigned int usecs)
> Currently the commit message doesn't give any hint why this is necessary. […]
The commit message to this patch is hard to have both ways, it is either very forward looking and mention things in the future or largely mention nothing at all.
I am happy with it as-is however if you have something specific in mind could you express the insight here Felix?
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/bddcb7bd_d7b1c8f9
PS6, Line 226: return internal_delay(flash, usecs);
> Since we don't use `internal_delay` as a callback, we may not provide `flashctx`. […]
If we put CB:67393 on top of this patch then `programmer_delay()` has been largely dealt with from the prospective of getting things into a re-entrant state of affairs.
The follow on would be to flatten things out a bit and remove `programmer_delay()` from being a callback and have the drivers naively call their respective delay implementations internally or core just call the default implementation however that is less urgent. Overall with your patch and CB:67393 the fire of `programmer_delay()` subsides.
File ichspi.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/f5d833c3_bdb57abf
PS5, Line 860: truct flashctx *flas
> Is it maybe sufficient to just use `NULL` in the case of ichspi as it is the internal timer anyway.
Ack
--
To view, visit https://review.coreboot.org/c/flashrom/+/66373
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Gerrit-Change-Number: 66373
Gerrit-PatchSet: 7
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Wed, 28 Sep 2022 12:19:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Felix Singer <felixsinger(a)posteo.net>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Anastasia Klimchuk, Alexander Goncharov.
Hello Felix Singer, build bot (Jenkins), Thomas Heijligen, Edward O'Callaghan, Anastasia Klimchuk,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/66373
to look at the new patch set (#7).
Change subject: tree: provide flashrom context into programmer's delay
......................................................................
tree: provide flashrom context into programmer's delay
Add the flashrom context to the delay function declaration, which
located in `struct programmer_entry`. This is an important step to
remove the global state. Programmers that use internal delay can
provide NULL as a context.
TOPIC=register_master_api
TEST=builds
Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Signed-off-by: Alexander Goncharov <chat(a)joursoir.net>
Ticket: https://ticket.coreboot.org/issues/391
---
M 82802ab.c
M amd_imc.c
M at45db.c
M atavia.c
M bitbang_spi.c
M cli_classic.c
M dediprog.c
M dummyflasher.c
M edi.c
M en29lv640b.c
M flashrom.c
M ichspi.c
M include/flash.h
M it87spi.c
M jedec.c
M nicintel_eeprom.c
M pony_spi.c
M raiden_debug_spi.c
M s25f.c
M spi25.c
M spi25_statusreg.c
M sst28sf040.c
M stm50.c
M w29ee011.c
M w39.c
M wbsio_spi.c
26 files changed, 142 insertions(+), 106 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/66373/7
--
To view, visit https://review.coreboot.org/c/flashrom/+/66373
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Gerrit-Change-Number: 66373
Gerrit-PatchSet: 7
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: newpatchset
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Anastasia Klimchuk, Alexander Goncharov.
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66373 )
Change subject: tree: provide flashrom context into programmer's delay
......................................................................
Patch Set 6:
(1 comment)
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/8021cf30_94c44f98
PS5, Line 220: void programmer_delay(const struct flashctx *flash, unsigned int usecs)
> Is it OK that I've refactored this function in this patch? Because otherwise there would be lots of […]
Currently the commit message doesn't give any hint why this is necessary. At least an explanation is needed.
--
To view, visit https://review.coreboot.org/c/flashrom/+/66373
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Gerrit-Change-Number: 66373
Gerrit-PatchSet: 6
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Wed, 28 Sep 2022 11:07:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Jean THOMAS, Alexander Goncharov.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/67878 )
Change subject: dirtyjtag: Add DirtyJTAG programmer
......................................................................
Patch Set 5:
(5 comments)
File dirtyjtag_spi.c:
https://review.coreboot.org/c/flashrom/+/67878/comment/fa6f589c_7d414453
PS5, Line 18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Please remove this paragraph. The address became outdated in the past so
we decided to drop it.
https://review.coreboot.org/c/flashrom/+/67878/comment/f15291b3_10509adf
PS5, Line 121: size_t num_xfer = (len + max_xfer_size - 1 ) / max_xfer_size; // ceil(len/max_xfer_size)
So this looks like your implementation supports arbitrary `writecnt` and
`readcnt`. Given that flashrom can limit these based on `.max_data_write`
and `.max_data_read`, the implementation could look much simpler. But doesn't
have to; I think there are two options:
1. Lift the `.max_data_*` limits so this function gets called for bigger
chunks. There should be less overhead as we wouldn't have to send the
TMS/STOP sequence as often. I assume this could speed up long reads.
Some of the memcpy() also seems unnecessary, but the USB transfers
probably limit speed so much that it doesn't matter.
2. Set `.max_data_*` such that we can expect `len <= 30` here¹. Then we
wouldn't need the loop and malloc(). In theory, even a single 32B buffer
would suffice.
I assume both could speed things up as currently we probably have a lot
of send,receive,send,receive,send sequences with little data in the second
send/receive. (Btw. is it necessary to drain input buffers with the receive
call even if we don't need the data?)
¹As the `max_xfer_size` accounts for both write and read counts, this is
a little tricky: we'd have to account for the SPI25 protocol overhead.
For the expected SPI commands, `25` should be the right limit (30B minus
1B opcode and 4B addresses).
https://review.coreboot.org/c/flashrom/+/67878/comment/92fb6bd0_88e784ac
PS5, Line 174: .max_data_read = 30,
: .max_data_write = 30,
This tells flashrom to limit `writecnt` and `readcnt`. It might not be
necessary with the current implementation, see comment above.
https://review.coreboot.org/c/flashrom/+/67878/comment/666a312e_aa77fe95
PS5, Line 267: }
This could probably be written much simpler if we'd focus on the strcmp.
For instance, something like
```
if (units[0] == '\0' || !strcasecmp(units, "Hz")) {
freq /= 1000;
} else if (!strcasecmp(units, "kHz")) {
/* nothing to do as we want kHz */
} else if (!strcasecmp(units, "MHz")) {
freq *= 1000;
} else {
...
return 1;
}
```
https://review.coreboot.org/c/flashrom/+/67878/comment/e84535bb_2789a264
PS5, Line 275: except TRST
What about SRST and TMS? I might read the code wrong, but it looks like
there's actually more set to high than to low?
--
To view, visit https://review.coreboot.org/c/flashrom/+/67878
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ic43e9a014ed7d04e429e73b30c9dcfdde1a78913
Gerrit-Change-Number: 67878
Gerrit-PatchSet: 5
Gerrit-Owner: Jean THOMAS <virgule(a)jeanthomas.me>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Jean THOMAS <virgule(a)jeanthomas.me>
Gerrit-Attention: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Comment-Date: Wed, 28 Sep 2022 10:34:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Felix Singer, Thomas Heijligen, Edward O'Callaghan, Anastasia Klimchuk.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/66373 )
Change subject: tree: provide flashrom context into programmer's delay
......................................................................
Patch Set 6:
(6 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/66373/comment/355901bb_49fe0de3
PS4, Line 10: This is an important step to
: remove the global state because it'll allow the programmer's data
: to be used in delay functions.
> Maybe just drop part of this sentence after 'because' as its not what this patch does specifically f […]
Sure!
https://review.coreboot.org/c/flashrom/+/66373/comment/3ebfc4cf_9d3e14e8
PS4, Line 13:
: Programmers that use internal delay can provide NULL as a context.
> Move this up to the last paragraph.
Done
https://review.coreboot.org/c/flashrom/+/66373/comment/fc2e439b_d1df8cba
PS4, Line 16: This is one of the steps on the way to move master's data
: memory management behind the initialisation API, for more
: context see other patches under the same topic specified below.
> Drop this paragraph.
Done
Patchset:
PS4:
> Can we rebase this one and have it go in? […]
Done
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/2e4ad5f5_482cef5a
PS5, Line 220: void programmer_delay(const struct flashctx *flash, unsigned int usecs)
Is it OK that I've refactored this function in this patch? Because otherwise there would be lots of nested if-statements.
File flashrom.c:
https://review.coreboot.org/c/flashrom/+/66373/comment/489874f0_f5fb7360
PS6, Line 226: return internal_delay(flash, usecs);
Since we don't use `internal_delay` as a callback, we may not provide `flashctx`. It will be more meaningful, just `internal_delay(usecs)`.
What do you think?
--
To view, visit https://review.coreboot.org/c/flashrom/+/66373
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibb0bce26ce2052853ee52158d7ba742967a9e229
Gerrit-Change-Number: 66373
Gerrit-PatchSet: 6
Gerrit-Owner: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Wed, 28 Sep 2022 10:30:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-MessageType: comment