From patchwork Sat Jan 10 20:28:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1454 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=1768077001; bh=/VON7Y6XKqm0HTcC+P7owMoySj+FrJYYU6dddtd1GqA=; 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=TYw5aHPnEIR0+X6bGVRIhzuE1zTeBA3wWqnYtSPScMV86igDux5U/RLn4cEVgfOlA tAyPadjuOiHN4lhJr2xBCGU745ESPjeiaq/lLqUg6bY01sB8ahEJi8K095pv4gQlqc bJyzOiidoBKZEeuD6LZ9cmf2CkwgynqPfGHXt6pCn6LpU0BEYla/NiMFjOZKDsT81X HrA0FQNuVpH0HngbrNuq+a88U5PhBtQqsxYRZjUaL17JRhNpqLdqceuFnq3zxt3bq6 Cg9eYWKnrCr5DE20xEqfzdB0maXgtg8+yl7V17RhEnucA7CN4d/f4xzi/t6ix716K3 Or21l/QtPGGhg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0875E69291 for ; Sat, 10 Jan 2026 13:30:01 -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 T6uy2ZUatHP4 for ; Sat, 10 Jan 2026 13:30:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768077000; bh=/VON7Y6XKqm0HTcC+P7owMoySj+FrJYYU6dddtd1GqA=; 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=QMoLRMsV39GXGZPXNN+x9oyczm/DdfhSqktS9KHX1izGt2pbFqWcpXtbJb4NtlS5L HZnvPL0cZpNWuVuBa9zdGJJdnaJcA3kPfokvMODVsEbto/c9jll2UOTA4b8NLQRlP8 wVoDwqzwOBTn1Kttmx+9iqDLZkKK0DtfNiODns6any9Okh3wBjQQpic6dvSy6XmkNX Lpe29t9PZz0a8caJRvcwK/xTg2MRs1iyFUYwD6w/yJYFTp+YyuaGL4eHEznzY+jBVG GPXcJbg+/aW4BmIQbifjlGIk4KAjz8EofBtzaru6vs3Sp4XJdt6fyUOzpvF9LlxDtG eLj6R90alkK2A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB2226927E for ; Sat, 10 Jan 2026 13:30:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768076998; bh=pp7/XmwgKhyTPHIjRi8uQPEE1DnBLK3CVfH4XdaIc1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NjIiTFyPpdQE6C36cJZv6J2Iqw5iN5mcDfZ2iZV0YBO6ZMd5Z1VHO+qbxTGFLDDGN F3dHebb/Oj8YCPkhfeoUX/C4XgnlpTH09KiwijRvcUqBxXMo78MO8+zotxyDbAUPyT y8jF8bRxOmt9KjOvVDvnYq50ymhWiqxM9X/e4MZrq2TI3fiRJPs/q67dW1tWkVhbJY GR4G0WBq1hxsnbWQC0mSeEG+M64MFdx4/vj79GyKq3pNISJogUrQXj+667zPa92oW0 DlEIgs6KBwzI3NXPn9EA7QJtBREwsqc4jcglHCmU5v/sRVA0ptMetaASdpdSdKqFm0 ghvqGkpsUX7zA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C18E969281; Sat, 10 Jan 2026 13:29:58 -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 Tvy5_jFRaPTb; Sat, 10 Jan 2026 13:29:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768076994; bh=fqJ2PWl2cn0eDlj3WjPYrKXQKM75ycGzXBdbpjPJOZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrZkmnZBfrCFs+cbzfVGrCts7XWvfmae92Hs/Uoucv3eoAjIsqMM6PwIZtbvkXnQR IBqLH4Y/QCorvjh5thMuCHKB2RfEOO2RdqTkNacAwYcAdklkXAGQwS6NNNeAueV7mV eEhFIHIumIbZIB4ZYB4KMtfqlgsMkP2gLjDoeY2RRsLhO9Y2b2O1m6ylL3ri2hkZ7f 8ycOnIwR3YB6iGUAJ7I6QBXplLfX4GkBFbWfM8QlzYcUOrjnSoBx8edJcG63MKpzxw H+VxTQPITBtgkpMVlE7kibnrKZIm++Kg9o0JW0BssE59zBQ2BbReL++JwWhes+rvxS Z4YO4H/5Otc1g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D5DF46927E; Sat, 10 Jan 2026 13:29:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 13:28:40 -0700 Message-ID: <20260110202906.187370-9-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: GGGORAAT3J4JZD4UAACDONHDJWQM52FB X-Message-ID-Hash: GGGORAAT3J4JZD4UAACDONHDJWQM52FB 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 08/26] boot: pxe: Add struct pxe_file for file loading 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 Add a struct to hold information about files that need to be loaded for PXE boot. This allows the caller to load files without using callbacks, similar to how include files are handled. The new struct pxe_file contains: - path: file path to load - type: file type (kernel, initrd, fdt, fdtoverlay) - addr: address where file was loaded (filled by caller) - size: size of loaded file (filled by caller) Also add a files alist to pxe_label to hold the list of files needed for booting that label. For now this is unused. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- include/pxe_utils.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/pxe_utils.h b/include/pxe_utils.h index f6ee0417a9b..2f194b91683 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -51,6 +51,7 @@ struct pxe_fdtoverlay { * @fdt: path to FDT to use * @fdtdir: path to FDT directory to use * @fdtoverlays: list of FDT overlays to apply (alist of struct pxe_fdtoverlay) + * @files: list of files to load (alist of struct pxe_file) * @say: message to print when this label is selected for booting * @ipappend: flags for appending IP address (0x1) and MAC address (0x3) * @attempted: 0 if we haven't tried to boot this label, 1 if we have @@ -71,6 +72,7 @@ struct pxe_label { char *fdt; char *fdtdir; struct alist fdtoverlays; + struct alist files; char *say; int ipappend; int attempted; @@ -93,6 +95,36 @@ struct pxe_include { int nest_level; }; +/** + * enum pxe_file_type_t - type of file to load for PXE boot + * + * @PFT_KERNEL: Kernel image + * @PFT_INITRD: Initial ramdisk + * @PFT_FDT: Flattened device tree + * @PFT_FDTOVERLAY: Device tree overlay + */ +enum pxe_file_type_t { + PFT_KERNEL, + PFT_INITRD, + PFT_FDT, + PFT_FDTOVERLAY, +}; + +/** + * struct pxe_file - a file that needs to be loaded + * + * @path: Path to the file + * @type: Type of file (kernel, initrd, etc.) + * @addr: Address where file was loaded (filled by caller) + * @size: Size of loaded file (filled by caller) + */ +struct pxe_file { + char *path; + enum pxe_file_type_t type; + ulong addr; + ulong size; +}; + /* * Describes a pxe menu as given via pxe files. *