bootstd: Allow storing x86 setup information
authorSimon Glass <sjg@chromium.org>
Wed, 12 Jul 2023 15:04:36 +0000 (09:04 -0600)
committerBin Meng <bmeng@tinylab.org>
Sun, 16 Jul 2023 15:13:17 +0000 (23:13 +0800)
On x86 boards Linux uses a block of binary data to provide information
about the command line, memory map, etc. Provide a way to store this in
the bootflow so it can be passed on to the OS.

No attempt is made to generalise the code, since other archs don't need
this information. The field is present always, though, to avoid needing
accessors or #ifdefs when building code on other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/bootflow.c
include/bootflow.h

index f33db7b..bf30087 100644 (file)
@@ -336,6 +336,8 @@ static int do_bootflow_info(struct cmd_tbl *cmdtp, int flag, int argc,
        else
                puts("(none)");
        putc('\n');
+       if (bflow->x86_setup)
+               printf("X86 setup: %p\n", bflow->x86_setup);
        printf("Logo:      %s\n", bflow->logo ?
               simple_xtoa((ulong)map_to_sysmem(bflow->logo)) : "(none)");
        if (bflow->logo) {
index a1c16ab..f263173 100644 (file)
@@ -82,6 +82,7 @@ enum bootflow_flags_t {
  * @fdt_addr: Address of loaded fdt
  * @flags: Flags for the bootflow (see enum bootflow_flags_t)
  * @cmdline: OS command line, or NULL if not known (allocated)
+ * @x86_setup: Pointer to x86 setup block inside @buf, NULL if not present
  */
 struct bootflow {
        struct list_head bm_node;
@@ -106,6 +107,7 @@ struct bootflow {
        ulong fdt_addr;
        int flags;
        char *cmdline;
+       char *x86_setup;
 };
 
 /**