[U-Boot] [PATCH] coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Christian Gmeiner christian.gmeiner at gmail.com
Mon Feb 18 12:06:07 UTC 2019


Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
 arch/x86/cpu/coreboot/tables.c               | 13 +++++++++++++
 arch/x86/include/asm/arch-coreboot/sysinfo.h |  6 +++++-
 arch/x86/include/asm/coreboot_tables.h       | 11 +++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/arch/x86/cpu/coreboot/tables.c b/arch/x86/cpu/coreboot/tables.c
index bc18b710c9..fa26b66f24 100644
--- a/arch/x86/cpu/coreboot/tables.c
+++ b/arch/x86/cpu/coreboot/tables.c
@@ -109,6 +109,16 @@ static void cb_parse_string(unsigned char *ptr, char **info)
 	*info = (char *)((struct cb_string *)ptr)->string;
 }
 
+static void cb_parse_boot_meda_params(unsigned char *ptr, struct sysinfo_t *info)
+{
+	struct cb_boot_media_params *params = (struct cb_boot_media_params *)ptr;
+
+	info->fmap_offset = params->fmap_offset;
+	info->cbfs_offset = params->cbfs_offset;
+	info->cbfs_size = params->cbfs_size;
+	info->boot_media_size = params->boot_media_size;
+}
+
 static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 {
 	struct cb_header *header;
@@ -211,6 +221,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
 		case CB_TAG_VBNV:
 			cb_parse_vbnv(ptr, info);
 			break;
+		case CB_TAG_BOOT_MEDIA_PARAMS:
+			cb_parse_boot_meda_params(ptr, info);
+			break;
 		}
 
 		ptr += rec->size;
diff --git a/arch/x86/include/asm/arch-coreboot/sysinfo.h b/arch/x86/include/asm/arch-coreboot/sysinfo.h
index dd8d1cba92..0969bf946b 100644
--- a/arch/x86/include/asm/arch-coreboot/sysinfo.h
+++ b/arch/x86/include/asm/arch-coreboot/sysinfo.h
@@ -51,8 +51,12 @@ struct sysinfo_t {
 	void	*cbmem_cons;
 
 	struct cb_serial *serial;
-};
 
+	u64 fmap_offset;
+	u64 cbfs_offset;
+	u64 cbfs_size;
+	u64 boot_media_size;
+};
 extern struct sysinfo_t lib_sysinfo;
 
 int get_coreboot_info(struct sysinfo_t *info);
diff --git a/arch/x86/include/asm/coreboot_tables.h b/arch/x86/include/asm/coreboot_tables.h
index c42175b94d..be752fc726 100644
--- a/arch/x86/include/asm/coreboot_tables.h
+++ b/arch/x86/include/asm/coreboot_tables.h
@@ -193,6 +193,17 @@ struct cb_vbnv {
 	uint32_t vbnv_size;
 };
 
+#define CB_TAG_BOOT_MEDIA_PARAMS 0x0030
+struct cb_boot_media_params {
+	uint32_t tag;
+	uint32_t size;
+	/* offsets are relative to start of boot media */
+	uint64_t fmap_offset;
+	uint64_t cbfs_offset;
+	uint64_t cbfs_size;
+	uint64_t boot_media_size;
+};
+
 #define CB_TAG_CMOS_OPTION_TABLE	0x00c8
 
 struct cb_cmos_option_table {
-- 
2.20.1



More information about the U-Boot mailing list