From 901d74b2d46cbd8b1d27477fa16388520fdabab1 Mon Sep 17 00:00:00 2001 From: Andrey Zhizhikin Date: Mon, 19 Sep 2022 20:49:16 +0200 Subject: [PATCH] fix(imx8m): move caam init after serial init CAAM provides serial output during initialization, but the serial init occurs after CAAM. This leads to serial output produced by CAAM init function to be omitted and not displayed. Change the order of initialization and call CAAM init after Serial. This has no impact as Serial does not require CAAM to be initialized upfront. Fixes: 2502709f60de ("plat: imx8m: Add caam module init on imx8m") Signed-off-by: Andrey Zhizhikin Cc: Jacky Bai Change-Id: I09c0a5474a1babfb0b53c4455891689ec08b5bdb --- plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c | 4 ++-- plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 4 ++-- plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 4 ++-- plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 5 +++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c index ba0db0cc7..1667baf45 100644 --- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c +++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c @@ -134,13 +134,13 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, imx_csu_init(csu_cfg); - imx8m_caam_init(); - console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ, IMX_CONSOLE_BAUDRATE, &console); /* This console is only used for boot stage */ console_set_scope(&console, CONSOLE_FLAG_BOOT); + imx8m_caam_init(); + /* * tell BL3-1 where the non-secure software image is located * and the entry state information. diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c index 5d2a64e8a..464c87dde 100644 --- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c +++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c @@ -139,13 +139,13 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, val = mmio_read_32(IMX_IOMUX_GPR_BASE + 0x2c); mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); - imx8m_caam_init(); - console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ, IMX_CONSOLE_BAUDRATE, &console); /* This console is only used for boot stage */ console_set_scope(&console, CONSOLE_FLAG_BOOT); + imx8m_caam_init(); + /* * tell BL3-1 where the non-secure software image is located * and the entry state information. diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c index d443c3df2..34631b868 100644 --- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c +++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c @@ -135,13 +135,13 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, val = mmio_read_32(IMX_IOMUX_GPR_BASE + 0x2c); mmio_write_32(IMX_IOMUX_GPR_BASE + 0x2c, val | 0x3DFF0000); - imx8m_caam_init(); - console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ, IMX_CONSOLE_BAUDRATE, &console); /* This console is only used for boot stage */ console_set_scope(&console, CONSOLE_FLAG_BOOT); + imx8m_caam_init(); + /* * tell BL3-1 where the non-secure software image is located * and the entry state information. diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c index e998a165c..59c3779ab 100644 --- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c @@ -132,14 +132,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, imx_aipstz_init(aipstz); - imx8m_caam_init(); - #if DEBUG_CONSOLE static console_t console; console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ, IMX_CONSOLE_BAUDRATE, &console); #endif + + imx8m_caam_init(); + /* * tell BL3-1 where the non-secure software image is located * and the entry state information. -- 2.39.5