diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 01d86c272c..36ec6e9125 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -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, diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h index 86429144ec..6125fe0285 100644 --- a/payloads/libpayload/include/libpayload.h +++ b/payloads/libpayload/include/libpayload.h @@ -47,6 +47,7 @@ #include #if CONFIG(LP_GPL) #include +#include #else #include #endif diff --git a/payloads/libpayload/include/sysinfo.h b/payloads/libpayload/include/sysinfo.h index 23e2d55409..324233170e 100644 --- a/payloads/libpayload/include/sysinfo.h +++ b/payloads/libpayload/include/sysinfo.h @@ -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; diff --git a/payloads/libpayload/libc/Makefile.mk b/payloads/libpayload/libc/Makefile.mk index 063118a925..45152f135c 100644 --- a/payloads/libpayload/libc/Makefile.mk +++ b/payloads/libpayload/libc/Makefile.mk @@ -52,5 +52,6 @@ libc-srcs += $(coreboottop)/src/commonlib/bsd/string.c ifeq ($(CONFIG_LP_GPL),y) libc-srcs += $(coreboottop)/src/commonlib/device_tree.c libc-srcs += $(coreboottop)/src/commonlib/list.c +libc-srcs += $(coreboottop)/src/commonlib/mipi/cmd.c endif endif diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c index b1be37c19e..bd05d7c04a 100644 --- a/payloads/libpayload/libc/coreboot.c +++ b/payloads/libpayload/libc/coreboot.c @@ -301,6 +301,11 @@ static void cb_parse_rsdp(void *ptr, struct sysinfo_t *info) info->acpi_rsdp = cb_acpi_rsdp->rsdp_pointer; } +static void cb_parse_panel_poweroff(unsigned char *ptr, struct sysinfo_t *info) +{ + info->cb_panel_poweroff = virt_to_phys(ptr); +} + int cb_parse_header(void *addr, int len, struct sysinfo_t *info) { struct cb_header *header; @@ -447,6 +452,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info) case CB_TAG_PCIE: cb_parse_pcie(ptr, info); break; + case CB_TAG_PANEL_POWEROFF: + cb_parse_panel_poweroff(ptr, info); + break; case CB_TAG_BOOT_MODE: cb_parse_boot_mode(ptr, info); break; diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index fcc7761044..ed5d52f0b5 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -91,6 +91,7 @@ enum { LB_TAG_CAPSULE = 0x0046, LB_TAG_CFR_ROOT = 0x0047, LB_TAG_ROOT_BRIDGE_INFO = 0x0048, + LB_TAG_PANEL_POWEROFF = 0x0049, /* The following options are CMOS-related */ LB_TAG_CMOS_OPTION_TABLE = 0x00c8, LB_TAG_OPTION = 0x00c9, @@ -629,6 +630,14 @@ struct lb_cfr { /* struct lb_cfr_option_form forms[] */ }; +struct lb_panel_poweroff { + uint32_t tag; + uint32_t size; + + /* MIPI DSI poweroff commands from panel_serializable_data. */ + uint8_t cmd[]; +}; + enum boot_mode_t { LB_BOOT_MODE_NORMAL, LB_BOOT_MODE_LOW_BATTERY,