From ee2ce29223c594d5c3f2f7743fb88a8d05e9918b Mon Sep 17 00:00:00 2001 From: Tony Dinh Date: Thu, 2 Nov 2023 11:51:15 -0700 Subject: bootstd: Skip over bad device during bootflows scanning During bootstd scanning for bootdevs, if bootdev_hunt_drv() encounters a device not found error (e.g. ENOENT), let it return a successful status so that bootstd will continue scanning the next devices, not stopping prematurely. Background: During scanning for bootflows, it's possible for bootstd to encounter a faulty device controller. Also when the same u-boot is used for another variant of the same board, some device controller such as SATA might not exist. I've found this issue while converting the Marvell Sheevaplug board to use bootstd. This board has 2 variants, the original Sheevaplug has MMC and USB only, but the later variant comes with USB, MMC, and eSATA ports. We have been using the same u-boot (starting with CONFIG_IDE and later with DM CONFIG_SATA) for both variants. This worked well with the old envs-scripting booting scheme. Signed-off-by: Tony Dinh Reviewed-by: Simon Glass --- boot/bootdev-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot') diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c index 44ae98a9269..4926a50da85 100644 --- a/boot/bootdev-uclass.c +++ b/boot/bootdev-uclass.c @@ -784,7 +784,7 @@ static int bootdev_hunt_drv(struct bootdev_hunter *info, uint seq, bool show) if (info->hunt) { ret = info->hunt(info, show); log_debug(" - hunt result %d\n", ret); - if (ret) + if (ret && ret != -ENOENT) return ret; } std->hunters_used |= BIT(seq); -- cgit v1.2.3 From a3a884c697c3e016ff5625c56509a3d725a01bdb Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Thu, 26 Oct 2023 15:54:49 -0400 Subject: boot: Fix syntax in fdt_overlay_apply_verbose() error message Remove superfluous "did". Signed-off-by: Hugo Villeneuve --- boot/fdt_support.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'boot') diff --git a/boot/fdt_support.c b/boot/fdt_support.c index 5e49078f8c3..b15d07765fe 100644 --- a/boot/fdt_support.c +++ b/boot/fdt_support.c @@ -2095,7 +2095,7 @@ int fdt_overlay_apply_verbose(void *fdt, void *fdto) printf("failed on fdt_overlay_apply(): %s\n", fdt_strerror(err)); if (!has_symbols) { - printf("base fdt does did not have a /__symbols__ node\n"); + printf("base fdt does not have a /__symbols__ node\n"); printf("make sure you've compiled with -@\n"); } } -- cgit v1.2.3 From cac91b0b728eca99a1f2216dab5fbe86e6578b65 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 1 Oct 2023 19:14:41 -0600 Subject: expo: Correct background colour Use the correct background colour when using white-on-black. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- boot/expo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'boot') diff --git a/boot/expo.c b/boot/expo.c index 139d684f8e6..cadb6a0ad6e 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -190,10 +190,12 @@ int expo_render(struct expo *exp) struct udevice *dev = exp->display; struct video_priv *vid_priv = dev_get_uclass_priv(dev); struct scene *scn = NULL; + enum colour_idx back; u32 colour; int ret; - colour = video_index_to_colour(vid_priv, VID_WHITE); + back = CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK) ? VID_BLACK : VID_WHITE; + colour = video_index_to_colour(vid_priv, back); ret = video_fill(dev, colour); if (ret) return log_msg_ret("fill", ret); -- cgit v1.2.3 From 741d1e9d3f368908e3cd1861ddd707e81e1fd576 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 15 Nov 2023 18:35:23 -0700 Subject: bootstd: Avoid freeing a non-allocated buffer EFI applications can be very large and thus used to cause boot failures when malloc() space was exhausted. A recent changed fixed this by using the kernel_addr_r environment var as the address of the buffer. However, it still frees the buffer when the bootflow is discarded. Fix this by introducing a flag to indicate whether the buffer was allocated, or not. Note that kernel_addr_r is not the last word here. It might be better to use lmb to place images. But there is a lot of refactoring to do before we can remove the environment variables. The distro scripts rely on them so it is safe for bootstd to do so too. Fixes: 6a8c2f9781c bootstd: Avoid allocating memory for the EFI file Signed-off-by: Simon Glass Reported by: Simon Glass Reported by: Shantur Rathore Reviewed-by: Heinrich Schuchardt Tested-by: Shantur Rathore --- boot/bootflow.c | 3 ++- boot/bootmeth_efi.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'boot') diff --git a/boot/bootflow.c b/boot/bootflow.c index 6922e7e0c4e..1ea2966ae9a 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -467,7 +467,8 @@ void bootflow_free(struct bootflow *bflow) free(bflow->name); free(bflow->subdir); free(bflow->fname); - free(bflow->buf); + if (!(bflow->flags & BOOTFLOWF_STATIC_BUF)) + free(bflow->buf); free(bflow->os_name); free(bflow->fdt_fname); free(bflow->bootmeth_priv); diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c index ae936c8daa1..9ba7734911e 100644 --- a/boot/bootmeth_efi.c +++ b/boot/bootmeth_efi.c @@ -160,6 +160,7 @@ static int efiload_read_file(struct bootflow *bflow, ulong addr) if (ret) return log_msg_ret("read", ret); bflow->buf = map_sysmem(addr, bflow->size); + bflow->flags |= BOOTFLOWF_STATIC_BUF; set_efi_bootdev(desc, bflow); -- cgit v1.2.3