Skip to contentSkip to conversation

coreboot CFR firmware attributes

PATCH Superseded Sean Rhodes 4 participants 7 messages Jul 10

Subsystems (11)

v3 of 14 Superseded Latest is v14 →

lore
Share & tools
lore

Sean Rhodes

author maintainer
#0 lore raw

v3 cover coreboot CFR firmware attributes

Hi,

This series adds a coreboot CFR firmware-attributes driver.

v3 addresses Julius's review feedback that this does not belong under platform/x86. The driver now lives under drivers/firmware/coreboot/, next to the existing coreboot table consumers. To support that, the firmware-attributes class helper is moved from drivers/platform/x86 to drivers/firmware.

The series also renames drivers/firmware/google to drivers/firmware/coreboot, because the drivers in that directory are coreboot table drivers rather than Google-specific firmware drivers. The existing CONFIG_GOOGLE_* symbols are intentionally kept to avoid user configuration churn.

The CFR driver uses the existing firmware-attributes ABI. It exposes runtime EFI variable-backed boolean, enum and integer options, skips suppressed, volatile, dependency-gated and non-runtime options, and keeps read-only or inactive options read-only in sysfs.

For CFR runtime-apply metadata using APM_CNT, x86 systems can apply a setting immediately after writing the EFI variable. Non-x86 builds keep the EFI write and report pending_reboot.

Changes in v3:
- Move the driver from platform/x86 to drivers/firmware/coreboot.
- Split out the firmware-attributes class helper move.
- Rename drivers/firmware/google to drivers/firmware/coreboot.
- Keep CONFIG_GOOGLE_* symbols unchanged.
- Keep coreboot bus internals private to drivers/firmware/coreboot.
- Keep CFR record definitions private to the CFR driver.
- Avoid rewriting EFI variables when userspace writes the current value.

Testing:
- Tested on a Star Labs Byte with firmware 26.07 and the driver built as a module against Linux 6.17.
- Verified runtime APM_CNT apply with power_led.
- Verified reboot-needed behavior with debug_level.
- Built x86 objects with W=1 for the CFR/coreboot/helper path and touched platform-x86 firmware-attributes users.
- Built ARM64 objects with clang for the CFR/coreboot/helper path.
- Passed git diff --check and scripts/checkpatch.pl --strict.

Sean Rhodes (3):
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 |   19 +-
 .../firmware/{google => coreboot}/Makefile    |    1 +
 drivers/firmware/{google => coreboot}/cbmem.c |    0
 drivers/firmware/coreboot/coreboot-cfr.c      | 1068 +++++++++++++++++
 .../{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         |    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 +-
 28 files changed, 1120 insertions(+), 25 deletions(-)
 rename drivers/firmware/{google => coreboot}/Kconfig (83%)
 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%)
author maintainer
#1 lore raw

PATCH v3 1/3 firmware: Move firmware attributes class helper

Move the firmware attributes class helper from drivers/platform/x86 to drivers/firmware and expose its class declaration through a public Linux header.

The helper is not x86-specific. Keeping it in firmware lets coreboot firmware drivers use the standard firmware-attributes ABI without living under platform/x86.

---
 MAINTAINERS                                               | 8 ++++++++
 drivers/firmware/Kconfig                                  | 3 +++
 drivers/firmware/Makefile                                 | 1 +
 .../x86 => firmware}/firmware_attributes_class.c          | 2 +-
 drivers/platform/x86/Kconfig                              | 3 ---
 drivers/platform/x86/Makefile                             | 2 --
 drivers/platform/x86/asus-armoury.c                       | 2 +-
 drivers/platform/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 +++---
 13 files changed, 22 insertions(+), 15 deletions(-)
 rename drivers/{platform/x86 => firmware}/firmware_attributes_class.c (94%)
 rename drivers/platform/x86/firmware_attributes_class.h => include/linux/firmware_attributes.h (60%)
MAINTAINERS +8 -0
index 15011f5752a9..ec0a12121357 100644
@@ -10114,6 +10114,14 @@ F:	include/linux/firewire.h
 F:	include/uapi/linux/firewire*.h
 F:	tools/firewire/
 
+FIRMWARE ATTRIBUTES CLASS
+M:	Hans de Goede <[email protected]>
+M:	Ilpo Järvinen <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/firmware/firmware_attributes_class.c
+F:	include/linux/firmware_attributes.h
+
 FIRMWARE FRAMEWORK FOR ARMV8-A
 M:	Sudeep Holla <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/firmware/Kconfig +3 -0
index 12dc70254842..78a239f8bbef 100644
@@ -8,6 +8,9 @@ menu "Firmware Drivers"
 
 source "drivers/firmware/arm_scmi/Kconfig"
 
+config FW_ATTR_CLASS
+	tristate
+
 config ARM_SCPI_PROTOCOL
 	tristate "ARM System Control and Power Interface (SCPI) Message Protocol"
 	depends on ARM || ARM64 || COMPILE_TEST
drivers/firmware/Makefile +1 -0
index 4ddec2820c96..385b6e8b7fc6 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP)	+= memmap.o
 obj-$(CONFIG_MTK_ADSP_IPC)	+= mtk-adsp-ipc.o
 obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
 obj-$(CONFIG_FW_CFG_SYSFS)	+= qemu_fw_cfg.o
+obj-$(CONFIG_FW_ATTR_CLASS)	+= firmware_attributes_class.o
 obj-$(CONFIG_SYSFB)		+= sysfb.o
 obj-$(CONFIG_SYSFB_SIMPLEFB)	+= sysfb_simplefb.o
 obj-$(CONFIG_TH1520_AON_PROTOCOL) += thead,th1520-aon.o
drivers/firmware/firmware_attributes_class.c renamed from drivers/platform/x86/firmware_attributes_class.c +1 -1
similarity index 94%
rename from drivers/platform/x86/firmware_attributes_class.c
rename to drivers/firmware/firmware_attributes_class.c
index 736e96c186d9..503ecc288086 100644
@@ -3,7 +3,7 @@
 /* Firmware attributes class helper module */
 
 #include <linux/module.h>
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 const struct class firmware_attributes_class = {
 	.name = "firmware-attributes",
drivers/platform/x86/Kconfig +0 -3
index b54b5212b204..beed14c38b54 100644
@@ -926,9 +926,6 @@ config DASHARO_ACPI
 
 source "drivers/platform/x86/x86-android-tablets/Kconfig"
 
-config FW_ATTR_CLASS
-	tristate
-
 config INTEL_IMR
 	bool "Intel Isolated Memory Region support"
 	depends on X86_INTEL_QUARK && IOSF_MBI
drivers/platform/x86/Makefile +0 -2
index 872ac3842391..cab20a4145e3 100644
@@ -63,8 +63,6 @@ obj-$(CONFIG_X86_PLATFORM_DRIVERS_HP)	+= hp/
 # Hewlett Packard Enterprise
 obj-$(CONFIG_UV_SYSFS)       += uv_sysfs.o
 
-obj-$(CONFIG_FW_ATTR_CLASS)	+= firmware_attributes_class.o
-
 # IBM Thinkpad (before 2005)
 obj-$(CONFIG_IBM_RTL)		+= ibm_rtl.o
 obj-$(CONFIG_SENSORS_HDAPS)	+= hdaps.o
drivers/platform/x86/asus-armoury.c +1 -1
index 495dc1e31d40..93fac0d464d2 100644
@@ -34,7 +34,7 @@
 #include <linux/sysfs.h>
 
 #include "asus-armoury.h"
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
 
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +1 -1
index ab46a023cc34..85670be01647 100644
@@ -16,7 +16,7 @@
 #include <linux/sysfs.h>
 #include <linux/wmi.h>
 #include "dell-wmi-sysman.h"
-#include "../../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define MAX_TYPES  4
 #include <linux/nls.h>
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +1 -1
index 27fd6cd21529..44314ae4e5e3 100644
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/wmi.h>
 #include "bioscfg.h"
-#include "../../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 #include <linux/nls.h>
 #include <linux/errno.h>
 
drivers/platform/x86/lenovo/think-lmi.c +1 -1
index e215e86e3db7..a56f152b5f28 100644
@@ -20,7 +20,7 @@
 #include <linux/types.h>
 #include <linux/dmi.h>
 #include <linux/wmi.h>
-#include "../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 #include "think-lmi.h"
 
 static bool debug_support;
drivers/platform/x86/lenovo/wmi-other.c +1 -1
index fbb32bf404f2..e9a2c4684e5f 100644
@@ -50,7 +50,7 @@
 #include "wmi-capdata.h"
 #include "wmi-events.h"
 #include "wmi-helpers.h"
-#include "../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define LENOVO_OTHER_MODE_GUID "DC2A8805-3A8C-41BA-A6F7-092E0089CD3B"
 
drivers/platform/x86/samsung-galaxybook.c +1 -1
index 6382af0b106c..74b8c887dd79 100644
@@ -28,7 +28,7 @@
 #include <linux/uuid.h>
 #include <linux/workqueue.h>
 #include <acpi/battery.h>
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define DRIVER_NAME "samsung-galaxybook"
 
include/linux/firmware_attributes.h renamed from drivers/platform/x86/firmware_attributes_class.h +3 -3
similarity index 60%
rename from drivers/platform/x86/firmware_attributes_class.h
rename to include/linux/firmware_attributes.h
index d27abe54fcf9..d4026ba1fcc2 100644
@@ -2,11 +2,11 @@
 
 /* Firmware attributes class helper module */
 
-#ifndef FW_ATTR_CLASS_H
-#define FW_ATTR_CLASS_H
+#ifndef _LINUX_FIRMWARE_ATTRIBUTES_H
+#define _LINUX_FIRMWARE_ATTRIBUTES_H
 
 #include <linux/device/class.h>
 
 extern const struct class firmware_attributes_class;
 
-#endif /* FW_ATTR_CLASS_H */
+#endif /* _LINUX_FIRMWARE_ATTRIBUTES_H */
maintainer Reviewed-by on v3 1/3
#2 lore raw

Re: [PATCH v3 1/3] firmware: Move firmware attributes class helper

Quoted 216 lines · Sean Rhodes

Move the firmware attributes class helper from drivers/platform/x86 to drivers/firmware and expose its class declaration through a public Linux header.

The helper is not x86-specific. Keeping it in firmware lets coreboot firmware drivers use the standard firmware-attributes ABI without living under platform/x86.

---
 MAINTAINERS                                               | 8 ++++++++
 drivers/firmware/Kconfig                                  | 3 +++
 drivers/firmware/Makefile                                 | 1 +
 .../x86 => firmware}/firmware_attributes_class.c          | 2 +-
 drivers/platform/x86/Kconfig                              | 3 ---
 drivers/platform/x86/Makefile                             | 2 --
 drivers/platform/x86/asus-armoury.c                       | 2 +-
 drivers/platform/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 +++---
 13 files changed, 22 insertions(+), 15 deletions(-)
 rename drivers/{platform/x86 => firmware}/firmware_attributes_class.c 
(94%)
 rename drivers/platform/x86/firmware_attributes_class.h => 

include/linux/firmware_attributes.h (60%)

MAINTAINERS +8 -0
index 15011f5752a9..ec0a12121357 100644
@@ -10114,6 +10114,14 @@ F:	include/linux/firewire.h
 F:	include/uapi/linux/firewire*.h
 F:	tools/firewire/
 
+FIRMWARE ATTRIBUTES CLASS
+M:	Hans de Goede <[email protected]>
+M:	Ilpo Järvinen <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/firmware/firmware_attributes_class.c
+F:	include/linux/firmware_attributes.h
+
 FIRMWARE FRAMEWORK FOR ARMV8-A
 M:	Sudeep Holla <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
drivers/firmware/Kconfig +3 -0
index 12dc70254842..78a239f8bbef 100644
@@ -8,6 +8,9 @@ menu "Firmware Drivers"
 
 source "drivers/firmware/arm_scmi/Kconfig"
 
+config FW_ATTR_CLASS
+	tristate
+
 config ARM_SCPI_PROTOCOL
 	tristate "ARM System Control and Power Interface (SCPI) Message 

Protocol"

drivers/firmware/Kconfig +0 -0
 	depends on ARM || ARM64 || COMPILE_TEST
drivers/firmware/Makefile +1 -0
index 4ddec2820c96..385b6e8b7fc6 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_FIRMWARE_MEMMAP)	+= memmap.o
 obj-$(CONFIG_MTK_ADSP_IPC)	+= mtk-adsp-ipc.o
 obj-$(CONFIG_RASPBERRYPI_FIRMWARE) += raspberrypi.o
 obj-$(CONFIG_FW_CFG_SYSFS)	+= qemu_fw_cfg.o
+obj-$(CONFIG_FW_ATTR_CLASS)	+= firmware_attributes_class.o
 obj-$(CONFIG_SYSFB)		+= sysfb.o
 obj-$(CONFIG_SYSFB_SIMPLEFB)	+= sysfb_simplefb.o
 obj-$(CONFIG_TH1520_AON_PROTOCOL) += thead,th1520-aon.o
drivers/firmware/firmware_attributes_class.c renamed from drivers/platform/x86/firmware_attributes_class.c +1 -1
similarity index 94%
rename from drivers/platform/x86/firmware_attributes_class.c
rename to drivers/firmware/firmware_attributes_class.c
index 736e96c186d9..503ecc288086 100644
@@ -3,7 +3,7 @@
 /* Firmware attributes class helper module */
 
 #include <linux/module.h>
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 const struct class firmware_attributes_class = {
 	.name = "firmware-attributes",
drivers/platform/x86/Kconfig +0 -3
index b54b5212b204..beed14c38b54 100644
@@ -926,9 +926,6 @@ config DASHARO_ACPI
 
 source "drivers/platform/x86/x86-android-tablets/Kconfig"
 
-config FW_ATTR_CLASS
-	tristate
-
 config INTEL_IMR
 	bool "Intel Isolated Memory Region support"
 	depends on X86_INTEL_QUARK && IOSF_MBI
drivers/platform/x86/Makefile +0 -2
index 872ac3842391..cab20a4145e3 100644
@@ -63,8 +63,6 @@ obj-$(CONFIG_X86_PLATFORM_DRIVERS_HP)	+= hp/
 # Hewlett Packard Enterprise
 obj-$(CONFIG_UV_SYSFS)       += uv_sysfs.o
 
-obj-$(CONFIG_FW_ATTR_CLASS)	+= firmware_attributes_class.o
-
 # IBM Thinkpad (before 2005)
 obj-$(CONFIG_IBM_RTL)		+= ibm_rtl.o
 obj-$(CONFIG_SENSORS_HDAPS)	+= hdaps.o
drivers/platform/x86/asus-armoury.c +1 -1
index 495dc1e31d40..93fac0d464d2 100644
@@ -34,7 +34,7 @@
 #include <linux/sysfs.h>
 
 #include "asus-armoury.h"
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define ASUS_NB_WMI_EVENT_GUID "0B3CBB35-E3C2-45ED-91C2-4C5A6D195D1C"
 
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c +1 -1
index ab46a023cc34..85670be01647 100644
@@ -16,7 +16,7 @@
 #include <linux/sysfs.h>
 #include <linux/wmi.h>
 #include "dell-wmi-sysman.h"
-#include "../../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define MAX_TYPES  4
 #include <linux/nls.h>
drivers/platform/x86/hp/hp-bioscfg/bioscfg.c +1 -1
index 27fd6cd21529..44314ae4e5e3 100644
@@ -14,7 +14,7 @@
 #include <linux/string.h>
 #include <linux/wmi.h>
 #include "bioscfg.h"
-#include "../../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 #include <linux/nls.h>
 #include <linux/errno.h>
 
drivers/platform/x86/lenovo/think-lmi.c +1 -1
index e215e86e3db7..a56f152b5f28 100644
@@ -20,7 +20,7 @@
 #include <linux/types.h>
 #include <linux/dmi.h>
 #include <linux/wmi.h>
-#include "../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 #include "think-lmi.h"
 
 static bool debug_support;
drivers/platform/x86/lenovo/wmi-other.c +1 -1
index fbb32bf404f2..e9a2c4684e5f 100644
@@ -50,7 +50,7 @@
 #include "wmi-capdata.h"
 #include "wmi-events.h"
 #include "wmi-helpers.h"
-#include "../firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define LENOVO_OTHER_MODE_GUID "DC2A8805-3A8C-41BA-A6F7-092E0089CD3B"
 
drivers/platform/x86/samsung-galaxybook.c +1 -1
index 6382af0b106c..74b8c887dd79 100644
@@ -28,7 +28,7 @@
 #include <linux/uuid.h>
 #include <linux/workqueue.h>
 #include <acpi/battery.h>
-#include "firmware_attributes_class.h"
+#include <linux/firmware_attributes.h>
 
 #define DRIVER_NAME "samsung-galaxybook"
 
include/linux/firmware_attributes.h renamed from drivers/platform/x86/firmware_attributes_class.h +0 -1
similarity index 60%
rename from drivers/platform/x86/firmware_attributes_class.h
rename to include/linux/firmware_attributes.h
index d27abe54fcf9..d4026ba1fcc2 100644
@@ -2,11 +2,11 @@
 
 /* Firmware attributes class helper module */
 
-#ifndef FW_ATTR_CLASS_H

include/linux/firmware_attributes.h line 12

Quoted 10 lines
include/linux/firmware_attributes.h renamed from drivers/platform/x86/firmware_attributes_class.h +3 -2
-#define FW_ATTR_CLASS_H
+#ifndef _LINUX_FIRMWARE_ATTRIBUTES_H
+#define _LINUX_FIRMWARE_ATTRIBUTES_H
 
 #include <linux/device/class.h>
 
 extern const struct class firmware_attributes_class;
 
-#endif /* FW_ATTR_CLASS_H */
+#endif /* _LINUX_FIRMWARE_ATTRIBUTES_H */

Looks good to me.

Mark

author maintainer
#3 lore raw

PATCH v3 2/3 firmware: Rename google firmware directory to coreboot

In reply to Sean Rhodes

Most drivers in drivers/firmware/google are coreboot table drivers rather than Google-specific firmware drivers. Rename the directory to coreboot and update the Kconfig prompt, build path and maintainer entry.

Keep the existing CONFIG_GOOGLE_* symbols to avoid user configuration churn in this mechanical move.

---
 MAINTAINERS                                                 | 4 ++--
 drivers/firmware/Kconfig                                    | 2 +-
 drivers/firmware/Makefile                                   | 2 +-
 drivers/firmware/{google => coreboot}/Kconfig               | 6 +++---
 drivers/firmware/{google => coreboot}/Makefile              | 0
 drivers/firmware/{google => coreboot}/cbmem.c               | 0
 drivers/firmware/{google => coreboot}/coreboot_table.c      | 0
 drivers/firmware/{google => coreboot}/coreboot_table.h      | 0
 .../firmware/{google => coreboot}/framebuffer-coreboot.c    | 0
 drivers/firmware/{google => coreboot}/gsmi.c                | 0
 drivers/firmware/{google => coreboot}/memconsole-coreboot.c | 0
 .../firmware/{google => coreboot}/memconsole-x86-legacy.c   | 0
 drivers/firmware/{google => coreboot}/memconsole.c          | 0
 drivers/firmware/{google => coreboot}/memconsole.h          | 6 +++---
 drivers/firmware/{google => coreboot}/vpd.c                 | 0
 drivers/firmware/{google => coreboot}/vpd_decode.c          | 0
 drivers/firmware/{google => coreboot}/vpd_decode.h          | 0
 17 files changed, 10 insertions(+), 10 deletions(-)
 rename drivers/firmware/{google => coreboot}/Kconfig (94%)
 rename drivers/firmware/{google => coreboot}/Makefile (100%)
 rename drivers/firmware/{google => coreboot}/cbmem.c (100%)
 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%)
MAINTAINERS +2 -2
index ec0a12121357..01344fc92253 100644
@@ -11068,14 +11068,14 @@ S:	Maintained
 F:	Documentation/networking/device_drivers/ethernet/google/gve.rst
 F:	drivers/net/ethernet/google
 
-GOOGLE FIRMWARE DRIVERS
+COREBOOT FIRMWARE DRIVERS
 M:	Tzung-Bi Shih <[email protected]>
 R:	Brian Norris <[email protected]>
 R:	Julius Werner <[email protected]>
 L:	[email protected]
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git
-F:	drivers/firmware/google/
+F:	drivers/firmware/coreboot/
 F:	include/linux/coreboot.h
 
 GOOGLE TENSOR SoC SUPPORT
drivers/firmware/Kconfig +1 -1
index 78a239f8bbef..4df0a0ad18b8 100644
@@ -293,7 +293,7 @@ endif # TURRIS_MOX_RWTM
 source "drivers/firmware/arm_ffa/Kconfig"
 source "drivers/firmware/broadcom/Kconfig"
 source "drivers/firmware/cirrus/Kconfig"
-source "drivers/firmware/google/Kconfig"
+source "drivers/firmware/coreboot/Kconfig"
 source "drivers/firmware/efi/Kconfig"
 source "drivers/firmware/imx/Kconfig"
 source "drivers/firmware/meson/Kconfig"
drivers/firmware/Makefile +1 -1
index 385b6e8b7fc6..7a8fc3eeb3f0 100644
@@ -30,7 +30,7 @@ obj-y				+= broadcom/
 obj-y				+= cirrus/
 obj-y				+= meson/
 obj-y				+= microchip/
-obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
+obj-$(CONFIG_GOOGLE_FIRMWARE)	+= coreboot/
 obj-y				+= efi/
 obj-y				+= imx/
 obj-y				+= psci/
drivers/firmware/coreboot/Kconfig renamed from drivers/firmware/google/Kconfig +3 -3
similarity index 94%
rename from drivers/firmware/google/Kconfig
rename to drivers/firmware/coreboot/Kconfig
index b78c644fa253..b248bafe8b6b 100644
@@ -1,10 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0-only
 menuconfig GOOGLE_FIRMWARE
-	bool "Google Firmware Drivers"
+	bool "coreboot firmware drivers"
 	default n
 	help
-	  These firmware drivers are used by Google servers,
-	  Chromebooks and other devices using coreboot firmware.
+	  These firmware drivers are used by devices running coreboot
+	  firmware, including Chromebooks and some Google servers.
 	  If in doubt, say "N".
 
 if GOOGLE_FIRMWARE
drivers/firmware/coreboot/Makefile renamed from drivers/firmware/google/Makefile +0 -0
similarity index 100%
rename from drivers/firmware/google/Makefile
rename to drivers/firmware/coreboot/Makefile
drivers/firmware/coreboot/cbmem.c renamed from drivers/firmware/google/cbmem.c +0 -0
similarity index 100%
rename from drivers/firmware/google/cbmem.c
rename to drivers/firmware/coreboot/cbmem.c
drivers/firmware/coreboot/coreboot_table.c renamed from drivers/firmware/google/coreboot_table.c +0 -0
similarity index 100%
rename from drivers/firmware/google/coreboot_table.c
rename to drivers/firmware/coreboot/coreboot_table.c
drivers/firmware/coreboot/coreboot_table.h renamed from drivers/firmware/google/coreboot_table.h +0 -0
similarity index 100%
rename from drivers/firmware/google/coreboot_table.h
rename to drivers/firmware/coreboot/coreboot_table.h
drivers/firmware/coreboot/framebuffer-coreboot.c renamed from drivers/firmware/google/framebuffer-coreboot.c +0 -0
similarity index 100%
rename from drivers/firmware/google/framebuffer-coreboot.c
rename to drivers/firmware/coreboot/framebuffer-coreboot.c
drivers/firmware/coreboot/gsmi.c renamed from drivers/firmware/google/gsmi.c +0 -0
similarity index 100%
rename from drivers/firmware/google/gsmi.c
rename to drivers/firmware/coreboot/gsmi.c
drivers/firmware/coreboot/memconsole-coreboot.c renamed from drivers/firmware/google/memconsole-coreboot.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole-coreboot.c
rename to drivers/firmware/coreboot/memconsole-coreboot.c
drivers/firmware/coreboot/memconsole-x86-legacy.c renamed from drivers/firmware/google/memconsole-x86-legacy.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole-x86-legacy.c
rename to drivers/firmware/coreboot/memconsole-x86-legacy.c
drivers/firmware/coreboot/memconsole.c renamed from drivers/firmware/google/memconsole.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole.c
rename to drivers/firmware/coreboot/memconsole.c
drivers/firmware/coreboot/memconsole.h renamed from drivers/firmware/google/memconsole.h +3 -3
similarity index 82%
rename from drivers/firmware/google/memconsole.h
rename to drivers/firmware/coreboot/memconsole.h
index aaff2b72b606..58899c2abaaa 100644
@@ -7,8 +7,8 @@
  * Copyright 2017 Google Inc.
  */
 
-#ifndef __FIRMWARE_GOOGLE_MEMCONSOLE_H
-#define __FIRMWARE_GOOGLE_MEMCONSOLE_H
+#ifndef __FIRMWARE_COREBOOT_MEMCONSOLE_H
+#define __FIRMWARE_COREBOOT_MEMCONSOLE_H
 
 #include <linux/types.h>
 
@@ -33,4 +33,4 @@ int memconsole_sysfs_init(void);
  */
 void memconsole_exit(void);
 
-#endif /* __FIRMWARE_GOOGLE_MEMCONSOLE_H */
+#endif /* __FIRMWARE_COREBOOT_MEMCONSOLE_H */
drivers/firmware/coreboot/vpd.c renamed from drivers/firmware/google/vpd.c +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd.c
rename to drivers/firmware/coreboot/vpd.c
drivers/firmware/coreboot/vpd_decode.c renamed from drivers/firmware/google/vpd_decode.c +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd_decode.c
rename to drivers/firmware/coreboot/vpd_decode.c
drivers/firmware/coreboot/vpd_decode.h renamed from drivers/firmware/google/vpd_decode.h +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd_decode.h
rename to drivers/firmware/coreboot/vpd_decode.h
#4 lore raw

Re: [PATCH v3 2/3] firmware: Rename google firmware directory to coreboot

Hi

Am 10.07.26 um 08:12 schrieb Sean Rhodes:

Quoted 6 lines

Most drivers in drivers/firmware/google are coreboot table drivers rather than Google-specific firmware drivers. Rename the directory to coreboot and update the Kconfig prompt, build path and maintainer entry.

Keep the existing CONFIG_GOOGLE_* symbols to avoid user configuration churn in this mechanical move.

You can use 'transitional' for easily renaming Kconfig options.

https://elixir.bootlin.com/linux/v7.1.2/source/Documentation/kbuild/kconfig-language.rst#L245

Best regards
Thomas

Quoted 176 lines
---
  MAINTAINERS                                                 | 4 ++--
  drivers/firmware/Kconfig                                    | 2 +-
  drivers/firmware/Makefile                                   | 2 +-
  drivers/firmware/{google => coreboot}/Kconfig               | 6 +++---
  drivers/firmware/{google => coreboot}/Makefile              | 0
  drivers/firmware/{google => coreboot}/cbmem.c               | 0
  drivers/firmware/{google => coreboot}/coreboot_table.c      | 0
  drivers/firmware/{google => coreboot}/coreboot_table.h      | 0
  .../firmware/{google => coreboot}/framebuffer-coreboot.c    | 0
  drivers/firmware/{google => coreboot}/gsmi.c                | 0
  drivers/firmware/{google => coreboot}/memconsole-coreboot.c | 0
  .../firmware/{google => coreboot}/memconsole-x86-legacy.c   | 0
  drivers/firmware/{google => coreboot}/memconsole.c          | 0
  drivers/firmware/{google => coreboot}/memconsole.h          | 6 +++---
  drivers/firmware/{google => coreboot}/vpd.c                 | 0
  drivers/firmware/{google => coreboot}/vpd_decode.c          | 0
  drivers/firmware/{google => coreboot}/vpd_decode.h          | 0
  17 files changed, 10 insertions(+), 10 deletions(-)

rename drivers/firmware/{google => coreboot}/Kconfig (94%) rename drivers/firmware/{google => coreboot}/Makefile (100%) rename drivers/firmware/{google => coreboot}/cbmem.c (100%) 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%)

MAINTAINERS +2 -2
index ec0a12121357..01344fc92253 100644
@@ -11068,14 +11068,14 @@ S:	Maintained
  F:	Documentation/networking/device_drivers/ethernet/google/gve.rst
  F:	drivers/net/ethernet/google
 
-GOOGLE FIRMWARE DRIVERS
+COREBOOT FIRMWARE DRIVERS
  M:	Tzung-Bi Shih <[email protected]>
  R:	Brian Norris <[email protected]>
  R:	Julius Werner <[email protected]>
  L:	[email protected]
  S:	Maintained
  T:	git git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git
-F:	drivers/firmware/google/
+F:	drivers/firmware/coreboot/
  F:	include/linux/coreboot.h
 
  GOOGLE TENSOR SoC SUPPORT
drivers/firmware/Kconfig +1 -1
index 78a239f8bbef..4df0a0ad18b8 100644
@@ -293,7 +293,7 @@ endif # TURRIS_MOX_RWTM
  source "drivers/firmware/arm_ffa/Kconfig"
  source "drivers/firmware/broadcom/Kconfig"
  source "drivers/firmware/cirrus/Kconfig"
-source "drivers/firmware/google/Kconfig"
+source "drivers/firmware/coreboot/Kconfig"
  source "drivers/firmware/efi/Kconfig"
  source "drivers/firmware/imx/Kconfig"
  source "drivers/firmware/meson/Kconfig"
drivers/firmware/Makefile +1 -1
index 385b6e8b7fc6..7a8fc3eeb3f0 100644
@@ -30,7 +30,7 @@ obj-y				+= broadcom/
  obj-y				+= cirrus/
  obj-y				+= meson/
  obj-y				+= microchip/
-obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
+obj-$(CONFIG_GOOGLE_FIRMWARE)	+= coreboot/
  obj-y				+= efi/
  obj-y				+= imx/
  obj-y				+= psci/
drivers/firmware/coreboot/Kconfig renamed from drivers/firmware/google/Kconfig +3 -3
similarity index 94%
rename from drivers/firmware/google/Kconfig
rename to drivers/firmware/coreboot/Kconfig
index b78c644fa253..b248bafe8b6b 100644
@@ -1,10 +1,10 @@
  # SPDX-License-Identifier: GPL-2.0-only
  menuconfig GOOGLE_FIRMWARE
-	bool "Google Firmware Drivers"
+	bool "coreboot firmware drivers"
  	default n
  	help
-	  These firmware drivers are used by Google servers,
-	  Chromebooks and other devices using coreboot firmware.
+	  These firmware drivers are used by devices running coreboot
+	  firmware, including Chromebooks and some Google servers.
  	  If in doubt, say "N".
 
  if GOOGLE_FIRMWARE
drivers/firmware/coreboot/Makefile renamed from drivers/firmware/google/Makefile +0 -0
similarity index 100%
rename from drivers/firmware/google/Makefile
rename to drivers/firmware/coreboot/Makefile
drivers/firmware/coreboot/cbmem.c renamed from drivers/firmware/google/cbmem.c +0 -0
similarity index 100%
rename from drivers/firmware/google/cbmem.c
rename to drivers/firmware/coreboot/cbmem.c
drivers/firmware/coreboot/coreboot_table.c renamed from drivers/firmware/google/coreboot_table.c +0 -0
similarity index 100%
rename from drivers/firmware/google/coreboot_table.c
rename to drivers/firmware/coreboot/coreboot_table.c
drivers/firmware/coreboot/coreboot_table.h renamed from drivers/firmware/google/coreboot_table.h +0 -0
similarity index 100%
rename from drivers/firmware/google/coreboot_table.h
rename to drivers/firmware/coreboot/coreboot_table.h
drivers/firmware/coreboot/framebuffer-coreboot.c renamed from drivers/firmware/google/framebuffer-coreboot.c +0 -0
similarity index 100%
rename from drivers/firmware/google/framebuffer-coreboot.c
rename to drivers/firmware/coreboot/framebuffer-coreboot.c
drivers/firmware/coreboot/gsmi.c renamed from drivers/firmware/google/gsmi.c +0 -0
similarity index 100%
rename from drivers/firmware/google/gsmi.c
rename to drivers/firmware/coreboot/gsmi.c
drivers/firmware/coreboot/memconsole-coreboot.c renamed from drivers/firmware/google/memconsole-coreboot.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole-coreboot.c
rename to drivers/firmware/coreboot/memconsole-coreboot.c
drivers/firmware/coreboot/memconsole-x86-legacy.c renamed from drivers/firmware/google/memconsole-x86-legacy.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole-x86-legacy.c
rename to drivers/firmware/coreboot/memconsole-x86-legacy.c
drivers/firmware/coreboot/memconsole.c renamed from drivers/firmware/google/memconsole.c +0 -0
similarity index 100%
rename from drivers/firmware/google/memconsole.c
rename to drivers/firmware/coreboot/memconsole.c
drivers/firmware/coreboot/memconsole.h renamed from drivers/firmware/google/memconsole.h +3 -3
similarity index 82%
rename from drivers/firmware/google/memconsole.h
rename to drivers/firmware/coreboot/memconsole.h
index aaff2b72b606..58899c2abaaa 100644
@@ -7,8 +7,8 @@
   * Copyright 2017 Google Inc.
   */
 
-#ifndef __FIRMWARE_GOOGLE_MEMCONSOLE_H
-#define __FIRMWARE_GOOGLE_MEMCONSOLE_H
+#ifndef __FIRMWARE_COREBOOT_MEMCONSOLE_H
+#define __FIRMWARE_COREBOOT_MEMCONSOLE_H
 
  #include <linux/types.h>
 
@@ -33,4 +33,4 @@ int memconsole_sysfs_init(void);
   */
  void memconsole_exit(void);
 
-#endif /* __FIRMWARE_GOOGLE_MEMCONSOLE_H */
+#endif /* __FIRMWARE_COREBOOT_MEMCONSOLE_H */
drivers/firmware/coreboot/vpd.c renamed from drivers/firmware/google/vpd.c +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd.c
rename to drivers/firmware/coreboot/vpd.c
drivers/firmware/coreboot/vpd_decode.c renamed from drivers/firmware/google/vpd_decode.c +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd_decode.c
rename to drivers/firmware/coreboot/vpd_decode.c
drivers/firmware/coreboot/vpd_decode.h renamed from drivers/firmware/google/vpd_decode.h +0 -0
similarity index 100%
rename from drivers/firmware/google/vpd_decode.h
rename to drivers/firmware/coreboot/vpd_decode.h
Signature · 6 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, (HRB 36809, AG Nürnberg)
author maintainer
#5 lore raw

PATCH v3 3/3 firmware: coreboot: Add CFR firmware attributes driver

In reply to Sean Rhodes

coreboot can publish a CFR tree in its coreboot table to describe firmware setup options. Add a firmware-attributes driver for that table entry under the coreboot firmware driver directory.

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 on x86. If firmware reports a failure, restore the old EFI variable value. Settings without a runtime apply hook, or non-x86 builds, 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.

---
 MAINTAINERS                              |    6 +
 drivers/firmware/coreboot/Kconfig        |   13 +
 drivers/firmware/coreboot/Makefile       |    1 +
 drivers/firmware/coreboot/coreboot-cfr.c | 1068 ++++++++++++++++++++++
 4 files changed, 1088 insertions(+)
 create mode 100644 drivers/firmware/coreboot/coreboot-cfr.c
MAINTAINERS +6 -0
index 01344fc92253..135040ce8758 100644
@@ -6665,6 +6665,12 @@ F:	tools/testing/selftests/cgroup/test_hugetlb_memcg.c
 F:	tools/testing/selftests/cgroup/test_kmem.c
 F:	tools/testing/selftests/cgroup/test_memcontrol.c
 
+COREBOOT CFR FIRMWARE ATTRIBUTES DRIVER
+M:	Sean Rhodes <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/firmware/coreboot/coreboot-cfr.c
+
 CORETEMP HARDWARE MONITORING DRIVER
 L:	[email protected]
 S:	Orphan
drivers/firmware/coreboot/Kconfig +13 -0
index b248bafe8b6b..e935a31e508d 100644
@@ -44,6 +44,19 @@ config GOOGLE_COREBOOT_TABLE
 	  device tree node /firmware/coreboot.
 	  If unsure say N.
 
+config COREBOOT_CFR
+	tristate "coreboot CFR firmware attributes"
+	depends on EFI
+	depends on GOOGLE_COREBOOT_TABLE
+	select FW_ATTR_CLASS
+	help
+	  This driver parses the coreboot CFR table and exposes runtime EFI
+	  variable-backed options through the firmware-attributes sysfs
+	  interface.
+
+	  If you have a system running coreboot with CFR runtime
+	  configuration support, say Y or M here.
+
 config GOOGLE_MEMCONSOLE
 	tristate
 	depends on GOOGLE_MEMCONSOLE_X86_LEGACY || GOOGLE_MEMCONSOLE_COREBOOT
drivers/firmware/coreboot/Makefile +1 -0
index 8151e323cc43..1b9d0c0e7593 100644
@@ -2,6 +2,7 @@
 
 obj-$(CONFIG_GOOGLE_SMI)		+= gsmi.o
 obj-$(CONFIG_GOOGLE_COREBOOT_TABLE)        += coreboot_table.o
+obj-$(CONFIG_COREBOOT_CFR)		+= coreboot-cfr.o
 obj-$(CONFIG_GOOGLE_FRAMEBUFFER_COREBOOT)  += framebuffer-coreboot.o
 obj-$(CONFIG_GOOGLE_MEMCONSOLE)            += memconsole.o
 obj-$(CONFIG_GOOGLE_MEMCONSOLE_COREBOOT)   += memconsole-coreboot.o
drivers/firmware/coreboot/coreboot-cfr.c new file +1068 -0

1,068 lines not on this page · raw message

#6 lore raw

Re: [PATCH v3 3/3] firmware: coreboot: Add CFR firmware attributes driver

Quoted 1 line · Sean Rhodes

+#include <linux/mod_devicetable.h>

Please don't add new users for this header file. Only use those <linux/device-id/*.h> that you actually need (if any).

Thanks
Uwe