From patchwork Fri Oct 21 00:23:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1692779 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; 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: 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=bMnHJ+lJ; 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 ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mtlj76JNKz23jk for ; Fri, 21 Oct 2022 11:29:47 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 87D5C8503F; Fri, 21 Oct 2022 02:26:24 +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="bMnHJ+lJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F2BAA85003; Fri, 21 Oct 2022 02:24: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.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 CAB3984FD6 for ; Fri, 21 Oct 2022 02:24:34 +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-xd30.google.com with SMTP id e15so1044695iof.2 for ; Thu, 20 Oct 2022 17:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=6yAUevy3vQgLJ60uVc0Qw+kitcM3vDhZCAmDpISy0ic=; b=bMnHJ+lJgyDWH/T2QD2FgoXvHmwCfmKlb7C5vYH46RVTMY4+iXgLgtYNO0ZUdfgP/G I5pIUo7imPV9RXJlKzW6DQ3mRJyt6+ueq9q+MReoJrw+IpbY/gE7RYHBH6exsp+JSf6h H4rGKE1DaWOH/eNzliWCGvkenN15M+dp7s+Tg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=6yAUevy3vQgLJ60uVc0Qw+kitcM3vDhZCAmDpISy0ic=; b=5FtPlmhgsQdUkVvsKWi6U1s0EhFEhUHsV8rTD1GaHZr5qi3Wg/ymPwa4pDTXelWRfn mTDyMkbbPbq9JXZT0ChBAhKKMmT/yOKwPxdefPFHsy3kmUZ+iBgFRjybGlO7g00N4DbB mWx1zATcv0iaL9jEGBTe3IAjQu+H828N6gRWVFvB7Je5J8iMKbpPjEDw+nBRY5MWOK+x DqAo72DxcYbQ8kPFCsVALRjeANUIxStqr2vzdn8YUvT9cqpUsiHAdTeBvWOlw0QhkDYE uL3AVOslri46+b28bfOvYg9vMQCmf9lYKej9sovtXFBTc44EXCecnOzLDprjOQaC63Jv hy6g== X-Gm-Message-State: ACrzQf1CrxsNJTy9sthjnmiJ6sXu3MgHCSSgTIeLB4Owk0OiLJWrxeLy EpEe08CXIkian0brc54NzYGFqf7eXDbYuA== X-Google-Smtp-Source: AMsMyM4IXexQSzGcOQlMh6C8rNvJVpkpgnfA+sH4eoGKTNCP3uK02/NowkxDpSPuZTESxXabAaMNdA== X-Received: by 2002:a05:6638:526:b0:363:d7be:4253 with SMTP id j6-20020a056638052600b00363d7be4253mr13105458jar.161.1666311848416; Thu, 20 Oct 2022 17:24:08 -0700 (PDT) Received: from sjg1.roam.corp.google.com (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id f8-20020a02a108000000b00356738a2aa2sm3646131jag.55.2022.10.20.17.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 17:24:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH v3 41/43] vbe: Record which phases loaded using VBE Date: Thu, 20 Oct 2022 18:23:18 -0600 Message-Id: <20221021002320.1169603-42-sjg@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221021002320.1169603-1-sjg@chromium.org> References: <20221021002320.1169603-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.6 at phobos.denx.de X-Virus-Status: Clean We expect VPL and SPL to load using VBE. Add a record of this so we can check it in U-Boot proper. Signed-off-by: Simon Glass --- (no changes since v1) boot/vbe_simple_fw.c | 10 ++++++++++ include/bloblist.h | 1 + include/vbe.h | 9 +++++++++ 3 files changed, 20 insertions(+) diff --git a/boot/vbe_simple_fw.c b/boot/vbe_simple_fw.c index fc05e9e2bd1..0a49d286703 100644 --- a/boot/vbe_simple_fw.c +++ b/boot/vbe_simple_fw.c @@ -9,6 +9,7 @@ #define LOG_CATEGORY LOGC_BOOT #include +#include #include #include #include @@ -154,11 +155,17 @@ static int simple_load_from_image(struct spl_image_info *spl_image, struct udevice *meth, *bdev; struct simple_priv *priv; struct bootflow bflow; + struct vbe_handoff *handoff; int ret; if (spl_phase() != PHASE_VPL && spl_phase() != PHASE_SPL) return -ENOENT; + ret = bloblist_ensure_size(BLOBLISTT_VBE, sizeof(struct vbe_handoff), + 0, (void **)&handoff); + if (ret) + return log_msg_ret("ro", ret); + vbe_find_first_device(&meth); if (!meth) return log_msg_ret("vd", -ENODEV); @@ -190,6 +197,9 @@ static int simple_load_from_image(struct spl_image_info *spl_image, /* this is not used from now on, so free it */ bootflow_free(&bflow); + /* Record that VBE was used in this phase */ + handoff->phases |= 1 << spl_phase(); + return 0; } SPL_LOAD_IMAGE_METHOD("vbe_simple", 5, BOOT_DEVICE_VBE, diff --git a/include/bloblist.h b/include/bloblist.h index 9684bfd5f4b..2a2f1700eb0 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -112,6 +112,7 @@ enum bloblist_tag_t { */ BLOBLISTT_PROJECT_AREA = 0x8000, BLOBLISTT_U_BOOT_SPL_HANDOFF = 0x8000, /* Hand-off info from SPL */ + BLOBLISTT_VBE = 0x8001, /* VBE per-phase state */ /* * Vendor-specific tags are permitted here. Projects can be open source diff --git a/include/vbe.h b/include/vbe.h index ece2697b5dc..5ede8181b98 100644 --- a/include/vbe.h +++ b/include/vbe.h @@ -25,6 +25,15 @@ enum vbe_phase_t { VBE_PHASE_OS, }; +/** + * struct vbe_handoff - information about VBE progress + * + * @phases: Indicates which phases used the VBE bootmeth (1 << PHASE_...) + */ +struct vbe_handoff { + u8 phases; +}; + /** * vbe_phase() - get current VBE phase *