Attention is currently required from: Lean Sheng Tan. Abel Briggs has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/64012 )
Change subject: ec/acpi: Refactor to reduce code duplication, use named constants ......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
has this been tested with any hardware?
Not yet. I am currently in the process of rebasing the WIP patchset for the (currently unsupported) Lenovo mainboard I have in order to test the general refactoring changes in this patchset, but for other affected boards, I would need to consult the mailing list for willing testers to ensure there are no regressions. I can move this back to WIP until I have testing artifacts, if that's preferred.
The rationale for this patchset was that I needed to factor out the EC of `mb/lenovo/s230u` into its own standalone folder to reuse it for my mainboard, but after seeing the current state of various standalone ECs, I was not comfortable duplicating code.
Semantically, this patchset (at least, this commit) should behave identically to master in cases where the UUT has a known-working EC which follows the standard EC hardware API. If the EC is non-functional, the `send` and `recv` functions will now avoid reading and writing to I/O space.
The vast majority of callers on these functions do not read the return value and effectively do not care about errors, so this patch should change little (they're already invoking the equivalent of undefined behavior if the EC fails). For the callers which do care about errors, we should try to ensure correct behavior.
I could not find a rationale as to why the return statements were commented out in the original implementation of these functions.