aboutsummaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
committerTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
commit9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c (patch)
treed28c5d99d4996b080ec0c38f24a0232d611ea847 /common/spl
parent7bc0be96f79344d7b103dd64c31be0574f7b39e9 (diff)
parente87da5704ffa6fc782d93d137fa30a37a5df3566 (diff)
downloadu-boot-9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c.zip
u-boot-9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c.tar.gz
u-boot-9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c.tar.bz2
Merge tag 'dm-pull-28jun22' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/Kconfig23
-rw-r--r--common/spl/Kconfig.tpl27
-rw-r--r--common/spl/Kconfig.vpl25
-rw-r--r--common/spl/spl.c25
-rw-r--r--common/spl/spl_ram.c2
5 files changed, 84 insertions, 18 deletions
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index 4851834..931619c 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -191,12 +191,25 @@ config SPL_BINMAN_SYMBOLS
depends on SPL_FRAMEWORK && BINMAN
default y
help
- This enables use of symbols in SPL which refer to U-Boot, enabling SPL
- to obtain the location of U-Boot simply by calling spl_get_image_pos()
- and spl_get_image_size().
+ This enables use of symbols in SPL which refer to other entries in
+ the same binman image as the SPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
- For this to work, you must have a U-Boot image in the binman image, so
- binman can update SPL with the location of it.
+ See tools/binman/binman.rst for a detailed explanation.
+
+config SPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in SPL"
+ depends on SPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
+ help
+ This enables use of symbols in SPL which refer to U-Boot phases,
+ enabling SPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
+
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update SPL with the locations of everything.
source "common/spl/Kconfig.nxp"
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index 9a0e719..e314b79 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -9,16 +9,29 @@ config TPL_SIZE_LIMIT
If this value is zero, it is ignored.
config TPL_BINMAN_SYMBOLS
- bool "Declare binman symbols in TPL"
- depends on SPL_FRAMEWORK && BINMAN
+ bool "Support binman symbols in TPL"
+ depends on TPL_FRAMEWORK && BINMAN
default y
help
- This enables use of symbols in TPL which refer to U-Boot, enabling TPL
- to obtain the location of U-Boot simply by calling spl_get_image_pos()
- and spl_get_image_size().
+ This enables use of symbols in TPL which refer to other entries in
+ the same binman image as the TPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
- For this to work, you must have a U-Boot image in the binman image, so
- binman can update TPL with the location of it.
+ See tools/binman/binman.rst for a detailed explanation.
+
+config TPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in TPL"
+ depends on TPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
+ help
+ This enables use of symbols in TPL which refer to U-Boot phases,
+ enabling TPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
+
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update TPL with the locations of everything.
config TPL_FRAMEWORK
bool "Support TPL based upon the common SPL framework"
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index ba1ea60..ba4b2e4 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -198,4 +198,29 @@ config VPL_TEXT_BASE
help
The address in memory that VPL will be running from.
+config VPL_BINMAN_SYMBOLS
+ bool "Declare binman symbols in VPL"
+ depends on VPL_FRAMEWORK && BINMAN
+ default y
+ help
+ This enables use of symbols in VPL which refer to other entries in
+ the same binman image as the VPL. These can be declared with the
+ binman_sym_declare(type, entry, prop) macro and accessed by the
+ binman_sym(type, entry, prop) macro defined in binman_sym.h.
+
+ See tools/binman/binman.rst for a detailed explanation.
+
+config VPL_BINMAN_UBOOT_SYMBOLS
+ bool "Declare binman symbols for U-Boot phases in VPL"
+ depends on VPL_BINMAN_SYMBOLS
+ default n if ARCH_IMX8M
+ default y
+ help
+ This enables use of symbols in VPL which refer to U-Boot phases,
+ enabling VPL to obtain the location and size of its next phase simply
+ by calling spl_get_image_pos() and spl_get_image_size().
+
+ For this to work, you must have all U-Boot phases in the same binman
+ image, so binman can update VPL with the locations of everything.
+
endmenu
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 2a69a7c..29e0898 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -34,12 +34,14 @@
#include <malloc.h>
#include <mapmem.h>
#include <dm/root.h>
+#include <dm/util.h>
#include <linux/compiler.h>
#include <fdt_support.h>
#include <bootcount.h>
#include <wdt.h>
DECLARE_GLOBAL_DATA_PTR;
+DECLARE_BINMAN_MAGIC_SYM;
#ifndef CONFIG_SYS_UBOOT_START
#define CONFIG_SYS_UBOOT_START CONFIG_SYS_TEXT_BASE
@@ -51,11 +53,10 @@ DECLARE_GLOBAL_DATA_PTR;
u32 *boot_params_ptr = NULL;
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
+#if CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS)
/* See spl.h for information about this */
binman_sym_declare(ulong, u_boot_any, image_pos);
binman_sym_declare(ulong, u_boot_any, size);
-#endif
#ifdef CONFIG_TPL
binman_sym_declare(ulong, u_boot_spl, image_pos);
@@ -67,6 +68,8 @@ binman_sym_declare(ulong, u_boot_vpl, image_pos);
binman_sym_declare(ulong, u_boot_vpl, size);
#endif
+#endif /* BINMAN_UBOOT_SYMBOLS */
+
/* Define board data structure */
static struct bd_info bdata __attribute__ ((section(".data")));
@@ -149,9 +152,11 @@ void spl_fixup_fdt(void *fdt_blob)
#endif
}
-#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
ulong spl_get_image_pos(void)
{
+ if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS))
+ return BINMAN_SYM_MISSING;
+
#ifdef CONFIG_VPL
if (spl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl, image_pos);
@@ -163,6 +168,9 @@ ulong spl_get_image_pos(void)
ulong spl_get_image_size(void)
{
+ if (!CONFIG_IS_ENABLED(BINMAN_UBOOT_SYMBOLS))
+ return BINMAN_SYM_MISSING;
+
#ifdef CONFIG_VPL
if (spl_next_phase() == PHASE_VPL)
return binman_sym(ulong, u_boot_vpl, size);
@@ -171,7 +179,6 @@ ulong spl_get_image_size(void)
binman_sym(ulong, u_boot_spl, size) :
binman_sym(ulong, u_boot_any, size);
}
-#endif /* BINMAN_SYMBOLS */
ulong spl_get_image_text_base(void)
{
@@ -222,7 +229,7 @@ __weak struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)
void spl_set_header_raw_uboot(struct spl_image_info *spl_image)
{
- ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+ ulong u_boot_pos = spl_get_image_pos();
spl_image->size = CONFIG_SYS_MONITOR_LEN;
@@ -780,6 +787,14 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
bootcount_inc();
+ /* Dump driver model states to aid analysis */
+ if (CONFIG_IS_ENABLED(DM_STATS)) {
+ struct dm_stats mem;
+
+ dm_get_mem(&mem);
+ dm_dump_mem(&mem);
+ }
+
memset(&spl_image, '\0', sizeof(spl_image));
#ifdef CONFIG_SYS_SPL_ARGS_ADDR
spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;
diff --git a/common/spl/spl_ram.c b/common/spl/spl_ram.c
index 8296459..d647108 100644
--- a/common/spl/spl_ram.c
+++ b/common/spl/spl_ram.c
@@ -70,7 +70,7 @@ static int spl_ram_load_image(struct spl_image_info *spl_image,
load.read = spl_ram_load_read;
spl_load_simple_fit(spl_image, &load, 0, header);
} else {
- ulong u_boot_pos = binman_sym(ulong, u_boot_any, image_pos);
+ ulong u_boot_pos = spl_get_image_pos();
debug("Legacy image\n");
/*