]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: google: Export coreboot table entries
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 17 Feb 2026 15:56:18 +0000 (16:56 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 20 Feb 2026 13:38:21 +0000 (14:38 +0100)
Move types for coreboot table entries to <linux/coreboot.h>. Allows
drivers in other subsystems to use these structures.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>
Acked-by: Julius Werner <jwerner@chromium.org>
Link: https://patch.msgid.link/20260217155836.96267-9-tzimmermann@suse.de
MAINTAINERS
drivers/firmware/google/coreboot_table.c
drivers/firmware/google/coreboot_table.h
drivers/firmware/google/framebuffer-coreboot.c
include/linux/coreboot.h [new file with mode: 0644]

index 4a2d5e8f0f630b6c6a1997b3cc543d3c23f3e19a..d0dfcfd15e59b08c07305b0f6183a2c394f080be 100644 (file)
@@ -10753,6 +10753,7 @@ L:      chrome-platform@lists.linux.dev
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git
 F:     drivers/firmware/google/
+F:     include/linux/coreboot.h
 
 GOOGLE TENSOR SoC SUPPORT
 M:     Peter Griffin <peter.griffin@linaro.org>
index a031d6fe6bc5aee9a4a06ec0650526ef3a05b73b..c769631ea15d788e915cbe6b1f6e62526ad7d135 100644 (file)
 
 #include "coreboot_table.h"
 
+/* Coreboot table header structure */
+struct coreboot_table_header {
+       char signature[4];
+       u32 header_bytes;
+       u32 header_checksum;
+       u32 table_bytes;
+       u32 table_checksum;
+       u32 table_entries;
+};
+
 #define CB_DEV(d) container_of(d, struct coreboot_device, dev)
 #define CB_DRV(d) container_of_const(d, struct coreboot_driver, drv)
 
index 17e9e5c3f6e178080648771c0a04ec531740ee33..616ca3903e5c6e50027ef6c4e5a1c4cc28d8cc15 100644 (file)
 #ifndef __COREBOOT_TABLE_H
 #define __COREBOOT_TABLE_H
 
+#include <linux/coreboot.h>
 #include <linux/device.h>
 
-struct coreboot_device_id;
-
-/* Coreboot table header structure */
-struct coreboot_table_header {
-       char signature[4];
-       u32 header_bytes;
-       u32 header_checksum;
-       u32 table_bytes;
-       u32 table_checksum;
-       u32 table_entries;
-};
-
-/* List of coreboot entry structures that is used */
-/* Generic */
-struct coreboot_table_entry {
-       u32 tag;
-       u32 size;
-};
-
-/* Points to a CBMEM entry */
-struct lb_cbmem_ref {
-       u32 tag;
-       u32 size;
-
-       u64 cbmem_addr;
-};
-
-#define LB_TAG_CBMEM_ENTRY 0x31
-
-/* Corresponds to LB_TAG_CBMEM_ENTRY */
-struct lb_cbmem_entry {
-       u32 tag;
-       u32 size;
-
-       u64 address;
-       u32 entry_size;
-       u32 id;
-};
-
-/* Describes framebuffer setup by coreboot */
-struct lb_framebuffer {
-       u32 tag;
-       u32 size;
-
-       u64 physical_address;
-       u32 x_resolution;
-       u32 y_resolution;
-       u32 bytes_per_line;
-       u8  bits_per_pixel;
-       u8  red_mask_pos;
-       u8  red_mask_size;
-       u8  green_mask_pos;
-       u8  green_mask_size;
-       u8  blue_mask_pos;
-       u8  blue_mask_size;
-       u8  reserved_mask_pos;
-       u8  reserved_mask_size;
-};
-
 /* A device, additionally with information from coreboot. */
 struct coreboot_device {
        struct device dev;
index 81aa522edb1ee1b6baef9e9dfb8332ca1914e630..fab3f28655d3b4960db9987f0e3ebbace1f21d20 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "coreboot_table.h"
 
-#define CB_TAG_FRAMEBUFFER 0x12
-
 #if defined(CONFIG_PCI)
 static bool framebuffer_pci_dev_is_enabled(struct pci_dev *pdev)
 {
diff --git a/include/linux/coreboot.h b/include/linux/coreboot.h
new file mode 100644 (file)
index 0000000..48705b4
--- /dev/null
@@ -0,0 +1,66 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * coreboot.h
+ *
+ * Coreboot device and driver interfaces.
+ *
+ * Copyright 2014 Gerd Hoffmann <kraxel@redhat.com>
+ * Copyright 2017 Google Inc.
+ * Copyright 2017 Samuel Holland <samuel@sholland.org>
+ */
+
+#ifndef _LINUX_COREBOOT_H
+#define _LINUX_COREBOOT_H
+
+#include <linux/types.h>
+
+/* List of coreboot entry structures that is used */
+
+#define CB_TAG_FRAMEBUFFER 0x12
+#define LB_TAG_CBMEM_ENTRY 0x31
+
+/* Generic */
+struct coreboot_table_entry {
+       u32 tag;
+       u32 size;
+};
+
+/* Points to a CBMEM entry */
+struct lb_cbmem_ref {
+       u32 tag;
+       u32 size;
+
+       u64 cbmem_addr;
+};
+
+/* Corresponds to LB_TAG_CBMEM_ENTRY */
+struct lb_cbmem_entry {
+       u32 tag;
+       u32 size;
+
+       u64 address;
+       u32 entry_size;
+       u32 id;
+};
+
+/* Describes framebuffer setup by coreboot */
+struct lb_framebuffer {
+       u32 tag;
+       u32 size;
+
+       u64 physical_address;
+       u32 x_resolution;
+       u32 y_resolution;
+       u32 bytes_per_line;
+       u8  bits_per_pixel;
+       u8  red_mask_pos;
+       u8  red_mask_size;
+       u8  green_mask_pos;
+       u8  green_mask_size;
+       u8  blue_mask_pos;
+       u8  blue_mask_size;
+       u8  reserved_mask_pos;
+       u8  reserved_mask_size;
+};
+
+#endif /* _LINUX_COREBOOT_H */