diff mbox series

[U-Boot] cmd: pxe: Use internal FDT if FDT file isn't found in FDTDIR

Message ID efe5d01c-0386-e7da-6eb1-54f5bfa492ce@elvees.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [U-Boot] cmd: pxe: Use internal FDT if FDT file isn't found in FDTDIR | expand

Commit Message

Anton Leontiev Aug. 9, 2019, 10:20 a.m. UTC
Original commit c61d94d86035 ("pxe: implement fdtdir extlinux.conf tag")
states, that if FDT file cannot be retrieved then FDT packaged in
firmware should be used.

If FDT file cannot be retrieved and it is specified explicitly using
FDT keyword then the label is skipped. If it cannot be found in
FDTDIR then internal FDT is tried first.

Signed-off-by: Anton Leontiev <aleontiev@elvees.com>
---
 cmd/pxe.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/cmd/pxe.c b/cmd/pxe.c
index 1dd0a74ea3..8175e342ee 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -794,9 +794,13 @@  static int label_boot(cmd_tbl_t *cmdtp, struct pxe_label *label)
 			int err = get_relfile_envaddr(cmdtp, fdtfile, "fdt_addr_r");
 			free(fdtfilefree);
 			if (err < 0) {
-				printf("Skipping %s for failure retrieving fdt\n",
-						label->name);
-				goto cleanup;
+				bootm_argv[3] = NULL;
+
+				if (label->fdt) {
+					printf("Skipping %s for failure retrieving FDT\n",
+					       label->name);
+					goto cleanup;
+				}
 			}
 		} else {
 			bootm_argv[3] = NULL;