From 27fcb8617dc1f1dedb9711b5fa1c01045f3e566a Mon Sep 17 00:00:00 2001 From: Kapil Porwal Date: Mon, 24 Nov 2025 13:15:36 +0530 Subject: [PATCH] commonlib: Add CBMEM ID to store boot mode Introduce a new CBMEM ID, CBMEM_ID_BOOT_MODE (0x444D5442, "BTMD"), to provide a dedicated storage location for the system's detected boot mode (e.g., normal boot, low-battery, off-mode boot etc). Storing the boot mode in CBMEM ensures that the initial detection performed early in the boot process (e.g., in romstage by reading PMIC logs) is securely passed to subsequent stages like ramstage, where different boot modes require distinct logic paths. Key changes: - Define CBMEM_ID_BOOT_MODE in cbmem_id.h. - Add "BOOT MODE" entry to the CBMEM_ID_TO_NAME_TABLE. BUG=b:439819922 TEST=Verify boot mode stored in CBMEM. Change-Id: I7ebf29385a99ac1be491bfefe1c74c8c9e58b55d Signed-off-by: Kapil Porwal Reviewed-on: https://review.coreboot.org/c/coreboot/+/90175 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h index 4cf1f09a84..20a1099f0a 100644 --- a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h +++ b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h @@ -91,6 +91,7 @@ #define CBMEM_ID_CSE_BP_INFO 0x42455343 #define CBMEM_ID_AMD_OPENSIL 0x4153494C #define CBMEM_ID_PVMFW 0x666d7670 +#define CBMEM_ID_BOOT_MODE 0x444D5442 #define CBMEM_ID_TO_NAME_TABLE \ { CBMEM_ID_ACPI, "ACPI " }, \ @@ -174,5 +175,6 @@ { CBMEM_ID_CSE_INFO, "CSE SPECIFIC INFO"},\ { CBMEM_ID_CSE_BP_INFO, "CSE BP INFO"}, \ { CBMEM_ID_AMD_OPENSIL, "OPENSIL DATA"}, \ - { CBMEM_ID_PVMFW, "PVMFW "} + { CBMEM_ID_PVMFW, "PVMFW "}, \ + { CBMEM_ID_BOOT_MODE, "BOOT MODE "} #endif /* _CBMEM_ID_H_ */