1 /* SPDX-License-Identifier: GPL-2.0-only */
5 * Internal header for coreboot table access.
8 * Copyright 2017 Google Inc.
12 #ifndef __COREBOOT_TABLE_H
13 #define __COREBOOT_TABLE_H
15 #include <linux/device.h>
17 /* Coreboot table header structure */
18 struct coreboot_table_header {
27 /* List of coreboot entry structures that is used */
29 struct coreboot_table_entry {
34 /* Points to a CBMEM entry */
42 /* Describes framebuffer setup by coreboot */
43 struct lb_framebuffer {
59 u8 reserved_mask_size;
62 /* A device, additionally with information from coreboot. */
63 struct coreboot_device {
66 struct coreboot_table_entry entry;
67 struct lb_cbmem_ref cbmem_ref;
68 struct lb_framebuffer framebuffer;
72 /* A driver for handling devices described in coreboot tables. */
73 struct coreboot_driver {
74 int (*probe)(struct coreboot_device *);
75 void (*remove)(struct coreboot_device *);
76 struct device_driver drv;
80 /* Register a driver that uses the data from a coreboot table. */
81 int coreboot_driver_register(struct coreboot_driver *driver);
83 /* Unregister a driver that uses the data from a coreboot table. */
84 void coreboot_driver_unregister(struct coreboot_driver *driver);
86 /* module_coreboot_driver() - Helper macro for drivers that don't do
87 * anything special in module init/exit. This eliminates a lot of
88 * boilerplate. Each module may only use this macro once, and
89 * calling it replaces module_init() and module_exit()
91 #define module_coreboot_driver(__coreboot_driver) \
92 module_driver(__coreboot_driver, coreboot_driver_register, \
93 coreboot_driver_unregister)
95 #endif /* __COREBOOT_TABLE_H */