Attention is currently required from: Anton Samsonov, Thomas Heijligen.
Alexander Goncharov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/77089?usp=email )
Change subject: Remove dependency on C23 __has_include()
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/77089?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Ic544963ffd29626ae0a21bdddb1c78850cc43ec6
Gerrit-Change-Number: 77089
Gerrit-PatchSet: 6
Gerrit-Owner: Anton Samsonov <devel(a)zxlab.ru>
Gerrit-Reviewer: Alexander Goncharov <chat(a)joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anton Samsonov <avscomputing(a)gmail.com>
Gerrit-CC: Anton Samsonov <contact-launchpad(a)zxlab.ru>
Gerrit-CC: Stefan Reinauer <stefan.reinauer(a)coreboot.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anton Samsonov <devel(a)zxlab.ru>
Gerrit-Comment-Date: Tue, 28 Nov 2023 20:31:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Carly Zlabek has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/79324?usp=email )
Change subject: erasure_layout: Remove redundant `verify_range` call from `erase_write`
......................................................................
erasure_layout: Remove redundant `verify_range` call from `erase_write`
Previously, verification would be unconditionally completed at the end
of `erase_write` with the non-legacy erase path.
Verification is already handled when writing and erasing chip data; in
`flashrom_image_write` based on `flashctx` options, and in the erase
loop of `erase_write` via `check_erased_range` calls, respectively.
This unnecessary verification added a performance penalty that was not
present with the legacy implementation.
Now, this call to `verify_range` has been removed to improve performance
and more closely reflect the verification done with the legacy path.
This change was tested using the linux_spi programmer to erase and write
to an MT25QL512 chip.
Change-Id: I638835facd9311979c4991cc4ca41a4b9e174bd5
Signed-off-by: Carly Zlabek <carlyzlabek(a)gmail.com>
Signed-off-by: Vincent Fazio <vfazio(a)gmail.com>
---
M erasure_layout.c
1 file changed, 0 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/24/79324/1
diff --git a/erasure_layout.c b/erasure_layout.c
index 0c31911..febfde1 100644
--- a/erasure_layout.c
+++ b/erasure_layout.c
@@ -385,13 +385,6 @@
*all_skipped = false;
}
- // verify write
- ret = verify_range(flashctx, newcontents + region_start, region_start, region_end - region_start);
- if (ret) {
- msg_cerr("Verifying flash. Write failed for range %#"PRIx32" : %#"PRIx32", Abort.\n",
- region_start, region_end);
- goto _end;
- }
_end:
memcpy(newcontents + region_start, old_start_buf, old_start - region_start);
--
To view, visit https://review.coreboot.org/c/flashrom/+/79324?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I638835facd9311979c4991cc4ca41a4b9e174bd5
Gerrit-Change-Number: 79324
Gerrit-PatchSet: 1
Gerrit-Owner: Carly Zlabek <carlyzlabek(a)gmail.com>
Gerrit-MessageType: newchange
Dreg has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/79299?usp=email )
Change subject: buspirate_spi: Add support for hiz output with pullups=off
......................................................................
buspirate_spi: Add support for hiz output with pullups=off
When working with low-voltage chips, the internal 10k pull-ups of the Bus Pirate might be too high. In such cases, it's necessary to create an external pull-up using lower-value resistors. For this, you can use the ``hiz`` parameter. This way, the Bus Pirate will operate as an open drain
Change-Id: I6d9909b23782ef3fcb1428fd127dae0d6b211855
Signed-off-by: Dreg <dreg(a)rootkit.es>
---
M buspirate_spi.c
M doc/classic_cli_manpage.rst
2 files changed, 22 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/99/79299/1
diff --git a/buspirate_spi.c b/buspirate_spi.c
index 72c28b0..7436d80 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -325,6 +325,7 @@
int spispeed = 0x7;
int serialspeed_index = -1;
int ret = 0;
+ bool hiz = false;
bool pullup = false;
bool psu = false;
bool aux = true;
@@ -368,6 +369,17 @@
}
free(tmp);
+ tmp = extract_programmer_param_str(cfg, "hiz");
+ if (tmp) {
+ if (strcasecmp("on", tmp) == 0)
+ hiz = true;
+ else if (strcasecmp("off", tmp) == 0)
+ ; // ignore
+ else
+ msg_perr("Invalid hiz state, not using them.\n");
+ }
+ free(tmp);
+
tmp = extract_programmer_param_str(cfg, "pullups");
if (tmp) {
if (strcasecmp("on", tmp) == 0)
@@ -692,9 +704,9 @@
/* Set SPI config: output type, idle, clock edge, sample */
bp_commbuf[0] = 0x80 | 0xa;
- if (pullup) {
+ if (pullup || hiz) {
bp_commbuf[0] &= ~(1 << 3);
- msg_pdbg("Pull-ups enabled, so using HiZ pin output! (Open-Drain mode)\n");
+ msg_pdbg("Pull-ups or HiZ enabled, so using HiZ pin output! (Open-Drain mode)\n");
}
ret = buspirate_sendrecv(bp_commbuf, 1, 1);
if (ret)
diff --git a/doc/classic_cli_manpage.rst b/doc/classic_cli_manpage.rst
index 5d6b7ef..3157793 100644
--- a/doc/classic_cli_manpage.rst
+++ b/doc/classic_cli_manpage.rst
@@ -763,6 +763,14 @@
where ``baud`` can be ``115200``, ``230400``, ``250000`` or ``2000000`` (``2M``).
The default is ``2M`` baud for Bus Pirate hardware version 3.0 and greater, and 115200 otherwise.
+When working with low-voltage chips, the internal 10k pull-ups of the Bus Pirate might be too high. In such cases, it's
+necessary to create an external pull-up using lower-value resistors. For this, you can use the ``hiz`` parameter.
+This way, the Bus Pirate will operate as an open drain. Syntax is::
+
+ flashrom -p buspirate_spi:hiz=state
+
+where ``state`` can be ``on`` or ``off``.
+
An optional pullups parameter specifies the use of the Bus Pirate internal pull-up resistors. This may be needed if you
are working with a flash ROM chip that you have physically removed from the board. Syntax is::
--
To view, visit https://review.coreboot.org/c/flashrom/+/79299?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I6d9909b23782ef3fcb1428fd127dae0d6b211855
Gerrit-Change-Number: 79299
Gerrit-PatchSet: 1
Gerrit-Owner: Dreg <dreg(a)fr33project.org>
Gerrit-MessageType: newchange
Attention is currently required from: Evan Benn.
Hsuan-ting Chen has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/79304?usp=email )
Change subject: flashrom_tester: Fix partial_lock_test on libflashrom
......................................................................
Patch Set 2:
(5 comments)
Patchset:
PS1:
Thanks for the prompt code review!
> I think this fix is fine in the mean time, but obviously the write itself should fail if it is being prevented due to write protect, not the verify.
I can confirm that this is the current ChromeOS behavior. I tested it by:
* Disable HWWP
* Enable SWWP
* Enable HWWP
* Write all zero to GBB with `flashrom -p internal -i GBB -w GBB.zero.bin` and expect a fail
* Write again with `-n`: `flashrom -p internal -i GBB -w GBB.zero.bin -n` and expect a success
* Check that GBB was not changed
> Did this regress at some point?
I cannot tell when this behavior changed, but the current behavior in ChromeOS is that "Write without verification will not fail."
> I remember there were differences here between chromeos and upstream flashrom, have those diverged more or are in sync now?
I'll have a look. I can't observe any for now.
---
However, regardless of the behavior, it makes more sense to run libflashrom and the flashrom binary with exactly the same flags.
File util/flashrom_tester/flashrom/src/cmd.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/43a65e1d_e9d824d6 :
PS1, Line 299: // flashrom cli has its own default flags.
> `flashrom cli sets these flags by default`
Done
File util/flashrom_tester/flashrom/src/flashromlib.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/70affd63_2d97f9f8 :
PS1, Line 200: .flag_set(FlashromFlag::FlashromFlagSkipUnreadableRegions, true);
> I don't see these last two being set in cli_classic. […]
Those should be CrOS only default value. Let me remove them (and land only in CrOS repo: [CL](https://chromium-review.googlesource.com/c/chromiumos/third_party/flash…)
File util/flashrom_tester/flashrom/src/lib.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/cf91d477_8100c483 :
PS1, Line 166: /// Set default flashrom flag if necessary.
> `Set flags to the defaults used by the flashrom cli`
Done
File util/flashrom_tester/src/tester.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/91aef8a9_deee5e9e :
PS1, Line 87: info!("Setup default flashrom flag(s)");
> I don't think this is a necessary log
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/79304?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Gerrit-Change-Number: 79304
Gerrit-PatchSet: 2
Gerrit-Owner: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Evan Benn <evanbenn(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)chromium.org>
Gerrit-Attention: Evan Benn <evanbenn(a)gmail.com>
Gerrit-Comment-Date: Tue, 28 Nov 2023 06:48:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Evan Benn <evanbenn(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Hsuan-ting Chen.
Hello Evan Benn, Hsuan Ting Chen, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/79304?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by build bot (Jenkins)
Change subject: flashrom_tester: Fix partial_lock_test on libflashrom
......................................................................
flashrom_tester: Fix partial_lock_test on libflashrom
partial_lock_test (Lock_top_quad, Lock_bottom_quad, Lock_bottom_half,
and Lock_top_half) tries to:
1. Disable HWWP
2. Lock partial
3. Enable HWWP
4. Try to write the locked partial and expect a failure
...
The 4th step only works on flashrom binary since the binary will set
FLASHROM_FLAG_VERIFY_AFTER_WRITE=1 by default and it will error out
while verifying.
But libflashrom does not set any flag beforehand, so it has
FLASHROM_FLAG_VERIFY_AFTER_WRITE=0 and thus it will think the write
command works normally and raise no error. This causes the issue that
flashrom_tester with libflashrom has been failed until today.
To solve this issue, there are two solutions:
1. Take care of the default flags in libflashrom
2. Always pass --noverify to flashrom binary and verify it afterwards.
To make both methods more consistent, I fix it with approach 1.
BUG=b:304439294
BRANCH=none
TEST=flashrom_tester internal --libflashrom Lock_top_quad
Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Signed-off-by: roccochen(a)chromium.com <roccochen(a)chromium.org>
---
M bindings/rust/libflashrom/src/lib.rs
M util/flashrom_tester/flashrom/src/cmd.rs
M util/flashrom_tester/flashrom/src/flashromlib.rs
M util/flashrom_tester/flashrom/src/lib.rs
M util/flashrom_tester/src/tester.rs
5 files changed, 66 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/04/79304/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/79304?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Gerrit-Change-Number: 79304
Gerrit-PatchSet: 2
Gerrit-Owner: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Evan Benn <evanbenn(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Hsuan Ting Chen, Hsuan-ting Chen.
Evan Benn has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/79304?usp=email )
Change subject: flashrom_tester: Fix partial_lock_test on libflashrom
......................................................................
Patch Set 1:
(5 comments)
Patchset:
PS1:
I vaguely recall many discussions about this, but can't recall the details enough.
I think this fix is fine in the mean time, but obviously the write itself should fail if it is being prevented due to write protect, not the verify.
Did this regress at some point? I remember there were differences here between chromeos and upstream flashrom, have those diverged more or are in sync now?
File util/flashrom_tester/flashrom/src/cmd.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/37b51cb8_0151f056 :
PS1, Line 299: // flashrom cli has its own default flags.
`flashrom cli sets these flags by default`
File util/flashrom_tester/flashrom/src/flashromlib.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/a668b391_406d2008 :
PS1, Line 200: .flag_set(FlashromFlag::FlashromFlagSkipUnreadableRegions, true);
I don't see these last two being set in cli_classic.c
File util/flashrom_tester/flashrom/src/lib.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/bbe08770_28c7fdae :
PS1, Line 166: /// Set default flashrom flag if necessary.
`Set flags to the defaults used by the flashrom cli`
File util/flashrom_tester/src/tester.rs:
https://review.coreboot.org/c/flashrom/+/79304/comment/dc5c9380_d08fd0c8 :
PS1, Line 87: info!("Setup default flashrom flag(s)");
I don't think this is a necessary log
--
To view, visit https://review.coreboot.org/c/flashrom/+/79304?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I7a8ac0c0984fef3cd9e73ed8d8097ddf429e54b2
Gerrit-Change-Number: 79304
Gerrit-PatchSet: 1
Gerrit-Owner: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Reviewer: Evan Benn <evanbenn(a)gmail.com>
Gerrit-Reviewer: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nikolai Artemiev <nartemiev(a)chromium.org>
Gerrit-Attention: Hsuan Ting Chen <roccochen(a)chromium.org>
Gerrit-Attention: Hsuan-ting Chen <roccochen(a)google.com>
Gerrit-Comment-Date: Mon, 27 Nov 2023 22:42:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Anton Samsonov, Thomas Heijligen.
Anton Samsonov has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/79152?usp=email )
Change subject: Makefile: Fix version string for non-Git builds
......................................................................
Patch Set 5:
(1 comment)
Patchset:
PS5:
> Jenkins derailed? […]
Done
--
To view, visit https://review.coreboot.org/c/flashrom/+/79152?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: I8694e618878823a9e96b1f2bcfa63f6c71d3c2ed
Gerrit-Change-Number: 79152
Gerrit-PatchSet: 5
Gerrit-Owner: Anton Samsonov <devel(a)zxlab.ru>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-CC: Anton Samsonov <contact-launchpad(a)zxlab.ru>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Anton Samsonov <devel(a)zxlab.ru>
Gerrit-Comment-Date: Mon, 27 Nov 2023 10:51:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anton Samsonov <contact-launchpad(a)zxlab.ru>
Gerrit-MessageType: comment