imx8: Add a default reset_cpu() implementation
authorFabio Estevam <festevam@denx.de>
Tue, 26 Mar 2024 12:19:49 +0000 (09:19 -0300)
committerFabio Estevam <festevam@gmail.com>
Sat, 30 Mar 2024 16:57:14 +0000 (13:57 -0300)
Add a weak default reset_cpu() implementation just like
it is done on arch/arm/mach-imx/cpu.c.

This allows the removal of the empty reset_cpu() in several
board files.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Hiago De Franco <hiago.franco@toradex.com> # Toradex Colibri iMX8X
arch/arm/mach-imx/imx8/cpu.c
board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
board/advantech/imx8qm_rom7720_a1/imx8qm_rom7720_a1.c
board/congatec/cgtqmx8/cgtqmx8.c
board/freescale/imx8qm_mek/imx8qm_mek.c
board/freescale/imx8qxp_mek/imx8qxp_mek.c
board/toradex/apalis-imx8/apalis-imx8.c
board/toradex/colibri-imx8x/colibri-imx8x.c

index 0b91e44..6e64318 100644 (file)
@@ -84,6 +84,10 @@ static char *get_reset_cause(void)
        }
 }
 
+__weak void reset_cpu(void)
+{
+}
+
 int arch_cpu_init(void)
 {
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_RECOVER_DATA_SECTION)
index 8b4d730..56b7bdb 100644 (file)
@@ -136,17 +136,6 @@ void detail_board_ddr_info(void)
        puts("\nDDR    ");
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       puts("SCI reboot request");
-
-       while (1)
-               putc('.');
-}
-
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
index 206ce7d..7f766a6 100644 (file)
@@ -112,14 +112,6 @@ int board_init(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
-
 int board_mmc_get_env_dev(int devno)
 {
        return devno;
index 26189ff..3b01354 100644 (file)
@@ -371,13 +371,6 @@ void detail_board_ddr_info(void)
        puts("\nDDR    ");
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
 
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, struct bd_info *bd)
index d96d1d0..2b209c8 100644 (file)
@@ -102,14 +102,6 @@ int board_init(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
-
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
index 516cefd..833bee5 100644 (file)
@@ -126,14 +126,6 @@ int board_init(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
-
 #ifdef CONFIG_OF_BOARD_SETUP
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
index 49719f2..0f993e6 100644 (file)
@@ -291,14 +291,6 @@ int board_init(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
index 6fc8076..a507d66 100644 (file)
@@ -140,14 +140,6 @@ int board_init(void)
        return 0;
 }
 
-/*
- * Board specific reset that is system reset.
- */
-void reset_cpu(void)
-{
-       /* TODO */
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {