diff options
author | Simon Glass | 2018-11-15 18:43:51 -0700 |
---|---|---|
committer | Tom Rini | 2018-11-26 08:25:32 -0500 |
commit | e945a726235af1adc2cadc93e86a39637ee6318d (patch) | |
tree | f880e62b0ab2e93daa3df6d7f6e4f35b365ad9b0 /include | |
parent | 9f407d4ef092c2ce7ab0f4f366aee252611dab3c (diff) |
spl: Set up the bloblist in SPL
The bloblist is normally set up in SPL ready for use by U-Boot. Add
a simple implementation of this to the common SPL code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/spl.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/spl.h b/include/spl.h index 9a439f468b9..a56032ae3eb 100644 --- a/include/spl.h +++ b/include/spl.h @@ -21,6 +21,33 @@ #define MMCSD_MODE_FS 2 #define MMCSD_MODE_EMMCBOOT 3 +/* + * u_boot_first_phase() - check if this is the first U-Boot phase + * + * U-Boot has up to three phases: TPL, SPL and U-Boot proper. Depending on the + * build flags we can determine whether the current build is for the first + * phase of U-Boot or not. If there is no SPL, then this is U-Boot proper. If + * there is SPL but no TPL, the the first phase is SPL. If there is TPL, then + * it is the first phase. + * + * @returns true if this is the first phase of U-Boot + * + */ +static inline bool u_boot_first_phase(void) +{ + if (IS_ENABLED(CONFIG_TPL)) { + if (IS_ENABLED(CONFIG_TPL_BUILD)) + return true; + } else if (IS_ENABLED(CONFIG_SPL)) { + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return true; + } else { + return true; + } + + return false; +} + struct spl_image_info { const char *name; u8 os; |