From 2ede256f549af5f9e173b4a9139fd4af2524bea3 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 11:39:47 -0300 Subject: imx-base.inc: avoid explicit imx-boot dependency We shouldn't force `imx-boot` dependency for i.MX8 SoCs as many can use U-Boot mainline and those use `imx-boot-container` to generate the binary blob. We moved the backward-compatibility note, about 'imx-boot' to the 'imx-boot-container' class. Signed-off-by: Otavio Salvador (cherry picked from commit bed09c8daec54c73766b563feb9ff7b4168c3e44) --- classes/imx-boot-container.bbclass | 3 +++ conf/machine/include/imx-base.inc | 16 ++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/classes/imx-boot-container.bbclass b/classes/imx-boot-container.bbclass index 711bbd9e..a420b4c4 100644 --- a/classes/imx-boot-container.bbclass +++ b/classes/imx-boot-container.bbclass @@ -20,6 +20,9 @@ # by variable UBOOT_PROVIDES_BOOT_CONTAINER, which is defined in the # base machine include file (imx-base.inc), and is set to "1" when the # 'imx-boot-container' is present in MACHINEOVERRIDES. +# +# NOTE: A backwards-compatible symlink is added for 'flash.bin', named +# 'imx-boot', during the deployment task. # Define ATF binary file to be deployed to the U-Boot build folder ATF_MACHINE_NAME = "bl31-${ATF_PLATFORM}.bin" diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index e24e14e1..43e78282 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -503,22 +503,18 @@ WKS_FILE_DEPENDS ?= " \ ${@bb.utils.contains('MACHINE_FEATURES', 'optee', '${OPTEE_WKS_FILE_DEPENDS}', '', d)} \ " -WKS_FILE_DEPENDS:append:mx8-nxp-bsp = " imx-boot" -WKS_FILE_DEPENDS:append:mx8m-nxp-bsp = " imx-boot" - # We need to restrict the append so we don't add this for other i.MX SoC's. # Derivatives that are not yet adopted the usage of boot container provided # by U-Boot build are still targeted to use 'imx-boot' package provided by -# NXP. Moving those derivatives to mainline BSP would require to define an +# NXP. +# +# Moving those derivatives to mainline BSP would require to define an # 'imx-boot-container' override, and test if the U-Boot built 'flash.bin' # binary is used a replacement. -# Note, that the results binary name of the boot container is set to 'imx-boot' +# +# NOTE: the results binary name of the boot container is set to 'imx-boot' # for both NXP and Mainline BSP. -# For Mainline BSP: the 'flash.bin' boot container is renamed during the -# deployment task extesion execution defined in imx-boot-container class. -# For NXP BSP: rename is done in 'imx-boot' recipe at the execution of compile -# task. -WKS_FILE_DEPENDS:append:imx-mainline-bsp:aarch64 = " \ +WKS_FILE_DEPENDS:append:imx-generic-bsp:aarch64 = " \ ${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0', 'imx-boot', '')} \ " -- cgit v1.2.3-54-g00ecf From 7b8a74393ab6cfe69d3da065fee60697b0daebad Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 11:43:44 -0300 Subject: Remove unuse `BOOT_TOOLS` variable The `BOOT_TOOLS` variable isn't used, but defined, inside few recipes. We are removing it from: - u-boot-fslc - imx-atf Signed-off-by: Otavio Salvador (cherry picked from commit 0d87d90f79c381dfc1a92548bd19600a23376a98) --- recipes-bsp/imx-atf/imx-atf_2.6.bb | 2 -- recipes-bsp/u-boot/u-boot-fslc_2022.07.bb | 6 ------ 2 files changed, 8 deletions(-) diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index b0cd4d3d..d491361b 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -18,8 +18,6 @@ S = "${WORKDIR}/git" inherit deploy -BOOT_TOOLS = "imx-boot-tools" - ATF_PLATFORM ??= "INVALID" EXTRA_OEMAKE += " \ diff --git a/recipes-bsp/u-boot/u-boot-fslc_2022.07.bb b/recipes-bsp/u-boot/u-boot-fslc_2022.07.bb index de6d22d0..1953d788 100644 --- a/recipes-bsp/u-boot/u-boot-fslc_2022.07.bb +++ b/recipes-bsp/u-boot/u-boot-fslc_2022.07.bb @@ -10,12 +10,6 @@ inherit ${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '1', 'im DEPENDS += "bc-native dtc-native python3-setuptools-native" -# Location known to imx-boot component, where U-Boot artifacts -# should be additionally deployed. -# See below note above do_deploy:append:mx8m-nxp-bsp for the purpose of -# this delopyment location -BOOT_TOOLS = "imx-boot-tools" - PROVIDES += "u-boot" B = "${WORKDIR}/build" -- cgit v1.2.3-54-g00ecf From 59324fb456d71f03f8071117504d7402276c4733 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 26 Jul 2022 15:59:38 -0300 Subject: imx-base.inc: consolidate `IMX_EXTRA_FIRMWARE` definition We should have a single definition for `IMX_EXTRA_FIRMWARE` variable as this is SoC specific and not machine, or recipe, dependent. This removes multiple assignments from: - conf/machine/imx8mq-evk.conf - conf/machine/include/imx8mm-evk.inc - conf/machine/include/imx8mn-evk.inc - conf/machine/include/imx8mp-evk.inc - recipes-bsp/imx-mkimage/imx-boot_1.0.bb Signed-off-by: Otavio Salvador (cherry picked from commit 63d73925950aa35ec1378696c0f5dcfd2fef9e83) --- conf/machine/imx8mq-evk.conf | 3 --- conf/machine/include/imx-base.inc | 6 ++++++ conf/machine/include/imx8mm-evk.inc | 3 --- conf/machine/include/imx8mn-evk.inc | 3 --- conf/machine/include/imx8mp-evk.inc | 3 --- recipes-bsp/imx-mkimage/imx-boot_1.0.bb | 3 --- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/conf/machine/imx8mq-evk.conf b/conf/machine/imx8mq-evk.conf index 1e8146a8..a2a81f4c 100644 --- a/conf/machine/imx8mq-evk.conf +++ b/conf/machine/imx8mq-evk.conf @@ -68,9 +68,6 @@ UBOOT_DTB_NAME = "imx8mq-evk.dtb" # Set ATF platform name ATF_PLATFORM = "imx8mq" -# Extra firmware package name, that is required to build boot container for fslc bsp -IMX_EXTRA_FIRMWARE = "firmware-imx-8m" - # Set imx-mkimage boot target IMXBOOT_TARGETS = "flash_evk flash_evk_no_hdmi flash_dp_evk" IMX_BOOT_SOC_TARGET = "iMX8M" diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 43e78282..297637af 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -343,6 +343,12 @@ SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS:append = " \ imx-test->virtual/imxvpu \ " +# Firmware used for boot. +IMX_EXTRA_FIRMWARE ?= "" +IMX_EXTRA_FIRMWARE:mx8-generic-bsp = "firmware-imx-8 imx-sc-firmware imx-seco" +IMX_EXTRA_FIRMWARE:mx8m-generic-bsp = "firmware-imx-8m" +IMX_EXTRA_FIRMWARE:mx8x-generic-bsp = "imx-sc-firmware imx-seco" + # Firmware MACHINE_FIRMWARE ?= "" MACHINE_FIRMWARE:append:mx27-generic-bsp = " firmware-imx-vpu-imx27" diff --git a/conf/machine/include/imx8mm-evk.inc b/conf/machine/include/imx8mm-evk.inc index 41f7bad4..6d317f11 100644 --- a/conf/machine/include/imx8mm-evk.inc +++ b/conf/machine/include/imx8mm-evk.inc @@ -37,9 +37,6 @@ SPL_BINARY = "spl/u-boot-spl.bin" ATF_PLATFORM = "imx8mm" -# Extra firmware package name, that is required to build boot container for fslc bsp -IMX_EXTRA_FIRMWARE = "firmware-imx-8m" - IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', '${IMXBOOT_TARGETS_BASENAME}_flexspi', '${IMXBOOT_TARGETS_BASENAME}', d)}" IMX_BOOT_SOC_TARGET = "iMX8MM" diff --git a/conf/machine/include/imx8mn-evk.inc b/conf/machine/include/imx8mn-evk.inc index 5a5b447f..2f2c02f9 100644 --- a/conf/machine/include/imx8mn-evk.inc +++ b/conf/machine/include/imx8mn-evk.inc @@ -42,9 +42,6 @@ SPL_BINARY = "spl/u-boot-spl.bin" ATF_PLATFORM = "imx8mn" -# Extra firmware package name, that is required to build boot container for fslc bsp -IMX_EXTRA_FIRMWARE = "firmware-imx-8m" - IMXBOOT_TARGETS = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', '${IMXBOOT_TARGETS_BASENAME}_flexspi', '${IMXBOOT_TARGETS_BASENAME}', d)}" IMX_BOOT_SOC_TARGET = "iMX8MN" diff --git a/conf/machine/include/imx8mp-evk.inc b/conf/machine/include/imx8mp-evk.inc index 3e98d3c1..d93557d2 100644 --- a/conf/machine/include/imx8mp-evk.inc +++ b/conf/machine/include/imx8mp-evk.inc @@ -37,9 +37,6 @@ SPL_BINARY = "spl/u-boot-spl.bin" ATF_PLATFORM = "imx8mp" -# Extra firmware package name, that is required to build boot container for fslc bsp -IMX_EXTRA_FIRMWARE = "firmware-imx-8m" - IMXBOOT_TARGETS = \ "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', '${IMXBOOT_TARGETS_BASENAME}_flexspi', \ '${IMXBOOT_TARGETS_BASENAME}', d)}" diff --git a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb index f35561de..ae7e2638 100644 --- a/recipes-bsp/imx-mkimage/imx-boot_1.0.bb +++ b/recipes-bsp/imx-mkimage/imx-boot_1.0.bb @@ -9,9 +9,6 @@ SECTION = "BSP" inherit use-imx-security-controller-firmware uboot-sign -IMX_EXTRA_FIRMWARE = "firmware-imx-8 imx-sc-firmware imx-seco" -IMX_EXTRA_FIRMWARE:mx8m-generic-bsp = "firmware-imx-8m" -IMX_EXTRA_FIRMWARE:mx8x-generic-bsp = "imx-sc-firmware imx-seco" DEPENDS += " \ u-boot \ ${IMX_EXTRA_FIRMWARE} \ -- cgit v1.2.3-54-g00ecf From 017b7c7767258615db3855d0756e51be787c3b45 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 13:27:52 -0300 Subject: imx-atf: avoid default dependencies addition We can use `INHIBIT_DEFAULT_DEPS` to avoid extra dependencies declaration and instead we can explicitly add the `virtual/${HOST_PREFIX}gcc` requirement. This is equivalent to previous code but in a easier to undertand implementation. Signed-off-by: Otavio Salvador (cherry picked from commit 896b5adc3fb85bd2817174d7aa2a07b64409f422) --- recipes-bsp/imx-atf/imx-atf_2.6.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index d491361b..9047fd09 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -32,7 +32,8 @@ AS[unexport] = "1" LD[unexport] = "1" # Baremetal, just need a compiler -DEPENDS:remove = "virtual/${TARGET_PREFIX}compilerlibs virtual/libc" +INHIBIT_DEFAULT_DEPS = "1" +DEPENDS = "virtual/${HOST_PREFIX}gcc" BUILD_OPTEE = "${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'true', 'false', d)}" -- cgit v1.2.3-54-g00ecf From a74f445b81fcc8eba14898460eeb27a4b7d5a059 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 13:34:02 -0300 Subject: imx-atf: use `MACHINE_ARCH` as `PACKAGE_ARCH` The recipe build changes depending on the `MACHINE_FEATURES` value (`optee` presence) so we need to set this as machine-specific. Signed-off-by: Otavio Salvador (cherry picked from commit 09ed3f6ad94544bdeb74439470cf510e786c8d5e) --- recipes-bsp/imx-atf/imx-atf_2.6.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index 9047fd09..5007ee75 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -67,5 +67,5 @@ do_deploy() { } addtask deploy after do_compile -PACKAGE_ARCH = "${MACHINE_SOCARCH}" +PACKAGE_ARCH = "${MACHINE_ARCH}" COMPATIBLE_MACHINE = "(mx8-generic-bsp)" -- cgit v1.2.3-54-g00ecf From e5d2cb13e1d1669c983eb71b9f92f8f92cd45c7d Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sat, 23 Jul 2022 14:24:36 -0300 Subject: imx-atf: mark `do_configure` as `noexec` There is no configure step or script so avoid running the task. Signed-off-by: Otavio Salvador (cherry picked from commit 205b34dce629f7345a29b659e3d6bbb7fae8ffb3) --- recipes-bsp/imx-atf/imx-atf_2.6.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-bsp/imx-atf/imx-atf_2.6.bb b/recipes-bsp/imx-atf/imx-atf_2.6.bb index 5007ee75..95258247 100644 --- a/recipes-bsp/imx-atf/imx-atf_2.6.bb +++ b/recipes-bsp/imx-atf/imx-atf_2.6.bb @@ -48,6 +48,8 @@ EXTRA_OEMAKE += 'LD="${@remove_options_tail(d.getVar('LD'))}"' EXTRA_OEMAKE += 'CC="${@remove_options_tail(d.getVar('CC'))}"' +do_configure[noexec] = "1" + do_compile() { # Clear LDFLAGS to avoid the option -Wl recognize issue oe_runmake bl31 -- cgit v1.2.3-54-g00ecf From b511d2ad3ba4b8175b68eca8410ff8cb1c7d2792 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 (cherry picked from commit 453def7956c864818b6d6a1a44b2b267df3a44fc) --- 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