From patchwork Mon Mar 21 13:37:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 553340 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:1248:0:0:0:0 with SMTP id z8csp1510859mag; Mon, 21 Mar 2022 06:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOmnxKeZCPYWPUt26E+YIz6GxYtLzqyd73DVTjzm4ncLZCghgzhdihG28ksFPX4vCtfplC X-Received: by 2002:a17:906:9b93:b0:6da:6388:dc57 with SMTP id dd19-20020a1709069b9300b006da6388dc57mr20541673ejc.338.1647869896365; Mon, 21 Mar 2022 06:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647869896; cv=none; d=google.com; s=arc-20160816; b=SOhAUMxaAqVgCi16RkL0oVypR/ew9Vyuv6JuyL8S4NRpIRkW+QtFUdOrUqNpKa504g Cu0hNYdg0eWyugKjHdBuADBafZw51oL7hxuQvZXmL6gBc3TKrcRM2DIu915qOjfkwGa+ jystYI2xC67YNqW9BxVyTNj1s9zhbWpi8Q6/Jnyb365VHa0rPWiwIhm/tda0G9fLEIoZ 3wo2VKW2XqnIcoUURHCk/kwVHsSq6aT8d57xC/JR+x5WWVt5iuguAyYrQpJs/YeoUIy2 5Nzc8jb06UhezkSwi5VBUZEo+Cc21ulNtZnR8CLslTIp61DInbW92hGn2MIE/8T6YVpr bHaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=aigltwAw4OIwEArx+jLosQqqu01GixHEWWIeE336u1k=; b=FuS6YpvWVw3akz1KBoic89vNzuXVweU7TcOBb4UWFA3wUkNUzjaRiXwjvzSgapFCXf DlQIPyVyIK5XS0DyFPVxxFnpsnm3hVkj3o6lD+MrXOHZKO/xqE/QzWD93QXpZ25BpJOD coa/eHuHlDMx3qOGpgTcanxqV2M9v+mmuin396w/PUAfOTif/6x11kksG9KFYZ6qT1NY xIMtdmsgsWuSnm2kLnNIP3kIlwl58/w8YYbAM3mpeMicx/7uOOowhPzE29QZc6KJ79Xp NI3sYCengObDWySr2vh82owDorBMHvxu2Q5z3vZbs4uQ70JZE7WqopcDTZnCC2oru4V5 9asA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iHvc4Oiz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id 5-20020a170906058500b006df76385e71si6881763ejn.785.2022.03.21.06.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 06:38:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iHvc4Oiz; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8BF6183B0E; Mon, 21 Mar 2022 14:38:14 +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="iHvc4Oiz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6B08283B20; Mon, 21 Mar 2022 14:38:10 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 A70FC83B0E for ; Mon, 21 Mar 2022 14:38:02 +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=masami.hiramatsu@linaro.org Received: by mail-pg1-x536.google.com with SMTP id d76so1018666pga.8 for ; Mon, 21 Mar 2022 06:38:02 -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 :user-agent:mime-version:content-transfer-encoding; bh=aigltwAw4OIwEArx+jLosQqqu01GixHEWWIeE336u1k=; b=iHvc4OizGRUlQu9r/XFy+Byq4y9L1wI8r4R1BbMooTdm7xGXOV7FDMvl1E5SVH86AW hz3bLWBZx/fimKZrFYwGzx6s/XgTXlBNDzApBU45HaTbxKEA8wnGI/4x1UDbkBs6Kuo5 D8b+LFpYhNochxXcSWsnZcZupW6yQt5dZEc9bdcgg3wsI3DU69/uqI8LtpYUN8G17x5A TprAEaPQYr7AOfBNxembhTuCXd1kGZqVYTyEy0ZElqBY/R+sUvSMyxeo9qcJn5ssNF3/ ctlqfWttKtF7e8UHVROGOk9RlnjbXKNEt25IPFs7WgBxy3hb+GP0iH7J/DewFzXv2xNC JqgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=aigltwAw4OIwEArx+jLosQqqu01GixHEWWIeE336u1k=; b=jR6TZHUdsnUZgvLi8rHw8jsxTUCsZmx4hfL9FpIeilenfLdlFXRrOMQo1B7Rv6epYN 05dFifSypbr+ptWUOsXJ2JirDtXDV9dNfZALw1m2l53iyApJvEekJP6OUG1vJjc04m6N fbmOLeGm5hbXpL+Yu6jwbW9RgEK0fJoD5gynSTTFEAIzfH6jpEfpqsE0uY1eWq7J/3Wr 4QLHVha0w+01VbvHcJ/2jTzR7G8BQfsSDRxsZKn0KVyE0pbtDC/eagl74fHtZ6QqjEyg ShBzYMg4yvUM0Gv1ogxvpS4LltPtKeVnLKFmQgCmg5UuOBJnJVek4pHEmt7dtXGFJi7W mzvw== X-Gm-Message-State: AOAM532bUVsj1ZqDMHwd10GS5illy/rmSQbollbWCdS4gbsOyOvwMe2z odvKprZr+LzjPmaoS4umT5xgFjDAzhb1Dw== X-Received: by 2002:aa7:8896:0:b0:4f7:b8f7:772e with SMTP id z22-20020aa78896000000b004f7b8f7772emr23327721pfe.62.1647869880682; Mon, 21 Mar 2022 06:38:00 -0700 (PDT) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id c21-20020a637255000000b003822e80f132sm8889326pgn.12.2022.03.21.06.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 06:38:00 -0700 (PDT) From: Masami Hiramatsu To: u-boot@lists.denx.de, Simon Glass Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH v3 3/3] efi_loader: Use sysreset instead of reset command Date: Mon, 21 Mar 2022 22:37:56 +0900 Message-Id: <164786987597.412493.4093936383155532813.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164786984495.412493.4209842889853239285.stgit@localhost> References: <164786984495.412493.4209842889853239285.stgit@localhost> User-Agent: StGit/0.19 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.5 at phobos.denx.de X-Virus-Status: Clean Use sysreset_walk_halt() directly from reset-after-capsule-on-disk feature to reboot (cold reset) machine instead of using reset command interface, since this is not a command. Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on the CONFIG_SYSRESET. Signed-off-by: Masami Hiramatsu Reviewed-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- Changes in v2: - Add CONFIG_SYSRESET dependency. - Fix to add #include --- lib/efi_loader/Kconfig | 1 + lib/efi_loader/efi_capsule.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index e5e35fe51f..33138237cc 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -130,6 +130,7 @@ config EFI_RUNTIME_UPDATE_CAPSULE config EFI_CAPSULE_ON_DISK bool "Enable capsule-on-disk support" + depends on SYSRESET select EFI_HAVE_CAPSULE_SUPPORT help Select this option if you want to use capsule-on-disk feature, diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 9fd6f78ad9..c6585cb113 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1150,9 +1151,9 @@ efi_status_t efi_launch_capsules(void) * UEFI spec requires to reset system after complete processing capsule * update on the storage. */ - log_info("Reboot after firmware update"); + log_info("Reboot after firmware update.\n"); /* Cold reset is required for loading the new firmware. */ - do_reset(NULL, 0, 0, NULL); + sysreset_walk_halt(SYSRESET_COLD); hang(); /* not reach here */