From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 728EEC54EE9 for ; Sun, 25 Sep 2022 15:09:28 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CF98B84DA9; Sun, 25 Sep 2022 17:04:52 +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="Az56TK9a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 61D9784C7D; Sun, 25 Sep 2022 17:03:58 +0200 (CEST) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 C96B184C4B for ; Sun, 25 Sep 2022 17:03:55 +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-xd34.google.com with SMTP id e205so3448307iof.1 for ; Sun, 25 Sep 2022 08:03:55 -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; bh=xElChSv+zC/rlM1vBnimgFTEubRnRRd6VXwuVMNj+i0=; b=Az56TK9aMwiw5+qVDmmbcet/+95v89Vm1vLIBUcepoaIe1k0AzuaIJYnXAfrG8HxAH bVCHNNuwYQK3DMjFOw+z+AqcJF6f1coz7/9t8uWI7ojAquQo+ZPiFy8zNOkKBq8oSTkO xbKU7Ga0mHtjKLNNQRhxoZEPPnDoy2rCr0Fhw= 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; bh=xElChSv+zC/rlM1vBnimgFTEubRnRRd6VXwuVMNj+i0=; b=RthHX8DVXowmye9sr9LXnI8bha/VBdL5al00z+bxn0v2kYvHo91fD4tLHQxhG83kYw tGKsZfWcIl9yQtIwXEjLrl+pa1Tz6vmunqduzDdF8dgTm5m+pzvhsjxN6wqimnU1g86g BbMA8dQf0K81Tm5usZWXQZYPKfc61Agwh8knKss8i8wg3T6LammBXGThnU/+N7IG7oV7 qNONMJqL4mIMWyA3W5pBHx97uJa/nNJHtp/lKNDy/Osn82v+aQUVMcBqEZaLQRxmaojC RJmpfL92wJw7hNuVpIgrMbw7e1vjghoww47+X66ycM0s1igS72AgBI5GnDCaoDz2a1GR PnPw== X-Gm-Message-State: ACrzQf2HJ97zdX6zfDPGifWqqBbLR57MUZico86Bm3u14BfeiyjngkPg vDcV+5iViBkpxidyN3D9zy0fwvZouBr5XQ== X-Google-Smtp-Source: AMsMyM6pvXXdQaDWwkYAUyQh92DwojzkevQPFwSPaCkE+5lY7ZLR6fMk1z45qYDpzMx6MSZ4HKz7Tw== X-Received: by 2002:a05:6638:14d6:b0:35a:6425:a027 with SMTP id l22-20020a05663814d600b0035a6425a027mr9861199jak.254.1664118235058; Sun, 25 Sep 2022 08:03:55 -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 u19-20020a926013000000b002f19d9838c6sm5360578ilb.25.2022.09.25.08.03.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Sep 2022 08:03:54 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 42/45] vbe: Record which phases loaded using VBE Date: Sun, 25 Sep 2022 09:02:45 -0600 Message-Id: <20220925150248.2524421-43-sjg@chromium.org> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog In-Reply-To: <20220925150248.2524421-1-sjg@chromium.org> References: <20220925150248.2524421-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 * -- 2.37.3.998.g577e59143f-goog