diff mbox series

[2/3] imx: imx8m*: Remove do_reset from board files

Message ID 25277ba3658920ff3be7464020438070844f05da.1583328917.git.hws@denx.de
State New
Headers show
Series ARM: Fix reset in SPL if SYSRESET is not used | expand

Commit Message

Harald Seiler March 4, 2020, 2:23 p.m. UTC
From: Claudius Heine <ch at denx.de>

Use the `do_reset` implementation of `arch/arm/lib/reset.c` in SPL
instead.  It is very close to what is done here, anyway, and plays
more nicely with the rest of U-Boot than adding a custom `do_reset`
implementation into board files.

`do_reset` from `arch/arm/lib/reset.c` calls `reset_cpu` with 0 as the
addr parameter while the boards are passing WDOG1_BASE_ADDR.  This is
ok because the `reset_cpu` implementation uses WDOG1_BASE_ADDR by
default if 0 is passed in.

Co-Authored-by: Harald Seiler <hws at denx.de>
Signed-off-by: Claudius Heine <ch at denx.de>
Signed-off-by: Harald Seiler <hws at denx.de>
---
 board/freescale/imx8mm_evk/spl.c  | 9 ---------
 board/freescale/imx8mn_evk/spl.c  | 9 ---------
 board/freescale/imx8mp_evk/spl.c  | 9 ---------
 board/toradex/verdin-imx8mm/spl.c | 9 ---------
 4 files changed, 36 deletions(-)

Comments

Marek Vasut March 4, 2020, 2:29 p.m. UTC | #1
On 3/4/20 3:23 PM, Harald Seiler wrote:
> From: Claudius Heine <ch at denx.de>
> 
> Use the `do_reset` implementation of `arch/arm/lib/reset.c` in SPL
> instead.  It is very close to what is done here, anyway, and plays
> more nicely with the rest of U-Boot than adding a custom `do_reset`
> implementation into board files.
> 
> `do_reset` from `arch/arm/lib/reset.c` calls `reset_cpu` with 0 as the
> addr parameter while the boards are passing WDOG1_BASE_ADDR.  This is
> ok because the `reset_cpu` implementation uses WDOG1_BASE_ADDR by
> default if 0 is passed in.
> 
> Co-Authored-by: Harald Seiler <hws at denx.de>
> Signed-off-by: Claudius Heine <ch at denx.de>
> Signed-off-by: Harald Seiler <hws at denx.de>
> ---
>  board/freescale/imx8mm_evk/spl.c  | 9 ---------
>  board/freescale/imx8mn_evk/spl.c  | 9 ---------
>  board/freescale/imx8mp_evk/spl.c  | 9 ---------
>  board/toradex/verdin-imx8mm/spl.c | 9 ---------
>  4 files changed, 36 deletions(-)

Reviewed-by: Marek Vasut <marex at denx.de>
Stefano Babic May 1, 2020, 4:33 p.m. UTC | #2
> From: Claudius Heine <ch at denx.de>
> Use the `do_reset` implementation of `arch/arm/lib/reset.c` in SPL
> instead.  It is very close to what is done here, anyway, and plays
> more nicely with the rest of U-Boot than adding a custom `do_reset`
> implementation into board files.
> `do_reset` from `arch/arm/lib/reset.c` calls `reset_cpu` with 0 as the
> addr parameter while the boards are passing WDOG1_BASE_ADDR.  This is
> ok because the `reset_cpu` implementation uses WDOG1_BASE_ADDR by
> default if 0 is passed in.
> Co-Authored-by: Harald Seiler <hws at denx.de>
> Signed-off-by: Claudius Heine <ch at denx.de>
> Signed-off-by: Harald Seiler <hws at denx.de>
> Reviewed-by: Marek Vasut <marex at denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/freescale/imx8mm_evk/spl.c b/board/freescale/imx8mm_evk/spl.c
index 5d17f397cb68..4d34622465b3 100644
--- a/board/freescale/imx8mm_evk/spl.c
+++ b/board/freescale/imx8mm_evk/spl.c
@@ -161,12 +161,3 @@  void board_init_f(ulong dummy)
 
 	board_init_r(NULL, 0);
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	puts ("resetting ...\n");
-
-	reset_cpu(WDOG1_BASE_ADDR);
-
-	return 0;
-}
diff --git a/board/freescale/imx8mn_evk/spl.c b/board/freescale/imx8mn_evk/spl.c
index 7aed14c52b68..45417b24464d 100644
--- a/board/freescale/imx8mn_evk/spl.c
+++ b/board/freescale/imx8mn_evk/spl.c
@@ -114,12 +114,3 @@  void board_init_f(ulong dummy)
 
 	board_init_r(NULL, 0);
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	puts("resetting ...\n");
-
-	reset_cpu(WDOG1_BASE_ADDR);
-
-	return 0;
-}
diff --git a/board/freescale/imx8mp_evk/spl.c b/board/freescale/imx8mp_evk/spl.c
index 0b20668e2b30..39c1dae684ac 100644
--- a/board/freescale/imx8mp_evk/spl.c
+++ b/board/freescale/imx8mp_evk/spl.c
@@ -149,12 +149,3 @@  void board_init_f(ulong dummy)
 
 	board_init_r(NULL, 0);
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	puts("resetting ...\n");
-
-	reset_cpu(WDOG1_BASE_ADDR);
-
-	return 0;
-}
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
index a5dc54082054..dc5bd84f332e 100644
--- a/board/toradex/verdin-imx8mm/spl.c
+++ b/board/toradex/verdin-imx8mm/spl.c
@@ -169,12 +169,3 @@  void board_init_f(ulong dummy)
 
 	board_init_r(NULL, 0);
 }
-
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	puts("resetting ...\n");
-
-	reset_cpu(WDOG1_BASE_ADDR);
-
-	return 0;
-}