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/+/52499 )
Change subject: hwaccess.h: Split hwaccess.h and extract hwaccess_x86_io.h out of it
......................................................................
Patch Set 6:
(1 comment)
File hwaccess.h:
https://review.coreboot.org/c/flashrom/+/52499/comment/e49686a0_d7f3b898
PS4, Line 113: #if IS_X86
> I've only now noticed this. Maybe we should name the new file accordingly, […]
I choose hwaccess_x86_io.h because it is a subset of hwaccess.h (i/o operations), the other name looked to me as "the same thing but for x86".
--
To view, visit https://review.coreboot.org/c/flashrom/+/52499
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idd04c7b36b24e9da339348a015df4f43a03744f7
Gerrit-Change-Number: 52499
Gerrit-PatchSet: 6
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: Tue, 27 Apr 2021 06:33:13 +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: Angel Pons.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52473 )
Change subject: s25f.c: Fix mismatched function definitions
......................................................................
Patch Set 3:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/52473/comment/86fd995c_537657e7
PS1, Line 8:
: This was missed because `uint32_t` is `unsigned int` in most cases.
: However, it is not the case for DJGPP 6.1.0 for some reason.
> > You got no response for a couple of days because I have been recovering from surgery WTF.. […]
Last couple of weeks have been pretty painful :| I've just been on and off review unofficially to help Anastasia which probably made it even more unclear. Since I rarely -2 I erroneously assumed you figured something might be strange. Any ways, cheers Angel and sorry for any confusion as well. Things like it would have been easier if I was full time Flashrom and hanging on IRC but sadly I am not.
I figured addr is of a specific length because of how it is decoded into precisely four unsigned bytes:
```
(addr >> 24) & 0xff,
(addr >> 16) & 0xff,
(addr >> 8) & 0xff,
(addr & 0xff)
```
Is `blocklen` just unused or am I not seeing it?
--
To view, visit https://review.coreboot.org/c/flashrom/+/52473
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I656a72b85d4c70b57f6ff9268186a4a60933f8a9
Gerrit-Change-Number: 52473
Gerrit-PatchSet: 3
Gerrit-Owner: Angel Pons <th3fanbus(a)gmail.com>
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: 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-Comment-Date: Tue, 27 Apr 2021 06:29:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Comment-In-Reply-To: Edward O'Callaghan <quasisec(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/51487
to look at the new patch set (#9).
Change subject: tests: Add unit test to run init/shutdown for mec1308.c
......................................................................
tests: Add unit test to run init/shutdown for mec1308.c
This patch includes mocks for io operations in hwaccess_x86_io.h
because those are needed to test lifecycle of mec1308.c
BUG=b:181803212
TEST=builds and ninja test
Change-Id: I3af612defe1af3850dfc1626a208d873e3a3eddc
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
A hwaccess_x86_io_unittest.h
M meson.build
M tests/init_shutdown.c
M tests/meson.build
M tests/tests.c
M tests/tests.h
6 files changed, 137 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/87/51487/9
--
To view, visit https://review.coreboot.org/c/flashrom/+/51487
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I3af612defe1af3850dfc1626a208d873e3a3eddc
Gerrit-Change-Number: 51487
Gerrit-PatchSet: 9
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-MessageType: newpatchset
Attention is currently required from: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Hello build bot (Jenkins), Nico Huber, Edward O'Callaghan, Angel Pons,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/52499
to look at the new patch set (#6).
Change subject: hwaccess.h: Split hwaccess.h and extract hwaccess_x86_io.h out of it
......................................................................
hwaccess.h: Split hwaccess.h and extract hwaccess_x86_io.h out of it
The change makes it possible to mock functions from hwaccess_x86_io.h
in tests by replacing this header with a different one when built
for a test environment. The rest of hwaccess.h is fine and works
for the test environment.
BUG=b:181803212
TEST=make clean && make CONFIG_EVERYTHING=yes VERSION=none
Build flashrom before and after this patch, flashrom binary
is the same (diff flashrom_before flashrom_after shows no diffs)
Change-Id: Idd04c7b36b24e9da339348a015df4f43a03744f7
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M hwaccess.h
A hwaccess_x86_io.h
2 files changed, 157 insertions(+), 136 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/99/52499/6
--
To view, visit https://review.coreboot.org/c/flashrom/+/52499
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Idd04c7b36b24e9da339348a015df4f43a03744f7
Gerrit-Change-Number: 52499
Gerrit-PatchSet: 6
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-MessageType: newpatchset
Attention is currently required from: Nico Huber.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52604 )
Change subject: [RFC] tests: Abstract port I/O and factor mec1308 specifics out
......................................................................
Patch Set 1:
(3 comments)
Patchset:
PS1:
Nico thank you so much, you really help me, this patch explains the idea perfectly!! I need some time, I am implementing this idea gradually. Two thoughts, added as comments.
File tests/init_shutdown.c:
https://review.coreboot.org/c/flashrom/+/52604/comment/a632b596_4c0c6537
PS1, Line 63: .outb = mec1308_outb,
I think, maybe I could get away with a default implementation of outx functions, and only customise inx functions? And this also means have 3 variables in io_mock
uint8_t outb_val
uint16_t outw_val
uint32_t outl_val
instead of void *priv.
Outx functions are mocked, so they do not do any actual output. The only useful thing could be the value passed to outx, the value definitely needed to be stored.
Having said that, maybe you see further than me and you see that default outx won't be sufficient?
what do you think?
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/52604/comment/6605b34b_ef93274a
PS1, Line 23: const struct io_mock *current_io = NULL;
Do you think it would work if I try to swap this line with extern definition in io_mock.h ? I want to try have extern const struct definition for current_io here (without assigning to NULL), and const struct with = NULL in io_mock.h
The reason is, it wasn't easy for me to understand why current_io is assigned NULL on the top, and then used in functions below. It takes some time (at least it took some time for me) to understand that current_io is reassigned in different file. When it is extern without any assignment, it is more clear that it is taken care of elsewhere.
I want to try swap lines, hope it can work.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52604
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia3a424478456a7c968b3c736ba371d755c494f30
Gerrit-Change-Number: 52604
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Comment-Date: Tue, 27 Apr 2021 05:24:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Nico Huber.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52596 )
Change subject: mec1308.c: Untangle successful vs failed init paths
......................................................................
Patch Set 3:
(1 comment)
File mec1308.c:
https://review.coreboot.org/c/flashrom/+/52596/comment/2a6e5fe6_4c3680a1
PS1, Line 519: mec1308_init_exit
> Yeah I was thinking about those label names a lot, I agree just saying this one is "exit" is not ide […]
This patch now has a sibling: https://review.coreboot.org/c/flashrom/+/52685
I used the same name for exit label.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52596
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ibf35335501e59636c544af124ad7a04a186790b4
Gerrit-Change-Number: 52596
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-CC: Victor Ding <victording(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Comment-Date: Tue, 27 Apr 2021 01:47:44 +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.
Anastasia Klimchuk has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52595 )
Change subject: mec1308.c: Extract params check into a function
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
This patch now has a sibling: https://review.coreboot.org/c/flashrom/+/52684
--
To view, visit https://review.coreboot.org/c/flashrom/+/52595
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If5be7709e93233a2e7ea9133de50382d2524a55f
Gerrit-Change-Number: 52595
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: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-CC: Victor Ding <victording(a)google.com>
Gerrit-Attention: Nico Huber <nico.h(a)gmx.de>
Gerrit-Comment-Date: Tue, 27 Apr 2021 01:45:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/52684 )
Change subject: ene_lpc.c: Extract params check into a function
......................................................................
ene_lpc.c: Extract params check into a function
This allows char *p to become a local variable in check_params,
and it is allocated and freed within check_params function.
Which means init function does not need char *p anymore,
in particular does not need to free it - and this makes cleanup
after failed init easier.
As a good side effect, init function becomes easier to read.
BUG=b:185191942
TEST=builds
Change-Id: I7c3b6dea0edbc7547f0b307a0508c7d2b2a6d370
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M ene_lpc.c
1 file changed, 16 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/84/52684/1
diff --git a/ene_lpc.c b/ene_lpc.c
index 1d045b8..560743c 100644
--- a/ene_lpc.c
+++ b/ene_lpc.c
@@ -513,11 +513,25 @@
.write_256 = default_spi_write_256,
};
+static int check_params(void)
+{
+ int ret = 0;
+ char *p = NULL;
+
+ p = extract_programmer_param("type");
+ if (p && strcmp(p, "ec")) {
+ msg_pdbg("ene_lpc only supports \"ec\" type devices\n");
+ ret = 1;
+ }
+
+ free(p);
+ return ret;
+}
+
int ene_lpc_init()
{
uint8_t hwver, ediid, i;
int ret = 0;
- char *p = NULL;
ene_lpc_data_t *ctx_data = NULL;
msg_pdbg("%s\n", __func__);
@@ -529,9 +543,7 @@
}
ctx_data->ec_state = EC_STATE_NORMAL;
- p = extract_programmer_param("type");
- if (p && strcmp(p, "ec")) {
- msg_pdbg("ene_lpc only supports \"ec\" type devices\n");
+ if (check_params()) {
ret = 1;
goto ene_probe_spi_flash_exit;
}
@@ -572,7 +584,6 @@
msg_pdbg("%s: successfully initialized ene\n", __func__);
ene_probe_spi_flash_exit:
- free(p);
if (ret)
free(ctx_data);
return ret;
--
To view, visit https://review.coreboot.org/c/flashrom/+/52684
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I7c3b6dea0edbc7547f0b307a0508c7d2b2a6d370
Gerrit-Change-Number: 52684
Gerrit-PatchSet: 1
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: newchange
Attention is currently required from: Nico Huber, Angel Pons.
Thomas Walker has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52310 )
Change subject: flashchips: Add Spansion/Cypress S25FL256L
......................................................................
Patch Set 6:
(2 comments)
File flashchips.c:
https://review.coreboot.org/c/flashrom/+/52310/comment/51a2d3cf_453deb75
PS5, Line 16387: FEATURE_4BA
> I see no mention of EAR (extended address register) in the datasheet, so that should be […]
Forgive me if I'm incorrect, but in the datasheet there is a section: 6.1.1 Extended Address
"""
Legacy commands continue to support 24-bit addresses for backward software compatibility. Extended 32-bit addresses are
enabled in two ways:
- Extended address mode
- 4 Byte address commands
"""
File spi25.c:
https://review.coreboot.org/c/flashrom/+/52310/comment/59c8eea4_fc5eee36
PS5, Line 492: true
> We could put it next to _5c
Moved to a more suitable spot.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52310
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I4e8cba554d0590c94dac92aa91e9ab400efca281
Gerrit-Change-Number: 52310
Gerrit-PatchSet: 6
Gerrit-Owner: Thomas Walker <thh.walker(a)gmail.com>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
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: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Comment-Date: Mon, 26 Apr 2021 23:48:52 +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>
Gerrit-MessageType: comment