Re: [PATCH v2 1/1] platform/x86: Add coreboot CFR firmware attributes
From: Julius Werner
Date: Thu Jul 09 2026 - 17:45:22 EST
On Thu, Jul 9, 2026 at 5:50 AM Sean Rhodes <sean@starlabs.systems> wrote:
>
> coreboot can publish a CFR tree in its coreboot table to describe
> firmware setup options. Add a firmware-attributes driver for that table
> entry and move the coreboot table bus definitions into <linux/coreboot.h>
> so the driver can bind from outside drivers/firmware/google.
>
> The driver exposes runtime EFI variable-backed boolean, enum and integer
> settings through the firmware-attributes ABI. It only registers settings
> with readable runtime EFI variables, skips suppressed, volatile,
> dependency-gated and non-runtime options, and keeps read-only or inactive
> options read-only in sysfs.
>
> For settings with an APM_CNT runtime-apply record, write the EFI variable
> and ask firmware to apply the setting immediately. If firmware reports a
> failure, restore the old EFI variable value. Settings without a runtime
> apply hook keep the EFI variable update and set pending_reboot.
>
> Tested on a Star Labs Byte with firmware 26.07 and the driver built as a
> module against Linux 6.17: runtime APM_CNT apply was verified with
> power_led, and reboot-needed behavior was verified with debug_level.
>
> Link: https://doc.coreboot.org/drivers/cfr.html
> Link: https://doc.coreboot.org/drivers/cfr_internal.html
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
> MAINTAINERS | 6 +
> drivers/firmware/google/coreboot_table.h | 45 --
> drivers/platform/x86/Kconfig | 13 +
> drivers/platform/x86/Makefile | 1 +
> drivers/platform/x86/coreboot-cfr.c | 986 +++++++++++++++++++++++
> include/linux/coreboot.h | 147 ++++
> 6 files changed, 1153 insertions(+), 45 deletions(-)
> create mode 100644 drivers/platform/x86/coreboot-cfr.c
Is there a specific reason to put this under platform/x86, or are you
just doing that because it's not related to Google? If so I think it's
just time to rename the directory from drivers/firmware/google to
drivers/firmware/coreboot, and then you could just put it next to the
other drivers. The only thing that's still completely unrelated to
coreboot in there is memconsole-legacy.c, but since it's piggy-backing
off the same buffer format as memconsole-coreboot.c I think it would
be fine to just leave it there anyway.