Files
linux-stable-mirror/include/linux/coreboot.h
T
Thomas Zimmermann a29a1f0ec8 drm/sysfb: corebootdrm: Add DRM driver for coreboot framebuffers
Add corebootdrm, a DRM driver for coreboot framebuffers. The driver
supports a pre-initialized framebuffer with various packed RGB formats.
The driver code is fairly small and uses the same logic as the other
sysfb drivers. Most of the implementation comes from existing sysfb
helpers.

Until now, coreboot relied on simpledrm or simplefb for boot-up graphics
output. Initialize the platform device for corebootdrm in the same place
in framebuffer_probe(). With a later commit, the simple-framebuffer should
be removed.

v4:
- sort include statements (Tzung-Bi)
v3:
- comment on _HAS_LFB semantics (Tzung-Bi)
- fix typo in commit description (Tzung-Bi)
- comment on simple-framebuffer being obsolete for coreboot
v2:
- reimplement as platform driver
- limit resources and mappings to known framebuffer memory; no
  page alignment
- create corebootdrm device from coreboot framebuffer code

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Julius Werner <jwerner@chromium.org>
Acked-by: Tzung-Bi Shih <tzungbi@kernel.org> # coreboot
Link: https://patch.msgid.link/20260217155836.96267-12-tzimmermann@suse.de
2026-02-20 14:38:24 +01:00

78 lines
1.5 KiB
C

/* 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/compiler_attributes.h>
#include <linux/stddef.h>
#include <linux/types.h>
typedef __aligned(4) u64 cb_u64;
/* 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;
cb_u64 cbmem_addr;
};
/* Corresponds to LB_TAG_CBMEM_ENTRY */
struct lb_cbmem_entry {
u32 tag;
u32 size;
cb_u64 address;
u32 entry_size;
u32 id;
};
/* Describes framebuffer setup by coreboot */
struct lb_framebuffer {
u32 tag;
u32 size;
cb_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;
};
/*
* True if the coreboot-provided data is large enough to hold information
* on the linear framebuffer. False otherwise.
*/
#define LB_FRAMEBUFFER_HAS_LFB(__fb) \
((__fb)->size >= offsetofend(struct lb_framebuffer, reserved_mask_size))
#endif /* _LINUX_COREBOOT_H */