summaryrefslogtreecommitdiff
path: root/include/spl.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-06 01:32:45 +0300
committerSimon Glass <sjg@chromium.org>2021-07-21 19:27:34 +0300
commitf178bebf551a43445ba8f1e1a4c1638eff8eb612 (patch)
treec36bf045cdad0eb02691bb999ba6f734e330c220 /include/spl.h
parent719d286475d2df1f1d8f4413659893934f38de7d (diff)
downloadu-boot-f178bebf551a43445ba8f1e1a4c1638eff8eb612.tar.xz
sandbox: Support executables for more phases
The SPL header has a function for obtaining the phase in capital letters, e.g. 'SPL'. Add one for lower-case also, as used by sandbox. Use this to generalise the sandbox logic for determining the filename of the next sandbox executable. This can provide support for VPL. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/spl.h')
-rw-r--r--include/spl.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/spl.h b/include/spl.h
index c643943482..d88fb79a67 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -176,6 +176,27 @@ static inline const char *spl_phase_name(enum u_boot_phase phase)
}
}
+/**
+ * spl_phase_prefix() - Get the prefix of the current phase
+ *
+ * @phase: Phase to look up
+ * @return phase prefix ("spl", "tpl", etc.)
+ */
+static inline const char *spl_phase_prefix(enum u_boot_phase phase)
+{
+ switch (phase) {
+ case PHASE_TPL:
+ return "tpl";
+ case PHASE_SPL:
+ return "spl";
+ case PHASE_BOARD_F:
+ case PHASE_BOARD_R:
+ return "";
+ default:
+ return "phase?";
+ }
+}
+
/* A string name for SPL or TPL */
#ifdef CONFIG_SPL_BUILD
# ifdef CONFIG_TPL_BUILD