From patchwork Sun Mar 22 23:57:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 2045 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=1774223877; bh=Fx18YBVIJmDr5l7nZ1d49ZWKZT/ChwUD9MzWd9aMA1A=; 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=cyRRu8ySQMAJjVtZLJGJL216MSM/5rwC7X+tB/e8An8fsIH1fto7LQ5k/iaA5M2L0 0cz5PMHYBi9SkEqyTl595xR/Cjnq1ws0FfrA2k/HtQ8xDhSlEKoc/O/E5kei6LZO6e BXE8R6M87bK51kiYScAKCIuaraEkeKIIeG5vUDVG1u12eKIisp2B7HKfBE21cHZ2SV fQk/RTgH5dxPNoyavNzrliF2ed8bAm0dPmtqnISZoQJvaAtIXDjEeK7NYQD+mRMu8E TkDCGV9FEYzqMiynkmz9UoVrhXCRGnJ5KQUf19iuL0mtsRWbIq3EapTVQWUWwz3K7G vbGmKjZgfZLtQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 48D276A1E3 for ; Sun, 22 Mar 2026 17:57:57 -0600 (MDT) 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 mjNvhSGbLMFX for ; Sun, 22 Mar 2026 17:57:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223874; bh=Fx18YBVIJmDr5l7nZ1d49ZWKZT/ChwUD9MzWd9aMA1A=; 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=c+nNo9WEhA5SgbpwSzbemdOOeNdS4pgBqW8M5YqifOJX+4kiwTephb4Koqj8NntXf t7LcXxX0Xy48k+0qitdwswyizcgRN/WhiJtiLuos3OAZNytfljkiOvicixCbB1G0T+ dGyvKXjTAlB3bstfYh88ug0/67Vq2kLN6+V9/oEFq49pqdjNvublbSSEp1+HVNsDHo SVT5fyHlwKEGHIrR4j4p0ohxiRs4vh1UaOPaN7rrb3TjgwBXpm/v1CYLl8+Q9EgBQV WB/msHT10MMLBxIrltPA+iRf+etVkCvQ+NDD8Z3Zv0/8/0/EmBAdTR1PTkLBlOb0VG P9n8Pxz+6hUHQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 217026A1F0 for ; Sun, 22 Mar 2026 17:57:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223871; bh=xd6Pk2Tzav8EnZhtCy+enH2daMGSQCdx4eShkZfKLKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UPc1QERS3iVL76OYk8vI3YdcxWBlMVzDTNBDszLr8gO2QBi2hmPW0EOgbhkhov1f2 KM+Kp+EikvQFG/A4cs4Uy0ocWoBNYdRiXwa8cNO8vSvJPf3D2/oR50w2oM0v+Rigf1 LQM+Z+FkXEpmUK9tdrk36NPKznaRogZxiDALRMVM7IiX+xn+1o0MgNIW7Tyz526huN 3haOBN7QHtdYBrZv0bVfLylFxZu5j/6n1aCJ20hoTACIhF0PVF7traZafF3EQMXEYX 7v3JE9guVvCy3ekhrVDPHbBjXB0z7jkCa7znj23eHR3MNsw0TIhVEC63bXO8fOVbW3 3XoA6kkjvlErQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 895196A1E2; Sun, 22 Mar 2026 17:57:51 -0600 (MDT) 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 egDUeFPDfHS7; Sun, 22 Mar 2026 17:57:51 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1774223867; bh=vScrvyWrPbnRMAZapQhPRQmS0C4OmVlsyOYBbZJhHSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JwABABkOxNvMbWF/gR34wf7SxCO3NCYkRmX2lzP+/j9tTNvjPwZk+CVvqUeu5zHOU sL1rkv8HQlzuVD1BgetvW1m9kaAuWmYnHSbw4teh30KLjLnecjVqE8TldgsShopYMK 4ahRUxo7tYbiMbjpBHoJ7lowCFTe6qXCFaZIMgrJq3Cwemxh75sus9afiTEJY1kFkS 0taCNCMIunXECKconYw+BjngJuci3sW2kYho+6rga6jLmGoj00oJrl0QN69RpIH9Sy 0a/SpeUTdqFduZF1NfUhbvmxJqS5ANpd2XLQUjZtnTwOkaqaSptCQl9KdEXqDeLYaR pC9ehpVd4EQRA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9C85D6A1EF; Sun, 22 Mar 2026 17:57:47 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Sun, 22 Mar 2026 17:57:11 -0600 Message-ID: <20260322235719.1729267-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260322235719.1729267-1-sjg@u-boot.org> References: <20260322235719.1729267-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BS3QZWBIYD6LLOXJIRRG6H4KISDGFZ5M X-Message-ID-Hash: BS3QZWBIYD6LLOXJIRRG6H4KISDGFZ5M 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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/14] bootstd: Add bootmeth_id to struct bootflow 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 bootmeth_id field to struct bootflow that bootmeths can use to store an identifier for this bootflow, e.g. an alist index for the PXE context used during scanning. Initialise it to -1 (not set) in bootflow_init(). Signed-off-by: Simon Glass --- boot/bootflow.c | 1 + doc/develop/bootstd/overview.rst | 5 ++++- include/bootflow.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/boot/bootflow.c b/boot/bootflow.c index d6549b5ce9a..dbda50b8231 100644 --- a/boot/bootflow.c +++ b/boot/bootflow.c @@ -712,6 +712,7 @@ void bootflow_init(struct bootflow *bflow, struct udevice *bootdev, bflow->dev = bootdev; bflow->method = meth; bflow->state = BOOTFLOWST_BASE; + bflow->bootmeth_id = -1; alist_init_struct(&bflow->images, struct bootflow_img); } diff --git a/doc/develop/bootstd/overview.rst b/doc/develop/bootstd/overview.rst index 0ff4868ba44..049aec56931 100644 --- a/doc/develop/bootstd/overview.rst +++ b/doc/develop/bootstd/overview.rst @@ -853,7 +853,10 @@ Each bootdev device has its own `struct bootdev_uc_plat` which holds a list of scanned bootflows just for that device. The bootflow itself is documented in bootflow_h_. It includes various bits of -information about the bootflow and a buffer to hold the file. +information about the bootflow and a buffer to hold the file. The ``bootmeth_id`` +field allows a bootmeth to associate an identifier with each bootflow, such as +an index into a list of parsed configurations. It is initialised to -1 (not +set) and its interpretation is up to the bootmeth. The ``bootmeth_priv`` field allows a bootmeth to attach private data to each bootflow, such as parsed configuration state. When the bootflow is freed, diff --git a/include/bootflow.h b/include/bootflow.h index 65aebefd3b3..dbdbca96596 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -101,6 +101,9 @@ enum bootflow_flags_t { * @bootmeth_priv: Private data for the bootmeth (allocated). Freed by * bootmeth_free_bootflow() which calls the bootmeth's free_bootflow() op * for internal cleanup, then frees the pointer itself. + * @bootmeth_id: Bootmeth-specific identifier for this bootflow, e.g. an + * alist index for the PXE context used during scanning. Interpretation + * is up to the bootmeth. * @images: List of loaded images (struct bootstd_img) */ struct bootflow { @@ -127,6 +130,7 @@ struct bootflow { char *cmdline; void *x86_setup; void *bootmeth_priv; + int bootmeth_id; struct alist images; };