From patchwork Wed Jun 19 12:34:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1949673 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=mTeBAmC3; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W433r21Ccz20XW for ; Wed, 19 Jun 2024 22:35:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6360088476; Wed, 19 Jun 2024 14:35:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mTeBAmC3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84B4C87923; Wed, 19 Jun 2024 14:34:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 70646881C6 for ; Wed, 19 Jun 2024 14:34:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7eb6b1045f7so227488739f.3 for ; Wed, 19 Jun 2024 05:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718800496; x=1719405296; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mFX2W7ShG88fWRML5sLLz2A3FSXY/nbg99ZII5hlqQs=; b=mTeBAmC3ihbGie5ZhYbccvBWdtD84MBsJJ/bUj7J2MGaf5MO8vwWiqhetxunYnlRdg z/KK9r8KcX7IYkImGZmWxdMIA33fgfrW6C50qkm+6oAAusJcj1JP13Xoi9/dllzqdP71 CdQQgfgU/qE5R5AdFXzlClXgExok22WM9ThM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718800496; x=1719405296; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mFX2W7ShG88fWRML5sLLz2A3FSXY/nbg99ZII5hlqQs=; b=HBHzIu+WXFRMo4TvQF9n/EKVyncJ88l7i4I9ArxnvOjBtzjySV8rXOjJZK/Rwm1eV2 CDGnOS+VVK32paU3GgKrUvH6AW0yKDj0gAe/hfO9eZdmQwFZ3jByXI7IwMsRE67+RMwe qgQgee3vP7U5AzbGJ4JEoULngrxZWxZXo3zUCeVu2n7NPy5Nb7qf4nvomexf5gbKW7v4 zKWuzuRabo3/JN6BDTzbnezCkcdyClcteyGlt0N2tjEHkAw+m3poHIcwtAluQFwUMPK1 vzadVa38By3bo80kZ74JVJ5LpWNPMgTv+dQyvl57Zpp848H6CGMFr6zxMl/rC1eVHGZp S36A== X-Gm-Message-State: AOJu0YxoRCYtQmABkDUIq2LMbhgOvhf51kS4l8pEPNcPuVv3LVPw6+sL dLHTLTpBnsRnERZGN5CW9SnJTaj6KsDJCNVSAPb0I469aE9BTen/hSud26Ypa6enEZNiy6y5ucd F4Q== X-Google-Smtp-Source: AGHT+IHLswwISAWQQlmerEg73fSKKRmnBwbi8gVMoCIXWYMKkei8bFB2TKU7SsX7yPTTH+pBx+xHQQ== X-Received: by 2002:a05:6602:2cd4:b0:7eb:7e0c:d17f with SMTP id ca18e2360f4ac-7f13edb2730mr303597239f.1.1718800494981; Wed, 19 Jun 2024 05:34:54 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b956a20f18sm3701882173.133.2024.06.19.05.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 05:34:54 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Paul Menzel , Simon Glass , Dan Carpenter , Marek Vasut , Michael Trimarchi , Patrick Delaunay , Svyatoslav Ryhel , Thomas Mittelstaedt , Tom Rini Subject: [PATCH 1/3] pxe: Add debugging for booting Date: Wed, 19 Jun 2024 06:34:50 -0600 Message-Id: <20240619123453.720600-1-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Show which boot protocol is being used. Signed-off-by: Simon Glass Reviewed-by: Michael Trimarchi --- boot/pxe_utils.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c index 4b22bb6f525..53ddb16be73 100644 --- a/boot/pxe_utils.c +++ b/boot/pxe_utils.c @@ -4,6 +4,8 @@ * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include @@ -762,17 +764,22 @@ static int label_boot(struct pxe_context *ctx, struct pxe_label *label) /* Try bootm for legacy and FIT format image */ if (genimg_get_format(buf) != IMAGE_FORMAT_INVALID && - IS_ENABLED(CONFIG_CMD_BOOTM)) + IS_ENABLED(CONFIG_CMD_BOOTM)) { + log_debug("using bootm\n"); do_bootm(ctx->cmdtp, 0, bootm_argc, bootm_argv); /* Try booting an AArch64 Linux kernel image */ - else if (IS_ENABLED(CONFIG_CMD_BOOTI)) + } else if (IS_ENABLED(CONFIG_CMD_BOOTI)) { + log_debug("using booti\n"); do_booti(ctx->cmdtp, 0, bootm_argc, bootm_argv); /* Try booting a Image */ - else if (IS_ENABLED(CONFIG_CMD_BOOTZ)) + } else if (IS_ENABLED(CONFIG_CMD_BOOTZ)) { + log_debug("using bootz\n"); do_bootz(ctx->cmdtp, 0, bootm_argc, bootm_argv); /* Try booting an x86_64 Linux kernel image */ - else if (IS_ENABLED(CONFIG_CMD_ZBOOT)) + } else if (IS_ENABLED(CONFIG_CMD_ZBOOT)) { + log_debug("using zboot\n"); do_zboot_parent(ctx->cmdtp, 0, zboot_argc, zboot_argv, NULL); + } unmap_sysmem(buf); From patchwork Wed Jun 19 12:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1949674 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ODYXhvMu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W43412qc7z20Wb for ; Wed, 19 Jun 2024 22:35:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F269B882DC; Wed, 19 Jun 2024 14:35:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ODYXhvMu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 76B65884AA; Wed, 19 Jun 2024 14:35:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2CF628844F for ; Wed, 19 Jun 2024 14:34:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7ebde93bf79so283938239f.1 for ; Wed, 19 Jun 2024 05:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718800497; x=1719405297; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tw6aQYVCpf6Z1vhy3PFXhnvbODqPE/ptNGn4/nRTx8M=; b=ODYXhvMuYuN2XISB+fnG6t+wCZT0tijwHRfpUBXzzZHtzuR105WhdzoSvupUj5CSY8 JtQhAFhuK0NgMhz3O7KmCk+bMfyUISnlPxUeSU/6wTxt9AN4HH35jJsp+TMo1l2u9/SG KFFrMxI39CskWSD4vqw89lmff3z2rl7hg2rCw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718800497; x=1719405297; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tw6aQYVCpf6Z1vhy3PFXhnvbODqPE/ptNGn4/nRTx8M=; b=Oywi4sa6jrLRUgEvEYQb/BXIpNeS6Wnnobm7ZQl8IXhHF/h0Hm900WHJaZBPw0QkAI 8zd2jvIGm4zXfmzT4U550Va1UneBacqvVOiylRnh6RgTKh9BD5RuZQU/JKHwDuHB2xfu 8KOZr7VHPvfdeonEakkuP7twBKadf1aTsvqoDI2bfPT30mlnmeldcWrKRdytJLLnJQUE r2TVq+oR5bD1QcZ5ZdvtvNgGoAYqtY+Qzb+u7AV9pn6vDMKN2jEPD+QfFG0Op8uMzx+n 3MQc62iXlCGQjWHSyf1BK9e+x/0PqRzgoi3ygetPgO+LOEzMQte1IzSISSHiU4KJwqAW 338A== X-Gm-Message-State: AOJu0YyHLp2fpbiBd9y6EYHGl4ER9kFRxPKel3VP4VDfY6NWSFvFYG84 pIVM11HSAP6oikUT7qtChR2MQQ+10R23Upn/rznFc+qct0MJ1drX/h1FUK3/0CSjToINMGsFuEJ 1IQ== X-Google-Smtp-Source: AGHT+IFY/jGpb4fVgLN+2wDv4TA/ILjI4sxOH77wSTrceJTKuBa3HrNf6M+XuHIQ0qSj57ZRNlrL9Q== X-Received: by 2002:a05:6602:1589:b0:7eb:4770:6ea2 with SMTP id ca18e2360f4ac-7f13ee2aea8mr283704939f.5.1718800497641; Wed, 19 Jun 2024 05:34:57 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b956a20f18sm3701882173.133.2024.06.19.05.34.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 05:34:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Paul Menzel , Simon Glass , Bin Meng , Tom Rini Subject: [PATCH 2/3] zboot: Add debugging for booting Date: Wed, 19 Jun 2024 06:34:51 -0600 Message-Id: <20240619123453.720600-2-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619123453.720600-1-sjg@chromium.org> References: <20240619123453.720600-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Show the boot arguments and the state mask, to aid debugging. Signed-off-by: Simon Glass --- cmd/x86/zboot.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c index addf28cb4aa..c14219f19e9 100644 --- a/cmd/x86/zboot.c +++ b/cmd/x86/zboot.c @@ -5,6 +5,8 @@ * Daniel Engström, Omicron Ceti AB, */ +#define LOG_CATEGORY LOGC_BOOT + #include #include #include @@ -14,8 +16,14 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { ulong bzimage_addr = 0, bzimage_size, initrd_addr, initrd_size; - ulong base_addr; const char *s, *cmdline; + ulong base_addr; + int i; + + log_debug("argc %d:", argc); + for (i = 0; i < argc; i++) + log_debug(" %s", argv[i]); + log_debug("\n"); /* argv[1] holds the address of the bzImage */ s = cmd_arg1(argc, argv) ? : env_get("fileaddr"); @@ -116,6 +124,7 @@ int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc, { int ret; + log_debug("state_mask %x\n", state_mask); if (flag & ZBOOT_STATE_START) ret = do_zboot_start(cmdtp, flag, argc, argv); if (!ret && (flag & ZBOOT_STATE_LOAD)) From patchwork Wed Jun 19 12:34:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1949675 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=cJr3+vwO; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W434C601Sz20Wb for ; Wed, 19 Jun 2024 22:35:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 855F4884AA; Wed, 19 Jun 2024 14:35:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cJr3+vwO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2264B8844B; Wed, 19 Jun 2024 14:35:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C4B4287923 for ; Wed, 19 Jun 2024 14:34:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7ebdb5d9915so240095939f.1 for ; Wed, 19 Jun 2024 05:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1718800498; x=1719405298; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X+GDZ8O5ppyOnlEhKFtCD7X+qzrHiUQmZ/BcTHvjrt0=; b=cJr3+vwO3Wq5Gy8GlUKYUq1MP6C0puV0NCE/INcBrBwZVsw8fPzC6/VcPWHZiBlXNn 00A7IsvxZ6XiFtnHddpQbsF28ffGS/esS7sYJXfb9Z+czSr4Ifjqr5qeyQW5VOstewIs 7GQgnk7/wkb5Xvkiya6kI8u6kUeez5+dv/JjQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718800498; x=1719405298; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X+GDZ8O5ppyOnlEhKFtCD7X+qzrHiUQmZ/BcTHvjrt0=; b=jiGpXf+/CKg1HdtqVlQiS2u2UKx7EMtc0e/lVCo152d/AdEA6oZx73qP0z9NnNelit cz07tKM/RTmrQBBKtO2jyArjbfLPZLhuCb7tAxq0UGXva2H6uy+jkQ0m/DIM08BfbW7B TZ+jkm86N2x35RbZK0OTBSecPZfbccqokmixF2kEk4d0eWh2JWan7Ti2teigR8xS9vap ZstO0iQsfJJ6sZ8Ak5tgOquTxUm1hXWmZM95Y9TkXRD2BbPKpepiKHvE1tzl4t3e6l3Y APhm0kUMCezVF4S2vvD0xBy1sYWiabAVgG/z4QWXHLa4yr1GcCwMZ9Mm4BUmfZkzXS06 Im/g== X-Gm-Message-State: AOJu0YwFOBHUvxwLTOSwXUlzbi+6sySnXlA7S9dV0nzMwyGxX4NO1fGr jnelRJGeelf7CITeHfWuefEr5bEkz7jra3kGUruSnMXAlsBJa7RzX01fzSWzVrrhaJ8pefInMcW AtQ== X-Google-Smtp-Source: AGHT+IHQGDJYKE2IzZ0D4qlJ1fhJVkcCO0JKV8dbRw+dhUK8CZlu7yvxCiiWSY0pPSAmvUVO+/Yw4g== X-Received: by 2002:a05:6602:3f84:b0:7eb:9697:95c9 with SMTP id ca18e2360f4ac-7f13eba7599mr290078839f.0.1718800498454; Wed, 19 Jun 2024 05:34:58 -0700 (PDT) Received: from chromium.org (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4b956a20f18sm3701882173.133.2024.06.19.05.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 05:34:58 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Paul Menzel , Simon Glass , Bin Meng , Tom Rini Subject: [PATCH 3/3] zboot: Correct use of state_mask argument Date: Wed, 19 Jun 2024 06:34:52 -0600 Message-Id: <20240619123453.720600-3-sjg@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240619123453.720600-1-sjg@chromium.org> References: <20240619123453.720600-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean There is confusion in this function between the flag and state_mask parameters, which prevents the boot from actually happening. Correct this by using state_mask instead of flag for deciding which states to go through. This fixes booting of some 32-bit Debian kernels. Note: Some sort of CI for this is in the works. Fixes: 228c6722d44 ("x86: zboot: Avoid iteration in do_zboot_states()") Signed-off-by: Simon Glass --- cmd/x86/zboot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/x86/zboot.c b/cmd/x86/zboot.c index c14219f19e9..94e602b8a5b 100644 --- a/cmd/x86/zboot.c +++ b/cmd/x86/zboot.c @@ -122,18 +122,18 @@ U_BOOT_SUBCMDS(zboot, int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], int state_mask) { - int ret; + int ret = 0; log_debug("state_mask %x\n", state_mask); - if (flag & ZBOOT_STATE_START) + if (state_mask & ZBOOT_STATE_START) ret = do_zboot_start(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_LOAD)) + if (!ret && (state_mask & ZBOOT_STATE_LOAD)) ret = do_zboot_load(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_SETUP)) + if (!ret && (state_mask & ZBOOT_STATE_SETUP)) ret = do_zboot_setup(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_INFO)) + if (!ret && (state_mask & ZBOOT_STATE_INFO)) ret = do_zboot_info(cmdtp, flag, argc, argv); - if (!ret && (flag & ZBOOT_STATE_GO)) + if (!ret && (state_mask & ZBOOT_STATE_GO)) ret = do_zboot_go(cmdtp, flag, argc, argv); if (ret) return ret;