From patchwork Fri Jan 9 23:11:33 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1420 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000439; bh=PqIR3Q+1mkgm1dW17yMN2f68KiBEnceqgKc84LBGNMU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=o1HaLYsCQkSXcSmwSBPZwEvP8zz1u6PObcr/VY65axK0kPQgAFgMRbUw1VVa4/UQs 8C1SHtpcDKcwzLbsAmtVXHo4o0+X9Z0ZUNXS4xx4gSc/+I4w85ESEPx3y4+pYAgCUm dtYhmz2+L0T2tzfyo1h6abPSHm308/KcNBOYcJ8h+i+wKz/8A94UOsZSRXKDDT9Izj hPgl1EUUDSOlldpmSF5tUvna48MIZ0A1XvcLSfPG1WcJXwa08LpCWRAUykKK2CwsFD iDMQI07JFcP3jxDgN9kLRjxbLIA6oRzsEakWYUGiHVGAA6PFAZ1JQo9yYiliBxxbnh HqHzV8HAnADhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 76E2269243 for ; Fri, 9 Jan 2026 16:13:59 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5Uk2k7n5nxin for ; Fri, 9 Jan 2026 16:13:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000439; bh=PqIR3Q+1mkgm1dW17yMN2f68KiBEnceqgKc84LBGNMU=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=o1HaLYsCQkSXcSmwSBPZwEvP8zz1u6PObcr/VY65axK0kPQgAFgMRbUw1VVa4/UQs 8C1SHtpcDKcwzLbsAmtVXHo4o0+X9Z0ZUNXS4xx4gSc/+I4w85ESEPx3y4+pYAgCUm dtYhmz2+L0T2tzfyo1h6abPSHm308/KcNBOYcJ8h+i+wKz/8A94UOsZSRXKDDT9Izj hPgl1EUUDSOlldpmSF5tUvna48MIZ0A1XvcLSfPG1WcJXwa08LpCWRAUykKK2CwsFD iDMQI07JFcP3jxDgN9kLRjxbLIA6oRzsEakWYUGiHVGAA6PFAZ1JQo9yYiliBxxbnh HqHzV8HAnADhQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5DC8A69218 for ; Fri, 9 Jan 2026 16:13:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000437; bh=nAetHA6jRAd1KAfPrFI9TK9x5u2soeCig5UinVYHOHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wLLKsN9oqEbVpnVWc4zftx9EW56DKaFI/EaRuvl1eKv/GV/+y7R3isccKvZG+bLsw dGMKNZCKiCVEx+ZwmqHFjw6Rg+96RwSFplinDyb6RysFpGzrraiCHq1ebTfabVuKQr 4Y8BXE4icntPMei/VFDfgXozQaudrHQmN68O7+auWdCtSo5yIhllA2hWGPyin0umYb HmLUm71qaw32+kkD/q6Ibo2/PIRXZEH9SL7FY166B59U4PUxSf33Qe4LifN0ZUi91K SZatwAVVYIWuNb4CDRmHjO5umvqgWoHnK/dd21w9whk0TRGOfKXXlYQxNZGYAQG04v V90yUT91ky70Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9B1EC69218; Fri, 9 Jan 2026 16:13:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 3-ashCTsnIQh; Fri, 9 Jan 2026 16:13:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000430; bh=VF3G0aJJuNSuB2vFrEBwlilLUW1G/iCtYXFfWv1C2fU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N5D+KE1sorx+nJNwYmmykBnzYmLYBUXOEZ0rLgXgBO1TlvtEaF1J7KvdMOolaDRFC xB0Ey1Yge60ftsDSeopdQbHaDNDqnmzDBG4fbSusG0CzjRZu19JrRNs/5j1S9ZrsX1 4v7brIVcIRYj0MTTzw7acyz7JeX6ISKX+coedll43a+uDMO+jGYu/bmGam60wESddm U03IbYinvvj27YM5Q7zWTZnzxHhCw6uMADnk0LGYvSfDVAAAErZ8mGCGCF67Rdh64S jHJYn3qJOJzyAhNRrz+RA8bR6ZFsrwe08ZUPo25uSFhSP/eUVQ/1Ll7TVawtUKSpMp gRdHzMvFfBNIg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3F7A25FF82; Fri, 9 Jan 2026 16:13:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 16:11:33 -0700 Message-ID: <20260109231151.4056804-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109231151.4056804-1-sjg@u-boot.org> References: <20260109231151.4056804-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YD2TE2ZPB4K5MCPZPHJOFXIGSCIVWCOP X-Message-ID-Hash: YD2TE2ZPB4K5MCPZPHJOFXIGSCIVWCOP X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 24/32] boot: pxe: Drop fdtoverlay_addr_r check in label_boot_fdtoverlay() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Remove the upfront check for fdtoverlay_addr_r environment variable. If it doesn't exist, get_relfile_envaddr() will reserve an address using LMB. Also use the address returned by get_relfile_envaddr() for mapping the overlay blob, rather than re-reading from the environment variable. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_utils.c | 13 +------------ test/boot/pxe.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 2084bb3e9bf..b269ef13f5a 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -307,23 +307,12 @@ static void label_boot_fdtoverlay(struct pxe_context *ctx, struct pxe_label *label) { char *fdtoverlay = label->fdtoverlays; - char *fdtoverlay_addr_env; - ulong fdtoverlay_addr; int err; err = fdt_check_header(ctx->fdt); if (err) return; - /* Get the specific overlay loading address */ - fdtoverlay_addr_env = env_get("fdtoverlay_addr_r"); - if (!fdtoverlay_addr_env) { - printf("Invalid fdtoverlay_addr_r for loading overlays\n"); - return; - } - - fdtoverlay_addr = hextoul(fdtoverlay_addr_env, NULL); - /* Cycle over the overlay files and apply them in order */ do { struct fdt_header *blob; @@ -362,7 +351,7 @@ static void label_boot_fdtoverlay(struct pxe_context *ctx, /* Resize main fdt */ fdt_shrink_to_minimum(ctx->fdt, 8192); - blob = map_sysmem(fdtoverlay_addr, 0); + blob = map_sysmem(addr, 0); err = fdt_check_header(blob); if (err) { printf("Invalid overlay %s, skipping\n", diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 365aff9f37a..7132d318c56 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -611,8 +611,8 @@ PXE_TEST_ARGS(pxe_test_errors_norun, UTF_CONSOLE | UTF_MANUAL, * Test overlay loading when fdtoverlay_addr_r is not set * * This tests that when a label has fdtoverlays but fdtoverlay_addr_r is not - * set, the overlay loading is skipped with an appropriate warning message, - * but the FDT is still loaded successfully. + * set, overlay loading is attempted via LMB allocation. The FDT is still + * loaded successfully even if overlays fail to load. */ static int pxe_test_overlay_no_addr_norun(struct unit_test_state *uts) { @@ -676,13 +676,16 @@ static int pxe_test_overlay_no_addr_norun(struct unit_test_state *uts) ut_assertok(fdt_check_header(fdt)); /* - * Check console output - FDT loaded, but overlays skipped with - * warning about missing fdtoverlay_addr_r + * Check console output - FDT loaded, overlays attempted via LMB + * allocation but fail since test environment cannot load them */ ut_assert_nextline("Retrieving file: /vmlinuz"); ut_assert_nextline("Retrieving file: /initrd.img"); ut_assert_nextline("Retrieving file: /dtb/board.dtb"); - ut_assert_nextline("Invalid fdtoverlay_addr_r for loading overlays"); + ut_assert_nextline("Retrieving file: /dtb/overlay1.dtbo"); + ut_assert_nextline("Failed loading overlay /dtb/overlay1.dtbo"); + ut_assert_nextline("Retrieving file: /dtb/overlay2.dtbo"); + ut_assert_nextline("Failed loading overlay /dtb/overlay2.dtbo"); ut_assert_console_end(); /* Clean up */