u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 01/11] bootstd: Tweak bootflow logic for device tree
@ 2023-04-01 21:45 Simon Glass
  2023-04-01 21:45 ` [PATCH v6 02/11] virtio: Ensure PCI is set up first Simon Glass
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Simon Glass @ 2023-04-01 21:45 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, huang lin, Jeffy Chen, Simon Glass, Kever Yang,
	Philipp Tomsich, Vagrant Cascadian

We should only store the FDT filename if we were unable to determine one.
Adjust the logic for this.

This corrects the case where no FDT is needed to boot, such as with EFI
using ACPI.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v5)

Changes in v5:
- Add new patch to tweak bootflow logic for device tree

 boot/bootmeth_efi.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
index 6a97ac02ff5c..d7e042cf01ee 100644
--- a/boot/bootmeth_efi.c
+++ b/boot/bootmeth_efi.c
@@ -235,21 +235,21 @@ static int distro_efi_read_bootflow_file(struct udevice *dev,
 
 	/* try the various available names */
 	ret = -ENOENT;
-	for (seq = 0; ret; seq++) {
+	*fname = '\0';
+	for (seq = 0; ret == -ENOENT; seq++) {
 		ret = distro_efi_get_fdt_name(fname, sizeof(fname), seq);
-		if (ret == -EALREADY) {
+		if (ret == -EALREADY)
 			bflow->flags = BOOTFLOWF_USE_PRIOR_FDT;
-			break;
-		}
-		if (ret)
-			return log_msg_ret("nam", ret);
-		ret = bootmeth_common_read_file(dev, bflow, fname, fdt_addr,
-						&size);
+		if (!ret)
+			ret = bootmeth_common_read_file(dev, bflow, fname,
+							fdt_addr, &size);
 	}
 
-	bflow->fdt_fname = strdup(fname);
-	if (!bflow->fdt_fname)
-		return log_msg_ret("fil", -ENOMEM);
+	if (*fname) {
+		bflow->fdt_fname = strdup(fname);
+		if (!bflow->fdt_fname)
+			return log_msg_ret("fil", -ENOMEM);
+	}
 
 	if (!ret) {
 		bflow->fdt_size = size;
-- 
2.40.0.348.gf938b09366-goog


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-04-03  6:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01 21:45 [PATCH v6 01/11] bootstd: Tweak bootflow logic for device tree Simon Glass
2023-04-01 21:45 ` [PATCH v6 02/11] virtio: Ensure PCI is set up first Simon Glass
2023-04-01 21:45 ` [PATCH v6 03/11] bootstd: Support booting EFI where multiple options exist Simon Glass
2023-04-01 21:45 ` [PATCH v6 04/11] bootstd: Report missing labels only when asked Simon Glass
2023-04-01 21:45 ` [PATCH v6 05/11] bootstd: Show a message sometimes if no bootflows are found Simon Glass
2023-04-01 21:45 ` [PATCH v6 06/11] rockchip: Move to standard boot Simon Glass
2023-04-01 21:45 ` [PATCH v6 07/11] rockchip: Use the same boot_targets for all boards Simon Glass
2023-04-01 21:45 ` [PATCH v6 08/11] bootstd: Disable BOOTSTD for boards with custom commands Simon Glass
2023-04-01 21:45 ` [PATCH v6 09/11] xilinx: Disable CONFIG_BOOTSTD_DEFAULTS for some xilinx boards Simon Glass
2023-04-01 22:31   ` Mark Kettenis
2023-04-02  2:41     ` Simon Glass
2023-04-02 14:42       ` Tom Rini
2023-04-02 19:16         ` Simon Glass
2023-04-03  6:47           ` Michal Simek
2023-04-01 22:29 ` [PATCH v6 01/11] bootstd: Tweak bootflow logic for device tree Mark Kettenis
     [not found] ` <20230402094532.v6.11.I41a5e66644a895a311889b009116245245c741a5@changeid>
2023-04-01 23:28   ` [PATCH v6 11/11] bootstd: Enable BOOTSTD_DEFAULTS by default Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).