DistroKit Mailinglist
 help / color / mirror / Atom feed
From: "Leonard Göhrs" <l.goehrs@pengutronix.de>
To: distrokit@pengutronix.de
Cc: "Leonard Göhrs" <l.goehrs@pengutronix.de>
Subject: [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M
Date: Wed, 17 Jan 2024 14:34:34 +0100	[thread overview]
Message-ID: <20240117133440.944800-2-l.goehrs@pengutronix.de> (raw)
In-Reply-To: <20240117133440.944800-1-l.goehrs@pengutronix.de>

This helps us on the TQ MBa8MPxL i.MX8MP development board,
that uses a different UART for debug output than the EVKs we
currently support.

Other i.MX8M boards should not be affected by the
IMX_BOOT_UART_BASE=auto configuration option because the automatic
selection will choose the correct UART.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 configs/platform-v8a/platformconfig           |   2 +-
 ...t-console-base-address-during-runtim.patch | 304 ++++++++++++++++++
 ...MX_BOOT_UART_BASE-autodetection-opti.patch | 172 ++++++++++
 ...mers-pengutronix-distrokit-20240117.patch} |  10 +-
 patches/tf-a-v2.8/series                      |  13 +-
 5 files changed, 491 insertions(+), 10 deletions(-)
 create mode 100644 patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runtim.patch
 create mode 100644 patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch
 rename patches/tf-a-v2.8/{0201-Release-2.8-customers-pengutronix-distrokit-20230210.patch => 0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch} (76%)

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index b71b361..c94ce70 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -216,7 +216,7 @@ PTXCONF_TF_A_ARM_ARCH_MAJOR_8=y
 PTXCONF_TF_A_ARM_ARCH_MAJOR=8
 PTXCONF_TF_A_PLATFORMS="imx8mq imx8mm imx8mn imx8mp"
 PTXCONF_TF_A_ARM_ARCH_MINOR=0
-PTXCONF_TF_A_EXTRA_ARGS=""
+PTXCONF_TF_A_EXTRA_ARGS="IMX_BOOT_UART_BASE=auto"
 PTXCONF_TF_A_ARTIFACTS="bl31.bin"
 
 #
diff --git a/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runtim.patch b/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runtim.patch
new file mode 100644
index 0000000..68f36ac
--- /dev/null
+++ b/patches/tf-a-v2.8/0201-feat-imx8m-detect-console-base-address-during-runtim.patch
@@ -0,0 +1,304 @@
+From: Marco Felsch <m.felsch@pengutronix.de>
+Date: Mon, 24 Jul 2023 15:05:58 +0200
+Subject: [PATCH] feat(imx8m): detect console base address during runtime
+
+Provide a helper to detect the enabled UART device during runtime. This
+lower the integration effort and make it more straight forward for
+'simple' use-cases with a single UART enabled. If multiple UARTs are
+enabled the first enabled is returned.
+
+The auto-detection is enabled by setting IMX_BOOT_UART_BASE=0 to keep
+the backward compatibility. For more advanced use-cases (multiple UARTs
+are enabled) the user still has to provide the correct base address.
+
+Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+Change-Id: I300a167e1a10f9aa991c8d1c3efe2c6b23f56c47
+---
+ plat/imx/imx8m/imx8m_ccm.c                | 58 +++++++++++++++++++++++++++++++
+ plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c | 11 +++++-
+ plat/imx/imx8m/imx8mm/platform.mk         |  1 +
+ plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 11 +++++-
+ plat/imx/imx8m/imx8mn/platform.mk         |  1 +
+ plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 11 +++++-
+ plat/imx/imx8m/imx8mp/platform.mk         |  1 +
+ plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 11 +++++-
+ plat/imx/imx8m/imx8mq/platform.mk         |  1 +
+ plat/imx/imx8m/include/imx8m_ccm.h        | 12 +++++++
+ 10 files changed, 114 insertions(+), 4 deletions(-)
+ create mode 100644 plat/imx/imx8m/imx8m_ccm.c
+ create mode 100644 plat/imx/imx8m/include/imx8m_ccm.h
+
+diff --git a/plat/imx/imx8m/imx8m_ccm.c b/plat/imx/imx8m/imx8m_ccm.c
+new file mode 100644
+index 000000000000..10a00c990031
+--- /dev/null
++++ b/plat/imx/imx8m/imx8m_ccm.c
+@@ -0,0 +1,58 @@
++/*
++ * Copyright (c) 2023, Pengutronix. All rights reserved.
++ *
++ * SPDX-License-Identifier: BSD-3-Clause
++ */
++
++#include <lib/mmio.h>
++#include <platform_def.h>
++
++#define UCR1    		0x80
++#define UCR1_UARTEN		BIT(0)
++#define DOMAIN0_RUNNING(d)	(((d) & 0x3) != 0)
++
++static struct imx_uart {
++	unsigned int ccm_reg;
++	unsigned int uart_base;
++} imx8m_uart_info[] = {
++	{	/* UART 1 */
++		.ccm_reg = 0x4490,
++		.uart_base = 0x30860000,
++	}, {	/* UART 2 */
++		.ccm_reg = 0x44a0,
++		.uart_base = 0x30890000,
++	}, {	/* UART 3 */
++		.ccm_reg = 0x44b0,
++		.uart_base = 0x30880000,
++	}, {	/* UART 4 */
++		.ccm_reg = 0x44c0,
++		.uart_base = 0x30a60000,
++	}
++};
++
++unsigned int imx8m_uart_get_base(void)
++{
++	unsigned int i;
++
++	for (i = 0; i < ARRAY_SIZE(imx8m_uart_info); i++) {
++		uint32_t val;
++
++		/*
++		 * At least check that the clock-gate is ungated before we
++		 * access the UART register.
++		 */
++		val = mmio_read_32(IMX_CCM_BASE + imx8m_uart_info[i].ccm_reg);
++		if (DOMAIN0_RUNNING(val)) {
++			val = mmio_read_32(imx8m_uart_info[i].uart_base + UCR1);
++			if (val & UCR1_UARTEN) {
++				return imx8m_uart_info[i].uart_base;
++			}
++		}
++	}
++
++	/*
++	 * We should return an error and inform the user but we can't do it
++	 * this early.
++	 */
++	return 0;
++}
+diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
+index 67bfd3651dfe..8e6636147438 100644
+--- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
+@@ -27,6 +27,7 @@
+ #include <imx_uart.h>
+ #include <imx_rdc.h>
+ #include <imx8m_caam.h>
++#include <imx8m_ccm.h>
+ #include <imx8m_csu.h>
+ #include <plat_imx8.h>
+ 
+@@ -130,6 +131,7 @@ void bl31_tzc380_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 = 0U;
+ 	static console_t console;
+ 	int i;
+ 
+@@ -144,7 +146,14 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
+ 
+ 	imx_csu_init(csu_cfg);
+ 
+-	console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ,
++#if IMX_BOOT_UART_BASE
++	console_base = IMX_BOOT_UART_BASE;
++#endif
++	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/imx8mm/platform.mk b/plat/imx/imx8m/imx8mm/platform.mk
+index 7a42554f5739..22791fda4c2c 100644
+--- a/plat/imx/imx8m/imx8mm/platform.mk
++++ b/plat/imx/imx8m/imx8mm/platform.mk
+@@ -37,6 +37,7 @@ BL31_SOURCES		+=	plat/imx/common/imx8_helpers.S			\
+ 				plat/imx/imx8m/imx_rdc.c			\
+ 				plat/imx/imx8m/imx8m_csu.c			\
+ 				plat/imx/imx8m/imx8m_caam.c			\
++				plat/imx/imx8m/imx8m_ccm.c			\
+ 				plat/imx/imx8m/imx8m_psci_common.c		\
+ 				plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c	\
+ 				plat/imx/imx8m/imx8mm/imx8mm_psci.c		\
+diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
+index eff198dd741c..aeb1cbf2945f 100644
+--- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
+@@ -25,6 +25,7 @@
+ #include <imx_uart.h>
+ #include <imx_rdc.h>
+ #include <imx8m_caam.h>
++#include <imx8m_ccm.h>
+ #include <imx8m_csu.h>
+ #include <platform_def.h>
+ #include <plat_imx8.h>
+@@ -121,6 +122,7 @@ static void bl31_tzc380_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 = 0U;
+ 	static console_t console;
+ 	unsigned int val;
+ 	int i;
+@@ -141,7 +143,14 @@ 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);
+ 
+-	console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ,
++#if IMX_BOOT_UART_BASE
++	console_base = IMX_BOOT_UART_BASE;
++#endif
++	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/imx8mn/platform.mk b/plat/imx/imx8m/imx8mn/platform.mk
+index 1c0ad4f3bc23..46516104f16d 100644
+--- a/plat/imx/imx8m/imx8mn/platform.mk
++++ b/plat/imx/imx8m/imx8mn/platform.mk
+@@ -31,6 +31,7 @@ BL31_SOURCES		+=	plat/imx/common/imx8_helpers.S			\
+ 				plat/imx/imx8m/imx_aipstz.c			\
+ 				plat/imx/imx8m/imx_rdc.c			\
+ 				plat/imx/imx8m/imx8m_caam.c			\
++				plat/imx/imx8m/imx8m_ccm.c			\
+ 				plat/imx/imx8m/imx8m_csu.c			\
+ 				plat/imx/imx8m/imx8m_psci_common.c		\
+ 				plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c	\
+diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+index 4c31fa28dab7..e25668b879b3 100644
+--- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+@@ -25,6 +25,7 @@
+ #include <imx_uart.h>
+ #include <imx_rdc.h>
+ #include <imx8m_caam.h>
++#include <imx8m_ccm.h>
+ #include <imx8m_csu.h>
+ #include <platform_def.h>
+ #include <plat_imx8.h>
+@@ -117,6 +118,7 @@ static void bl31_tzc380_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 = 0U;
+ 	static console_t console;
+ 	unsigned int val;
+ 	unsigned int i;
+@@ -137,7 +139,14 @@ 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);
+ 
+-	console_imx_uart_register(IMX_BOOT_UART_BASE, IMX_BOOT_UART_CLK_IN_HZ,
++#if IMX_BOOT_UART_BASE
++	console_base = IMX_BOOT_UART_BASE;
++#endif
++	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/imx8mp/platform.mk b/plat/imx/imx8m/imx8mp/platform.mk
+index 5414c0a5732d..cdb504de0f3d 100644
+--- a/plat/imx/imx8m/imx8mp/platform.mk
++++ b/plat/imx/imx8m/imx8mp/platform.mk
+@@ -32,6 +32,7 @@ BL31_SOURCES		+=	plat/imx/common/imx8_helpers.S			\
+ 				plat/imx/imx8m/imx_aipstz.c			\
+ 				plat/imx/imx8m/imx_rdc.c			\
+ 				plat/imx/imx8m/imx8m_caam.c			\
++				plat/imx/imx8m/imx8m_ccm.c			\
+ 				plat/imx/imx8m/imx8m_csu.c			\
+ 				plat/imx/imx8m/imx8m_psci_common.c		\
+ 				plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c	\
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 3c2d223fef21..1cb2d2a25b54 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -25,6 +25,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)
+@@ -124,6 +125,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 = 0U;
+ 	static console_t console;
+ 	int i;
+ 	/* enable CSU NS access permission */
+@@ -133,7 +135,14 @@ 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 IMX_BOOT_UART_BASE
++	console_base = IMX_BOOT_UART_BASE;
++#endif
++	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 985be71725f7..0c34c10bdcb4 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -25,6 +25,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			\
+diff --git a/plat/imx/imx8m/include/imx8m_ccm.h b/plat/imx/imx8m/include/imx8m_ccm.h
+new file mode 100644
+index 000000000000..acbd135cb314
+--- /dev/null
++++ b/plat/imx/imx8m/include/imx8m_ccm.h
+@@ -0,0 +1,12 @@
++/*
++ * Copyright (c) 2023, Pengutronix. All rights reserved.
++ *
++ * SPDX-License-Identifier: BSD-3-Clause
++ */
++
++#ifndef IMX8M_CCM_H
++#define IMX8M_CCM_H
++
++unsigned int imx8m_uart_get_base(void);
++
++#endif /* IMX8M_CCM_H */
diff --git a/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch b/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch
new file mode 100644
index 0000000..9fae109
--- /dev/null
+++ b/patches/tf-a-v2.8/0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch
@@ -0,0 +1,172 @@
+From: Marco Felsch <m.felsch@pengutronix.de>
+Date: Wed, 2 Aug 2023 08:11:35 +0200
+Subject: [PATCH] fix(imx8m): make IMX_BOOT_UART_BASE autodetection option more
+ obvious
+
+Switch from IMX_BOOT_UART_BASE=0 to IMX_BOOT_UART_BASE=auto to make it
+more obvious that the detection is based on the runtime autodetection.
+
+In addition this moves the evaluation of IMX_BOOT_UART_BASE into the
+makefile which removes the ugly conditional compilation as well.
+
+Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
+Change-Id: I92c13607bf81c6267f4b6aee829d74902b7f72d2
+---
+ plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c | 5 +----
+ plat/imx/imx8m/imx8mm/platform.mk         | 3 +++
+ plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c | 5 +----
+ plat/imx/imx8m/imx8mn/platform.mk         | 3 +++
+ plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c | 5 +----
+ plat/imx/imx8m/imx8mp/platform.mk         | 3 +++
+ plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c | 5 +----
+ plat/imx/imx8m/imx8mq/platform.mk         | 3 +++
+ 8 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
+index 8e6636147438..c8a3adf8f333 100644
+--- a/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
+@@ -131,7 +131,7 @@ void bl31_tzc380_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 = 0U;
++	unsigned int console_base = IMX_BOOT_UART_BASE;
+ 	static console_t console;
+ 	int i;
+ 
+@@ -146,9 +146,6 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
+ 
+ 	imx_csu_init(csu_cfg);
+ 
+-#if IMX_BOOT_UART_BASE
+-	console_base = IMX_BOOT_UART_BASE;
+-#endif
+ 	if (console_base == 0U) {
+ 		console_base = imx8m_uart_get_base();
+ 	}
+diff --git a/plat/imx/imx8m/imx8mm/platform.mk b/plat/imx/imx8m/imx8mm/platform.mk
+index 22791fda4c2c..1b4a1f2f37c7 100644
+--- a/plat/imx/imx8m/imx8mm/platform.mk
++++ b/plat/imx/imx8m/imx8mm/platform.mk
+@@ -159,6 +159,9 @@ BL32_SIZE		?=	0x2000000
+ $(eval $(call add_define,BL32_SIZE))
+ 
+ IMX_BOOT_UART_BASE	?=	0x30890000
++ifeq (${IMX_BOOT_UART_BASE},auto)
++    override IMX_BOOT_UART_BASE	:=	0
++endif
+ $(eval $(call add_define,IMX_BOOT_UART_BASE))
+ 
+ EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT)
+diff --git a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
+index aeb1cbf2945f..147249ee5e56 100644
+--- a/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mn/imx8mn_bl31_setup.c
+@@ -122,7 +122,7 @@ static void bl31_tzc380_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 = 0U;
++	unsigned int console_base = IMX_BOOT_UART_BASE;
+ 	static console_t console;
+ 	unsigned int val;
+ 	int i;
+@@ -143,9 +143,6 @@ 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);
+ 
+-#if IMX_BOOT_UART_BASE
+-	console_base = IMX_BOOT_UART_BASE;
+-#endif
+ 	if (console_base == 0U) {
+ 		console_base = imx8m_uart_get_base();
+ 	}
+diff --git a/plat/imx/imx8m/imx8mn/platform.mk b/plat/imx/imx8m/imx8mn/platform.mk
+index 46516104f16d..a6b43f213506 100644
+--- a/plat/imx/imx8m/imx8mn/platform.mk
++++ b/plat/imx/imx8m/imx8mn/platform.mk
+@@ -65,6 +65,9 @@ BL32_SIZE		?=	0x2000000
+ $(eval $(call add_define,BL32_SIZE))
+ 
+ IMX_BOOT_UART_BASE	?=	0x30890000
++ifeq (${IMX_BOOT_UART_BASE},auto)
++    override IMX_BOOT_UART_BASE	:=	0
++endif
+ $(eval $(call add_define,IMX_BOOT_UART_BASE))
+ 
+ EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT)
+diff --git a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+index e25668b879b3..b0a41c741c17 100644
+--- a/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mp/imx8mp_bl31_setup.c
+@@ -118,7 +118,7 @@ static void bl31_tzc380_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 = 0U;
++	unsigned int console_base = IMX_BOOT_UART_BASE;
+ 	static console_t console;
+ 	unsigned int val;
+ 	unsigned int i;
+@@ -139,9 +139,6 @@ 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);
+ 
+-#if IMX_BOOT_UART_BASE
+-	console_base = IMX_BOOT_UART_BASE;
+-#endif
+ 	if (console_base == 0U) {
+ 		console_base = imx8m_uart_get_base();
+ 	}
+diff --git a/plat/imx/imx8m/imx8mp/platform.mk b/plat/imx/imx8m/imx8mp/platform.mk
+index cdb504de0f3d..0169144f4a1a 100644
+--- a/plat/imx/imx8m/imx8mp/platform.mk
++++ b/plat/imx/imx8m/imx8mp/platform.mk
+@@ -156,6 +156,9 @@ BL32_SIZE		?=	0x2000000
+ $(eval $(call add_define,BL32_SIZE))
+ 
+ IMX_BOOT_UART_BASE	?=	0x30890000
++ifeq (${IMX_BOOT_UART_BASE},auto)
++    override IMX_BOOT_UART_BASE	:=	0
++endif
+ $(eval $(call add_define,IMX_BOOT_UART_BASE))
+ 
+ EL3_EXCEPTION_HANDLING := $(SDEI_SUPPORT)
+diff --git a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+index 1cb2d2a25b54..a2c81610b353 100644
+--- a/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
++++ b/plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
+@@ -125,7 +125,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 = 0U;
++	unsigned int console_base = IMX_BOOT_UART_BASE;
+ 	static console_t console;
+ 	int i;
+ 	/* enable CSU NS access permission */
+@@ -135,9 +135,6 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
+ 
+ 	imx_aipstz_init(aipstz);
+ 
+-#if IMX_BOOT_UART_BASE
+-	console_base = IMX_BOOT_UART_BASE;
+-#endif
+ 	if (console_base == 0U) {
+ 		console_base = imx8m_uart_get_base();
+ 	}
+diff --git a/plat/imx/imx8m/imx8mq/platform.mk b/plat/imx/imx8m/imx8mq/platform.mk
+index 0c34c10bdcb4..6ee7d23d4882 100644
+--- a/plat/imx/imx8m/imx8mq/platform.mk
++++ b/plat/imx/imx8m/imx8mq/platform.mk
+@@ -55,6 +55,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)
diff --git a/patches/tf-a-v2.8/0201-Release-2.8-customers-pengutronix-distrokit-20230210.patch b/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch
similarity index 76%
rename from patches/tf-a-v2.8/0201-Release-2.8-customers-pengutronix-distrokit-20230210.patch
rename to patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch
index f230656..1d1a9b9 100644
--- a/patches/tf-a-v2.8/0201-Release-2.8-customers-pengutronix-distrokit-20230210.patch
+++ b/patches/tf-a-v2.8/0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch
@@ -1,13 +1,13 @@
-From: Marco Felsch <m.felsch@pengutronix.de>
-Date: Fri, 10 Feb 2023 12:51:49 +0100
-Subject: [PATCH] Release 2.8/customers/pengutronix/distrokit/20230210-1
+From: =?UTF-8?q?Leonard=20G=C3=B6hrs?= <l.goehrs@pengutronix.de>
+Date: Wed, 17 Jan 2024 11:13:01 +0100
+Subject: [PATCH] Release 2.8/customers/pengutronix/distrokit/20240117-1
 
 ---
  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Makefile b/Makefile
-index 1bfff716485a..cf80e5cac8f3 100644
+index 1bfff716485a..f39eb940a024 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -327,7 +327,7 @@ endif
@@ -15,7 +15,7 @@ index 1bfff716485a..cf80e5cac8f3 100644
          BUILD_STRING  :=  $(shell git describe --always --dirty --tags 2> /dev/null)
  endif
 -VERSION_STRING    :=  v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}
-+VERSION_STRING    :=  v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20230210-1
++VERSION_STRING    :=  v${VERSION}(${BUILD_TYPE}):${BUILD_STRING}-20240117-1
  
  ifeq (${AARCH32_INSTRUCTION_SET},A32)
  TF_CFLAGS_aarch32	+=	-marm
diff --git a/patches/tf-a-v2.8/series b/patches/tf-a-v2.8/series
index a29319d..7a73fce 100644
--- a/patches/tf-a-v2.8/series
+++ b/patches/tf-a-v2.8/series
@@ -1,6 +1,6 @@
 # umpf-base: v2.8
 # umpf-name: 2.8/customers/pengutronix/distrokit
-# umpf-version: 2.8/customers/pengutronix/distrokit/20230210-1
+# umpf-version: 2.8/customers/pengutronix/distrokit/20240117-1
 # umpf-topic: v2.8/topic/fix-build-warnings
 # umpf-hashinfo: 4730b4b80206cf2fc27787f43cefd3169a6f8a2f
 # umpf-topic-range: 9881bb93a3bc0a3ea37e9f093e09ab4b360a9e48..da1b5e74dc7c2b3e7a2d9a1adb7e23beeba079e3
@@ -16,7 +16,12 @@
 0105-refactor-imx8mq-introduce-BL31_SIZE.patch
 0106-feat-imx8mq-add-BL31-PIE-support.patch
 0107-feat-imx8mq-add-support-for-gcc-12.x.patch
-# umpf-release: 2.8/customers/pengutronix/distrokit/20230210-1
-# umpf-topic-range: be7bcbebf5b22958e8b88564ca0865b4591263e7..827865ee983d0c7cd4bb99d85d46f972386e5ea9
-0201-Release-2.8-customers-pengutronix-distrokit-20230210.patch
+# umpf-topic: v2.8/topic/uart-runtime-detection
+# umpf-hashinfo: b59093eaea88fddf1c893eb8f45a3eadf1f570cc
+# umpf-topic-range: be7bcbebf5b22958e8b88564ca0865b4591263e7..015b0b19a839d0d4beb01babbe1af81917fcfb57
+0201-feat-imx8m-detect-console-base-address-during-runtim.patch
+0202-fix-imx8m-make-IMX_BOOT_UART_BASE-autodetection-opti.patch
+# umpf-release: 2.8/customers/pengutronix/distrokit/20240117-1
+# umpf-topic-range: 015b0b19a839d0d4beb01babbe1af81917fcfb57..070499680453a1c6a358828e4bd7cf6c9629ef6b
+0301-Release-2.8-customers-pengutronix-distrokit-20240117.patch
 # umpf-end

base-commit: 186b41e16055cd2e2eada7af81a63371f5da0ad1
-- 
2.39.2




  reply	other threads:[~2024-01-17 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
2024-01-17 13:34 ` Leonard Göhrs [this message]
2024-01-17 13:34 ` [DistroKit] [PATCH v2 2/7] images: imx8m: move the root-a partition further back Leonard Göhrs
2024-01-17 13:34 ` [DistroKit] [PATCH v2 3/7] images: imx8m: add a barebox environment partition Leonard Göhrs
2024-01-17 13:34 ` [DistroKit] [PATCH v2 4/7] v8a: images: imx8m: add barebox state partition Leonard Göhrs
2024-01-17 13:34 ` [DistroKit] [PATCH v2 5/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
2024-01-17 13:34 ` [DistroKit] [PATCH v2 6/7] v8a: imx8m: enable image generation for TQ MBa8MPxL Leonard Göhrs
2024-01-17 13:34 ` [DistroKit] [PATCH v2 7/7] v8a: imx8m: enable barebox state " Leonard Göhrs
2024-01-26 16:43 ` [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240117133440.944800-2-l.goehrs@pengutronix.de \
    --to=l.goehrs@pengutronix.de \
    --cc=distrokit@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox