Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/57975 )
Change subject: raiden_debug_spi: Use new API to register shutdown function
......................................................................
raiden_debug_spi: Use new API to register shutdown function
This allows programmer to register shutdown function in spi_master
struct, which means there is no need to call register_shutdown in init
function, since this call is now a part of register_spi_master.
As a consequence of using new API, two things are happening here:
1) No resource leakage anymore in case register_shutdown() would fail,
2) Fixed propagation of register_spi_master() return values.
TRY TO TEST ME ON HW
BUG=b:185191942
TEST=test in CB:57918
Change-Id: I8927224779f24d1fda088991337e54d7272775a6
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M raiden_debug_spi.c
1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/75/57975/1
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c
index 40090f2..d9ca565 100644
--- a/raiden_debug_spi.c
+++ b/raiden_debug_spi.c
@@ -1298,6 +1298,7 @@
.read = default_spi_read,
.write_256 = default_spi_write_256,
.write_aai = default_spi_write_aai,
+ .shutdown = raiden_debug_spi_shutdown,
};
static int match_endpoint(struct libusb_endpoint_descriptor const *descriptor,
@@ -1613,10 +1614,7 @@
return SPI_GENERIC_ERROR;
}
- register_spi_master(spi_config, data);
- register_shutdown(raiden_debug_spi_shutdown, data);
-
- return 0;
+ return register_spi_master(spi_config, data);
}
const struct programmer_entry programmer_raiden_debug_spi = {
--
To view, visit https://review.coreboot.org/c/flashrom/+/57975
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8927224779f24d1fda088991337e54d7272775a6
Gerrit-Change-Number: 57975
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newchange
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/57973 )
Change subject: raiden_debug_spi: Use spi data in configure_protocol
......................................................................
raiden_debug_spi: Use spi data in configure_protocol
Spi data for this programmer now contains pointer to spi_master
struct, and can be used in configure_protocol.
This patch is making init code of raiden_debug_spi a bit more
consistent with other programmers.
BUG=b:185191942
TEST=test in CB:57918
Change-Id: I5df0609efcd1fdb274b8cc84536253d5dbae5270
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M raiden_debug_spi.c
1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/73/57973/1
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c
index 9cba2a8..d783fef 100644
--- a/raiden_debug_spi.c
+++ b/raiden_debug_spi.c
@@ -1317,15 +1317,16 @@
* is being used by the device USB SPI interface and if needed query the
* device for its capabilities.
*
- * @param spi_config Raiden SPI config which will be modified.
+ * @param data Raiden SPI data, data contains pointer to config which will be modified.
*
- * @returns Returns status code with 0 on success.
+ * @returns Returns status code with 0 on success.
*/
-static int configure_protocol(struct spi_master *spi_config)
+static int configure_protocol(struct raiden_debug_spi_data *data)
{
int status = 0;
struct raiden_debug_spi_data *ctx_data =
- (struct raiden_debug_spi_data *)spi_config->data;
+ (struct raiden_debug_spi_data *)data;
+ struct spi_master *spi_config = ctx_data->spi_config;
ctx_data->protocol_version =
ctx_data->dev->interface_descriptor->bInterfaceProtocol;
@@ -1596,13 +1597,12 @@
data->out_ep = out_endpoint;
data->spi_config = spi_config;
- spi_config->data = data; /* data is needed to configure protocol below */
/*
* The SPI master needs to be configured based on the device connected.
* Using the device protocol interrogation, we will set the limits on
* the write and read sizes and switch command functions.
*/
- ret = configure_protocol(spi_config);
+ ret = configure_protocol(data);
if (ret) {
msg_perr("Raiden: Error configuring protocol\n"
" protocol = %u\n"
--
To view, visit https://review.coreboot.org/c/flashrom/+/57973
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5df0609efcd1fdb274b8cc84536253d5dbae5270
Gerrit-Change-Number: 57973
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newchange
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/57972 )
Change subject: raiden_debug_spi: Link spi_master struct to spi data
......................................................................
raiden_debug_spi: Link spi_master struct to spi data
For this programmer, spi_master struct is dynamically allocated
and needs to be freed on shutdown. Adding a pointer to spi data
struct allows to link spi_master from spi data, which in turn allows
to pass spi data into shutdown function. As a result, both
register_spi_master and register_shutdown use the same data, and
this unblocks moving raiden_debug_spi to new API (like all the
other spi masters in commit a69c5196d20d136b1de120f0fa5ea1e06c3776da).
See further patches in this chain.
BUG=b:185191942
TEST=test in CB:57918
Change-Id: I5400802aa6961538df12fcd5339f7e2a5db145a1
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M raiden_debug_spi.c
1 file changed, 5 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/72/57972/1
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c
index 92779fc..9cba2a8 100644
--- a/raiden_debug_spi.c
+++ b/raiden_debug_spi.c
@@ -441,6 +441,7 @@
*/
uint16_t max_spi_write_count;
uint16_t max_spi_read_count;
+ struct spi_master *spi_config;
};
/*
* USB permits a maximum bulk transfer of 64B.
@@ -1377,9 +1378,8 @@
static int raiden_debug_spi_shutdown(void * data)
{
- struct spi_master *spi_config = data;
- struct raiden_debug_spi_data *ctx_data =
- (struct raiden_debug_spi_data *)spi_config->data;
+ struct raiden_debug_spi_data *ctx_data = (struct raiden_debug_spi_data *)data;
+ struct spi_master *spi_config = ctx_data->spi_config;
int ret = LIBUSB(libusb_control_transfer(
ctx_data->dev->handle,
@@ -1594,6 +1594,7 @@
data->dev = device;
data->in_ep = in_endpoint;
data->out_ep = out_endpoint;
+ data->spi_config = spi_config;
spi_config->data = data; /* data is needed to configure protocol below */
/*
@@ -1613,7 +1614,7 @@
}
register_spi_master(spi_config, data);
- register_shutdown(raiden_debug_spi_shutdown, spi_config);
+ register_shutdown(raiden_debug_spi_shutdown, data);
return 0;
}
--
To view, visit https://review.coreboot.org/c/flashrom/+/57972
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5400802aa6961538df12fcd5339f7e2a5db145a1
Gerrit-Change-Number: 57972
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Edward O'Callaghan, Angel Pons.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57269 )
Change subject: tests: Add NON_ZERO macro and not_null function instead of MOCK_HANDLE
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS3:
> Generally, if there is hope that it is fixed, one can just hit the rebase […]
it works thank you! my chain is now all green :)
--
To view, visit https://review.coreboot.org/c/flashrom/+/57269
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5ad6ee4aa9091447c6c9108c92bf7f6e755fca48
Gerrit-Change-Number: 57269
Gerrit-PatchSet: 4
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
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-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sun, 26 Sep 2021 23:51:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Michał Żygowski, Jonathan Zhang, Angel Pons.
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57793 )
Change subject: ich_descriptors: Add explicit checks for all chipsets
......................................................................
Patch Set 4:
(2 comments)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57793/comment/9d7aa624_a574e8a4
PS3, Line 10: A new chipset
: was added that necessitated adding back a check for an older
: chipset.
> That's not accurate. It was the way that the new check was written […]
I've reworded this to focus on what's being done in this patch. If somebody wants more context they can easily find it in the commit mentioned in the previous sentence.
File ich_descriptors.c:
https://review.coreboot.org/c/flashrom/+/57793/comment/badc142e_6d1f4a48
PS1, Line 968: if (content->ICCRIBA != 0x34)
: msg_pwarn("Unknown flash descriptor, assuming 300 series compatibility.\n");
> This one had a different message.
"Unknown flash descriptor, assuming 300 series compatibility" and "Peculiar flash descriptor, assuming 300 series compatibility" mean the same thing. Both are msg_pwarn(), too.
Regardless, this is not worth splitting hairs so I've reverted back to using msg_pwarn() since you seem to prefer it that way.
--
To view, visit https://review.coreboot.org/c/flashrom/+/57793
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f
Gerrit-Change-Number: 57793
Gerrit-PatchSet: 4
Gerrit-Owner: David Hendricks
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Sun, 26 Sep 2021 21:15:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: David Hendricks
Gerrit-MessageType: comment
Attention is currently required from: Michał Żygowski, Jonathan Zhang, David Hendricks, Angel Pons.
Hello build bot (Jenkins), Michał Żygowski, Jonathan Zhang, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/57793
to look at the new patch set (#4).
Change subject: ich_descriptors: Add explicit checks for all chipsets
......................................................................
ich_descriptors: Add explicit checks for all chipsets
This partially undoes changes made in commit cd9b7b427
(ich_descriptors: Normalize chipset detection) to re-add explicit
matching of each chipset with one or more strap length values.
Since ranges are checked explicitly, the `warn_if` parameter to
warn_peculiar_desc() is no longer necessary and is removed.
Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f
Signed-off-by: David Hendricks <ddaveh(a)amazon.com>
---
M ich_descriptors.c
1 file changed, 19 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/93/57793/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/57793
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f
Gerrit-Change-Number: 57793
Gerrit-PatchSet: 4
Gerrit-Owner: David Hendricks
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Michał Żygowski <michal.zygowski(a)3mdeb.com>
Gerrit-Attention: Jonathan Zhang <jonzhang(a)fb.com>
Gerrit-Attention: David Hendricks
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: newpatchset