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 A7673ECAAD5 for ; Sat, 27 Aug 2022 18:49:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36B5083FEE; Sat, 27 Aug 2022 20:49:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="AL4uXS58"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C70F684565; Sat, 27 Aug 2022 20:49:34 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0C6DB83FDE for ; Sat, 27 Aug 2022 20:49:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 82527601C5; Sat, 27 Aug 2022 18:49:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA1EBC433D6; Sat, 27 Aug 2022 18:49:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661626169; bh=LP21OoEthaaO3sSBDcW52VBJWi//OlXCCaniahmIZxM=; h=From:To:Cc:Subject:Date:From; b=AL4uXS58U6AU9u6KNer1rhH/iBG0DPTiOp/TX/LbA6vCzwCT4KhFXFJHM5Zihp8HX 2GyRrx8AAMwchoficqCXGZgo5zTIFkPc3zrmJbS+h7rjh6PRM66D8G1esfaBNDTbz9 vN2EEF3MFlNK1iRSmonKy/8kq8DUJyeRPBIf8AElyVVwmzcEntUFwaBobRTUo7Qt1O VoTDEEWTCXBi2oEcHJvxS3yZRNI9LggBAnf+wfHGPVq8+t+5fXpDkPAaF0N3SRhXdv ATdQGBmva6SGvOxzSIr4IKdXU57bM+WUA0S2Qrmq9ijnD7vEj/TFdnbdQRFcFtd/cb GabEl9ZBvp8fA== Received: by pali.im (Postfix) id 2458CC7A; Sat, 27 Aug 2022 20:49:27 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: =?UTF-8?q?Marek=20Beh=C3=BAn?= , Stefan Roese Cc: u-boot@lists.denx.de Subject: [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue Date: Sat, 27 Aug 2022 20:49:20 +0200 Message-Id: <20220827184920.4313-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 When rescue mode was activated reset also bootdelay env variable to its default value. This will ensure that reset button works and starts rescue mode also in the case when user changed bootdelay env variable to -1 (which has meaning to not start autoboot). Signed-off-by: Pali Rohár --- board/CZ.NIC/turris_mox/turris_mox.c | 5 +++-- board/CZ.NIC/turris_omnia/turris_omnia.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c index 3dbd68e52366..5e1cf328ecc1 100644 --- a/board/CZ.NIC/turris_mox/turris_mox.c +++ b/board/CZ.NIC/turris_mox/turris_mox.c @@ -440,8 +440,9 @@ static void handle_reset_button(void) env_set_default_vars(1, (char * const *)vars, 0); if (read_reset_button()) { - const char * const vars[2] = { + const char * const vars[3] = { "bootcmd", + "bootdelay", "distro_bootcmd", }; @@ -449,7 +450,7 @@ static void handle_reset_button(void) * Set the above envs to their default values, in case the user * managed to break them. */ - env_set_default_vars(2, (char * const *)vars, 0); + env_set_default_vars(3, (char * const *)vars, 0); /* Ensure bootcmd_rescue is used by distroboot */ env_set("boot_targets", "rescue"); diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index cf8a6026702b..a7f96e5b7739 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -549,8 +549,9 @@ static void handle_reset_button(void) env_set_ulong("omnia_reset", reset_status); if (reset_status) { - const char * const vars[2] = { + const char * const vars[3] = { "bootcmd", + "bootdelay", "distro_bootcmd", }; @@ -558,7 +559,7 @@ static void handle_reset_button(void) * Set the above envs to their default values, in case the user * managed to break them. */ - env_set_default_vars(2, (char * const *)vars, 0); + env_set_default_vars(3, (char * const *)vars, 0); /* Ensure bootcmd_rescue is used by distroboot */ env_set("boot_targets", "rescue"); -- 2.20.1