diff --git a/meta-digi-arm/classes/boot-artifacts.bbclass b/meta-digi-arm/classes/boot-artifacts.bbclass index 34ff5a307..c625f222d 100644 --- a/meta-digi-arm/classes/boot-artifacts.bbclass +++ b/meta-digi-arm/classes/boot-artifacts.bbclass @@ -31,6 +31,7 @@ def get_bootable_artifacts(d): types = d.getVar('UBOOT_CONFIG', True) or "" ram_configs = d.getVar('RAM_CONFIGS', True) or "" + soc_revisions = d.getVar('SOC_REVISIONS', True) or "" uboot_prefix = d.getVar('UBOOT_PREFIX', True) or "" uboot_suffix = d.getVar('UBOOT_SUFFIX', True) or "" artifacts = [] @@ -43,8 +44,14 @@ def get_bootable_artifacts(d): else: machine = d.getVar('MACHINE', True) or "" ram_combinations = get_uboot_ram_combinations(d) - for ramc in ram_combinations.split(" "): - artifacts.append("%s-%s-%s.%s" % (uboot_prefix, machine, ramc, uboot_suffix)) + if soc_revisions == "": + for ramc in ram_combinations.split(" "): + artifacts.append("%s-%s-%s.%s" % (uboot_prefix, machine, ramc, uboot_suffix)) + else: + for soc_rev in soc_revisions.split(" "): + for ramc in ram_combinations.split(" "): + artifacts.append("%s-%s-%s-%s.%s" % (uboot_prefix, machine, soc_rev, ramc, uboot_suffix)) + return " ".join(artifacts) BOOTABLE_ARTIFACTS = "${@get_bootable_artifacts(d)}" diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt index 76ed5aa6a..7de0eb26e 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_sd.txt @@ -19,6 +19,17 @@ if test $? -eq 1; then exit; fi +# Since SOMs with the B0 SOC might have an older U-Boot that doesn't export the +# SOC revision to the environment, use B0 by default +if test -z "${soc_rev}"; then + setenv soc_rev B0 +fi + +# In case this script is used to update to a newer release whose imx-boot file +# is not recognized by the SECO fw check, bypass it by default. The script has +# the necessary logic to choose the correct imx-boot file for the target's SOC. +setenv skip-uboot-check "yes" + # Determine U-Boot file to program basing on SOM's RAM size and SOC type (linked to bus width) ram_freq="1.2GHz" bus_width="32bit" @@ -26,20 +37,20 @@ if test -n "${module_ram}" && test -n "${soc_type}"; then if test "${soc_type}" = "imx8dx"; then bus_width="16bit" fi - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${ram_freq}_${module_ram}_${bus_width}.bin; + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-${ram_freq}_${module_ram}_${bus_width}.bin; else # Determine U-Boot file to program basing on SOM's variant if test -n "${module_variant}"; then if test "${module_variant}" = "0x01"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_32bit.bin; + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_32bit.bin; elif test "${module_variant}" = "0x02" || \ test "${module_variant}" = "0x03"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_2GB_32bit.bin; + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_2GB_32bit.bin; elif test "${module_variant}" = "0x04" || \ test "${module_variant}" = "0x05"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_16bit.bin; + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_16bit.bin; elif test "${module_variant}" = "0x06"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_512GB_16bit.bin; + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_512GB_16bit.bin; fi fi fi @@ -54,13 +65,13 @@ else echo ""; echo "1. Set variable 'INSTALL_UBOOT_FILENAME' depending on your ConnectCore 8X variant:"; echo " - For a QuadXPlus CPU with 1GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_32bit.bin"; + echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_32bit.bin"; echo " - For a QuadXPlus CPU with 2GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_2GB_32bit.bin"; + echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_2GB_32bit.bin"; echo " - For a DualX CPU with 1GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_16bit.bin"; + echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_16bit.bin"; echo " - For a DualX CPU with 512MB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-1.2GHz_512MB_16bit.bin"; + echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_512MB_16bit.bin"; echo ""; echo "2. Run the install script again."; echo ""; diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh index eb2320674..5979f30c6 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-pro/install_linux_fw_uuu.sh @@ -46,6 +46,13 @@ sleep 10 # Enable the redirect support to get u-boot variables values uuu fb: ucmd setenv stdout serial,fastboot +# Since SOMs with the B0 SOC might have an older U-Boot that doesn't export the +# SOC revision to the environment, use B0 by default +soc_rev=$(getenv "soc_rev") +if [ -z "${soc_rev}" ]; then + soc_rev="B0" +fi + # Determine U-Boot file to program basing on SOM's SOC type (linked to bus width) bus_width="32bit" @@ -69,10 +76,10 @@ if [ -z "${module_ram}" ]; then else module_ram="512MB" fi - INSTALL_UBOOT_FILENAME="imx-boot-ccimx8x-sbc-pro-1.2GHz_${module_ram}_${bus_width}.bin" + INSTALL_UBOOT_FILENAME="imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_${module_ram}_${bus_width}.bin" fi else - INSTALL_UBOOT_FILENAME="imx-boot-ccimx8x-sbc-pro-1.2GHz_${module_ram}_${bus_width}.bin" + INSTALL_UBOOT_FILENAME="imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_${module_ram}_${bus_width}.bin" fi # remove redirect @@ -87,13 +94,13 @@ else echo "" echo "1. Add U-boot file name, depending on your ConnectCore 8X variant, to script command line:" echo " - For a QuadXPlus CPU with 1GB LPDDR4, run:" - echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_32bit.bin" + echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_32bit.bin" echo " - For a QuadXPlus CPU with 2GB LPDDR4, run:" - echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-1.2GHz_2GB_32bit.bin" + echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_2GB_32bit.bin" echo " - For a DualX CPU with 1GB LPDDR4, run:" - echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-1.2GHz_1GB_16bit.bin" + echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_1GB_16bit.bin" echo " - For a DualX CPU with 512MB LPDDR4, run:" - echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-1.2GHz_512MB_16bit.bin" + echo " => ./install_linux_fs_uuu.sh imx-boot-ccimx8x-sbc-pro-${soc_rev}-1.2GHz_512MB_16bit.bin" echo "" echo "2. Run the install script again." echo ""