DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board
@ 2024-01-17 13:34 Leonard Göhrs
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M Leonard Göhrs
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit

This adds support for the i.MX8MP based MBa8MPxL[1] by TQ.

This board uses another UART than e.g. the NXP EVK boards
for debug output. This is why we need a tf-a patch that
automatically selects the UART at runtime based on which one
is already enabled. 

While at it I've also added a barebox state partition for all
other i.MX8M images, to prepare them for RAUC support
and added RAUC support for the MBa8MPxL.

This patch series is built upon Ahmads series[2] that
updates barebox and cleans up its configuration,
so that should be merged first to prevent conflicts.

Changes from v1 to v2:

  - Add an (admittedly untested) i.MX8MQ version of the tf-a
    UART auto detection patch and use "IMX_BOOT_UART_BASE=auto"
    instead of "IMX_BOOT_UART_BASE=0".
    The variant in v1 with "IMX_BOOT_UART_BASE=0" would previously
    have silently broken support on i.MX8MQ.
  - More changes to the partition layout based on the given feedback.
  - Simplified "barebox-common-defaultenv/init/bootsource".

[1]: https://www.tq-group.com/en/products/tq-embedded/arm-architecture/mba8mpxl/
[2]: https://lore.distrokit.org/distrokit/20240102154603.3678357-1-a.fatoum@pengutronix.de/T/#t





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M
  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
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 2/7] images: imx8m: move the root-a partition further back Leonard Göhrs
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 2/7] images: imx8m: move the root-a partition further back
  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 ` [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M Leonard Göhrs
@ 2024-01-17 13:34 ` Leonard Göhrs
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 3/7] images: imx8m: add a barebox environment partition Leonard Göhrs
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

The 896K assigned to the barebox partition are getting ever closer to
overflowing (barebox-nxp-imx8mn-evk.img is as of now 883K).
Increasing the barebox partition also requires changes to the respective
devicetrees because the location of the environment is hardcoded to
be at 896K there.

Move the root-a partition further back to free up some space so we
can add a state partition now and eventually move the environment
partition as well and then increase the barebox partition size.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 configs/platform-v8a/config/images/imx8m.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/platform-v8a/config/images/imx8m.config b/configs/platform-v8a/config/images/imx8m.config
index 59cdac1..32a0661 100644
--- a/configs/platform-v8a/config/images/imx8m.config
+++ b/configs/platform-v8a/config/images/imx8m.config
@@ -10,7 +10,7 @@ image @IMAGE@ {
                holes = {"(440; 32K)"}
        }
        partition root-A {
-               offset = 2M
+               offset = 4M
                image = "root.ext2"
                partition-type-uuid = b921b045-1df0-41c3-af44-4c6f280d3fae
        }
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 3/7] images: imx8m: add a barebox environment partition
  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 ` [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M Leonard Göhrs
  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 ` Leonard Göhrs
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 4/7] v8a: images: imx8m: add barebox state partition Leonard Göhrs
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

The barebox environment is configured in the board devicetrees to
be at 896k and 128k in size (e.g. the last 128k before the 1M mark).
This is for compatibility with the fdisk behaviour of placing the
start of the first partition at the 1M mark.

Not everyone knows this though, so it can easily happen that someone
increases the size of the barebox partition, making it overlap with
the environment "partition".

Make this less likely to happen by listing the barebox state in
the genimage config.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 configs/platform-v8a/config/images/imx8m.config | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/configs/platform-v8a/config/images/imx8m.config b/configs/platform-v8a/config/images/imx8m.config
index 32a0661..a4a7e12 100644
--- a/configs/platform-v8a/config/images/imx8m.config
+++ b/configs/platform-v8a/config/images/imx8m.config
@@ -9,6 +9,14 @@ image @IMAGE@ {
                in-partition-table = false
                holes = {"(440; 32K)"}
        }
+       partition barebox-environment {
+               # The barebox environment location is configured in the board
+               # devicetree files to 0xe0000 ... 0xe0000+0x20000.
+               offset = 896K
+               size = 128K
+               in-partition-table = false
+               image = /dev/null
+       }
        partition root-A {
                offset = 4M
                image = "root.ext2"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 4/7] v8a: images: imx8m: add barebox state partition
  2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
                   ` (2 preceding siblings ...)
  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 ` 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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

Having a place to store state allows us to use RAUC on i.MX8M based
boards. The 1Mb size is quite large for a state partition, which
uses a compact representation, but using this size means we do not
have to change the partition alignment.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 configs/platform-v8a/config/images/imx8m.config | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configs/platform-v8a/config/images/imx8m.config b/configs/platform-v8a/config/images/imx8m.config
index a4a7e12..9278090 100644
--- a/configs/platform-v8a/config/images/imx8m.config
+++ b/configs/platform-v8a/config/images/imx8m.config
@@ -17,6 +17,12 @@ image @IMAGE@ {
                in-partition-table = false
                image = /dev/null
        }
+       partition barebox-state {
+               offset = 3M
+               size = 1M
+               partition-type-uuid = 4778ed65-bf42-45fa-9c5b-287a1dc4aab1 # barebox-state
+               image = /dev/null
+       }
        partition root-A {
                offset = 4M
                image = "root.ext2"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 5/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board
  2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
                   ` (3 preceding siblings ...)
  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 ` Leonard Göhrs
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 6/7] v8a: imx8m: enable image generation for TQ MBa8MPxL Leonard Göhrs
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

The generated image can be used to boot the board via SD card.

The dev.mmc1.broken_cd barebox environment entry is required because
the board's card detect does not reliably detect an inserted USB-SD-Mux,
resulting in the board failing to boot.
This should not (negatively) affect the other v8a machines.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 .../nv/dev.mmc1.broken_cd                     |  1 +
 configs/platform-v8a/barebox.config           |  4 +--
 configs/platform-v8a/kernelconfig             |  2 +-
 .../platforms/image-tq-mba8mpxl.in            | 10 ++++++
 .../platform-v8a/rules/image-tq-mba8mpxl.make | 36 +++++++++++++++++++
 5 files changed, 50 insertions(+), 3 deletions(-)
 create mode 100644 configs/platform-v8a/barebox-common-defaultenv/nv/dev.mmc1.broken_cd
 create mode 100644 configs/platform-v8a/platforms/image-tq-mba8mpxl.in
 create mode 100644 configs/platform-v8a/rules/image-tq-mba8mpxl.make

diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/dev.mmc1.broken_cd b/configs/platform-v8a/barebox-common-defaultenv/nv/dev.mmc1.broken_cd
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/configs/platform-v8a/barebox-common-defaultenv/nv/dev.mmc1.broken_cd
@@ -0,0 +1 @@
+1
diff --git a/configs/platform-v8a/barebox.config b/configs/platform-v8a/barebox.config
index 02d314f..fc4f643 100644
--- a/configs/platform-v8a/barebox.config
+++ b/configs/platform-v8a/barebox.config
@@ -60,7 +60,7 @@ CONFIG_MACH_PHYTEC_SOM_IMX8MQ=y
 # CONFIG_MACH_POLYHEX_DEBIX is not set
 # CONFIG_MACH_PROTONIC_IMX8M is not set
 # CONFIG_MACH_SKOV_IMX8MP is not set
-# CONFIG_MACH_TQ_MBA8MPXL is not set
+CONFIG_MACH_TQ_MBA8MPXL=y
 # CONFIG_MACH_VARISCITE_DT8MCUSTOMBOARD_IMX8MP is not set
 # CONFIG_MACH_ZII_IMX8MQ_DEV is not set
 
@@ -762,7 +762,7 @@ CONFIG_MFD_SYSCON=y
 # CONFIG_MFD_TWL6030 is not set
 # CONFIG_RAVE_SP_CORE is not set
 # CONFIG_MFD_STPMIC1 is not set
-# CONFIG_MFD_PCA9450 is not set
+CONFIG_MFD_PCA9450=y
 # CONFIG_MFD_RN568PMIC is not set
 # CONFIG_MFD_ATMEL_FLEXCOM is not set
 CONFIG_MFD_RK808=y
diff --git a/configs/platform-v8a/kernelconfig b/configs/platform-v8a/kernelconfig
index a37fd1e..079c6ac 100644
--- a/configs/platform-v8a/kernelconfig
+++ b/configs/platform-v8a/kernelconfig
@@ -2381,7 +2381,7 @@ CONFIG_SMSC_PHY=m
 # CONFIG_DP83822_PHY is not set
 # CONFIG_DP83TC811_PHY is not set
 # CONFIG_DP83848_PHY is not set
-# CONFIG_DP83867_PHY is not set
+CONFIG_DP83867_PHY=y
 # CONFIG_DP83869_PHY is not set
 # CONFIG_DP83TD510_PHY is not set
 CONFIG_VITESSE_PHY=y
diff --git a/configs/platform-v8a/platforms/image-tq-mba8mpxl.in b/configs/platform-v8a/platforms/image-tq-mba8mpxl.in
new file mode 100644
index 0000000..956063a
--- /dev/null
+++ b/configs/platform-v8a/platforms/image-tq-mba8mpxl.in
@@ -0,0 +1,10 @@
+## SECTION=image
+
+config IMAGE_TQ_MBA8MPXL
+	tristate
+	select HOST_GENIMAGE
+	select IMAGE_ROOT_EXT
+	select BAREBOX
+	prompt "Generate images/tq-mba8mpxl.img"
+	help
+	  Generate a bootable SD card image to deploy on a TQ MBa8MPxL board.
diff --git a/configs/platform-v8a/rules/image-tq-mba8mpxl.make b/configs/platform-v8a/rules/image-tq-mba8mpxl.make
new file mode 100644
index 0000000..65c50cc
--- /dev/null
+++ b/configs/platform-v8a/rules/image-tq-mba8mpxl.make
@@ -0,0 +1,36 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Sascha Hauer <s.hauer@pengutronix.de>
+# Copyright (C) 2024 by Leonard Göhrs <l.goehrs@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_TQ_MBA8MPXL) += image-tq-mba8mpxl
+
+#
+# Paths and names
+#
+IMAGE_TQ_MBA8MPXL		:= image-tq-mba8mpxl
+IMAGE_TQ_MBA8MPXL_DIR	:= $(BUILDDIR)/$(IMAGE_TQ_MBA8MPXL)
+IMAGE_TQ_MBA8MPXL_IMAGE	:= $(IMAGEDIR)/tq-mba8mpxl.img
+IMAGE_TQ_MBA8MPXL_FILES	:= $(IMAGEDIR)/root.tgz
+IMAGE_TQ_MBA8MPXL_CONFIG	:= imx8m.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+IMAGE_TQ_MBA8MPXL_ENV := \
+        BAREBOX_IMAGE=barebox-tqma8mpxl.img
+
+$(IMAGE_TQ_MBA8MPXL_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_TQ_MBA8MPXL)
+	@$(call finish)
+
+# vim: syntax=make
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 6/7] v8a: imx8m: enable image generation for TQ MBa8MPxL
  2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
                   ` (4 preceding siblings ...)
  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 ` 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
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 configs/platform-v8a/platformconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index c94ce70..3d37202 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -135,7 +135,7 @@ PTXCONF_KERNEL_IMAGE_RAW=y
 PTXCONF_KERNEL_IMAGE="Image"
 PTXCONF_KERNEL_DTB=y
 PTXCONF_KERNEL_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_KERNEL_DTS="armada-3720-community.dts freescale/imx8mm-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mp-evk.dts freescale/imx8mq-evk.dts rockchip/rk3568-rock-3a.dts"
+PTXCONF_KERNEL_DTS="armada-3720-community.dts freescale/imx8mm-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mp-evk.dts freescale/imx8mq-evk.dts rockchip/rk3568-rock-3a.dts freescale/imx8mp-tqma8mpql-mba8mpxl.dts"
 # PTXCONF_KERNEL_DTBO is not set
 # PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
@@ -289,6 +289,7 @@ PTXCONF_IMAGE_ROOT_TGZ=y
 PTXCONF_IMAGE_ROOT_TGZ_LABEL=""
 # PTXCONF_IMAGE_ROOT_UBI is not set
 # PTXCONF_IMAGE_ROOT_UBIFS is not set
+PTXCONF_IMAGE_TQ_MBA8MPXL=y
 
 #
 # ipkg options                  
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [DistroKit] [PATCH v2 7/7] v8a: imx8m: enable barebox state for TQ MBa8MPxL
  2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
                   ` (5 preceding siblings ...)
  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 ` Leonard Göhrs
  2024-01-26 16:43 ` [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Robert Schwebel
  7 siblings, 0 replies; 9+ messages in thread
From: Leonard Göhrs @ 2024-01-17 13:34 UTC (permalink / raw)
  To: distrokit; +Cc: Leonard Göhrs

This allows updating the root filesystem via RAUC.

The magic value was selected by fair dice roll.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 .../barebox-common-defaultenv/init/bootsource |  2 +-
 configs/platform-v8a/dts/bootstate.dtsi       | 21 +++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/configs/platform-v8a/barebox-common-defaultenv/init/bootsource b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource
index af47c82..aa1d06d 100644
--- a/configs/platform-v8a/barebox-common-defaultenv/init/bootsource
+++ b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource
@@ -10,7 +10,7 @@ if [ "$bootsource" = mmc ]; then
 	global.boot.default="mmc$bootsource_instance net"
 fi
 
-if of_compatible -k radxa,rock3a; then
+if of_compatible -k radxa,rock3a tq,imx8mp-tqma8mpql-mba8mpxl; then
 	global.boot.default="bootchooser net"
 	global bootchooser.state_prefix="state.bootstate"
 	global bootchooser.targets="system0 system1"
diff --git a/configs/platform-v8a/dts/bootstate.dtsi b/configs/platform-v8a/dts/bootstate.dtsi
index d5dee2c..1a8fe3f 100644
--- a/configs/platform-v8a/dts/bootstate.dtsi
+++ b/configs/platform-v8a/dts/bootstate.dtsi
@@ -19,6 +19,27 @@
 
 #endif
 
+/** TQ-Systems i.MX8MPlus TQMa8MPxL on MBa8MPxL *******************************/
+#ifdef imx8mp_tqma8mpql_mba8mpxl_dts
+/ {
+	aliases {
+		state = &state_sd;
+	};
+
+	state_sd: state {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "barebox,state";
+		magic = <0x5e4d20bf>;
+		backend = <&usdhc2>;   // via GPT Type UUID
+		backend-type = "raw";
+		backend-storage-type = "direct";
+		backend-stridesize = <0x40>;
+	};
+};
+
+#endif
+
 /** Generic bootstate node for all platforms **********************************/
 / {
 	state: state {
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board
  2024-01-17 13:34 [DistroKit] [PATCH v2 0/7] v8a: imx8m: add i.MX8MP based TQ MBa8MPxL board Leonard Göhrs
                   ` (6 preceding siblings ...)
  2024-01-17 13:34 ` [DistroKit] [PATCH v2 7/7] v8a: imx8m: enable barebox state " Leonard Göhrs
@ 2024-01-26 16:43 ` Robert Schwebel
  7 siblings, 0 replies; 9+ messages in thread
From: Robert Schwebel @ 2024-01-26 16:43 UTC (permalink / raw)
  To: Leonard Göhrs; +Cc: distrokit

Applied series to next.

On Wed, Jan 17, 2024 at 02:34:33PM +0100, Leonard Göhrs wrote:
> This adds support for the i.MX8MP based MBa8MPxL[1] by TQ.
> 
> This board uses another UART than e.g. the NXP EVK boards
> for debug output. This is why we need a tf-a patch that
> automatically selects the UART at runtime based on which one
> is already enabled. 
> 
> While at it I've also added a barebox state partition for all
> other i.MX8M images, to prepare them for RAUC support
> and added RAUC support for the MBa8MPxL.
> 
> This patch series is built upon Ahmads series[2] that
> updates barebox and cleans up its configuration,
> so that should be merged first to prevent conflicts.
> 
> Changes from v1 to v2:
> 
>   - Add an (admittedly untested) i.MX8MQ version of the tf-a
>     UART auto detection patch and use "IMX_BOOT_UART_BASE=auto"
>     instead of "IMX_BOOT_UART_BASE=0".
>     The variant in v1 with "IMX_BOOT_UART_BASE=0" would previously
>     have silently broken support on i.MX8MQ.
>   - More changes to the partition layout based on the given feedback.
>   - Simplified "barebox-common-defaultenv/init/bootsource".
> 
> [1]: https://www.tq-group.com/en/products/tq-embedded/arm-architecture/mba8mpxl/
> [2]: https://lore.distrokit.org/distrokit/20240102154603.3678357-1-a.fatoum@pengutronix.de/T/#t
> 
> 
> 
> 

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-26 16:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [DistroKit] [PATCH v2 1/7] tf-a: add patch to auto-detect the correct UART on i.MX8M Leonard Göhrs
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox