From patchwork Mon Sep 22 18:00:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 392 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=1758564123; bh=kSwPyGiDpnlObASyd7p1Vz8Klxn6LvzJ6Ouu2MSnQ+M=; 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=Ipv6bSRVuXP6hCmbWRo/MMy8VjNAKRguSVmUcrKZ8TsBFKna/JzCn0aD7XyOJzPvD ieukyB7DSoWOyi1WkXhhTz2ZFbg1fabnZz54/aZxoE/vy5gjmfMkajlBeOX4Zbqfve Z6+zGZZaXao53aDl8smTEde+AgAHotAGDL/izNXQMLIKmQ2znTh7BHiWWWjA/Hco8G B4Kn9rVKFNy9PHfs1Z466DTNmY8s94zbZlINHby9CUC/Ud0b6SzG8GKb2T5Oja5KGM ikuPICXIIj8GtJuoAzz1MZPlVmdMy6BAFVlY2eZgD9b+SiZUpg0u1yfT/a2SKL4MRh yWbn983xUFXkA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EA38167CB4 for ; Mon, 22 Sep 2025 12:02:03 -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 gWEAEPoysj1a for ; Mon, 22 Sep 2025 12:02:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564123; bh=kSwPyGiDpnlObASyd7p1Vz8Klxn6LvzJ6Ouu2MSnQ+M=; 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=Ipv6bSRVuXP6hCmbWRo/MMy8VjNAKRguSVmUcrKZ8TsBFKna/JzCn0aD7XyOJzPvD ieukyB7DSoWOyi1WkXhhTz2ZFbg1fabnZz54/aZxoE/vy5gjmfMkajlBeOX4Zbqfve Z6+zGZZaXao53aDl8smTEde+AgAHotAGDL/izNXQMLIKmQ2znTh7BHiWWWjA/Hco8G B4Kn9rVKFNy9PHfs1Z466DTNmY8s94zbZlINHby9CUC/Ud0b6SzG8GKb2T5Oja5KGM ikuPICXIIj8GtJuoAzz1MZPlVmdMy6BAFVlY2eZgD9b+SiZUpg0u1yfT/a2SKL4MRh yWbn983xUFXkA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D102E67C32 for ; Mon, 22 Sep 2025 12:02:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564122; bh=9GiD8/ijozvy+nYHBU7nrxayTCuDOGttMMhRAnLqXVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HBLGnjo1U5kvFPIXBl4usho4fgMw+UNiaDcp14gfWKbke4QN1HB/n47kxIxt/JdF1 qqabzkUTceoqlBMYjnHF37c2RuaesFESntMmBpHYIrcdXjzc/c0WQ5/KQ/mp9n7hjx qJbkaXjTyOqTg5zcxT/odP1c7oFEc7A1GAHrADieuH6SCyT0cxSPGn9QFO4RQ6ENGO 7Xl+1M9+RjJLLsXASsryv5OkFtCzuSpplQQt16GapGENnOoI5wWncEJ/mIl7qz5cee iVxAJDnFxHdQ8rhGeN+0LWCI50dJEzepZN8TePU8hBno+YQiw3u3tOO8UNvhCrmCXy m+Blj2Kjy6NYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D584367C68; Mon, 22 Sep 2025 12:02:02 -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 J_9Nb7JtfMuY; Mon, 22 Sep 2025 12:02:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564119; bh=ZFo8cakkmEF7w4nt2ZitBE+JID2UOCcR0QYT1e2SZ/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c2eDARfCj0RB+qgTkoV8y0qYhVJaqkbKP6+7t49Q2LaVSM8GvlELBFIWo1GkLyFZi OlwQCbxmm6A2HRVIlFeOdDsOH1Ldj+IF3QHaBFjvJlDt68flQnOcheRbUTjnjERwq3 DnPaIS2tcUeGiY7v606X/j8tWFggX0rrPZ0yYGSOBzqiRiyqZ1y1zxFUppyMG2EPJv 4R/dIyBEgTcZQ+XbmV90AbqMCxILUhL50n3AZRp7B6ky/rMV63iDvV2wGMr5Kh7QSS R7CbrOU5NbvEBKrLYk7utv8XrGpKD+OcDxcTchP1hEl/ohdiAHDyJhdz3fxmETDVN9 1JhxmIjVIxZxA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 10C7F67B38; Mon, 22 Sep 2025 12:01:59 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:52 -0600 Message-ID: <20250922180116.3088502-9-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: L65CE4ZCMOTKMVPALZES4PZ7IPZZFESY X-Message-ID-Hash: L65CE4ZCMOTKMVPALZES4PZ7IPZZFESY 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 08/24] boot: Select the fake-go state explicitly 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 Rather than always going through this state, require callers to explicitly request it. This will allow the option to be enabled without affecting the boot, unless the user expressly requests it. Signed-off-by: Simon Glass --- boot/bootm.c | 9 ++++----- doc/usage/cmd/bootm.rst | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boot/bootm.c b/boot/bootm.c index 0981494a2b8..d86fedc7be1 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1300,8 +1300,7 @@ int boot_run(struct bootm_info *bmi, const char *cmd, int extra_states) int states; bmi->cmd_name = cmd; - states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP | - BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO; + states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP; if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH)) states |= BOOTM_STATE_RAMDISK; states |= extra_states; @@ -1318,7 +1317,7 @@ int bootm_run(struct bootm_info *bmi) { return boot_run(bmi, "bootm", BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | - BOOTM_STATE_LOADOS); + BOOTM_STATE_LOADOS | BOOTM_STATE_OS_GO); } int bootz_run(struct bootm_info *bmi) @@ -1356,7 +1355,7 @@ int bootz_run(struct bootm_info *bmi) images->os.os = IH_OS_LINUX; - return boot_run(bmi, "bootz", 0); + return boot_run(bmi, "bootz", BOOTM_STATE_OS_GO); } int booti_run(struct bootm_info *bmi) @@ -1365,7 +1364,7 @@ int booti_run(struct bootm_info *bmi) return boot_run(bmi, "booti", BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER | - BOOTM_STATE_LOADOS); + BOOTM_STATE_LOADOS | BOOTM_STATE_OS_GO); } void bootm_read_env(struct bootm_info *bmi) diff --git a/doc/usage/cmd/bootm.rst b/doc/usage/cmd/bootm.rst index 5af331873ce..dde441d8360 100644 --- a/doc/usage/cmd/bootm.rst +++ b/doc/usage/cmd/bootm.rst @@ -130,7 +130,8 @@ prep are required. After this the OS itself is ready to boot. fake - This is only used for testing and only available when `CONFIG_TRACE` is + This is only used for testing and only available when `CONFIG_BOOTM_FAKE_GO` + is enabled. It fakes a boot of the OS, performs all the normal steps right up to the point where U-Boot is about to jump to the OS. It then runs a list of commands from the `fakegocmd` environment variable. Note that the