Skip to contentSkip to conversation

coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

PATCH New Christian Gmeiner 3 participants 4 messages Feb 18, 2019 – Feb 21, 2019 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Change-Id I7a2e320f2296bc20e1ac2f10cc2297697c50e097
---
 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(-)
arch/x86/cpu/coreboot/tables.c +13 -0
index bc18b710c9..fa26b66f24 100644
@@ -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;
arch/x86/include/asm/arch-coreboot/sysinfo.h +5 -1
index dd8d1cba92..0969bf946b 100644
@@ -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);
arch/x86/include/asm/coreboot_tables.h +11 -0
index c42175b94d..be752fc726 100644
@@ -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 {
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Hi Christian,

Quoted 2 lines · Christian Gmeiner

Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097

What is this?

Quoted 1 line

Can you please include a commit message to explain the changes? Thanks!

Quoted 11 lines
---
 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(-)
arch/x86/cpu/coreboot/tables.c +0 -0
index bc18b710c9..fa26b66f24 100644

arch/x86/cpu/coreboot/tables.c static void cb_parse_string(unsigned char *ptr, char **info) · line 111

Quoted 3 lines
arch/x86/cpu/coreboot/tables.c +0 -0
@@ -109,6 +109,16 @@ static void cb_parse_string(unsigned char *ptr, char **info)
        *info = (char *)((struct cb_string *)ptr)->string;
 }
 

Regards,
Bin

#2 lore raw

PATCH 1/1 coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Hi Bin,

Am Mi., 20. Feb. 2019 um 10:10 Uhr schrieb Bin Meng <[email protected]>:

Quoted 10 lines

Hi Christian,

Quoted 2 lines · Christian Gmeiner

Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097

What is this?

Opps.. that is the gerrit change id from our internal infrastructure.

Quoted 4 lines
Quoted 1 line

Can you please include a commit message to explain the changes? Thanks!

Sure. Maybe I have the follow up patches ready to improve cbfs detection in general
and add the workarounds needed for apollo lake (where 256KiB right below 4GiB is decoded by read-only SRAM).

Signature · 5 lines
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
#3 lore raw

PATCH 1/1 coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Hi Christian,

Quoted 10 lines · Christian Gmeiner

Hi Bin,

Am Mi., 20. Feb. 2019 um 10:10 Uhr schrieb Bin Meng <[email protected]>:

Quoted 6 lines

Hi Christian,

Quoted 1 line · Christian Gmeiner
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097

What is this?

Opps.. that is the gerrit change id from our internal infrastructure.

If you use patman it will filter these out automatically.

Regards,
Simon