From 453def7956c864818b6d6a1a44b2b267df3a44fc Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 13:52:57 -0300 Subject: imx-atf: allow setting the UART used during boot A new `ATF_BOOT_UART_BASE` variable can be used in machine to set the UART aimed for use during the boot, without the need of changing the source code. Signed-off-by: Otavio Salvador --- conf/machine/include/imx-base.inc | 9 +++++++++ recipes-bsp/imx-atf/imx-atf_2.6.bb | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 297637af..2962c9e9 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -113,6 +113,15 @@ UBOOT_PROVIDES_BOOT_CONTAINER:imx-boot-container = "1" # Default TF-A provider to NXP downstream fork IMX_DEFAULT_ATF_PROVIDER ??= "imx-atf" +# Allow setting the UART used during the boot by ATF. + +# FIXME: We should return INVALID here but currently only i.MX8M has support to override the UART +# base address in source code. +SOC_ATF_BOOT_UART_BASE = "" + +SOC_ATF_BOOT_UART_BASE:mx8m-generic-bsp = "0x30890000" +ATF_BOOT_UART_BASE ?= "${SOC_ATF_BOOT_UART_BASE}" + PREFERRED_PROVIDER_virtual/xserver = "xserver-xorg" XSERVER_DRIVER = "xf86-video-fbdev" XSERVER_DRIVER:vf-generic-bsp = "xf86-video-modesetting" diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index 95258247..194ef935 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -18,7 +18,11 @@ S = "${WORKDIR}/git" inherit deploy -ATF_PLATFORM ??= "INVALID" +ATF_PLATFORM ??= "INVALID" + +# FIXME: We should return INVALID here but currently only i.MX8M has support to override the UART +# base address in source code. +ATF_BOOT_UART_BASE ?= "" EXTRA_OEMAKE += " \ CROSS_COMPILE="${TARGET_PREFIX}" \ @@ -48,6 +52,9 @@ EXTRA_OEMAKE += 'LD="${@remove_options_tail(d.getVar('LD'))}"' EXTRA_OEMAKE += 'CC="${@remove_options_tail(d.getVar('CC'))}"' +# Set the UART to use during the boot. +EXTRA_OEMAKE += 'IMX_BOOT_UART_BASE=${ATF_BOOT_UART_BASE}' + do_configure[noexec] = "1" do_compile() { -- cgit v1.2.3-54-g00ecf