From patchwork Wed Mar 16 08:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 551837 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp59407mag; Wed, 16 Mar 2022 01:03:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlZ98QmUH4vfFeozoGLhigswK6Vzr5qtB2Jhi9KY06zH5HU0uYdtq99U0I89EJoIkp2fWu X-Received: by 2002:a05:6402:2987:b0:414:39b0:7fc1 with SMTP id eq7-20020a056402298700b0041439b07fc1mr28540172edb.214.1647417803073; Wed, 16 Mar 2022 01:03:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647417803; cv=none; d=google.com; s=arc-20160816; b=HDWi6d2xlPvzndnsANaRLzvzqrQ3H9Jz8WUSilI+ep/SXDtxqxn+nuPHeWc5iS2aCX KssB+ra3DI3ivtZYzmesd4cZLc9SPhQGzkIb7oGAC7dql13IDswnRnlNRT8wCSpRx8Sc TCq/5x/JLkAz6n6YVdm56qF37qLLQyDKUdKpxd5cHchvUeiyIqpYK6iBkS+vYG6db9mT pzi575tU1BNLudjZWoiheQrtrv5sH8tQ9RrGBJHxB83BlPv6uXKXwAhJEBDwme+aNFrN ijjIvTHQ/Re7zwEnqed3KDgKHT8CfSY6pjX0Zcuz6ogVTC6L+8KJuEZpYtOPcy+AZcqt nC1A== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=1bxfzlDQPi+NsufmlXnWXLV1eDw8RsAKKTLDOe2N3UI=; b=B6l8BoWk2naglvoJVVboMrgjx68BmWLeV28aGgSD4MCu3REym+Z90CEC9W5c2VKnfs aX+XZQx35kn6m7D7dQzREZE3ItcZTaKrsePDkD53ruZF3Olg51HpkHCoqDtBnUGC8MoG bgIDYuXeUqfsYPYmw3iPvjX6UOM4jyH1PuVK4nzENGj32Imzs/DWE4kUtFnEcLUixvaM 0JmG8+fzfHs+9dkjEcMibHD55myG5EJPg6/2C3W390x5xTzJQ6fj95QqbCBGqXfVkJX1 Rjb+xpYQr0nIZtRYVrJUkPGKKfgXKz9GRzcHUe/smsyerNCE74mMLAGRwIi/2P1xMCWV qaBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hQ1TKB7K; 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 y9-20020a056402270900b00416a367fdf3si890299edd.218.2022.03.16.01.03.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 01:03:23 -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=hQ1TKB7K; 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 8AB4280F78; Wed, 16 Mar 2022 09:03: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="hQ1TKB7K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 150B98007A; Wed, 16 Mar 2022 09:03:17 +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-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) (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 1C18B80F78 for ; Wed, 16 Mar 2022 09:03:13 +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-pf1-x433.google.com with SMTP id s42so3031229pfg.0 for ; Wed, 16 Mar 2022 01:03:13 -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:user-agent:mime-version :content-transfer-encoding; bh=1bxfzlDQPi+NsufmlXnWXLV1eDw8RsAKKTLDOe2N3UI=; b=hQ1TKB7KencDxK32YmpxaIbSydBx0k8AfwmNMm8SDLA1YZhZfu9m8RH5sWneH4lgyK hJwzm39hq46boG8EXkJbfBDtkuIMAtM/Y0eNuGHCS+V5IM2x0UY5T88D4yZV9ay5QBba ZCwjWije9AHmf0ZdWKwtLNsF0ZRLuG9PhDOLvlx0rTAUrrjrq4AiwhIlOT3GMQsXyThc Mq+adAjDIqclVbsed4MguSE3tKRenC8ZSQoddOKueYd63JurI5s25W07FWSUwXqvy9M4 z21Gzot+HCOHRn0F0xBOTnt8tvUJSxeREwlafaMGpE8q736rrvfBJpyxpa6Eyg+FhPtm iB6w== 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:user-agent :mime-version:content-transfer-encoding; bh=1bxfzlDQPi+NsufmlXnWXLV1eDw8RsAKKTLDOe2N3UI=; b=BCQRB+HlYqn1zQF/cXy/XmF6oeNcw3ZbDaflTSCN/qoWmYSZvGPPeGe2ccQ81HYkbX d5/rtte+LPXJEhsuV6R09+THVlBwxisLkeeFrtGDYqzch0qVI/HdNYtam1WsNRS3Of1H 1vZJb3eEf/ZZgN9lzLfYq5PTUVxxM05EQOMzEtvtQ+XCsk2mosppwiGC6wPlq/7p6IhI t6ZfluEZGAWsNMcFAuyqwIeWYI7qbSLc1A3bg6c7a4vamla44RBJcAuMYmUdQlO77h6l iH69eeDJuJSq7tYcJ/CqHIu0OViS/vQDVNjXO1xjQYGtM9Bmoacg3m4c3CWjEFipjWdR p4Mw== X-Gm-Message-State: AOAM531btg8LWx4jVZrZ93kz4hWRo//xRwtoZK6Aa9Tuvh+rZxPA7wbM Rr7lEVwM9gMzJLKOPu8vXysSja/AAFttiw== X-Received: by 2002:a05:6a00:1248:b0:4f7:db0:4204 with SMTP id u8-20020a056a00124800b004f70db04204mr32579480pfi.27.1647417791187; Wed, 16 Mar 2022 01:03:11 -0700 (PDT) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id gw19-20020a17090b0a5300b001c5c937384bsm1523174pjb.52.2022.03.16.01.03.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 01:03:10 -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 v2] efi_loader: Use sysreset instead of reset command Date: Wed, 16 Mar 2022 17:03:06 +0900 Message-Id: <164741778621.309780.13612431059777970603.stgit@localhost> X-Mailer: git-send-email 2.25.1 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 613b531b82..a3d1d7e95a 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 */