nman external-symbol improvements
Driver model memory-usage reporting
patman test-reporting improvements
Add bloblist design goals
This commit is contained in:
Tom Rini
2022-07-08 14:39:07 -04:00
59 changed files with 1694 additions and 380 deletions

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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;

View File

@@ -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");
/*