public inbox for chrome-platform@lists.linux.dev
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: tzungbi@kernel.org, briannorris@chromium.org,
	jwerner@chromium.org, javierm@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	airlied@gmail.com, simona@ffwll.ch
Cc: chrome-platform@lists.linux.dev, dri-devel@lists.freedesktop.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 4/8] firmware: google: Export coreboot driver and device interfaces
Date: Thu,  8 Jan 2026 15:19:44 +0100	[thread overview]
Message-ID: <20260108145058.56943-5-tzimmermann@suse.de> (raw)
In-Reply-To: <20260108145058.56943-1-tzimmermann@suse.de>

Split coreboot_table.h: move struct coreboot_table_header into
coreboot_table.h and the rest of the header to include/linux/coreboot.h.

Prepares coreboot for allowing drivers in other subsystems.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/firmware/google/cbmem.c               |  3 +--
 drivers/firmware/google/coreboot_table.c      | 11 +++++++-
 .../firmware/google/framebuffer-coreboot.c    |  3 +--
 drivers/firmware/google/memconsole-coreboot.c |  2 +-
 drivers/firmware/google/vpd.c                 |  2 +-
 .../linux/coreboot.h                          | 27 +++++++------------
 6 files changed, 23 insertions(+), 25 deletions(-)
 rename drivers/firmware/google/coreboot_table.h => include/linux/coreboot.h (88%)

diff --git a/drivers/firmware/google/cbmem.c b/drivers/firmware/google/cbmem.c
index 3397bacdfdbe..b3e477d9ad4e 100644
--- a/drivers/firmware/google/cbmem.c
+++ b/drivers/firmware/google/cbmem.c
@@ -7,6 +7,7 @@
  * Copyright 2022 Google LLC
  */
 
+#include <linux/coreboot.h>
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/io.h>
@@ -18,8 +19,6 @@
 #include <linux/slab.h>
 #include <linux/sysfs.h>
 
-#include "coreboot_table.h"
-
 struct cbmem_entry {
 	char *mem_file_buf;
 	u32 size;
diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
index ae20c0527032..3b07e1d60255 100644
--- a/drivers/firmware/google/coreboot_table.c
+++ b/drivers/firmware/google/coreboot_table.c
@@ -9,6 +9,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/coreboot.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/init.h>
@@ -21,7 +22,15 @@
 #include <linux/slab.h>
 #include <linux/sysfb.h>
 
-#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)
diff --git a/drivers/firmware/google/framebuffer-coreboot.c b/drivers/firmware/google/framebuffer-coreboot.c
index 7ac9dc4f5392..88815e0abb3f 100644
--- a/drivers/firmware/google/framebuffer-coreboot.c
+++ b/drivers/firmware/google/framebuffer-coreboot.c
@@ -9,6 +9,7 @@
  * Copyright 2017 Samuel Holland <samuel@sholland.org>
  */
 
+#include <linux/coreboot.h>
 #include <linux/device.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
@@ -17,8 +18,6 @@
 #include <linux/platform_data/simplefb.h>
 #include <linux/platform_device.h>
 
-#include "coreboot_table.h"
-
 static const struct simplefb_format formats[] = SIMPLEFB_FORMATS;
 
 static int framebuffer_probe(struct coreboot_device *dev)
diff --git a/drivers/firmware/google/memconsole-coreboot.c b/drivers/firmware/google/memconsole-coreboot.c
index 4aa9b1cad3c3..bc7e4bfb2d08 100644
--- a/drivers/firmware/google/memconsole-coreboot.c
+++ b/drivers/firmware/google/memconsole-coreboot.c
@@ -7,6 +7,7 @@
  * Copyright 2017 Google Inc.
  */
 
+#include <linux/coreboot.h>
 #include <linux/device.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
@@ -14,7 +15,6 @@
 #include <linux/module.h>
 
 #include "memconsole.h"
-#include "coreboot_table.h"
 
 #define CB_TAG_CBMEM_CONSOLE	0x17
 
diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c
index 8d7f123f96f4..f75008b956d5 100644
--- a/drivers/firmware/google/vpd.c
+++ b/drivers/firmware/google/vpd.c
@@ -7,6 +7,7 @@
  * Copyright 2017 Google Inc.
  */
 
+#include <linux/coreboot.h>
 #include <linux/ctype.h>
 #include <linux/init.h>
 #include <linux/io.h>
@@ -20,7 +21,6 @@
 #include <linux/slab.h>
 #include <linux/sysfs.h>
 
-#include "coreboot_table.h"
 #include "vpd_decode.h"
 
 #define CB_TAG_VPD      0x2c
diff --git a/drivers/firmware/google/coreboot_table.h b/include/linux/coreboot.h
similarity index 88%
rename from drivers/firmware/google/coreboot_table.h
rename to include/linux/coreboot.h
index 4c71830c98ca..26ea5eecac52 100644
--- a/drivers/firmware/google/coreboot_table.h
+++ b/include/linux/coreboot.h
@@ -1,32 +1,26 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * coreboot_table.h
+ * coreboot.h
  *
- * Internal header for coreboot table access.
+ * Coreboot device and driver interfaces.
  *
  * Copyright 2014 Gerd Hoffmann <kraxel@redhat.com>
  * Copyright 2017 Google Inc.
  * Copyright 2017 Samuel Holland <samuel@sholland.org>
  */
 
-#ifndef __COREBOOT_TABLE_H
-#define __COREBOOT_TABLE_H
+#ifndef _LINUX_COREBOOT_H
+#define _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 */
+
+#define CB_TAG_FRAMEBUFFER 0x12
+#define LB_TAG_CBMEM_ENTRY 0x31
+
 /* Generic */
 struct coreboot_table_entry {
 	u32 tag;
@@ -41,9 +35,6 @@ struct lb_cbmem_ref {
 	u64 cbmem_addr;
 };
 
-#define CB_TAG_FRAMEBUFFER 0x12
-#define LB_TAG_CBMEM_ENTRY 0x31
-
 /* Corresponds to LB_TAG_CBMEM_ENTRY */
 struct lb_cbmem_entry {
 	u32 tag;
@@ -118,4 +109,4 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
 	module_driver(__coreboot_driver, coreboot_driver_register, \
 			coreboot_driver_unregister)
 
-#endif /* __COREBOOT_TABLE_H */
+#endif /* _LINUX_COREBOOT_H */
-- 
2.52.0


  parent reply	other threads:[~2026-01-08 14:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-08 14:19 [PATCH 0/8] drm, coreboot: Add DRM coreboot driver Thomas Zimmermann
2026-01-08 14:19 ` [PATCH 1/8] firmware: google: Do sysfb test before creating coreboot framebuffer Thomas Zimmermann
2026-01-08 16:55   ` Julius Werner
2026-01-09  9:17     ` Thomas Zimmermann
2026-01-09 10:21       ` Javier Martinez Canillas
2026-01-13 22:32         ` Julius Werner
2026-01-14  8:13           ` Thomas Zimmermann
2026-01-14 20:32             ` Julius Werner
2026-01-08 14:19 ` [PATCH 2/8] firmware: google: Init coreboot bus with subsys_initcall() Thomas Zimmermann
2026-01-09 10:24   ` Javier Martinez Canillas
2026-01-08 14:19 ` [PATCH 3/8] firmware: google: Clean up include statements in coreboot_table.h Thomas Zimmermann
2026-01-09 10:24   ` Javier Martinez Canillas
2026-01-08 14:19 ` Thomas Zimmermann [this message]
2026-01-09 10:26   ` [PATCH 4/8] firmware: google: Export coreboot driver and device interfaces Javier Martinez Canillas
2026-01-08 14:19 ` [PATCH 5/8] video/aperture: Support coreboot devices Thomas Zimmermann
2026-01-09 10:30   ` Javier Martinez Canillas
2026-01-08 14:19 ` [PATCH 6/8] drm/sysfb: Remove duplicate declarations Thomas Zimmermann
2026-01-09 10:31   ` Javier Martinez Canillas
2026-01-14  9:02     ` Thomas Zimmermann
2026-01-08 14:19 ` [PATCH 7/8] drm/sysfb: Generalize pixel-format matching Thomas Zimmermann
2026-01-09 10:32   ` Javier Martinez Canillas
2026-01-08 14:19 ` [PATCH 8/8] drm/sysfb: corebootdrm: Add DRM driver for coreboot framebuffers Thomas Zimmermann
2026-01-14 21:49   ` kernel test robot
2026-01-14 22:12   ` kernel test robot
2026-01-08 18:10 ` [PATCH 0/8] drm, coreboot: Add DRM coreboot driver Brian Norris
2026-01-09  8:50   ` Thomas Zimmermann
2026-01-09 10:37     ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260108145058.56943-5-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jwerner@chromium.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzungbi@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox