From patchwork Sat Jan 10 20:28:46 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1460 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=1768077026; bh=/1cCurKWA94dAt09QGObCSSGb1oXga1MoiWDcO7ASGI=; 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=rdk00yaGePwb4TqzOPEdIm66yBxyCoiAQ7WwSOKQf6oBkbxdbwrnAJ9APh2GP9or/ sjKWvMofpMJd0lXyfBi1t9kp3cKe+kCK6riOlJfyx/6fMu84FaDrV6O0ayRmO2U+2E a8V6lL0iQHapIpyF6bsnSc7ly378srpeY9BtZA5563WCYrEYXChRHq/Bew5bbgrLEh R8RbZ/wEGebfwhB65EUgIeF3qAlBivZ+8fh9x5vmtYnlVaE5BQWsABNCYrShEy4LMK HNhA7+p7ooNdg+lEO7qI8M1oJjitDHlJdRH8OjsZJhKSNo9uVIoRU/B0cMzynQU/sU X2JOO+6YsjN3Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9077B69186 for ; Sat, 10 Jan 2026 13:30:26 -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 qmrGPZfdeaEd for ; Sat, 10 Jan 2026 13:30:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077026; bh=/1cCurKWA94dAt09QGObCSSGb1oXga1MoiWDcO7ASGI=; 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=rdk00yaGePwb4TqzOPEdIm66yBxyCoiAQ7WwSOKQf6oBkbxdbwrnAJ9APh2GP9or/ sjKWvMofpMJd0lXyfBi1t9kp3cKe+kCK6riOlJfyx/6fMu84FaDrV6O0ayRmO2U+2E a8V6lL0iQHapIpyF6bsnSc7ly378srpeY9BtZA5563WCYrEYXChRHq/Bew5bbgrLEh R8RbZ/wEGebfwhB65EUgIeF3qAlBivZ+8fh9x5vmtYnlVaE5BQWsABNCYrShEy4LMK HNhA7+p7ooNdg+lEO7qI8M1oJjitDHlJdRH8OjsZJhKSNo9uVIoRU/B0cMzynQU/sU X2JOO+6YsjN3Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CC696927E for ; Sat, 10 Jan 2026 13:30:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077024; bh=zqvjX57SRT4nt6JZey8pwp9nf/RnfCOwp58IHP+V9UQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hjY5PBERsT+tbT7Tgi3f9YnFOp7d5H4nRIfvf15zVk6UjOKDb9YkVfEHuUCYqVHqu pWtpddqvpDFpSv4lgy82T4aI44/QzpRjRhMNxaXzxN+6xbU/6zn1XKJd5qXd0B2whC LmrKJ8Pd/P545/BrdCkHqkmzRZMUXM26GTKVP3HmzkiFURYr4wjSsAuHrIdVqn8ipa 6C4E19+M2xNxxWoVg2PN7wBif/ZzY5jxinG6LUPe/9F1zZEiKm8qvKIzGVw2YZaHmU V19Yj8YSP8TEZa908MFxLE3rmvH2/vNF8SX7KkG5rekseaHYIhzIhA0LU8S8AZzIds WX273q7dlkOYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F4B169299; Sat, 10 Jan 2026 13:30:24 -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 JVAxhbQRLwcN; Sat, 10 Jan 2026 13:30:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077018; bh=0Qkz/9ejDqq0EXMeAGfx9SYG/EUqT06S98B0b2ZfGIk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m5KbFvjb1k4n267VuMSGFYWegSDhf59ozWCQAqgRjbd5Z9Sc02VtiHBm3GP8dHY17 rnxH95YdFP6yI9U/bq/xT3rZEXPMiHnggbh4fmxWIFUzpI+LXH3sqIBpmo+ZoOqqzR ypdOxxXnwvod1jpwAi4jaNvPRQlnlBfweEat4vY3AzbJiD5lEy15l9X47Onsln2Jtq HW3AdG/8H8WkPCRVlpKRmlLqzdgXXN2yb3zrZxFcHtzOkMRqk0J53lUkaDDNws83SC ++p8Tu9aeRc/7EHbkz6odLB5yZsIWG/RU9yjD7A2xtYIyT9Didau5zawUHYG8xMYKD ZgYTdcddBEDlA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 803746927E; Sat, 10 Jan 2026 13:30:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:28:46 -0700 Message-ID: <20260110202906.187370-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110202906.187370-1-sjg@u-boot.org> References: <20260110202906.187370-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WXS336Z47OSABM2PGODXPUSNQKFRYDNV X-Message-ID-Hash: WXS336Z47OSABM2PGODXPUSNQKFRYDNV 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 14/26] boot: pxe: Add the FDT to the files list when parsing 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 When parsing an fdt directive, add the path to the files list with type PFT_FDT. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/pxe_parse.c | 6 +++++- test/boot/pxe.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/boot/pxe_parse.c b/boot/pxe_parse.c index 7dac5c94759..bcbe0495cbb 100644 --- a/boot/pxe_parse.c +++ b/boot/pxe_parse.c @@ -625,8 +625,12 @@ static int parse_label(char **c, struct pxe_menu *cfg) } break; case T_FDT: - if (!label->fdt) + if (!label->fdt) { err = parse_sliteral(c, &label->fdt); + if (err < 0) + break; + err = label_add_file(label, label->fdt, PFT_FDT); + } break; case T_FDTDIR: if (!label->fdtdir) diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 0751228dc99..2d690141349 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -190,15 +190,17 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_asserteq_str("/initrd.img", label->initrd); ut_asserteq_str("/dtb/board.dtb", label->fdt); ut_assertnull(label->fdtdir); - ut_asserteq(4, label->files.count); + ut_asserteq(5, label->files.count); ut_asserteq_str("/vmlinuz", alist_get(&label->files, 0, struct pxe_file)->path); ut_asserteq_str("/initrd.img", alist_get(&label->files, 1, struct pxe_file)->path); - ut_asserteq_str("/dtb/overlay1.dtbo", + ut_asserteq_str("/dtb/board.dtb", alist_get(&label->files, 2, struct pxe_file)->path); - ut_asserteq_str("/dtb/overlay2.dtbo", + ut_asserteq_str("/dtb/overlay1.dtbo", alist_get(&label->files, 3, struct pxe_file)->path); + ut_asserteq_str("/dtb/overlay2.dtbo", + alist_get(&label->files, 4, struct pxe_file)->path); ut_asserteq_str("Booting default Linux kernel", label->say); ut_asserteq(0, label->ipappend); ut_asserteq(0, label->attempted); @@ -306,7 +308,7 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) * environment, and verify overlay files can be loaded. */ label = list_first_entry(&cfg->labels, struct pxe_label, list); - ut_asserteq(4, label->files.count); + ut_asserteq(5, label->files.count); /* Set environment variables for file loading */ ut_assertok(env_set_hex("kernel_addr_r", PXE_KERNEL_ADDR)); @@ -325,15 +327,15 @@ static int pxe_test_parse_norun(struct unit_test_state *uts) ut_asserteq(PXE_KERNEL_ADDR, ctx.kern_addr); ut_asserteq(PXE_FDT_ADDR, ctx.fdt_addr); - /* Verify overlays were loaded to valid addresses (indices 2 and 3) */ - ut_assert(alist_get(&label->files, 2, - struct pxe_file)->addr >= PXE_OVERLAY_ADDR); + /* Verify overlays were loaded to valid addresses (indices 3 and 4) */ ut_assert(alist_get(&label->files, 3, struct pxe_file)->addr >= PXE_OVERLAY_ADDR); + ut_assert(alist_get(&label->files, 4, + struct pxe_file)->addr >= PXE_OVERLAY_ADDR); /* Second overlay should be at a higher address than the first */ - ut_assert(alist_get(&label->files, 3, struct pxe_file)->addr > - alist_get(&label->files, 2, struct pxe_file)->addr); + ut_assert(alist_get(&label->files, 4, struct pxe_file)->addr > + alist_get(&label->files, 3, struct pxe_file)->addr); /* Verify no more console output */ ut_assert_console_end();