Message ID | 20221021002320.1169603-33-sjg@chromium.org |
---|---|
State | Accepted |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> 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=<UNKNOWN>) 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=dnS32YUQ; 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 4Mtljl5q9Rz23kD for <incoming@patchwork.ozlabs.org>; Fri, 21 Oct 2022 11:30:19 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9187D85049; Fri, 21 Oct 2022 02:26:38 +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="dnS32YUQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7DE0184FF6; Fri, 21 Oct 2022 02:24:25 +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-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 723DF84FEF for <u-boot@lists.denx.de>; Fri, 21 Oct 2022 02:24: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=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id y80so1037851iof.3 for <u-boot@lists.denx.de>; Thu, 20 Oct 2022 17:24:02 -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=ReEfAFiXG0eqDxiUldLA1lWo1t4x9BKQNQ1BrAeUU6w=; b=dnS32YUQJPfUlwgDLqiHzPCLf4IEAFJlu711gWoPoukZi5F6GjEVjwSNn084W4X5x4 OXCpPphus4tS1qzxK+LD91qBxRs7ImtGGwqrqzZZDVIEjNdQ0Aiie4dZj+dHRhseI+nW ZTfCmJGN6b6k+DuYC1a4XhiE5df9jc5FqxuQg= 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=ReEfAFiXG0eqDxiUldLA1lWo1t4x9BKQNQ1BrAeUU6w=; b=Kk0pAjMNpZ9MZGYNpscpbtGqH7FhCoCEBHfDjlbOpRp7rKendfZaHk0jPduU2y5qT/ Pf1SfHs8mgz74b00N5l5IxWrEq1J5KcbhVBKDbSwCmmuTGZziXnnE2mq1ONONxj3J/T1 irF+C/MtXX8ymsEo72ypltTFAtYSyUS8puB7PWn1Tcn0lmIn1CDwzVYtEwOdWYvrwDIp m6S/+Oh2XLJJQguSATku0p15htmdFTmBJHxPQx7aKriflD7xhGY88hMBHuQWf7IhThQL qEJKnZ6lXsiL20C/SHhbBM/9uNmpJpy/TmEXCQ6X2rwghXzxMHV/Lr+bBm0yZFaSVwyD k5Zw== X-Gm-Message-State: ACrzQf1prwfU2gu9s4bQKPa3ufFIg+X8DX/VncF0o6irUG67OR2zSGSP FlkTBR1J9/w0Pa4MiRNBCccDYVyFpztHIw== X-Google-Smtp-Source: AMsMyM7Boy4ukn1cTvjRNZ9NcIStBSxq8hk4WGALvR++rrA+vEsv+mBPVzr1UOhtolgP4KPHUX4B0g== X-Received: by 2002:a05:6638:25cb:b0:363:edfe:3e3f with SMTP id u11-20020a05663825cb00b00363edfe3e3fmr13068948jat.270.1666311841841; Thu, 20 Oct 2022 17:24:01 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 17:24:01 -0700 (PDT) From: Simon Glass <sjg@chromium.org> To: U-Boot Mailing List <u-boot@lists.denx.de> Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org> Subject: [PATCH v3 32/43] vbe: Support selecting operations by SPL phase Date: Thu, 20 Oct 2022 18:23:09 -0600 Message-Id: <20221021002320.1169603-33-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 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean |
Series |
vbe: Implement the full firmware flow
|
expand
|
diff --git a/include/vbe.h b/include/vbe.h index b83f6f0c519..ece2697b5dc 100644 --- a/include/vbe.h +++ b/include/vbe.h @@ -10,6 +10,34 @@ #ifndef __VBE_H #define __VBE_H +/** + * enum vbe_phase_t - current phase of VBE + * + * VBE operates in two distinct phases. In VPL it has to choose which firmware + * to run (SPL, U-Boot, OP-TEE, etc.). It then carries on running until it gets + * to U-Boot, where it decides which OS to run + * + * @VBE_PHASE_FIRMWARE: Selecting the firmware to run + * @VBE_PHASE_OS: Selecting the Operating System to run + */ +enum vbe_phase_t { + VBE_PHASE_FIRMWARE, + VBE_PHASE_OS, +}; + +/** + * vbe_phase() - get current VBE phase + * + * Returns: Current VBE phase + */ +static inline enum vbe_phase_t vbe_phase(void) +{ + if (IS_ENABLED(CONFIG_SPL_BUILD)) + return VBE_PHASE_FIRMWARE; + + return VBE_PHASE_OS; +} + /** * vbe_list() - List the VBE bootmeths *
VBE supports booting firmware during the SPL phases, i.e. so that VPL can start SPL and SPL can start U-Boot. It also supports booting an OS, when in U-Boot. As a first step towards these features, add functions to indicate the current VBE phase. The firmware selection is done in VPL and the OS selection is done in U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org> --- (no changes since v1) include/vbe.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)