mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
spl: Add methods to find the position/size of next phase
Binman supports writing the position and size of U-Boot proper and SPL into the previous phase of U-Boot. This allows the next phase to be easily located and loaded. Add functions to return these useful values, along with symbols to allow TPL to load SPL. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -42,6 +42,12 @@ u32 *boot_params_ptr = NULL;
|
|||||||
|
|
||||||
/* 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);
|
||||||
|
|
||||||
|
#ifdef CONFIG_TPL
|
||||||
|
binman_sym_declare(ulong, spl, image_pos);
|
||||||
|
binman_sym_declare(ulong, spl, size);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define board data structure */
|
/* Define board data structure */
|
||||||
static bd_t bdata __attribute__ ((section(".data")));
|
static bd_t bdata __attribute__ ((section(".data")));
|
||||||
@@ -120,6 +126,20 @@ void spl_fixup_fdt(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ulong spl_get_image_pos(void)
|
||||||
|
{
|
||||||
|
return spl_phase() == PHASE_TPL ?
|
||||||
|
binman_sym(ulong, spl, image_pos) :
|
||||||
|
binman_sym(ulong, u_boot_any, image_pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
ulong spl_get_image_size(void)
|
||||||
|
{
|
||||||
|
return spl_phase() == PHASE_TPL ?
|
||||||
|
binman_sym(ulong, spl, size) :
|
||||||
|
binman_sym(ulong, u_boot_any, size);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Weak default function for board specific cleanup/preparation before
|
* Weak default function for board specific cleanup/preparation before
|
||||||
* Linux boot. Some boards/platforms might not need it, so just provide
|
* Linux boot. Some boards/platforms might not need it, so just provide
|
||||||
|
@@ -169,10 +169,29 @@ struct spl_load_info {
|
|||||||
* We need to know the position of U-Boot in memory so we can jump to it. We
|
* We need to know the position of U-Boot in memory so we can jump to it. We
|
||||||
* allow any U-Boot binary to be used (u-boot.bin, u-boot-nodtb.bin,
|
* allow any U-Boot binary to be used (u-boot.bin, u-boot-nodtb.bin,
|
||||||
* u-boot.img), hence the '_any'. These is no checking here that the correct
|
* u-boot.img), hence the '_any'. These is no checking here that the correct
|
||||||
* image is found. For * example if u-boot.img is used we don't check that
|
* image is found. For example if u-boot.img is used we don't check that
|
||||||
* spl_parse_image_header() can parse a valid header.
|
* spl_parse_image_header() can parse a valid header.
|
||||||
|
*
|
||||||
|
* Similarly for SPL, so that TPL can jump to SPL.
|
||||||
*/
|
*/
|
||||||
binman_sym_extern(ulong, u_boot_any, image_pos);
|
binman_sym_extern(ulong, u_boot_any, image_pos);
|
||||||
|
binman_sym_extern(ulong, u_boot_any, size);
|
||||||
|
binman_sym_extern(ulong, spl, image_pos);
|
||||||
|
binman_sym_extern(ulong, spl, size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spl_get_image_pos() - get the image position of the next phase
|
||||||
|
*
|
||||||
|
* This returns the image position to use to load the next phase of U-Boot
|
||||||
|
*/
|
||||||
|
ulong spl_get_image_pos(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* spl_get_image_size() - get the size of the next phase
|
||||||
|
*
|
||||||
|
* This returns the size to use to load the next phase of U-Boot
|
||||||
|
*/
|
||||||
|
ulong spl_get_image_size(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spl_load_simple_fit_skip_processing() - Hook to allow skipping the FIT
|
* spl_load_simple_fit_skip_processing() - Hook to allow skipping the FIT
|
||||||
|
Reference in New Issue
Block a user