diff mbox series

[U-Boot] coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS

Message ID 20190218120607.4515-1-christian.gmeiner@gmail.com
State Changes Requested
Delegated to: Bin Meng
Headers show
Series [U-Boot] coreboot: add support fot CB_TAG_BOOT_MEDIA_PARAMS | expand

Commit Message

Christian Gmeiner Feb. 18, 2019, 12:06 p.m. UTC
Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097
Signed-off-by: Christian Gmeiner <christian.gmeiner@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(-)

Comments

Bin Meng Feb. 20, 2019, 9:10 a.m. UTC | #1
Hi Christian,

On Mon, Feb 18, 2019 at 8:06 PM Christian Gmeiner
<christian.gmeiner@gmail.com> wrote:
>
> Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097

What is this?

> Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>

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

> ---
>  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;
>  }
>

Regards,
Bin
Christian Gmeiner Feb. 20, 2019, 9:29 a.m. UTC | #2
Hi Bin,

Am Mi., 20. Feb. 2019 um 10:10 Uhr schrieb Bin Meng <bmeng.cn@gmail.com>:
>
> Hi Christian,
>
> On Mon, Feb 18, 2019 at 8:06 PM Christian Gmeiner
> <christian.gmeiner@gmail.com> wrote:
> >
> > Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097
>
> What is this?
>

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

> > Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
>
> 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).
Simon Glass Feb. 21, 2019, 2:47 a.m. UTC | #3
Hi Christian,

On Wed, 20 Feb 2019 at 02:29, Christian Gmeiner
<christian.gmeiner@gmail.com> wrote:
>
> Hi Bin,
>
> Am Mi., 20. Feb. 2019 um 10:10 Uhr schrieb Bin Meng <bmeng.cn@gmail.com>:
> >
> > Hi Christian,
> >
> > On Mon, Feb 18, 2019 at 8:06 PM Christian Gmeiner
> > <christian.gmeiner@gmail.com> wrote:
> > >
> > > 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
diff mbox series

Patch

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 {