All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue
@ 2022-08-27 18:49 Pali Rohár
  2022-08-28  3:48 ` Marek Behún
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Pali Rohár @ 2022-08-27 18:49 UTC (permalink / raw)
  To: Marek Behún, Stefan Roese; +Cc: u-boot

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 <pali@kernel.org>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue
  2022-08-27 18:49 [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue Pali Rohár
@ 2022-08-28  3:48 ` Marek Behún
  2022-08-30 12:26 ` Stefan Roese
  2022-09-13  6:59 ` Stefan Roese
  2 siblings, 0 replies; 4+ messages in thread
From: Marek Behún @ 2022-08-28  3:48 UTC (permalink / raw)
  To: Pali Rohár; +Cc: Stefan Roese, u-boot

On Sat, 27 Aug 2022 20:49:20 +0200
Pali Rohár <pali@kernel.org> wrote:

> 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 <pali@kernel.org>

Reviewed-by: Marek Behún <kabel@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue
  2022-08-27 18:49 [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue Pali Rohár
  2022-08-28  3:48 ` Marek Behún
@ 2022-08-30 12:26 ` Stefan Roese
  2022-09-13  6:59 ` Stefan Roese
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2022-08-30 12:26 UTC (permalink / raw)
  To: Pali Rohár, Marek Behún; +Cc: u-boot

On 27.08.22 20:49, Pali Rohár wrote:
> 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 <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   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");

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue
  2022-08-27 18:49 [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue Pali Rohár
  2022-08-28  3:48 ` Marek Behún
  2022-08-30 12:26 ` Stefan Roese
@ 2022-09-13  6:59 ` Stefan Roese
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2022-09-13  6:59 UTC (permalink / raw)
  To: Pali Rohár, Marek Behún; +Cc: u-boot

On 27.08.22 20:49, Pali Rohár wrote:
> 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 <pali@kernel.org>

Applied to u-boot-marvell/master

Thanks,
Stefan

> ---
>   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");

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-09-13  6:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27 18:49 [PATCH] arm: mvebu: turris_{omnia, mox}: Reset bootdelay env for rescue Pali Rohár
2022-08-28  3:48 ` Marek Behún
2022-08-30 12:26 ` Stefan Roese
2022-09-13  6:59 ` Stefan Roese

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.