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

2019-02-18 Thread Christian Gmeiner
Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097
Signed-off-by: Christian Gmeiner 
---
 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

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-02-20 Thread Bin Meng
Hi Christian,

On Mon, Feb 18, 2019 at 8:06 PM Christian Gmeiner
 wrote:
>
> Change-Id: I7a2e320f2296bc20e1ac2f10cc2297697c50e097

What is this?

> Signed-off-by: Christian Gmeiner 

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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-02-20 Thread Christian Gmeiner
Hi Bin,

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

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

> > Signed-off-by: Christian Gmeiner 
>
> 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).

-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


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

2019-02-20 Thread Simon Glass
Hi Christian,

On Wed, 20 Feb 2019 at 02:29, Christian Gmeiner
 wrote:
>
> Hi Bin,
>
> Am Mi., 20. Feb. 2019 um 10:10 Uhr schrieb Bin Meng :
> >
> > Hi Christian,
> >
> > On Mon, Feb 18, 2019 at 8:06 PM Christian Gmeiner
> >  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
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot