diff options
| author | Tom Rini <[email protected]> | 2021-01-28 11:37:58 -0500 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-01-28 11:37:58 -0500 |
| commit | 07394fb05e4d48fee360ef38c96b3ef0576b7352 (patch) | |
| tree | eaf9b03553cbea1907d578a86799aafaf4887504 /common | |
| parent | 8b195f4b716e4d802768e0e2cd63b417a4690b7f (diff) | |
| parent | 54f884bb0b1ebc16946890bb8349fe0ca2455bb2 (diff) | |
Merge branch '2021-01-27-assorted-fixes-and-improvements'
- A wide variety of fixes throughout the tree.
Diffstat (limited to 'common')
| -rw-r--r-- | common/Kconfig | 10 | ||||
| -rw-r--r-- | common/autoboot.c | 6 | ||||
| -rw-r--r-- | common/bloblist.c | 17 | ||||
| -rw-r--r-- | common/board_f.c | 10 | ||||
| -rw-r--r-- | common/image-fit-sig.c | 2 | ||||
| -rw-r--r-- | common/spl/Kconfig | 9 | ||||
| -rw-r--r-- | common/spl/spl.c | 6 |
7 files changed, 49 insertions, 11 deletions
diff --git a/common/Kconfig b/common/Kconfig index d8982ba3776..45535e3501d 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -697,6 +697,16 @@ config BLOBLIST_ADDR Sets the address of the bloblist, set up by the first part of U-Boot which runs. Subsequent U-Boot stages typically use the same address. +config BLOBLIST_SIZE_RELOC + hex "Size of bloblist after relocation" + depends on BLOBLIST + default BLOBLIST_SIZE + help + Sets the size of the bloblist in bytes after relocation. Since U-Boot + has a lot more memory available then, it is possible to use a larger + size than the one set up by SPL. This bloblist is set up during the + relocation process. + endmenu source "common/spl/Kconfig" diff --git a/common/autoboot.c b/common/autoboot.c index ddb6246be34..b025fd99a0b 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -164,9 +164,9 @@ static int passwd_abort_key(uint64_t etime) }; char presskey[MAX_DELAY_STOP_STR]; - u_int presskey_len = 0; - u_int presskey_max = 0; - u_int i; + int presskey_len = 0; + int presskey_max = 0; + int i; # ifdef CONFIG_AUTOBOOT_DELAY_STR if (delaykey[0].str == NULL) diff --git a/common/bloblist.c b/common/bloblist.c index 33b58623807..0e6448becbc 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -33,6 +33,12 @@ static const char *const tag_name[] = { [BLOBLISTT_SPL_HANDOFF] = "SPL hand-off", [BLOBLISTT_VBOOT_CTX] = "Chrome OS vboot context", [BLOBLISTT_VBOOT_HANDOFF] = "Chrome OS vboot hand-off", + [BLOBLISTT_ACPI_GNVS] = "ACPI GNVS", + [BLOBLISTT_INTEL_VBT] = "Intel Video-BIOS table", + [BLOBLISTT_TPM2_TCG_LOG] = "TPM v2 log space", + [BLOBLISTT_TCPA_LOG] = "TPM log space", + [BLOBLISTT_ACPI_TABLES] = "ACPI tables for x86", + [BLOBLISTT_SMBIOS_TABLES] = "SMBIOS tables for x86", }; const char *bloblist_tag_name(enum bloblist_tag_t tag) @@ -317,6 +323,15 @@ void bloblist_show_list(void) } } +void bloblist_reloc(void *to, uint to_size, void *from, uint from_size) +{ + struct bloblist_hdr *hdr; + + memcpy(to, from, from_size); + hdr = to; + hdr->size = to_size; +} + int bloblist_init(void) { bool expected; @@ -327,6 +342,8 @@ int bloblist_init(void) * that runs */ expected = !u_boot_first_phase(); + if (spl_prev_phase() == PHASE_TPL && !IS_ENABLED(CONFIG_TPL_BLOBLIST)) + expected = false; if (expected) ret = bloblist_check(CONFIG_BLOBLIST_ADDR, CONFIG_BLOBLIST_SIZE); diff --git a/common/board_f.c b/common/board_f.c index ae3001bed1b..4327a43a33b 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -568,9 +568,10 @@ static int reserve_bloblist(void) { #ifdef CONFIG_BLOBLIST /* Align to a 4KB boundary for easier reading of addresses */ - gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp - CONFIG_BLOBLIST_SIZE, - 0x1000); - gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE); + gd->start_addr_sp = ALIGN_DOWN(gd->start_addr_sp - + CONFIG_BLOBLIST_SIZE_RELOC, 0x1000); + gd->new_bloblist = map_sysmem(gd->start_addr_sp, + CONFIG_BLOBLIST_SIZE_RELOC); #endif return 0; @@ -658,7 +659,8 @@ static int reloc_bloblist(void) debug("Copying bloblist from %p to %p, size %x\n", gd->bloblist, gd->new_bloblist, size); - memcpy(gd->new_bloblist, gd->bloblist, size); + bloblist_reloc(gd->new_bloblist, CONFIG_BLOBLIST_SIZE_RELOC, + gd->bloblist, size); gd->bloblist = gd->new_bloblist; } #endif diff --git a/common/image-fit-sig.c b/common/image-fit-sig.c index d39741e9058..31cc580941a 100644 --- a/common/image-fit-sig.c +++ b/common/image-fit-sig.c @@ -360,7 +360,7 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset, const void *sig_blob, int sig_offset) { int noffset; - char *err_msg = ""; + char *err_msg = "No 'signature' subnode found"; int verified = 0; int ret; diff --git a/common/spl/Kconfig b/common/spl/Kconfig index bdc229f9306..774541c02bc 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -186,7 +186,7 @@ config SPL_BOOTROM_SUPPORT config SPL_BOOTCOUNT_LIMIT bool "Support bootcount in SPL" - depends on SPL_ENV_SUPPORT + depends on SPL_ENV_SUPPORT && !TPL_BOOTCOUNT_LIMIT help On some boards, which use 'falcon' mode, it is necessary to check and increment the number of boot attempts. Such boards do not @@ -1382,6 +1382,13 @@ config TPL_BOARD_INIT spl_board_init() from board_init_r(). This function should be provided by the board. +config TPL_BOOTCOUNT_LIMIT + bool "Support bootcount in TPL" + depends on TPL_ENV_SUPPORT + help + If this option is enabled, the TPL will support bootcount. + For example, it may be useful to choose the device to boot. + config TPL_LDSCRIPT string "Linker script for the TPL stage" depends on TPL diff --git a/common/spl/spl.c b/common/spl/spl.c index 835c53deaa8..8cb6f3d531f 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -734,7 +734,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) debug("Failed to stash bootstage: err=%d\n", ret); #endif - debug("loaded - jumping to U-Boot...\n"); + debug("loaded - jumping to %s...\n", spl_phase_name(spl_next_phase())); spl_board_prepare_for_boot(); jump_to_image_no_args(&spl_image); } @@ -837,7 +837,9 @@ ulong spl_relocate_stack_gd(void) #endif } -#if defined(CONFIG_BOOTCOUNT_LIMIT) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT) +#if defined(CONFIG_BOOTCOUNT_LIMIT) && \ + ((!defined(CONFIG_TPL_BUILD) && !defined(CONFIG_SPL_BOOTCOUNT_LIMIT)) || \ + (defined(CONFIG_TPL_BUILD) && !defined(CONFIG_TPL_BOOTCOUNT_LIMIT))) void bootcount_store(ulong a) { } |
