From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 03/21] spl: Set up the bloblist in SPL
Date: Thu, 15 Nov 2018 18:43:51 -0700 [thread overview]
Message-ID: <20181116014409.147279-4-sjg@chromium.org> (raw)
In-Reply-To: <20181116014409.147279-1-sjg@chromium.org>
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>
---
Changes in v3: None
Changes in v2: None
common/spl/spl.c | 18 ++++++++++++++++--
include/spl.h | 27 +++++++++++++++++++++++++++
2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 740182a8be6..eea92ec1f8c 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <bloblist.h>
#include <binman_sym.h>
#include <dm.h>
#include <spl.h>
@@ -343,6 +344,14 @@ static int spl_common_init(bool setup_malloc)
return ret;
}
#endif
+ if (CONFIG_IS_ENABLED(BLOBLIST)) {
+ ret = bloblist_init();
+ if (ret) {
+ debug("%s: Failed to set up bloblist: ret=%d\n",
+ __func__, ret);
+ return ret;
+ }
+ }
if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
ret = fdtdec_setup();
if (ret) {
@@ -481,6 +490,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
BOOT_DEVICE_NONE,
};
struct spl_image_info spl_image;
+ int ret;
debug(">>spl:board_init_r()\n");
@@ -527,6 +537,12 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
}
spl_perform_fixups(&spl_image);
+ if (CONFIG_IS_ENABLED(BLOBLIST)) {
+ ret = bloblist_finish();
+ if (ret)
+ printf("Warning: Failed to finish bloblist (ret=%d)\n",
+ ret);
+ }
#ifdef CONFIG_CPU_V7M
spl_image.entry_point |= 0x1;
@@ -563,8 +579,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
gd->malloc_ptr / 1024);
#endif
#ifdef CONFIG_BOOTSTAGE_STASH
- int ret;
-
bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
CONFIG_BOOTSTAGE_STASH_SIZE);
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;
--
2.19.1.1215.g8438c0b245-goog
next prev parent reply other threads:[~2018-11-16 1:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 1:43 [U-Boot] [PATCH v3 00/21] spl: Add features for passing info from SPL to U-Boot proper Simon Glass
2018-11-16 1:43 ` [U-Boot] [PATCH v3 01/21] spl: Add support for logging in SPL and TPL Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 02/21] Add core support for a bloblist to convey data from SPL Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` Simon Glass [this message]
2018-11-26 18:43 ` [U-Boot] [U-Boot,v3,03/21] spl: Set up the bloblist in SPL Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 04/21] bloblist: Locate bloblist in U-Boot Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot,v3,04/21] " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 05/21] test: Add a simple test for bloblist Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 06/21] Add bloblist documentation Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot,v3,06/21] " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 07/21] spl: Support hash, input, pch, pci, rtc, tpm in SPL Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 08/21] spl: Add a define for SPL_TPL_PROMPT Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 09/21] spl: Make SPL_DISABLE_BANNER_PRINT a positive option Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 10/21] spl: Add a comment to spl_set_bd() Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot,v3,10/21] " Tom Rini
2018-11-16 1:43 ` [U-Boot] [PATCH v3 11/21] sandbox: Add a memory map to the sandbox README Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 12/21] test/py: Add a way to pass flags to sandbox Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 13/21] sandbox: Add an option to display of-platdata in SPL Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 14/21] sandbox: Drop the deprecated 'sb' command Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 15/21] sandbox: Add a new " Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot,v3,15/21] " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 16/21] sandbox: Allow puts() output before global_data is set up Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 17/21] sandbox: Refactor code to create os_jump_to_file() Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 18/21] sandbox: Use malloc() and free() from os layer Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 19/21] sandbox: Filter arguments when starting U-Boot Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 20/21] sandbox: Boot in U-Boot through the standard call Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-16 1:44 ` [U-Boot] [PATCH v3 21/21] spl: Add support for passing handoff info to U-Boot proper Simon Glass
2018-11-26 18:44 ` [U-Boot] [U-Boot, v3, " Tom Rini
2018-11-27 0:08 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181116014409.147279-4-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox