From patchwork Sat Aug 1 16:08:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1339760 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: 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=SP9QJs8g; dkim-atps=neutral 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BJpz62xK1z9sSt for ; Sun, 2 Aug 2020 02:10:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7769E8216F; Sat, 1 Aug 2020 18:09:03 +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="SP9QJs8g"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E90BC81F2C; Sat, 1 Aug 2020 18:08:44 +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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (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 4ED5681BEB for ; Sat, 1 Aug 2020 18:08:40 +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-ot1-x344.google.com with SMTP id q9so9259362oth.5 for ; Sat, 01 Aug 2020 09:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x8UbbQuTkfr1Q3NjcT/CKFoKU0RbS1/YAhv2xfKWXQg=; b=SP9QJs8gxIVjRn5MDPrQ98FqD0Grv1wWTFrPLGWTq1xlLqcK2GcB3p8WgB6p4191+m VBlnMv5SN2e5ADtS1Y1hkz050azM/xR9FSgFQKciHI9KGJTA4WdzjHhtGceQmlKxP3nC wD/xd823mmqZNqMfUXmq3Li6tK80mWMbZ9Yqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x8UbbQuTkfr1Q3NjcT/CKFoKU0RbS1/YAhv2xfKWXQg=; b=lcruMKlGipRuuJwrFmw261nx7dgpzPHkxxRws3m/YzwL+KEWgSVQSpzYeLQqPgWTIU BNIMVZU0JYO2Fq7YnyuJYdEdFNFbXt0S9h5EOYCiXj2d+jubQIeLTQr0BY7NZxFd27cL cJyw/7k5Qr9Wn51OjKOqkA1wMy+BlMV9EdbaSoVyRafwOuXrDwi+t2dAJBltw2EWvMuh gNyYufkoTlRTti4u74+rYkkmkblPXwyN1FHDuQ9LL4uA/eHrToOo+QnkH6ttjqQi/vFa gt+IduHxxN3dPlfyabRyICWWuUFv4cCJwYScf5jh1+3/1cXX6KfzRoRLeTcHQe8PWiGv sNTQ== X-Gm-Message-State: AOAM531mREjXPv0Lov2V4Xkvsp1kgLs2UULiokctiVSBCgaRRyBrlhVq LZR2EXeI5EBzh7O6zWSIfoKVKdjy5KiIRg== X-Google-Smtp-Source: ABdhPJwEvOra0IRhp4/qTUlL+cD83InKLgWMf+GMRN8jjO2dGXMM+nG4E8qGhIwucSmtaGEs7dvMiw== X-Received: by 2002:a9d:4704:: with SMTP id a4mr7044774otf.349.1596298118985; Sat, 01 Aug 2020 09:08:38 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id a14sm1911907otf.41.2020.08.01.09.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2020 09:08:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Andy Shevchenko , Bin Meng , Joe Hershberger , Wolfgang Wallner Subject: [PATCH 09/16] x86: zboot: Add an 'info' subcommand Date: Sat, 1 Aug 2020 10:08:17 -0600 Message-Id: <20200801160824.17486-10-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.163.g6104cc2f0b6-goog In-Reply-To: <20200801160824.17486-1-sjg@chromium.org> References: <20200801160824.17486-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add a little subcommand that prints out where the kernel was loaded and its setup pointer. Run it by default in the normal boot. Signed-off-by: Simon Glass Reviewed-by: Wolfgang Wallner --- arch/x86/lib/zimage.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c index 5b096e9b0b0..2210ff69b72 100644 --- a/arch/x86/lib/zimage.c +++ b/arch/x86/lib/zimage.c @@ -68,9 +68,10 @@ struct zboot_state { enum { ZBOOT_STATE_START = BIT(0), - ZBOOT_STATE_GO = BIT(1), + ZBOOT_STATE_INFO = BIT(1), + ZBOOT_STATE_GO = BIT(2), - ZBOOT_STATE_COUNT = 2, + ZBOOT_STATE_COUNT = 3, }; static void build_command_line(char *command_line, int auto_boot) @@ -383,6 +384,15 @@ static int do_zboot_start(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } +static int do_zboot_info(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + printf("Kernel loaded at %08lx, setup_base=%p\n", + state.load_address, state.base_ptr); + + return 0; +} + static int do_zboot_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -400,6 +410,7 @@ static int do_zboot_go(struct cmd_tbl *cmdtp, int flag, int argc, U_BOOT_SUBCMDS(zboot, U_BOOT_CMD_MKENT(start, 8, 1, do_zboot_start, "", ""), + U_BOOT_CMD_MKENT(info, 1, 1, do_zboot_info, "", ""), U_BOOT_CMD_MKENT(go, 1, 1, do_zboot_go, "", ""), ) @@ -440,7 +451,7 @@ int do_zboot_parent(struct cmd_tbl *cmdtp, int flag, int argc, } do_zboot_states(cmdtp, flag, argc, argv, ZBOOT_STATE_START | - ZBOOT_STATE_GO); + ZBOOT_STATE_INFO | ZBOOT_STATE_GO); return CMD_RET_FAILURE; }