[Concept,29/32] boot: pxe: Move overlay loading to pxe_load_files()

Message ID 20260109231151.4056804-30-sjg@u-boot.org
State New
Headers
Series boot: pxe: Refactor into separate load/setup phases |

Commit Message

Simon Glass Jan. 9, 2026, 11:11 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move the overlay loading from label_process_fdt() to pxe_load_files(),
grouping all file loading (kernel, initrd, FDT, overlays) in one place.

The overlay applying remains in label_process_fdt() since it operates
on the working FDT after it has been set up.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 boot/pxe_utils.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Patch

diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index 4bae830f353..e336b125716 100644
--- a/boot/pxe_utils.c
+++ b/boot/pxe_utils.c
@@ -515,10 +515,8 @@  static int label_process_fdt(struct pxe_context *ctx, struct pxe_label *label)
 	if (label->kaslrseed)
 		label_boot_kaslrseed(ctx);
 
-	if (IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY) && label->fdtoverlays.count) {
-		label_load_fdtoverlays(ctx, label);
+	if (IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY) && label->fdtoverlays.count)
 		label_apply_fdtoverlays(ctx, label);
-	}
 
 	return 0;
 }
@@ -681,6 +679,9 @@  static int pxe_load_files(struct pxe_context *ctx, struct pxe_label *label,
 		}
 	}
 
+	if (IS_ENABLED(CONFIG_OF_LIBFDT_OVERLAY) && label->fdtoverlays.count)
+		label_load_fdtoverlays(ctx, label);
+
 	return 0;
 }