Attention is currently required from: Nico Huber, Angel Pons, Anastasia Klimchuk.
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/57436 )
Change subject: tests: Extract setup and teardown for chip tests
......................................................................
Patch Set 1: Code-Review+1
(3 comments)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/57436/comment/4e305b53_15b3b205
PS1, Line 29: g_chip_state
I wonder if it is time to embed this into `data` of the flashctx to avoid possible test coupling. Things like `reset_global_chip_state()` are signs that this could be a good idea to consider.
https://review.coreboot.org/c/flashrom/+/57436/comment/55a52ebf_6b509d87
PS1, Line 89: static void reset_global_chip_state()
: {
: g_chip_state.unlock_calls = 0;
: }
Just inline this function to the one call site.
OK more generally in OOP speak here; It is best to avoid having global state management functions which are akin to a singleton class and instead use generators for this kind of state.
https://review.coreboot.org/c/flashrom/+/57436/comment/74a8e006_b2731b70
PS1, Line 94: setup_for_chip
> Usually this would be a statement, e.g. just `set_up_chip`.
+1 drop the _for_ just `setup_chip()`
--
To view, visit https://review.coreboot.org/c/flashrom/+/57436
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If59315646f06344664df08b145866d9ce846d751
Gerrit-Change-Number: 57436
Gerrit-PatchSet: 1
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: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Comment-Date: Tue, 07 Sep 2021 12:56:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Nico Huber <nico.h(a)gmx.de>
Gerrit-MessageType: comment
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/+/57436 )
Change subject: tests: Extract setup and teardown for chip tests
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/57436/comment/1de248ca_0260a57f
PS1, Line 94: setup_for_chip
Usually this would be a statement, e.g. just `set_up_chip`.
--
To view, visit https://review.coreboot.org/c/flashrom/+/57436
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: If59315646f06344664df08b145866d9ce846d751
Gerrit-Change-Number: 57436
Gerrit-PatchSet: 1
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: Tue, 07 Sep 2021 11:48:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
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/+/57326 )
Change subject: tests: Add tests to read from chip
......................................................................
Patch Set 2:
(3 comments)
Patchset:
PS1:
> Can the refactor and the new tests be split into two patches to make it slightly easier to review?
Yes, I created a chain so that it's more readable. Previous one CB:57436 extracts setup and teardown, this one adds new tests.
File tests/chip.c:
https://review.coreboot.org/c/flashrom/+/57326/comment/de3f172d_d46ef6d0
PS1, Line 232: 16
> I was really wondering what this is about... I guess you mean the […]
There was something in my head when I was writing this comment, but I feel it's not that relevant anymore. I removed the comment (comes into effect in CB:57437). Also this size is really small, should be more realistic, which is also done in CB:57437.
I recall now, in the very first chip test there was a comment on why chip is so small.
In general, I was thinking, this can be expanded to test small or large chips, and various eraseblocks.
https://review.coreboot.org/c/flashrom/+/57326/comment/7e55bdec_da035d2e
PS1, Line 246: };
> Should these be static/global so they can be shared among test functions?
Yes right, they started to repeat once more tests have been added. I created CB:57437 for this.
--
To view, visit https://review.coreboot.org/c/flashrom/+/57326
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia57781ebc670c7bd6197e56fe8a20651a425c756
Gerrit-Change-Number: 57326
Gerrit-PatchSet: 2
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, 07 Sep 2021 05:58:19 +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: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/57437
to look at the new patch set (#2).
Change subject: tests: Make chip definitions static global
......................................................................
tests: Make chip definitions static global
This way chip definitions can be reused between test functions.
Existing mock chip is promoted from 8KiB to 8MiB and eraseblocks
are expanded accordingly. Old value of 8KiB was very small and it
was confusing. Mock chip looks more realistic now.
BUG=b:181803212
TEST=builds and ninja test
Change-Id: Ia9b5fc71e30610684e68e9aca9fb1970da8f840a
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M tests/chip.c
1 file changed, 51 insertions(+), 112 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/37/57437/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/57437
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia9b5fc71e30610684e68e9aca9fb1970da8f840a
Gerrit-Change-Number: 57437
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: 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/+/57326
to look at the new patch set (#2).
Change subject: tests: Add tests to read from chip
......................................................................
tests: Add tests to read from chip
Two tests cover the code which performs do_read operation.
First one works with fake chip and dummy programmer. Fake chip has all
operations defined, and a buffer to emulate chip memory.
Second one uses the chip which is closer to the real one, because
read/write/unlock/erase operations are real. The tests takes the
advantage of dummyflasher's capability of emulating a W25Q128.V chip.
BUG=b:181803212
TEST=builds and ninja test
Change-Id: Ia57781ebc670c7bd6197e56fe8a20651a425c756
Signed-off-by: Anastasia Klimchuk <aklm(a)chromium.org>
---
M tests/chip.c
M tests/io_mock.h
M tests/meson.build
M tests/tests.c
M tests/tests.h
5 files changed, 146 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/26/57326/2
--
To view, visit https://review.coreboot.org/c/flashrom/+/57326
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia57781ebc670c7bd6197e56fe8a20651a425c756
Gerrit-Change-Number: 57326
Gerrit-PatchSet: 2
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-MessageType: newpatchset
Attention is currently required from: Sophie van Soest.
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56060 )
Change subject: chipset_enable.c: Mark Z97 as DEP
......................................................................
Patch Set 5: Code-Review+2
--
To view, visit https://review.coreboot.org/c/flashrom/+/56060
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I73bdd9afefae8e7c013d400e17a15e56d84322f4
Gerrit-Change-Number: 56060
Gerrit-PatchSet: 5
Gerrit-Owner: Sophie van Soest <sophie(a)entropie.rocks>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Sophie van Soest <sophie(a)entropie.rocks>
Gerrit-Comment-Date: Mon, 06 Sep 2021 21:55:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: Sophie van Soest.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/56060 )
Change subject: chipset_enable.c: Mark Z97 as DEP
......................................................................
Patch Set 5: Code-Review+2
(1 comment)
File chipset_enable.c:
https://review.coreboot.org/c/flashrom/+/56060/comment/d80ddd12_d14c928c
PS3, Line 1972: OK
> Done and rebased to latest origin/master.
Thanks!
--
To view, visit https://review.coreboot.org/c/flashrom/+/56060
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I73bdd9afefae8e7c013d400e17a15e56d84322f4
Gerrit-Change-Number: 56060
Gerrit-PatchSet: 5
Gerrit-Owner: Sophie van Soest <sophie(a)entropie.rocks>
Gerrit-Reviewer: Felix Singer <felixsinger(a)posteo.net>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Sophie van Soest <sophie(a)entropie.rocks>
Gerrit-Comment-Date: Mon, 06 Sep 2021 16:37:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Sophie van Soest <sophie(a)entropie.rocks>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment