Move the firmware attributes class helper out of platform/x86, rename
the coreboot-table firmware driver directory from google to coreboot, and
add a coreboot CFR firmware attributes driver.
Changes in v8:
- Add a preparatory include-order cleanup before moving the firmware
attributes class helper.
- Add direct includes for __packed and container_of(), use scoped cleanup
for EFI names and the driver mutex, and document the efivar lock
requirement on private helpers.
- Replace the duplicated CFR record walkers with one checked iterator that
distinguishes malformed input from the end of a record list.
- Validate enum entries before accessing them and propagate malformed child
records instead of treating them as absent.
- Restore the EFI variable after a failed runtime apply without retrying
the failed firmware operation, and only emit a change event when the new
EFI value remains stored.
- Document the possible-values size limit and why CFR entries without a
usable runtime EFI variable are skipped.
Changes in v7:
- Restore the existing include order in converted platform/x86 drivers
and add Oliver's Tested-by to the helper move.
- Use for loops for CFR record walks, document pointer-based value
validation and intentionally ignored record types, and remove a
redundant PAGE_SIZE check.
- Validate the CFR payload checksum before parsing it.
- Make EFI writes transactional, lock EFI reads, and expose settings
read-only when EFI writes are unavailable.
- Skip settings beneath suppressed or dependency-gated forms, propagate
enclosing read-only or inactive state, and bound CFR form nesting.
- Propagate transient probe failures, preserve APM token zero, and reject
enumeration values that cannot fit in the sysfs output buffer.
Testing:
- x86_64 defconfig W=1 build of coreboot-cfr.o on upstream master.
- v7 x86_64 and UML allmodconfig W=1 builds of the driver and helper.
- Runtime APM_CNT apply and reboot-needed behavior on a Star Labs Byte with
firmware 26.07 and Linux 6.17.
Sean Rhodes (4):
platform/x86: Sort firmware attributes class includes
firmware: Move firmware attributes class helper
firmware: Rename google firmware directory to coreboot
firmware: coreboot: Add CFR firmware attributes driver
MAINTAINERS | 18 +-
drivers/firmware/Kconfig | 5 +-
drivers/firmware/Makefile | 3 +-
drivers/firmware/{google => coreboot}/Kconfig | 20 +-
.../firmware/{google => coreboot}/Makefile | 1 +
drivers/firmware/{google => coreboot}/cbmem.c | 0
drivers/firmware/coreboot/coreboot-cfr.c | 1185 +++++++++++++++++
.../{google => coreboot}/coreboot_table.c | 0
.../{google => coreboot}/coreboot_table.h | 0
.../framebuffer-coreboot.c | 0
drivers/firmware/{google => coreboot}/gsmi.c | 0
.../memconsole-coreboot.c | 0
.../memconsole-x86-legacy.c | 0
.../{google => coreboot}/memconsole.c | 0
.../{google => coreboot}/memconsole.h | 6 +-
drivers/firmware/{google => coreboot}/vpd.c | 0
.../{google => coreboot}/vpd_decode.c | 0
.../{google => coreboot}/vpd_decode.h | 0
.../firmware_attributes_class.c | 2 +-
drivers/platform/x86/Kconfig | 3 -
drivers/platform/x86/Makefile | 2 -
drivers/platform/x86/asus-armoury.c | 2 +-
.../x86/dell/dell-wmi-sysman/sysman.c | 9 +-
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 9 +-
drivers/platform/x86/lenovo/think-lmi.c | 5 +-
drivers/platform/x86/lenovo/wmi-other.c | 2 +-
drivers/platform/x86/samsung-galaxybook.c | 3 +-
.../linux/firmware_attributes.h | 6 +-
28 files changed, 1249 insertions(+), 32 deletions(-)
rename drivers/firmware/{google => coreboot}/Kconfig (82%)
rename drivers/firmware/{google => coreboot}/Makefile (92%)
rename drivers/firmware/{google => coreboot}/cbmem.c (100%)
create mode 100644 drivers/firmware/coreboot/coreboot-cfr.c
rename drivers/firmware/{google => coreboot}/coreboot_table.c (100%)
rename drivers/firmware/{google => coreboot}/coreboot_table.h (100%)
rename drivers/firmware/{google => coreboot}/framebuffer-coreboot.c (100%)
rename drivers/firmware/{google => coreboot}/gsmi.c (100%)
rename drivers/firmware/{google => coreboot}/memconsole-coreboot.c (100%)
rename drivers/firmware/{google => coreboot}/memconsole-x86-legacy.c (100%)
rename drivers/firmware/{google => coreboot}/memconsole.c (100%)
rename drivers/firmware/{google => coreboot}/memconsole.h (82%)
rename drivers/firmware/{google => coreboot}/vpd.c (100%)
rename drivers/firmware/{google => coreboot}/vpd_decode.c (100%)
rename drivers/firmware/{google => coreboot}/vpd_decode.h (100%)
rename drivers/{platform/x86 => firmware}/firmware_attributes_class.c (94%)
rename drivers/platform/x86/firmware_attributes_class.h =>
include/linux/firmware_attributes.h (60%)
--
2.53.0