[PATCH v14 0/5] coreboot CFR firmware attributes

From: Sean Rhodes

Date: Tue Sep 01 2026 - 14:56:09 EST


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 v14:
- Rebase on current upstream master after Linux 7.3-rc1, preserving the
intervening coreboot table bounds and CBMEM no-map changes.
- Drop the standalone include-order cleanup. Replace the affected relative
includes directly in the firmware attributes helper move, as requested by
Tzung-Bi.
- Split the DRM coreboot framebuffer dependency update from the firmware
directory and Kconfig rename so it can receive a DRM Acked-by separately.
- Keep the CFR driver and its runtime behavior unchanged from v13.

Changes in v13:
- Rebase on current upstream master.
- Restore the CONFIG_GOOGLE_* to CONFIG_COREBOOT_* renames for generic
coreboot firmware symbols, with the old names kept as transitional
symbols.
Julius clarified that the symbol names are part of the directory rename
cleanup and should describe coreboot rather than Google. Update the
matching Kconfig dependencies and Makefile gates to use the new symbols.
- Split the arm64 defconfig symbol update into a separate final patch, as
requested by Krzysztof and Julius, instead of folding it into the rename.
- Move the COREBOOT FIRMWARE DRIVERS MAINTAINERS entry to its alphabetical
position.
- Make the CFR APM_CNT runtime-apply dependency explicit with HAS_IOPORT
instead of using an x86-only runtime branch.

Changes in v12:
- Temporarily kept the existing CONFIG_GOOGLE_* symbols and dropped the
arm64 defconfig update after review feedback against the user-visible
config rename. v13 supersedes this with transitional symbols and a split
defconfig patch.
- Free invalid enum labels before returning an error from CFR enum parsing.

Changes in v11:
- Keep the scoped cleanup in the CFR driver, but use explicit goto cleanup
for the nested sysfs group registration path.

Changes in v10:
- Rename generic firmware Kconfig symbols from CONFIG_GOOGLE_* to
CONFIG_COREBOOT_* and keep the old names as transitional symbols, as
suggested by Julius.
- Update arm64 defconfig and DRM coreboot framebuffer dependencies for the
new symbols. In v13, the arm64 defconfig update is split into its own
patch; in v14, the DRM dependency is split into its own patch.
- Address the nested cleanup-path review on CFR attribute registration.

Changes in v9:
- Add the missing kstrtox.h include used by kstrtou32().
- Use a single kobject rollback path when setting registration fails.
- Split a few helper locals for readability, including the pending reboot
device lookup and enum-value population.
- Avoid an intermediate void pointer cast while parsing numeric CFR
options.
- Check the possible-values buffer length before computing each label
length.

Changes in v8:
- Add a preparatory include-order cleanup before moving the firmware
attributes class helper. This is superseded by the direct replacements in
v14.
- 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:
- Validate the CFR payload checksum and use bounded record walks. Propagate
malformed input and transient probe failures instead of silently dropping
settings.
- Make EFI writes transactional, serialize EFI reads and writes, and expose
settings read-only when EFI writes are unavailable. Preserve
`pending_reboot` when rollback cannot fully restore a setting.
- Propagate suppressed, dependency-gated, read-only and inactive form
state, and bound form nesting.
- Preserve APM token zero and reject enumerations whose values cannot fit
in the sysfs output buffer.

Earlier revisions:
- Move the driver from platform/x86 to drivers/firmware/coreboot and split
out the firmware-attributes helper move and google-to-coreboot directory
rename, following Julius's review.
- Keep coreboot bus internals and CFR records private, avoid rewriting EFI
variables when the requested value is already active, and store driver
data on the class device instead of in a file-global pointer.
- Use the coreboot-specific device ID header, explicit helper includes,
scoped resource cleanup and device-managed driver state in response to
the initial reviews.

Tested on a Star Labs Byte with firmware 26.07: runtime APM_CNT apply was
verified with power_led, and reboot-needed behavior was verified with
debug_level.

Sean Rhodes (5):
firmware: Move firmware attributes class helper
firmware: Rename google firmware directory to coreboot
drm/sysfb: Update coreboot framebuffer Kconfig symbol
firmware: coreboot: Add CFR firmware attributes driver
arm64: defconfig: Update coreboot firmware symbols

MAINTAINERS | 34 +-
arch/arm64/configs/defconfig | 6 +-
drivers/firmware/Kconfig | 5 +-
drivers/firmware/Makefile | 3 +-
drivers/firmware/{google => coreboot}/Kconfig | 89 +-
drivers/firmware/coreboot/Makefile | 15 +
drivers/firmware/{google => coreboot}/cbmem.c | 0
drivers/firmware/coreboot/coreboot-cfr.c | 1204 +++++++++++++++++
.../{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/firmware/google/Makefile | 14 -
drivers/gpu/drm/sysfb/Kconfig | 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 | 2 +-
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c | 2 +-
drivers/platform/x86/lenovo/think-lmi.c | 2 +-
drivers/platform/x86/lenovo/wmi-other.c | 2 +-
drivers/platform/x86/samsung-galaxybook.c | 2 +-
.../linux/firmware_attributes.h | 6 +-
31 files changed, 1337 insertions(+), 66 deletions(-)
rename drivers/firmware/{google => coreboot}/Kconfig (57%)
create mode 100644 drivers/firmware/coreboot/Makefile
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%)
delete mode 100644 drivers/firmware/google/Makefile
rename drivers/platform/x86/firmware_attributes_class.h => include/linux/firmware_attributes.h (60%)