Skip to contentSkip to conversation

ARM: imx8mm: verdin-imx8mm: fix board hang in spl

PATCH In review Marcel Ziswiler 3 participants 4 messages May 16, 2022 – May 20, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: imx8mm: verdin-imx8mm: fix board hang in spl

From: Marcel Ziswiler <[email protected]>

Move the preloader_console_init() call after spl_early_init() to avoid board hang in SPL.

While at it remove explicit in-code console/debug UART pinmuxing (uart1 and its pinmuxing are already marked as u-boot,dm-spl via device tree).

Fixes 4551e1898769 ("configs: verdin-imx8mm: verdin-imx8mp: enable dm serial")

---
I only very recently this weekend learned that verdin-imx8mm has such hang early in SPL issue due to it missing to move the preloader_console_init() call similar as to what Peng did in [1].

Unfortunately, this likely breaks Peng's [V2,00/14] imx8m: convert to DM_SERIAL series of late [2] and would need applying before ASAP.

Sorry about that.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

 board/toradex/verdin-imx8mm/spl.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
board/toradex/verdin-imx8mm/spl.c +2 -11
index 1f3f38351ef..f0361f93ea9 100644
@@ -74,15 +74,8 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
-#define UART_PAD_CTRL	(PAD_CTL_PUE | PAD_CTL_PE | PAD_CTL_DSE4)
 #define WDOG_PAD_CTRL	(PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 
-/* Verdin UART_3, Console/Debug UART */
-static iomux_v3_cfg_t const uart_pads[] = {
-	IMX8MM_PAD_SAI2_RXFS_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-	IMX8MM_PAD_SAI2_RXC_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
 static iomux_v3_cfg_t const wdog_pads[] = {
 	IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
 };
@@ -96,8 +89,6 @@ __weak void board_early_init(void)
 	imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
 
 	set_wdog_reset(wdog);
-
-	imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
 }
 
 int power_init_board(void)
@@ -143,8 +134,6 @@ void board_init_f(ulong dummy)
 
 	timer_init();
 
-	preloader_console_init();
-
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -162,6 +151,8 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 
+	preloader_console_init();
+
 	enable_tzc380();
 
 	power_init_board();
Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Move the preloader_console_init() call after spl_early_init() to avoid board hang in SPL.

While at it remove explicit in-code console/debug UART pinmuxing (uart1 and its pinmuxing are already marked as u-boot,dm-spl via device tree).

Quoted 7 lines
Fixes 4551e1898769 ("configs: verdin-imx8mm: verdin-imx8mp: enable dm serial")

---
I only very recently this weekend learned that verdin-imx8mm has such hang early in SPL issue due to it missing to move the preloader_console_init() call similar as to what Peng did in [1].

Any comments?

Could somebody please pull this one in ASAP as it is currently really broken. Thanks!

Quoted 58 lines

Unfortunately, this likely breaks Peng's [V2,00/14] imx8m: convert to DM_SERIAL series of late [2] and would need applying before ASAP.

Sorry about that.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

 board/toradex/verdin-imx8mm/spl.c | 13 ++-----------

 1 file changed, 2 insertions(+), 11 deletions(-)
board/toradex/verdin-imx8mm/spl.c +0 -0
index 1f3f38351ef..f0361f93ea9 100644
@@ -74,15 +74,8 @@ int board_fit_config_name_match(const char *name)
  }
  #endif


-#define UART_PAD_CTRL  (PAD_CTL_PUE | PAD_CTL_PE | PAD_CTL_DSE4) #define WDOG_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)

board/toradex/verdin-imx8mm/spl.c +0 -6
-/* Verdin UART_3, Console/Debug UART */
-static iomux_v3_cfg_t const uart_pads[] = {
-       IMX8MM_PAD_SAI2_RXFS_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MM_PAD_SAI2_RXC_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-

 static iomux_v3_cfg_t const wdog_pads[] = { IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL), };

board/toradex/verdin-imx8mm/spl.c +0 -0
@@ -96,8 +89,6 @@ __weak void board_early_init(void)
         imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));


        set_wdog_reset(wdog);
-
-       imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads)); }

 int power_init_board(void)

board/toradex/verdin-imx8mm/spl.c +0 -0
@@ -143,8 +134,6 @@ void board_init_f(ulong dummy)


        timer_init();

-       preloader_console_init();
-
        /* Clear the BSS. */ memset(__bss_start, 0, __bss_end - __bss_start);

board/toradex/verdin-imx8mm/spl.c +0 -0
@@ -162,6 +151,8 @@ void board_init_f(ulong dummy)
                 hang();
         }


+       preloader_console_init();
+
        enable_tzc380();

        power_init_board();

#2 lore raw

Hi Marcel,

Quoted 12 lines · Marcel Ziswiler
Quoted 11 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Move the preloader_console_init() call after spl_early_init() to avoid board hang in SPL.

While at it remove explicit in-code console/debug UART pinmuxing (uart1 and its pinmuxing are already marked as u-boot,dm-spl via device tree).

Fixes 4551e1898769 ("configs: verdin-imx8mm: verdin-imx8mp: enable dm serial")
Quoted 9 lines
Quoted 4 lines

---
I only very recently this weekend learned that verdin-imx8mm has such hang early in SPL issue due to it missing to move the preloader_console_init() call similar as to what Peng did in [1].

Any comments?

Could somebody please pull this one in ASAP as it is currently really broken. Thanks!

My next big merge will take place for the end of the week, I have written down to not forget this.

Stefano

Quoted 58 lines
Quoted 58 lines

Unfortunately, this likely breaks Peng's [V2,00/14] imx8m: convert to DM_SERIAL series of late [2] and would need applying before ASAP.

Sorry about that.

[1] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
[2] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

  board/toradex/verdin-imx8mm/spl.c | 13 ++-----------
  1 file changed, 2 insertions(+), 11 deletions(-)
board/toradex/verdin-imx8mm/spl.c +2 -11
index 1f3f38351ef..f0361f93ea9 100644
@@ -74,15 +74,8 @@ int board_fit_config_name_match(const char *name)
  }
  #endif
 
-#define UART_PAD_CTRL  (PAD_CTL_PUE | PAD_CTL_PE | PAD_CTL_DSE4)
  #define WDOG_PAD_CTRL  (PAD_CTL_DSE6 | PAD_CTL_ODE | PAD_CTL_PUE | PAD_CTL_PE)
 
-/* Verdin UART_3, Console/Debug UART */
-static iomux_v3_cfg_t const uart_pads[] = {
-       IMX8MM_PAD_SAI2_RXFS_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
-       IMX8MM_PAD_SAI2_RXC_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
-};
-
  static iomux_v3_cfg_t const wdog_pads[] = {
         IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B  | MUX_PAD_CTRL(WDOG_PAD_CTRL),
  };
@@ -96,8 +89,6 @@ __weak void board_early_init(void)
         imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
 
         set_wdog_reset(wdog);
-
-       imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
  }
 
  int power_init_board(void)
@@ -143,8 +134,6 @@ void board_init_f(ulong dummy)
 
         timer_init();
 
-       preloader_console_init();
-
         /* Clear the BSS. */
         memset(__bss_start, 0, __bss_end - __bss_start);
 
@@ -162,6 +151,8 @@ void board_init_f(ulong dummy)
                 hang();
         }
 
+       preloader_console_init();
+
         enable_tzc380();
 
         power_init_board();
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#3 lore raw

PATCH 1/1 ARM: imx8mm: verdin-imx8mm: fix board hang in spl

In reply to Marcel Ziswiler
Quoted 7 lines

From: Marcel Ziswiler <[email protected]>
Move the preloader_console_init() call after spl_early_init() to avoid board hang in SPL.
While at it remove explicit in-code console/debug UART pinmuxing (uart1 and its pinmuxing are already marked as u-boot,dm-spl via device tree).

Fixes 4551e1898769 ("configs: verdin-imx8mm: verdin-imx8mp: enable dm serial")

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================