From 76bd6844dcfeb1a7d2f529c2f715b34f4e574229 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 30 Jul 2023 11:16:56 -0600 Subject: bootstd: Add private bootmeth data to the bootflow Some bootmeths need to store their own information related to the bootflow, in addition to the generic information in struct bootflow. Add a pointer for this. Signed-off-by: Simon Glass --- include/bootflow.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/bootflow.h') diff --git a/include/bootflow.h b/include/bootflow.h index 4152577afb7..ff2bddb5151 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -83,6 +83,7 @@ enum bootflow_flags_t { * @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 + * @bootmeth_priv: Private data for the bootmeth */ struct bootflow { struct list_head bm_node; @@ -108,6 +109,7 @@ struct bootflow { int flags; char *cmdline; char *x86_setup; + void *bootmeth_priv; }; /** -- cgit v1.2.3 From cbb607d2d9be44a5ded7a652e8e7646925adc1e0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 30 Jul 2023 11:17:00 -0600 Subject: bootstd: Allow display of the x86 setup information Provide an option to dump this information if available. Move the funciion prototype to the common x86 header. Allow the command line to be left out since 'bootflow info' show this itself and it is not in the correct place in memory until the kernel is actually booted. Fix a badly aligned heading while we are here. Signed-off-by: Simon Glass --- include/bootflow.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/bootflow.h') diff --git a/include/bootflow.h b/include/bootflow.h index ff2bddb5151..fdcfeddc1a6 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -108,7 +108,7 @@ struct bootflow { ulong fdt_addr; int flags; char *cmdline; - char *x86_setup; + void *x86_setup; void *bootmeth_priv; }; -- cgit v1.2.3 From c279224ea6686a992b258b01e07fcadb7f0c7ecb Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Aug 2023 19:33:18 -0600 Subject: bootstd: Add a command to read all files for a bootflow Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until it is needed to boot. This saves time when scanning and avoids needing to allocate memory for something that may never be used. To permit reading of these files, add a new 'bootflow read' command. Signed-off-by: Simon Glass --- include/bootflow.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/bootflow.h') diff --git a/include/bootflow.h b/include/bootflow.h index fdcfeddc1a6..44d3741eaca 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -352,6 +352,17 @@ void bootflow_free(struct bootflow *bflow); */ int bootflow_boot(struct bootflow *bflow); +/** + * bootflow_read_all() - Read all bootflow files + * + * Some bootmeths delay reading of large files until booting is requested. This + * causes those files to be read. + * + * @bflow: Bootflow to read + * Return: result of trying to read + */ +int bootflow_read_all(struct bootflow *bflow); + /** * bootflow_run_boot() - Try to boot a bootflow * -- cgit v1.2.3