From patchwork Mon Sep 22 18:00:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 391 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=1758564120; bh=mPXvTEmgVO0mqmeDaCks5nU4X5TrZU2SZfl7VNT9Nz8=; 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=GDCAlWb1zs8cy7Tcfw8djxCOayLCiWBK/vnsr31FsjGlMhwfYld/6HUx+MmzpIXPi fkzKE8XMNSdv2Vkt/V3SwCEqqyDLGxrPi3VZNthHH2DFzLrs7d/WFXpUjuzr5vAOOA +bdleVC4AoCN0MzVyqh0bf735I9/tVMCJ20SNneikqO9nsnoCA8gNArSB4MWlkfgX/ b8txKwONncrYu1AtbKrPlI46zPHM4OJWljtdh791XLdcOND8iTep7xK3MoxKD67MTk cCPW9VZCUtx67nT7OWqtv+nIaXScNe3yK4O9rZI2wNmiWrIsAr6B3Dxr+jlYl1KAIc OZRsVqDw2AWvA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 87A2E67C65 for ; Mon, 22 Sep 2025 12:02:00 -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 ilxjE9iflldf for ; Mon, 22 Sep 2025 12:02:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564120; bh=mPXvTEmgVO0mqmeDaCks5nU4X5TrZU2SZfl7VNT9Nz8=; 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=GDCAlWb1zs8cy7Tcfw8djxCOayLCiWBK/vnsr31FsjGlMhwfYld/6HUx+MmzpIXPi fkzKE8XMNSdv2Vkt/V3SwCEqqyDLGxrPi3VZNthHH2DFzLrs7d/WFXpUjuzr5vAOOA +bdleVC4AoCN0MzVyqh0bf735I9/tVMCJ20SNneikqO9nsnoCA8gNArSB4MWlkfgX/ b8txKwONncrYu1AtbKrPlI46zPHM4OJWljtdh791XLdcOND8iTep7xK3MoxKD67MTk cCPW9VZCUtx67nT7OWqtv+nIaXScNe3yK4O9rZI2wNmiWrIsAr6B3Dxr+jlYl1KAIc OZRsVqDw2AWvA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7707667C32 for ; Mon, 22 Sep 2025 12:02:00 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564118; bh=j09zRc+HFc4sUpqJw4XTY4Gv1hwy8zot9cjIe7lebeQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vHz1oOHxueTRjteUYVSlUHWtziBpiMpyIBa7oVhyI7pp2W8AJzQRqvbnF+bzLvJ0J QFh0eFYcB/ITtt9sLhUi6yBr7yd8Iqth10RhpqWen/AfcoHxF3tKC+xBIrTYTgjhir VwiwZgAdi6wyuOo2RRyBWH9aiAwo/gV8rmRE5ikkedTC6B5JZI5z5jyi4MYB23M8S6 bAM7f2XRajU1zx2MphjlG5B5DEFCmqkpyhZelbGPAI7hla3yY0CavVHOpaK3jY/N/s xSjYwOptYm3KlE99/GzelNEOy5Rp+jmNvfMNdPaaGHo9OHaLU3PpfEKCaIgQll/liW BR68cCIXom1kg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C09BA5FE1A; Mon, 22 Sep 2025 12:01:58 -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 zXw2EPsR9u0u; Mon, 22 Sep 2025 12:01:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758564114; bh=65I4LP/MGHma2IuBzqi5avnXRrfFU1dhGisMtOkmLEU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HB37CGrSgy0R+HyH62/+DcVEEI0Hs07OOnfjCO3ljGCP8HMfOhSutpc8Ry/GIfZtY AUrSy8fDL/hXo/dDSOXod8gHEC62ARyHlTAtyH49iSgMCeWlKwRf2OqYhwgsbUzJOu pQgcOGY8hMmK5eZZSdmDqvUVm+82k9bhBnT5E+T+NxeOO5MZDMuQkvxJ18uBAhazFX lNZ7Ar0JH7Bt/rzOsoCiQQGflSeFS4oIQQMb/qRF2X1vaUVlPMKNvALbc21uZ8RAcL YX8SgXA4gJLJhuOKq4nPsq+lCjakGfowBBVajhGyPVWQJzzdDvwZ8KMvoGyeHVVVoG j84OHlgRCvYLQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7885E67B38; Mon, 22 Sep 2025 12:01:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 22 Sep 2025 12:00:51 -0600 Message-ID: <20250922180116.3088502-8-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: 4LWJNVOGEHJ4URPELWMJ3TC73HC5W65S X-Message-ID-Hash: 4LWJNVOGEHJ4URPELWMJ3TC73HC5W65S 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 07/24] boot: Provide a Kconfig to enable faking the boot 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 This feature was designed for tracing but can be useful for debugging too, since it is possible to examine the state of the system just before handing off to the OS. Provide a separate CONFIG_BOOTM_FAKE_GO option to allow this feature to be used separate from tracing. Enable it for the EFI app. Signed-off-by: Simon Glass --- boot/Kconfig | 8 ++++++++ boot/bootm.c | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/boot/Kconfig b/boot/Kconfig index 13036fd3a09..8f0cecfb1f6 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -453,6 +453,14 @@ config BOOTM_VXWORKS help Support booting VxWorks images via the bootm command. +config BOOTM_FAKE_GO + bool "Support faking a boot, for debugging purposes" + default y if TRACE || EFI_APP + help + Provides a way to fake the boot, so that almost everything is done + to prepare for the boot, but the jump to the OS does not actually + happen. This can be useful for debugging. + endif # BOOT config PXE_UTILS diff --git a/boot/bootm.c b/boot/bootm.c index a536737db09..0981494a2b8 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -1260,9 +1260,9 @@ int bootm_run_states(struct bootm_info *bmi, int states) ret = boot_fn(BOOTM_STATE_OS_PREP, bmi); } -#ifdef CONFIG_TRACE /* Pretend to run the OS, then run a user command */ - if (!ret && (states & BOOTM_STATE_OS_FAKE_GO)) { + if (IS_ENABLED(CONFIG_BOOTM_FAKE_GO) && !ret && + (states & BOOTM_STATE_OS_FAKE_GO)) { char *cmd_list = env_get("fakegocmd"); log_debug("fake_go\n"); @@ -1270,7 +1270,6 @@ int bootm_run_states(struct bootm_info *bmi, int states) if (!ret && cmd_list) ret = run_command_list(cmd_list, -1, 0); } -#endif /* Check for unsupported subcommand. */ if (ret) {