binman: Add a library to access binman entries

SPL and TPL can access information about binman entries using link-time
symbols but this is not available in U-Boot proper. Of course it could be
made available, but the intention is to just read the device tree.

Add support for this, so that U-Boot can locate entries.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass 2019-12-06 21:41:34 -07:00 committed by Bin Meng
parent 553cb06887
commit 3c10dc95bd
5 changed files with 114 additions and 0 deletions

View file

@ -18,6 +18,7 @@
#if defined(CONFIG_CMD_BEDBUG)
#include <bedbug/type.h>
#endif
#include <binman.h>
#include <command.h>
#include <console.h>
#include <dm.h>
@ -347,6 +348,14 @@ static int initr_manual_reloc_cmdtable(void)
}
#endif
static int initr_binman(void)
{
if (!CONFIG_IS_ENABLED(BINMAN_FDT))
return 0;
return binman_init();
}
#if defined(CONFIG_MTD_NOR_FLASH)
static int initr_flash(void)
{
@ -697,6 +706,7 @@ static init_fnc_t init_sequence_r[] = {
#ifdef CONFIG_EFI_LOADER
efi_memory_init,
#endif
initr_binman,
stdio_init_tables,
initr_serial,
initr_announce,