From 776932e187f38ca53ed57fc662461ba0da005520 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Fri, 19 Mar 2021 18:51:30 -0300 Subject: Rework the u-boot-fslc and u-boot-imx settings logic We need to make it more obvious what is in use, when we support both bootloaders and for it we are now using the _pn suffix for both. This also fixes the WIC_FILE depending on the choice otherwise image build fails. Signed-off-by: Otavio Salvador --- conf/machine/include/imx-base.inc | 53 ++++++++++++++++++++++++++++++------- conf/machine/include/imx8mm-evk.inc | 5 ++++ conf/machine/include/imx8mn-evk.inc | 5 ++++ conf/machine/include/imx8x-mek.inc | 5 ++++ 4 files changed, 58 insertions(+), 10 deletions(-) (limited to 'conf/machine/include') diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 4790005b2..d52123e27 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -18,7 +18,50 @@ IMX_DEFAULT_BSP_mx5 ?= "mainline" MACHINEOVERRIDES =. "use-${IMX_DEFAULT_BSP}-bsp:" +# UBOOT_BINARY is used inside the wks files to dynamically find the required +# U-Boot file. +UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" + +# Using the 'IMX_DEFAULT_BOOTLOADER' the machine can support multiple bootloader +# versions. This is done for NXP reference board where we support 'u-boot-fslc' +# and 'u-boot-imx'. +# +# So, for example in imx6qdlsabresd, we support both flavor and for this we +# define: +# +# ,----[ imx6qdlsabresd.conf ] +# | ### u-boot-fslc settings ### +# | +# | SPL_BINARY_pn-u-boot-fslc = "SPL" +# | UBOOT_MACHINE_pn-u-boot-fslc ?= "mx6sabresd_defconfig" +# | UBOOT_SUFFIX_pn-u-boot-fslc = "img" +# | +# | ### u-boot-imx settings ### +# | +# | # The u-boot-imx does not provide unified functionality for DL/Q/QP SoC +# | # variants. Change the defconfig to the targeted SoC variant. +# | UBOOT_MACHINE_pn-u-boot-imx ?= "mx6qsabresd_defconfig" +# | UBOOT_SUFFIX_pn-u-boot-imx = "imx" +# `---- +# +# As result, the 'UBOOT_SUFFIX' is dynamically set based on the preferred U-Boot +# flavor to use. +# +# For machines where one of the flavors is required, we can force it. An example +# is the imx53qsb, which we define: +# +# ,----[ imx53qsb.conf ] +# | # This machine is not supported by u-boot-imx as it is not tested by NXP on this +# | # board. So we force it to use u-boot-fslc which is based on mainline here. +# | IMX_DEFAULT_BOOTLOADER = "u-boot-fslc" +# | +# | UBOOT_MAKE_TARGET = "u-boot.imx" +# | UBOOT_SUFFIX = "imx" +# | +# | UBOOT_MACHINE = "mx53loco_config" +# `---- IMX_DEFAULT_BOOTLOADER ??= "u-boot-fslc" +UBOOT_SUFFIX ?= "${UBOOT_SUFFIX_pn-${IMX_DEFAULT_BOOTLOADER}}" IMX_DEFAULT_UBOOTTOOLS = "${@bb.utils.contains('IMX_DEFAULT_BOOTLOADER', 'u-boot-imx','u-boot-imx-tools', 'u-boot-tools', d)}" @@ -32,16 +75,6 @@ PREFERRED_PROVIDER_virtual/bootloader ??= "${IMX_DEFAULT_BOOTLOADER}" PREFERRED_PROVIDER_u-boot-mxsboot-native ??= "u-boot-fslc-mxsboot-native" -# Set specific make target and binary suffix -UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}" -UBOOT_MAKE_TARGET ?= "u-boot.${UBOOT_SUFFIX}" -UBOOT_MAKE_TARGET_mxs ?= "u-boot.sb" -UBOOT_MAKE_TARGET_mx8 ?= "" - -UBOOT_SUFFIX ?= "imx" -UBOOT_SUFFIX_mxs ?= "sb" -UBOOT_SUFFIX_mx8 ?= "bin" - UBOOT_ENTRYPOINT_mxs = "0x40008000" UBOOT_ENTRYPOINT_mx51 = "0x90008000" UBOOT_ENTRYPOINT_mx53 = "0x70008000" diff --git a/conf/machine/include/imx8mm-evk.inc b/conf/machine/include/imx8mm-evk.inc index 619ad6632..9b590fe01 100644 --- a/conf/machine/include/imx8mm-evk.inc +++ b/conf/machine/include/imx8mm-evk.inc @@ -22,6 +22,11 @@ KERNEL_DEVICETREE_append_use-nxp-bsp = " \ " UBOOT_DTB_NAME = "${KERNEL_DEVICETREE_BASENAME}.dtb" +IMX_DEFAULT_BOOTLOADER_use-nxp-bsp = "u-boot-imx" +IMX_DEFAULT_BOOTLOADER_use-mainline-bsp = "u-boot-fslc" + +UBOOT_SUFFIX = "bin" + UBOOT_CONFIG ??= "sd" UBOOT_CONFIG[sd] = "${UBOOT_CONFIG_BASENAME}_defconfig,sdcard" UBOOT_CONFIG[mfgtool] = "${UBOOT_CONFIG_BASENAME}_defconfig" diff --git a/conf/machine/include/imx8mn-evk.inc b/conf/machine/include/imx8mn-evk.inc index ad4f5dea8..6a5b31f7e 100644 --- a/conf/machine/include/imx8mn-evk.inc +++ b/conf/machine/include/imx8mn-evk.inc @@ -22,6 +22,11 @@ KERNEL_DEVICETREE_append_use-nxp-bsp = " \ " UBOOT_DTB_NAME = "${KERNEL_DEVICETREE_BASENAME}.dtb" +IMX_DEFAULT_BOOTLOADER_use-nxp-bsp = "u-boot-imx" +IMX_DEFAULT_BOOTLOADER_use-mainline-bsp = "u-boot-fslc" + +UBOOT_SUFFIX = "bin" + UBOOT_CONFIG ??= "sd" UBOOT_CONFIG[sd] = "${UBOOT_CONFIG_BASENAME}_defconfig,sdcard" UBOOT_CONFIG[fspi] = "${UBOOT_CONFIG_BASENAME}_defconfig" diff --git a/conf/machine/include/imx8x-mek.inc b/conf/machine/include/imx8x-mek.inc index 490e00dbf..814a34c1a 100644 --- a/conf/machine/include/imx8x-mek.inc +++ b/conf/machine/include/imx8x-mek.inc @@ -54,6 +54,11 @@ UBOOT_CONFIG[fspi] = "${UBOOT_CONFIG_BASENAME}_fspi_defconfig" IMX_BOOT_SEEK = "32" +# This machine is not supported by u-boot-fslc, so we force it to use +# u-boot-imx here. +IMX_DEFAULT_BOOTLOADER = "u-boot-imx" +UBOOT_SUFFIX = "bin" + # Set ATF platform name ATF_PLATFORM = "imx8qx" -- cgit v1.2.3-54-g00ecf