From patchwork Mon Sep 22 18:00:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 397 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=1758564138; bh=U0bphEFhu+XB6clY8SF+5ApGgjHtZHNn62vb5vo1KSY=; 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=GYH45RDRONC0YTRc02DTMU+QzK4eZJQMeHLTdUH84YxXibZMYCv1VTDKSJ5nysZ1E vtTXCeGCRfTtrCEKTtDn0jtiYwj6J5D531I91/XTu4hKAZVCa1/22XTuS8QtmElbww 0TXIF1LiAAZb+u8augzoir7Ds6zfLQl5xg2x0qvoe8wlhqh/AWHsmQB9EOhmhxrOMn aBsGc97w9tsT4GQCSE70mqwozKWRoZVNkNHy+TdF0P3uxx3tG+v66oEabewcysS7Zu VCHCupIYMm/pcc/DZ6X+9nkGmGGwXJepSLQmPgHG2ZlcN1FWBv5ioCdQxpXPc5tjTa 7tGWDqRR3KXxw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D759D67C52 for ; Mon, 22 Sep 2025 12:02:18 -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 9HYdsOc7LRbR for ; Mon, 22 Sep 2025 12:02:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564138; bh=U0bphEFhu+XB6clY8SF+5ApGgjHtZHNn62vb5vo1KSY=; 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=GYH45RDRONC0YTRc02DTMU+QzK4eZJQMeHLTdUH84YxXibZMYCv1VTDKSJ5nysZ1E vtTXCeGCRfTtrCEKTtDn0jtiYwj6J5D531I91/XTu4hKAZVCa1/22XTuS8QtmElbww 0TXIF1LiAAZb+u8augzoir7Ds6zfLQl5xg2x0qvoe8wlhqh/AWHsmQB9EOhmhxrOMn aBsGc97w9tsT4GQCSE70mqwozKWRoZVNkNHy+TdF0P3uxx3tG+v66oEabewcysS7Zu VCHCupIYMm/pcc/DZ6X+9nkGmGGwXJepSLQmPgHG2ZlcN1FWBv5ioCdQxpXPc5tjTa 7tGWDqRR3KXxw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C71285FE1A for ; Mon, 22 Sep 2025 12:02:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564136; bh=pNKgi7VCc7ot3gOVgdzLYwrz9U7VymWJVUrob3ifP2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npagOOXg/F2jr9y+PeOLqBwWsMWZPNsIcIPm8LJsONaz495M+GfZ7mvLaVDBEFecV qgAG7C0skvNv3WY/a8H+5swuTpXmBgTpGK3Ooi/NBrapZi24rIiK2F+J0oVld5c+Vs vN7GTTfMEcXzGKXM4o2Bm0jxKcoSKZzHM7phpYmqQO7DLfAsc25nbuI8G4+VraR+ce +Bj6FrNGy+1R+2aTZb5IAbfPF3aFs3XTbbQYoxeIdJwO4ULMztWwrWVkn+TBdflECl dVjnfXW3ixWla5pZ4cV6tyecklNCc7Y/HX1E4r2X+EyF6y2Lv83zrrVGKI4K8Ut0rH T7F0lN0qfzzKw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7DA3767C52; Mon, 22 Sep 2025 12:02:16 -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 NyMmmi1W2M-s; Mon, 22 Sep 2025 12:02:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564129; bh=F34RV414OMsqKJ1RiB5h4y9bWxfqZ2ZP6gc2C8IHuzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QhekJ8xR4weP9ECzO00lFBHE0rGogNWhO2diWRlV7/m0RXoDVT5BMr9/5e2984kC+ ssdH/tHd5C9dSO3/rZSZ91FMxe64DRaGKAe/xIi0Yfu8YY//U6VYutrrE5s38ia3xI DYlykh1nL8qIR9Z9yxdAPfrITYyRcRaoTLYmXXIpvzEAzBmu8uGpMYqCFTQSG+TEJd stBdvmbQS6Gux+Yu1wLqt3H9GiW2s30FU+pX1jKvIEcH8TDgdyAkCMLr5dvD3M8Dt+ fwdpqEsQykG8XX5NRVgUS2RMJUYz2trBk2tx0wt6/wEpFRSYFIiAMPpWCEA4RH3/lE g9CVc4jZ1epyQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4DA285FE1A; Mon, 22 Sep 2025 12:02:09 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:57 -0600 Message-ID: <20250922180116.3088502-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250922180116.3088502-1-sjg@u-boot.org> References: <20250922180116.3088502-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 4E6MXVMN7VXZJSVRZAT7ZKMXDPOVZO4N X-Message-ID-Hash: 4E6MXVMN7VXZJSVRZAT7ZKMXDPOVZO4N 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/24] boot: Support a fake go with pxe 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 Provide a way to pass the 'fake go' flag from the bootflow flag through to the PXE implementation, so that a request for a fake go (via 'bootflow boot -f') is handled correctly in the bootmeth and when booting. Add a little more debugging of this in PXE. Signed-off-by: Simon Glass --- boot/ext_pxe_common.c | 4 ++++ boot/pxe_utils.c | 21 ++++++++++++++++++--- include/pxe_utils.h | 2 ++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/boot/ext_pxe_common.c b/boot/ext_pxe_common.c index 67d7b68d310..3b1412b86d3 100644 --- a/boot/ext_pxe_common.c +++ b/boot/ext_pxe_common.c @@ -89,6 +89,9 @@ static int extlinux_setup(struct udevice *dev, struct bootflow *bflow, false, plat->use_fallback, bflow); if (ret) return log_msg_ret("ctx", ret); + log_debug("bootfl flags %x\n", bflow->flags); + if (bflow->flags & BOOTFLOWF_FAKE_GO) + ctx->fake_go = true; return 0; } @@ -103,6 +106,7 @@ int extlinux_boot(struct udevice *dev, struct bootflow *bflow, /* if we have already selected a label, just boot it */ if (plat->ctx.label) { + plat->ctx.fake_go = bflow->flags & BOOTFLOWF_FAKE_GO; ret = pxe_do_boot(&plat->ctx); } else { ret = extlinux_setup(dev, bflow, getfile, allow_abs_path, diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 13fd815451d..981023a3012 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -427,6 +427,11 @@ skip_overlay: static int label_process_fdt(struct pxe_context *ctx, struct pxe_label *label, char *kernel_addr, const char **fdt_argp) { + log_debug("label '%s' kernel_addr '%s' label->fdt '%s' fdtdir '%s' " + "kernel_label '%s' fdt_argp '%s'\n", + label->name, kernel_addr, label->fdt, label->fdtdir, + label->kernel_label, *fdt_argp); + /* For FIT, the label can be identical to kernel one */ if (label->fdt && !strcmp(label->kernel_label, label->fdt)) { *fdt_argp = kernel_addr; @@ -594,7 +599,11 @@ static int label_run_boot(struct pxe_context *ctx, struct pxe_label *label, int states; states = ctx->restart ? BOOTM_STATE_RESTART : BOOTM_STATE_START; - log_debug("using bootm\n"); + log_debug("using bootm fake_go=%d\n", ctx->fake_go); + if (ctx->fake_go) + states |= BOOTM_STATE_OS_FAKE_GO; + else + states |= BOOTM_STATE_OS_GO; ret = boot_run(&bmi, "ext", states | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS); @@ -782,8 +791,10 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) if (!conf_fdt_str) { if (!IS_ENABLED(CONFIG_SUPPORT_PASSING_ATAGS) || - strcmp("-", label->fdt)) + strcmp("-", label->fdt)) { conf_fdt_str = env_get("fdt_addr"); + log_debug("using fdt_addr '%s'\n", conf_fdt_str); + } } if (!conf_fdt_str) { @@ -792,13 +803,17 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) buf = map_sysmem(kern_addr, 0); if (genimg_get_format(buf) != IMAGE_FORMAT_FIT) { if (!IS_ENABLED(CONFIG_SUPPORT_PASSING_ATAGS) || - strcmp("-", label->fdt)) + strcmp("-", label->fdt)) { conf_fdt_str = env_get("fdtcontroladdr"); + log_debug("using fdtcontroladdr '%s'\n", + conf_fdt_str); + } } unmap_sysmem(buf); } if (conf_fdt_str) conf_fdt = hextoul(conf_fdt_str, NULL); + log_debug("conf_fdt %lx\n", conf_fdt); if (ctx->bflow && conf_fdt_str) ctx->bflow->fdt_addr = conf_fdt; diff --git a/include/pxe_utils.h b/include/pxe_utils.h index 9100a861ba1..7ecb5788d0b 100644 --- a/include/pxe_utils.h +++ b/include/pxe_utils.h @@ -135,6 +135,7 @@ typedef int (*pxe_getfile_func)(struct pxe_context *ctx, const char *file_path, * @conf_fdt: FDT address * @restart: true to use BOOTM_STATE_RESTART instead of BOOTM_STATE_START (only * supported with FIT / bootm) + * @fake_go: Do a 'fake' boot, up to the last possible point, then return */ struct pxe_context { /** @@ -170,6 +171,7 @@ struct pxe_context { char *conf_fdt_str; ulong conf_fdt; bool restart; + bool fake_go; }; /**