Richard Hughes has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/64663 )
Change subject: libflashrom: Allow getting the progress_state from the flashctx
......................................................................
libflashrom: Allow getting the progress_state from the flashctx
External users of the libflashrom API cannot peek into the abstract
flashrom_flashctx structure, unlike the local CLI. Provide some API to
get the flashrom_progress struct from a flashrom_flashctx.
This allows fwupd to use the new flashrom_set_progress_callback() API
without using a global variable with the callback data.
Change-Id: I322bf56ff92f7b4d0ffc92768e9f0cdf7cb82010
Signed-off-by: Richard Hughes <richard(a)hughsie.com>
---
M cli_output.c
M include/libflashrom.h
M libflashrom.c
M libflashrom.map
4 files changed, 19 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/63/64663/1
diff --git a/cli_output.c b/cli_output.c
index e5b829a..9b7c70d 100644
--- a/cli_output.c
+++ b/cli_output.c
@@ -77,7 +77,7 @@
void flashrom_progress_cb(struct flashrom_flashctx *flashctx)
{
- struct flashrom_progress *progress_state = flashctx->progress_state;
+ struct flashrom_progress *progress_state = flashrom_get_progress_state(flashctx);
unsigned int pc = 0;
unsigned int *percentages = progress_state->user_data;
if (progress_state->current > 0 && progress_state->total > 0)
diff --git a/include/libflashrom.h b/include/libflashrom.h
index 21a5785..e6d1cf7 100644
--- a/include/libflashrom.h
+++ b/include/libflashrom.h
@@ -97,6 +97,17 @@
void flashrom_set_progress_callback(struct flashrom_flashctx *const flashctx,
flashrom_progress_callback *progress_callback, struct flashrom_progress *progress_state);
+/**
+ * @brief Get the progress state.
+ *
+ * Get the progress state set in flashrom_set_progress_callback().
+ *
+ * @param flashctx The current flash context.
+ * @return last set progress state
+ */
+struct flashrom_progress *flashrom_get_progress_state(struct flashrom_flashctx *flashctx);
+
+
/** @} */ /* end flashrom-general */
/**
diff --git a/libflashrom.c b/libflashrom.c
index 0c6613e..6499387 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -65,6 +65,12 @@
return 0;
}
+struct flashrom_progress *
+flashrom_get_progress_state(struct flashrom_flashctx *flashctx)
+{
+ return flashctx->progress_state;
+}
+
void flashrom_set_progress_callback(struct flashrom_flashctx *flashctx, flashrom_progress_callback *progress_callback, struct flashrom_progress *progress_state)
{
flashctx->progress_callback = progress_callback;
diff --git a/libflashrom.map b/libflashrom.map
index b3af70b..7eb2903 100644
--- a/libflashrom.map
+++ b/libflashrom.map
@@ -10,6 +10,7 @@
flashrom_flash_getsize;
flashrom_flash_probe;
flashrom_flash_release;
+ flashrom_get_progress_state;
flashrom_image_read;
flashrom_image_verify;
flashrom_image_write;
--
To view, visit https://review.coreboot.org/c/flashrom/+/64663
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I322bf56ff92f7b4d0ffc92768e9f0cdf7cb82010
Gerrit-Change-Number: 64663
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Hughes <richard(a)hughsie.com>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Thomas Heijligen, Edward O'Callaghan, Angel Pons, Nikolai Artemiev.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64488 )
Change subject: dummyflasher: Wire variable size feature via opaque infra
......................................................................
Patch Set 3:
(1 comment)
File dummyflasher.c:
https://review.coreboot.org/c/flashrom/+/64488/comment/ddc854ac_a9dba977
PS1, Line 1269: rmst.spi = *s_mst;
: rmst.opaque = *o_mst;
> > So... do you think it's too bad? :) I don't have another ideas at the moment :\ […]
Good news: I got rid of double master! Now everything is done as opaque master. I will leave another comment unresolved to verify with the users of the feature, but at the moment I am optimistic :)
I noticed something:
> when I tried to port things from chromium myself
Wow I didn't know that you have experience porting things from chromium!
--
To view, visit https://review.coreboot.org/c/flashrom/+/64488
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I76402bfdf8b1a75489e4509fec92c9a777d0cf58
Gerrit-Change-Number: 64488
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
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: 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: Felix Singer <felixsinger(a)posteo.net>
Gerrit-CC: Namyoon Woo <namyoon(a)google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Comment-Date: Wed, 25 May 2022 00:47:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen, Edward O'Callaghan, Angel Pons, Anastasia Klimchuk, Nikolai Artemiev.
Hello build bot (Jenkins), Thomas Heijligen, Edward O'Callaghan, Nikolai Artemiev, Peter Marheine,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/64488
to look at the new patch set (#3).
Change subject: dummyflasher: Wire variable size feature via opaque infra
......................................................................
dummyflasher: Wire variable size feature via opaque infra
Wire "variable size" feature in dummy programmer via opaque
infra. This patch fixes the broken build with CONFIG_DUMMY=no.
Dummyflasher registers opaque master for the case when it is
initialised with EMULATE_VARIABLE_SIZE. Dummy opaque master
emulates read/write/erase as simple memory operations over
`data->flashchip_contents`.
Fixes: https://ticket.coreboot.org/issues/365
TEST=the following scenarious run successfully
Testing build
$ make clean && make CONFIG_DUMMY=no
$ flashrom -h : dummy is not in the list
$ make clean && make CONFIG_EVERYTHING=yes
$ flashrom -h : dummy is in the list
Testing "variable size" feature
$ flashrom -p dummy:size=8388608,emulate=VARIABLE_SIZE -V
$ flashrom -p dummy:size=8388608,emulate=VARIABLE_SIZE -r /tmp/dump.bin -V
$ head -c 8388608 </dev/urandom >/tmp/image.bin
$ flashrom -p dummy:image=/tmp/image.bin,size=8388608,emulate=VARIABLE_SIZE -w /tmp/dump.bin -V
Testing standard flow
$ flashrom -p dummy:emulate=W25Q128FV -V
$ flashrom -p dummy:emulate=W25Q128FV -r /tmp/dump.bin -V
$ head -c 16777216 </dev/urandom >/tmp/image.bin
$ flashrom -p dummy:image=/tmp/image.bin,emulate=W25Q128FV -w /tmp/dump.bin -V
Change-Id: I76402bfdf8b1a75489e4509fec92c9a777d0cf58
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M dummyflasher.c
M flashchips.c
M include/chipdrivers.h
3 files changed, 77 insertions(+), 73 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/88/64488/3
--
To view, visit https://review.coreboot.org/c/flashrom/+/64488
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I76402bfdf8b1a75489e4509fec92c9a777d0cf58
Gerrit-Change-Number: 64488
Gerrit-PatchSet: 3
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
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: 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: Felix Singer <felixsinger(a)posteo.net>
Gerrit-CC: Namyoon Woo <namyoon(a)google.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newpatchset
Attention is currently required from: Nikolai Artemiev, Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64607 )
Change subject: flashchips.c: add CMP bit entry to W25Q256.V
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/64607
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I1cb400f6b8542a9054875b8f2557db1cc06292e2
Gerrit-Change-Number: 64607
Gerrit-PatchSet: 2
Gerrit-Owner: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Tue, 24 May 2022 23:49:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Thomas Heijligen.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64384 )
Change subject: meson: use files() for srcs list
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/64384/comment/10519b5a_2623fbe9
PS1, Line 8:
> Meson looks up if the file xyz.c exists when calling file("xyz.c"). […]
Sorry I was too brief; yes please include the first part in the commit message that is all.
--
To view, visit https://review.coreboot.org/c/flashrom/+/64384
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I346b5468b4203f1521ec73a90f93ff3b13ebf43c
Gerrit-Change-Number: 64384
Gerrit-PatchSet: 1
Gerrit-Owner: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Reviewer: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Tue, 24 May 2022 23:46:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Thomas Heijligen <src(a)posteo.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Anastasia Klimchuk, Nikolai Artemiev, Sergii Dmytruk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64375 )
Change subject: spi25_statusreg.c: Allow opaque masters to hook spi_{rw}_register()
......................................................................
Patch Set 4:
(1 comment)
File spi25_statusreg.c:
https://review.coreboot.org/c/flashrom/+/64375/comment/df68aca4_bbd605a6
PS3, Line 35: }
> Well, it says "Do not unnecessarily use braces where a single statement will do.". […]
I think once we get clang-format decided on we can just make this sort of thing automatic and make the whole code-base consistent. This sort of thing comes up from time to time in code review unnecessarily due to lack of tooling usage.
--
To view, visit https://review.coreboot.org/c/flashrom/+/64375
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3ab0d7f5f48338c8ecb118a69651c203fbc516ac
Gerrit-Change-Number: 64375
Gerrit-PatchSet: 4
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Reviewer: Subrata Banik <subratabanik(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Attention: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-Comment-Date: Tue, 24 May 2022 23:43:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Comment-In-Reply-To: Sergii Dmytruk <sergii.dmytruk(a)3mdeb.com>
Gerrit-MessageType: comment
Attention is currently required from: Angel Pons.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64425 )
Change subject: flashchips.c: Fix 4BA for S25FL512S
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/64425/comment/2fd2e31d_42b18674
PS1, Line 12: so select them through `FEATURE_4BA_EAR7`. As it is not known how this
> It looks like they use different opcodes, though (16/17 instead of […]
Turned out we actually supported different opcodes already with
the `.wrea_override` field. As it's hard to understand, I dropped
it in CB:64636 and replaced it with a proper feature flag.
If my commit chain lands, I guess this change here becomes obsolete.
--
To view, visit https://review.coreboot.org/c/flashrom/+/64425
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I08c5a70351d945130183fe01c328dc4d30cfe0ef
Gerrit-Change-Number: 64425
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Tue, 24 May 2022 13:49:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment