Nico Huber has submitted this change. ( 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, for example it allows to remove
data assignment `spi_config->data = data` from init function. This
assignment was only needed for configure_protocol function, and
now it is not needed anymore.
BUG=b:185191942
TEST=test in CB:57918
Change-Id: I5df0609efcd1fdb274b8cc84536253d5dbae5270
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57973
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M raiden_debug_spi.c
1 file changed, 5 insertions(+), 7 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c
index 9cba2a8..6a79000 100644
--- a/raiden_debug_spi.c
+++ b/raiden_debug_spi.c
@@ -1317,15 +1317,14 @@
* 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 ctx_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 *ctx_data)
{
int status = 0;
- struct raiden_debug_spi_data *ctx_data =
- (struct raiden_debug_spi_data *)spi_config->data;
+ struct spi_master *spi_config = ctx_data->spi_config;
ctx_data->protocol_version =
ctx_data->dev->interface_descriptor->bInterfaceProtocol;
@@ -1596,13 +1595,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: 3
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: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Nico Huber has submitted this change. ( 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>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57972
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M raiden_debug_spi.c
1 file changed, 5 insertions(+), 4 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
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: 3
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: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Attention is currently required from: Nico Huber, Michael Niewöhner.
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58012 )
Change subject: util: Add Nix shell file
......................................................................
Patch Set 4:
(1 comment)
File util/shell.nix:
https://review.coreboot.org/c/flashrom/+/58012/comment/165ac211_f107d6bd
PS3, Line 3: stdenv
> https://nixos. […]
It's like the build-essentials package from Debian.
--
To view, visit https://review.coreboot.org/c/flashrom/+/58012
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Gerrit-Change-Number: 58012
Gerrit-PatchSet: 4
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Comment-Date: Sat, 09 Oct 2021 23:12:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Felix Singer <felixsinger(a)posteo.net>
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Michael Niewöhner.
Felix Singer has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/58012 )
Change subject: util: Add Nix shell file
......................................................................
Patch Set 4:
(1 comment)
File util/shell.nix:
https://review.coreboot.org/c/flashrom/+/58012/comment/d747f61d_65d22f08
PS3, Line 3: stdenv
> What does this imply? […]
https://nixos.org/manual/nixpkgs/stable/#sec-tools-of-stdenv
--
To view, visit https://review.coreboot.org/c/flashrom/+/58012
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Gerrit-Change-Number: 58012
Gerrit-PatchSet: 4
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Comment-Date: Sat, 09 Oct 2021 23:11:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Michael Niewöhner.
Hello build bot (Jenkins), Nico Huber, Thomas Heijligen, Michael Niewöhner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/58012
to look at the new patch set (#4).
Change subject: util: Add Nix shell file
......................................................................
util: Add Nix shell file
Add a Nix shell file which is able to compile flashrom.
Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Signed-off-by: Felix Singer <felix.singer(a)secunet.com>
---
A util/shell.nix
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/12/58012/4
--
To view, visit https://review.coreboot.org/c/flashrom/+/58012
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I9757b952f4b034e98c2b4b70fbede52d8efb9d50
Gerrit-Change-Number: 58012
Gerrit-PatchSet: 4
Gerrit-Owner: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
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: Nico Huber <nico.h(a)gmx.de>
Gerrit-Attention: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57917 )
Change subject: tests: Add wrap for libusb_init and use it in dediprog test
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57917/comment/52440bc7_74c27d95
PS3, Line 15: real libusb_init
> That would be ideal, for the tests not to know of existence of libusb.h. […]
Actually, there are two things: 1. `libusb.h`, we can either use the original or
write our own. 2. If we use the original, we can choose to link against libusb.
The latter is controlled by meson. `flashrom_test_dep` includes `deps` which
contains libusb. Not sure if that was thought through.
If we wouldn't link to libusb, there'd be nothing to wrap. We could just provide
our own mock functions without any tricks.
If we don't want to use the original `libusb.h`, we can just put our own into
`tests/libusb.h`. Might need some adjustment to meson so it's found. However,
I don't see the reason not to use the original yet.
--
To view, visit https://review.coreboot.org/c/flashrom/+/57917
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I51c9cb96db1afb3298f4d098df96509d3cb3c046
Gerrit-Change-Number: 57917
Gerrit-PatchSet: 3
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: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sat, 09 Oct 2021 19:40:18 +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: Angel Pons, Anastasia Klimchuk.
Nico Huber 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 5:
(1 comment)
Patchset:
PS4:
> >>You mean to put not_null() into `tests/tests.c`? […]
Heh, I assumed a typo because "include" dirs are really just for `.h` files :)
--
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: 5
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: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sat, 09 Oct 2021 19:30:43 +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: Lubomir Rintel, Felix Singer, Thomas Heijligen.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/23337 )
Change subject: flashchips: reset a M25P10-A before a probe
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
Maybe we should just add a new entry for 25P10VP.
--
To view, visit https://review.coreboot.org/c/flashrom/+/23337
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I19a5332756d15b3cb74609c44a8d3fed2f4a2d68
Gerrit-Change-Number: 23337
Gerrit-PatchSet: 2
Gerrit-Owner: Lubomir Rintel <lkundrak(a)v3.sk>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Carl-Daniel Hailfinger <hailfinger(a)gmail.com>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Reviewer: Stefan T <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: Thomas Heijligen <src(a)posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Attention: Lubomir Rintel <lkundrak(a)v3.sk>
Gerrit-Attention: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Attention: Thomas Heijligen <src(a)posteo.de>
Gerrit-Comment-Date: Sat, 09 Oct 2021 09:03:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk.
Nikolai Artemiev has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57975 )
Change subject: raiden_debug_spi: Use new API to register shutdown function
......................................................................
Patch Set 4: Code-Review+1
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/57975/comment/874f219d_09f9da66
PS3, Line 19: (Nikolai) tested probe/read/write with a servo micro and puff board
> If you want, you can express this with a manually-added `Tested-by` tag
Done, thanks!
--
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: 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: Nikolai Artemiev <nartemiev(a)google.com>
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: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Sat, 09 Oct 2021 07:29:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber, Edward O'Callaghan, Anastasia Klimchuk, Nikolai Artemiev.
Nikolai Artemiev has uploaded a new patch set (#4) to the change originally created by Anastasia Klimchuk. ( 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.
BUG=b:185191942
TEST=test in CB:57918
(Nikolai) tested probe/read/write with a servo micro and puff board
Change-Id: I8927224779f24d1fda088991337e54d7272775a6
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
Tested-by: Nikolai Artemiev <nartemiev(a)google.com>
---
M raiden_debug_spi.c
1 file changed, 2 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/75/57975/4
--
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: 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: Nikolai Artemiev <nartemiev(a)google.com>
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: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nikolai Artemiev <nartemiev(a)google.com>
Gerrit-MessageType: newpatchset