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/+/52597 )
Change subject: mec1308.c: Separate shutdown from failed init cleanup
......................................................................
Patch Set 1:
(1 comment)
File mec1308.c:
https://review.coreboot.org/c/flashrom/+/52597/comment/47d1a0d9_e6c025c8
PS1, Line 520: /* Exit passthru mode before performing commands which do not affect
: the SPI ROM */
: mec1308_exit_passthru_mode(ctx_data);
:
: /* Re-enable SMI and ACPI.
: FIXME: is there an ordering dependency? */
: if (mbx_write(ctx_data, MEC1308_MBX_CMD, MEC1308_CMD_SMI_ENABLE))
: msg_pdbg("%s: unable to re-enable SMI\n", __func__);
: if (mbx_write(ctx_data, MEC1308_MBX_CMD, MEC1308_CMD_ACPI_ENABLE))
: msg_pdbg("%s: unable to re-enable ACPI\n", __func__);
Could we just call mec1308_shutdown() here? Would have to skip the free() below, though:
failed_init_cleanup:
mec1308_shutdown(ctx_data);
return 1;
mec1308_init_exit:
...
--
To view, visit https://review.coreboot.org/c/flashrom/+/52597
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I6d62d43dd8b6ebc595f9fd747e0f4cd80f3c10da
Gerrit-Change-Number: 52597
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: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Miklós Márton <martonmiklosqdev(a)gmail.com>
Gerrit-CC: Nico Huber <nico.h(a)gmx.de>
Gerrit-CC: Victor Ding <victording(a)google.com>
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: Thu, 22 Apr 2021 14:32:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: Edward O'Callaghan, Angel Pons, Arthur Heymans.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52473 )
Change subject: s25f.c: Fix mismatched function definitions
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://review.coreboot.org/c/flashrom/+/52473/comment/4c86892a_c0fbbdbf
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.
> Edward, any updates?
WTF?
--
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: 1
Gerrit-Owner: 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: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-Comment-Date: Thu, 22 Apr 2021 14:05:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
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.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/52364 )
Change subject: programmer.h,chipset_enable.c: Make penable fn ptr more descript
......................................................................
Patch Set 2:
(1 comment)
File programmer.h:
https://review.coreboot.org/c/flashrom/+/52364/comment/7c1e71b9_b36e5467
PS1, Line 228: enable_flash_xxx
> Example: https://github.com/torvalds/linux/blob/fcadab740480e0e0e9fa9bd272acd409884d…
Huh? that's documentation examples, I don't see there any `xxx` in an API?
Also, the syntax alone makes it obvious that it's not a specific implementation
that is called. Why introduce placeholders? Imagine I would have used outb_xxx,
inb_xxx, outw_xxx, etc. in CB:52604. Would there be any benefit?
I see the whole thing here as a usual command pattern. The function references
are often called run() or execute(); doit() would work for me too. For me it's
a chipset enable and what we do is run the chipset enable.
NB. I think enable_flash_* is not a good name for these functions in general.
--
To view, visit https://review.coreboot.org/c/flashrom/+/52364
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b3a4ec51ea488c40c20ccafea883f8dea93577d
Gerrit-Change-Number: 52364
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec(a)chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm(a)chromium.org>
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: 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: Thu, 22 Apr 2021 13:59: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>
Comment-In-Reply-To: Anastasia Klimchuk <aklm(a)chromium.org>
Gerrit-MessageType: comment
Nico Huber 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:
(1 comment)
File tests/io_mock.h:
https://review.coreboot.org/c/flashrom/+/52604/comment/39ff6e3a_65e92cea
PS1, Line 6: void (*outb)(unsigned char value, unsigned short port);
Directly passing `priv` to each function would be nicer.
--
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-Comment-Date: Thu, 22 Apr 2021 13:08:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
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/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c
......................................................................
Patch Set 7:
(1 comment)
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/858d0498_0b1fc070
PS6, Line 102: return ((port == 0x2e /* MEC1308_SIO_PORT1 */
: || port == 0x4e /* MEC1308_SIO_PORT2 */)
: ? 0x20 /* MEC1308_DEVICE_ID_REG */
: : ((outb_val == 0x84 /* MEC1308_MBX_DATA_START */)
: ? 0xaa /* MEC1308_CMD_PASSTHRU_SUCCESS */
: : 0));
> I think I mentioned something about a set of function pointers per tested programmer […]
So, CB:52604 is what I had in mind. Feel free to take it over if
it looks useful. The inb/inw/inl pointers are probably not needed
if we'd decide to use will_return()/mock() instead.
--
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: 7
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: Thu, 22 Apr 2021 13:06:01 +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
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/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c
......................................................................
Patch Set 7:
(1 comment)
File hwaccess_io_unittest.h:
PS2:
> I think the `meson.build` should be allowed to cover subdirs generally. For […]
Actually, I've no idea why the tests are declared in the
toplevel `meson.build`. @Edward was there any constraint
that led to it?
--
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: 7
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: Thu, 22 Apr 2021 12:37:46 +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: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c
......................................................................
Patch Set 7:
(1 comment)
File hwaccess_io_unittest.h:
PS2:
> This file is referenced in meson. […]
I think the `meson.build` should be allowed to cover subdirs generally. For
instance if we had an `include/` dir, I guess nobody would complain to
reference that from the toplevel `meson.build`. What makes this a little
odd is that `tests/` has its own `meson.build`, I'll have to check why we
actually need it in the toplevel file.
--
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: 7
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: Thu, 22 Apr 2021 12:33:54 +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: Edward O'Callaghan, Angel Pons, Anastasia Klimchuk.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51487 )
Change subject: tests: Add unit test to run init/shutdown for mec1308.c
......................................................................
Patch Set 7:
(1 comment)
File tests/tests.c:
https://review.coreboot.org/c/flashrom/+/51487/comment/2cf17884_0732a9b5
PS6, Line 102: return ((port == 0x2e /* MEC1308_SIO_PORT1 */
: || port == 0x4e /* MEC1308_SIO_PORT2 */)
: ? 0x20 /* MEC1308_DEVICE_ID_REG */
: : ((outb_val == 0x84 /* MEC1308_MBX_DATA_START */)
: ? 0xaa /* MEC1308_CMD_PASSTHRU_SUCCESS */
: : 0));
> The tricky thing is: inb needs to know what was the value of the last outb call. […]
I think I mentioned something about a set of function pointers per tested programmer
before ;) together with the state that is needed per programmer, that could be moved
out of `tests.c`, closer to the actual test. I'll sketch and push something quickly,
it's easier to show than to explain ^^
It's not a perfect solution. It would rely on global state and that means we could
never test code for multiple programmers in parallel in one process. But I guess
there is no way around it. We basically emulate PC hardware, the ports used by
different programmers could overlap (e.g. 0x2e/0x4e are very common) so we can
only emulate one at a time, or have to run tests in separate processes.
--
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: 7
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: Thu, 22 Apr 2021 12:23:33 +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>
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/+/52499 )
Change subject: hwaccess.h: Split hwaccess.h and extract hwaccess_io.h out of it
......................................................................
Patch Set 4: Code-Review+1
(1 comment)
File hwaccess.h:
https://review.coreboot.org/c/flashrom/+/52499/comment/bb957235_4c2cb836
PS4, Line 113: #if IS_X86
I've only now noticed this. Maybe we should name the new file accordingly,
e.g. `hwaccess_x86_io.h`, `hwaccess_x86.h`?
--
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: 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: 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: Thu, 22 Apr 2021 12:07:32 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment