From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 04/21] bloblist: Locate bloblist in U-Boot
Date: Thu, 15 Nov 2018 18:43:52 -0700 [thread overview]
Message-ID: <20181116014409.147279-5-sjg@chromium.org> (raw)
In-Reply-To: <20181116014409.147279-1-sjg@chromium.org>
Add support for locating a bloblist in U-Boot that has been set up by SPL.
It is copied into RAM during relocation.
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3: None
Changes in v2: None
common/board_f.c | 34 +++++++++++++++++++++++++++++++
include/asm-generic/global_data.h | 4 ++++
2 files changed, 38 insertions(+)
diff --git a/common/board_f.c b/common/board_f.c
index 96503ff8d3c..42378537c8d 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
+#include <bloblist.h>
#include <console.h>
#include <cpu.h>
#include <dm.h>
@@ -560,6 +561,16 @@ static int reserve_stacks(void)
return arch_reserve_stacks();
}
+static int reserve_bloblist(void)
+{
+#ifdef CONFIG_BLOBLIST
+ gd->start_addr_sp -= CONFIG_BLOBLIST_SIZE;
+ gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE);
+#endif
+
+ return 0;
+}
+
static int display_new_sp(void)
{
debug("New Stack Pointer is: %08lx\n", gd->start_addr_sp);
@@ -666,6 +677,24 @@ static int reloc_bootstage(void)
return 0;
}
+static int reloc_bloblist(void)
+{
+#ifdef CONFIG_BLOBLIST
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ return 0;
+ if (gd->new_bloblist) {
+ int size = CONFIG_BLOBLIST_SIZE;
+
+ debug("Copying bloblist from %p to %p, size %x\n",
+ gd->bloblist, gd->new_bloblist, size);
+ memcpy(gd->new_bloblist, gd->bloblist, size);
+ gd->bloblist = gd->new_bloblist;
+ }
+#endif
+
+ return 0;
+}
+
static int setup_reloc(void)
{
if (gd->flags & GD_FLG_SKIP_RELOC) {
@@ -813,6 +842,9 @@ static const init_fnc_t init_sequence_f[] = {
initf_malloc,
log_init,
initf_bootstage, /* uses its own timer, so does not need DM */
+#ifdef CONFIG_BLOBLIST
+ bloblist_init,
+#endif
initf_console_record,
#if defined(CONFIG_HAVE_FSP)
arch_fsp_init,
@@ -913,6 +945,7 @@ static const init_fnc_t init_sequence_f[] = {
reserve_global_data,
reserve_fdt,
reserve_bootstage,
+ reserve_bloblist,
reserve_arch,
reserve_stacks,
dram_init_banksize,
@@ -932,6 +965,7 @@ static const init_fnc_t init_sequence_f[] = {
INIT_FUNC_WATCHDOG_RESET
reloc_fdt,
reloc_bootstage,
+ reloc_bloblist,
setup_reloc,
#if defined(CONFIG_X86) || defined(CONFIG_ARC)
copy_uboot_to_ram,
diff --git a/include/asm-generic/global_data.h b/include/asm-generic/global_data.h
index c83fc01b764..ccf361ed88a 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -122,6 +122,10 @@ typedef struct global_data {
struct list_head log_head; /* List of struct log_device */
int log_fmt; /* Mask containing log format info */
#endif
+#if CONFIG_IS_ENABLED(BLOBLIST)
+ struct bloblist_hdr *bloblist; /* Bloblist information */
+ struct bloblist_hdr *new_bloblist; /* Relocated blolist info */
+#endif
} gd_t;
#endif
--
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 ` [U-Boot] [PATCH v3 03/21] spl: Set up the bloblist in SPL Simon Glass
2018-11-26 18:43 ` [U-Boot] [U-Boot,v3,03/21] " Tom Rini
2018-11-16 1:43 ` Simon Glass [this message]
2018-11-26 18:43 ` [U-Boot] [U-Boot,v3,04/21] bloblist: Locate bloblist in U-Boot 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-5-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