diff mbox series

[u-boot-marvell,07/12] arm: mvebu: turris_mox: Always handle reset button

Message ID 20211009173346.7859-8-kabel@kernel.org
State Accepted
Commit f3c71e75b08b7cbe35acc29d89e90c05edd70d40
Delegated to: Stefan Roese
Headers show
Series Small Turris MOX and Omnia changes | expand

Commit Message

Marek Behún Oct. 9, 2021, 5:33 p.m. UTC
From: Marek Behún <marek.behun@nic.cz>

Handle reset button even if we can't configure modules.

This happens if we fail retrieving reset GPIO with which we can reset
the modules.

(Note that this GPIO is different from reset button GPIO.)

Signed-off-by: Marek Behún <marek.behun@nic.cz>
---
 board/CZ.NIC/turris_mox/turris_mox.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Roese Oct. 21, 2021, 5:32 a.m. UTC | #1
On 09.10.21 19:33, Marek Behún wrote:
> From: Marek Behún <marek.behun@nic.cz>
> 
> Handle reset button even if we can't configure modules.
> 
> This happens if we fail retrieving reset GPIO with which we can reset
> the modules.
> 
> (Note that this GPIO is different from reset button GPIO.)
> 
> Signed-off-by: Marek Behún <marek.behun@nic.cz>

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

Thanks,
Stefan

> ---
>   board/CZ.NIC/turris_mox/turris_mox.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
> index ff0ed28045..7c5acfd1d9 100644
> --- a/board/CZ.NIC/turris_mox/turris_mox.c
> +++ b/board/CZ.NIC/turris_mox/turris_mox.c
> @@ -617,7 +617,7 @@ int last_stage_init(void)
>   
>   	/* configure modules */
>   	if (get_reset_gpio(&reset_gpio) < 0)
> -		return 0;
> +		goto handle_reset_btn;
>   
>   	if (peridot > 0) {
>   		if (configure_peridots(&reset_gpio) < 0) {
> @@ -654,6 +654,7 @@ int last_stage_init(void)
>   		}
>   	}
>   
> +handle_reset_btn:
>   	handle_reset_button();
>   
>   	return 0;
> 


Viele Grüße,
Stefan
diff mbox series

Patch

diff --git a/board/CZ.NIC/turris_mox/turris_mox.c b/board/CZ.NIC/turris_mox/turris_mox.c
index ff0ed28045..7c5acfd1d9 100644
--- a/board/CZ.NIC/turris_mox/turris_mox.c
+++ b/board/CZ.NIC/turris_mox/turris_mox.c
@@ -617,7 +617,7 @@  int last_stage_init(void)
 
 	/* configure modules */
 	if (get_reset_gpio(&reset_gpio) < 0)
-		return 0;
+		goto handle_reset_btn;
 
 	if (peridot > 0) {
 		if (configure_peridots(&reset_gpio) < 0) {
@@ -654,6 +654,7 @@  int last_stage_init(void)
 		}
 	}
 
+handle_reset_btn:
 	handle_reset_button();
 
 	return 0;