libpayload: Pass panel power-off commands to payloads

Introduce the lb_panel_poweroff/cb_panel_poweroff structs to pass the
panel power-off commands from coreboot to payloads.

Also add mipi_panel_parse_commands() to libpayload libc, so that
payloads can utilize it to parse the power-off commands.

BUG=b:474187570
TEST=emerge-jedi coreboot libpayload
BRANCH=skywalker

Change-Id: I652178c8075a1f3aee356502e682ef9a4f3d1cf8
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90738
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yidi Lin <yidilin@google.com>
Reviewed-by: Chen-Tsung Hsieh <chentsung@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Yu-Ping Wu 2026-01-13 11:48:42 +08:00 committed by Yu-Ping Wu
commit 8cfc71d9e0
6 changed files with 29 additions and 0 deletions

View file

@ -85,6 +85,7 @@ enum {
CB_TAG_TYPE_C_INFO = 0x0042,
CB_TAG_ACPI_RSDP = 0x0043,
CB_TAG_PCIE = 0x0044,
CB_TAG_PANEL_POWEROFF = 0x0049,
CB_TAG_CMOS_OPTION_TABLE = 0x00c8,
CB_TAG_OPTION = 0x00c9,
CB_TAG_OPTION_ENUM = 0x00ca,
@ -446,6 +447,14 @@ struct cb_acpi_rsdp {
cb_uint64_t rsdp_pointer; /* Address of the ACPI RSDP */
};
struct cb_panel_poweroff {
uint32_t tag;
uint32_t size;
/* MIPI DSI poweroff commands from panel_serializable_data. */
uint8_t cmd[];
};
enum boot_mode_t {
CB_BOOT_MODE_NORMAL,
CB_BOOT_MODE_LOW_BATTERY,

View file

@ -47,6 +47,7 @@
#include <cbgfx.h>
#if CONFIG(LP_GPL)
#include <commonlib/helpers.h>
#include <commonlib/mipi/cmd.h>
#else
#include <commonlib/bsd/helpers.h>
#endif

View file

@ -180,6 +180,7 @@ struct sysinfo_t {
enum boot_mode_t boot_mode;
uintptr_t memory_info;
uintptr_t cb_panel_poweroff;
};
extern struct sysinfo_t lib_sysinfo;