diff options
Diffstat (limited to 'patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch')
-rw-r--r-- | patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch new file mode 100644 index 0000000..c488337 --- /dev/null +++ b/patches/tf-a-v2.10/0002-feat-imx8mq-detect-console-base-address-during-runti.patch @@ -0,0 +1,69 @@ +From aeb68be64c5c47142de3c95a8961749f7b33030a Mon Sep 17 00:00:00 2001 +From: Ahmad Fatoum <a.fatoum@pengutronix.de> +Date: Wed, 13 Mar 2024 02:08:54 +0100 +Subject: [PATCH 2/3] feat(imx8mq): detect console base address during runtime + +Change-Id: I9ba70f7068e762da979bd103390fa006c3a5d480 +--- + plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 8 +++++++- + plat/imx/imx8m/imx8mq/platform.mk | 4 ++++ + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +index 7065a658614f..70c2def7d18b 100644 +--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c ++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c +@@ -26,6 +26,7 @@ + #include <imx_aipstz.h> + #include <imx_uart.h> + #include <imx8m_caam.h> ++#include <imx8m_ccm.h> + #include <plat_imx8.h> + + #define TRUSTY_PARAMS_LEN_BYTES (4096*2) +@@ -145,6 +146,7 @@ static void bl31_tz380_setup(void) + void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, + u_register_t arg2, u_register_t arg3) + { ++ unsigned int console_base = IMX_BOOT_UART_BASE; + static console_t console; + int i; + /* enable CSU NS access permission */ +@@ -154,7 +156,11 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, + + imx_aipstz_init(aipstz); + +- console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ, ++ if (console_base == 0U) { ++ console_base = imx8m_uart_get_base(); ++ } ++ ++ console_imx_uart_register(console_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); +diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk +index b1c189fa09f5..648159eb3d10 100644 +--- a/plat/imx/imx8m/imx8mq/platform.mk ++++ b/plat/imx/imx8m/imx8mq/platform.mk +@@ -31,6 +31,7 @@ BL31_SOURCES += plat/imx/common/imx8_helpers.S \ + plat/imx/imx8m/gpc_common.c \ + plat/imx/imx8m/imx_aipstz.c \ + plat/imx/imx8m/imx8m_caam.c \ ++ plat/imx/imx8m/imx8m_ccm.c \ + plat/imx/imx8m/imx8m_psci_common.c \ + plat/imx/imx8m/imx8mq/gpc.c \ + plat/imx/common/imx8_topology.c \ +@@ -62,6 +63,9 @@ BL32_SIZE ?= 0x2000000 + $(eval $(call add_define,BL32_SIZE)) + + IMX_BOOT_UART_BASE ?= 0x30860000 ++ifeq (${IMX_BOOT_UART_BASE},auto) ++ override IMX_BOOT_UART_BASE := 0 ++endif + $(eval $(call add_define,IMX_BOOT_UART_BASE)) + + ifeq (${SPD},trusty) +-- +2.39.2 + |