Skip to content
Snippets Groups Projects
Commit 38c04d8e authored by Simon Glass's avatar Simon Glass
Browse files

spl: Allow disabling binman symbols in SPL


When CONFIG_SPL_FIT is enabled we do not access U-Boot directly in
the image, since it is embedded in a FIT which is parsed at runtime.

Provide a CONFIG option to drop the symbols in this case.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 00959d87
No related branches found
No related tags found
No related merge requests found
...@@ -101,6 +101,18 @@ config SPL_SHOW_ERRORS ...@@ -101,6 +101,18 @@ config SPL_SHOW_ERRORS
This adds a small amount to SPL code size, perhaps 100 bytes. This adds a small amount to SPL code size, perhaps 100 bytes.
config SPL_BINMAN_SYMBOLS
bool "Declare binman symbols in SPL"
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().
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.
menu "PowerPC and LayerScape SPL Boot options" menu "PowerPC and LayerScape SPL Boot options"
config SPL_NAND_BOOT config SPL_NAND_BOOT
...@@ -1321,6 +1333,18 @@ config TPL_SIZE_LIMIT ...@@ -1321,6 +1333,18 @@ config TPL_SIZE_LIMIT
Specifies the maximum length of the U-Boot TPL image. Specifies the maximum length of the U-Boot TPL image.
If this value is zero, it is ignored. If this value is zero, it is ignored.
config TPL_BINMAN_SYMBOLS
bool "Declare binman symbols in SPL"
depends on SPL_FRAMEWORK && BINMAN
default y
help
This enables use of symbols in TPL 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().
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.
config TPL_FRAMEWORK config TPL_FRAMEWORK
bool "Support TPL based upon the common SPL framework" bool "Support TPL based upon the common SPL framework"
default y if SPL_FRAMEWORK default y if SPL_FRAMEWORK
......
...@@ -49,9 +49,11 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -49,9 +49,11 @@ DECLARE_GLOBAL_DATA_PTR;
u32 *boot_params_ptr = NULL; u32 *boot_params_ptr = NULL;
#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
/* See spl.h for information about this */ /* See spl.h for information about this */
binman_sym_declare(ulong, u_boot_any, image_pos); binman_sym_declare(ulong, u_boot_any, image_pos);
binman_sym_declare(ulong, u_boot_any, size); binman_sym_declare(ulong, u_boot_any, size);
#endif
#ifdef CONFIG_TPL #ifdef CONFIG_TPL
binman_sym_declare(ulong, u_boot_spl, image_pos); binman_sym_declare(ulong, u_boot_spl, image_pos);
...@@ -140,6 +142,7 @@ void spl_fixup_fdt(void *fdt_blob) ...@@ -140,6 +142,7 @@ void spl_fixup_fdt(void *fdt_blob)
#endif #endif
} }
#if CONFIG_IS_ENABLED(BINMAN_SYMBOLS)
ulong spl_get_image_pos(void) ulong spl_get_image_pos(void)
{ {
return spl_phase() == PHASE_TPL ? return spl_phase() == PHASE_TPL ?
...@@ -153,6 +156,7 @@ ulong spl_get_image_size(void) ...@@ -153,6 +156,7 @@ ulong spl_get_image_size(void)
binman_sym(ulong, u_boot_spl, size) : binman_sym(ulong, u_boot_spl, size) :
binman_sym(ulong, u_boot_any, size); binman_sym(ulong, u_boot_any, size);
} }
#endif /* BINMAN_SYMBOLS */
ulong spl_get_image_text_base(void) ulong spl_get_image_text_base(void)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment