aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
committerTom Rini <trini@konsulko.com>2022-10-31 14:43:04 -0400
commita90afc6730e6c67ad37f4c98a02891a93b4ff971 (patch)
tree724c085433631e142a56c052d667139cba29b4a6 /cmd
parent6f38d91158e7e4199753b79e0a25c1a65175aba4 (diff)
parent77bec9e3d8bd2dc307447b92a3d5cefd693a62ad (diff)
Merge branch '2022-10-31-vbe-implement-the-full-firmware-flow'
To quote Simon: This series provides an implementation of VBE from TPL through to U-Boot proper, using VBE to load the relevant firmware stages. It buils a single image.bin file containing all the phases: TPL - initial phase, loads VPL using binman symbols VPL - main firmware phase, loads SPL using VBE parameters SPL - loads U-Boot proper using VBE parameters U-Boot - final firmware phase, where OS booting is processed This series does not include the OS-booting phase. That will be the subject of a future series. The implementation is entirely handled by sandbox. It should be possible to enable this on a real board without much effort, but that is also the subject of a future series.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sf.c2
-rw-r--r--cmd/vbe.c31
2 files changed, 31 insertions, 2 deletions
diff --git a/cmd/sf.c b/cmd/sf.c
index f9b2d9a47a..cf92ac4109 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -558,7 +558,7 @@ static int do_spi_flash_test(int argc, char *const argv[])
return 1;
}
- from = map_sysmem(CONFIG_SYS_TEXT_BASE, 0);
+ from = map_sysmem(CONFIG_TEXT_BASE, 0);
memcpy(buf, from, len);
ret = spi_flash_test(flash, buf, len, offset, vbuf);
free(vbuf);
diff --git a/cmd/vbe.c b/cmd/vbe.c
index a5737edc04..befaf07c64 100644
--- a/cmd/vbe.c
+++ b/cmd/vbe.c
@@ -7,9 +7,11 @@
*/
#include <common.h>
+#include <bloblist.h>
#include <bootmeth.h>
#include <bootstd.h>
#include <command.h>
+#include <spl.h>
#include <vbe.h>
static int do_vbe_list(struct cmd_tbl *cmdtp, int flag, int argc,
@@ -74,14 +76,41 @@ static int do_vbe_info(struct cmd_tbl *cmdtp, int flag, int argc,
return 0;
}
+static int do_vbe_state(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ struct vbe_handoff *handoff;
+ int i;
+
+ handoff = bloblist_find(BLOBLISTT_VBE, sizeof(struct vbe_handoff));
+ if (!handoff) {
+ printf("No VBE state\n");
+ return CMD_RET_FAILURE;
+ }
+
+ printf("Phases:");
+ for (i = PHASE_NONE; i < PHASE_COUNT; i++) {
+ if (handoff->phases & (1 << i))
+ printf(" %s", spl_phase_name(i));
+
+ }
+ if (!handoff->phases)
+ printf(" (none)");
+ printf("\n");
+
+ return 0;
+}
+
#ifdef CONFIG_SYS_LONGHELP
static char vbe_help_text[] =
"list - list VBE bootmeths\n"
"vbe select - select a VBE bootmeth by sequence or name\n"
- "vbe info - show information about a VBE bootmeth";
+ "vbe info - show information about a VBE bootmeth\n"
+ "vbe state - show VBE state";
#endif
U_BOOT_CMD_WITH_SUBCMDS(vbe, "Verified Boot for Embedded", vbe_help_text,
U_BOOT_SUBCMD_MKENT(list, 1, 1, do_vbe_list),
U_BOOT_SUBCMD_MKENT(select, 2, 1, do_vbe_select),
+ U_BOOT_SUBCMD_MKENT(state, 2, 1, do_vbe_state),
U_BOOT_SUBCMD_MKENT(info, 2, 1, do_vbe_info));