From patchwork Thu Oct 29 00:25:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1389668 X-Patchwork-Delegate: trini@ti.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=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=b5SrYbPq; 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 4CM5py12Zbz9sV0 for ; Thu, 29 Oct 2020 11:26:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 70B6E824FC; Thu, 29 Oct 2020 01:26:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="b5SrYbPq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0AE9824DE; Thu, 29 Oct 2020 01:26:11 +0100 (CET) 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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (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 A82AE824A8 for ; Thu, 29 Oct 2020 01:26:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x543.google.com with SMTP id s22so890436pga.9 for ; Wed, 28 Oct 2020 17:26:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n5F2thosGyZvZniKXgGd9Rsns7gjUVAKncs8BSfblsY=; b=b5SrYbPqC5M9jU7DXL4pftCcuiEdHq55bqMEXH+6n4XtANGaF6jXnZw+Gyx/xPFIsz 9zaNSqYoLkmocYZnZQyE7YEMpP+HC4Mc60yxphuJ08V/YpkyLvVXn/4UD5t/zaNCWqsx aomP7v5EOmYr6WLsZlSnE8xdAp3eixBwSH3/jnTrN8VEpW1+V4/2CPrkKOiAm0ZQvDUW 18tV8RJn8PI8sjI2/TZAclcm2OXGmUlWEcj2ebIlQWXXFpANTJHg6MxhdLm10B/vnYIV 8wfcTo2dyaURUDxy6CtFtuHZo7OY0Qc0k/h+g60JMSdA1dyyi95rLoKX/2tqSVpjWtAY IOBw== 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=n5F2thosGyZvZniKXgGd9Rsns7gjUVAKncs8BSfblsY=; b=VcjqRuhuBoaBtk/P9yMMjcRiRjiqXWG5KN5TEHUgcSGZmA1BRTcs5EtpY2cDO9nCn+ hEfBwdZlVodhHBd89CuIjD1vjSfzOQ2qUhTWx4UNzlBJDNCMTgpm48i/3oaLrX9GgMkq AwBQWpIF0Kfv+MatxGGfGWd7l48TfbaG9x4oUEW+khsRZJbRfsXl1Wlt825flb2oOeJW aKDVhzy+sjuh+WgIevM6nfaD5cj2FXZr46uXXxJkjg2/Hh5Qnt5fL9pMFESxBNI2sSUh f4r0g4khwvSWn5oL/4tl+tpW+eXUpsbnEjqMjhKfPmAVJ3TE5pdLdZWn79W5OoVx0W8G K+Ew== X-Gm-Message-State: AOAM5338fVcRM8jnymHqJRZLXEYvTlxYMKk+hNmxlPlp2Ju/jWhKbZzM XU0oUtjZQLS6M0NNRdUJjVjamw== X-Google-Smtp-Source: ABdhPJzLr0YXtyOrAVvzb2DYCrKhz09ySQkFgBi6n60MYuam9JlqoYhBNWVOriqgI6L1wEUyzJ10TQ== X-Received: by 2002:a17:90a:db55:: with SMTP id u21mr1376914pjx.235.1603931167234; Wed, 28 Oct 2020 17:26:07 -0700 (PDT) Received: from localhost.localdomain (p784a66b9.tkyea130.ap.so-net.ne.jp. [120.74.102.185]) by smtp.gmail.com with ESMTPSA id s22sm731502pfu.119.2020.10.28.17.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 17:26:06 -0700 (PDT) From: AKASHI Takahiro To: lukma@denx.de, trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [RESEND PATCH v6 05/17] efi_loader: add option to initialise EFI subsystem early Date: Thu, 29 Oct 2020 09:25:16 +0900 Message-Id: <20201029002528.34408-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201029002528.34408-1-takahiro.akashi@linaro.org> References: <20201029002528.34408-1-takahiro.akashi@linaro.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 If this option, CONFIG_EFI_SETUP_EARLY, is enabled, the initialisation of UEFI subsystem will be done as part of U-Boot initialisation. Please note that this option won't be enabled explicitly by users, instead, should be enabled implicitly by other configuration options. Specifically, this feature will be utilised in implementing capsule-on-disk feature. Signed-off-by: AKASHI Takahiro --- common/board_r.c | 6 ++++++ lib/efi_loader/Kconfig | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index b9217b2e27f0..2212d981e5ea 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -73,6 +73,9 @@ #if defined(CONFIG_GPIO_HOG) #include #endif +#ifdef CONFIG_EFI_SETUP_EARLY +#include +#endif DECLARE_GLOBAL_DATA_PTR; @@ -889,6 +892,9 @@ static init_fnc_t init_sequence_r[] = { #endif #if defined(CONFIG_PRAM) initr_mem, +#endif +#ifdef CONFIG_EFI_SETUP_EARLY + (init_fnc_t)efi_init_obj_list, #endif run_main_loop, }; diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index ab42f3ba75b1..075481428cdf 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -27,6 +27,10 @@ config EFI_LOADER if EFI_LOADER +config EFI_SETUP_EARLY + bool + default n + choice prompt "Store for non-volatile UEFI variables" default EFI_VARIABLE_FILE_STORE