From 2687207948b2c9a7c1b707df4cfa26e23452c694 Mon Sep 17 00:00:00 2001 From: Gabriel Valcazar Date: Wed, 28 Jun 2023 15:23:27 +0200 Subject: [PATCH] ccimx8x: reflect imx-boot simplification in installer scripts We no longer need logic to determine the SOM's RAM size and bus width, we only need to know the SOC revision, which is info that is always available. Signed-off-by: Gabriel Valcazar --- .../ccimx8x/install_linux_fw_sd.txt | 61 +------------------ .../ccimx8x/install_linux_fw_usb.txt | 61 +------------------ .../ccimx8x/install_linux_fw_uuu.sh | 56 +---------------- 3 files changed, 4 insertions(+), 174 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt index d405e4ebb..4701c79eb 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_sd.txt @@ -18,66 +18,7 @@ fi # 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) -bus_width="32bit" -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-##MACHINE##-${soc_rev}-${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-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x02"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin; - elif test "${module_variant}" = "0x03"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin; - elif test "${module_variant}" = "0x04"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x05"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x06"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin; - elif test "${module_variant}" = "0x07"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x08"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x09"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin; - elif test "${module_variant}" = "0x0A"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x0B"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - fi - fi -fi - -# Use 'test -n ...' because 'test -z ...' does not work well on old versions of -# u-boot when the checked value is empty. -if test -n "${INSTALL_UBOOT_FILENAME}"; then - true; -else - echo ""; - echo "[ERROR] Cannot determine U-Boot file for this module!"; - 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-##MACHINE##-${soc_rev}-1GB_32bit.bin"; - echo " - For a QuadXPlus CPU with 2GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin"; - echo " - For a DualX CPU with 1GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin"; - echo " - For a DualX CPU with 512MB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin"; - echo ""; - echo "2. Run the install script again."; - echo ""; - echo "Aborted"; - echo ""; - exit; -fi; +setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}.bin; setenv INSTALL_MMCDEV 1 diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt index f3688b958..16cc5c187 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_usb.txt @@ -18,66 +18,7 @@ fi # 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) -bus_width="32bit" -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-##MACHINE##-${soc_rev}-${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-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x02"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin; - elif test "${module_variant}" = "0x03"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin; - elif test "${module_variant}" = "0x04"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x05"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x06"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin; - elif test "${module_variant}" = "0x07"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x08"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_32bit.bin; - elif test "${module_variant}" = "0x09"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin; - elif test "${module_variant}" = "0x0A"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - elif test "${module_variant}" = "0x0B"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin; - fi - fi -fi - -# Use 'test -n ...' because 'test -z ...' does not work well on old versions of -# u-boot when the checked value is empty. -if test -n "${INSTALL_UBOOT_FILENAME}"; then - true; -else - echo ""; - echo "[ERROR] Cannot determine U-Boot file for this module!"; - 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-##MACHINE##-${soc_rev}-1GB_32bit.bin"; - echo " - For a QuadXPlus CPU with 2GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin"; - echo " - For a DualX CPU with 1GB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin"; - echo " - For a DualX CPU with 512MB LPDDR4, run:"; - echo " => setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin"; - echo ""; - echo "2. Run the install script again."; - echo ""; - echo "Aborted"; - echo ""; - exit; -fi; +setenv INSTALL_UBOOT_FILENAME imx-boot-##MACHINE##-${soc_rev}.bin; setenv INSTALL_USBDEV 0 diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh index ddfb41624..de02952cf 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x/install_linux_fw_uuu.sh @@ -93,7 +93,7 @@ fi echo "" echo "Determining image files to use..." -# Determine U-Boot file to program basing on SOM's SOC type (linked to bus width) +# Determine U-Boot file to program basing on SOM's SOC revision if [ -z ${INSTALL_UBOOT_FILENAME} ]; then # 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 @@ -102,59 +102,7 @@ if [ -z ${INSTALL_UBOOT_FILENAME} ]; then soc_rev="B0" fi - bus_width="32bit" - soc_type=$(getenv "soc_type") - if [ "$soc_type" = "imx8dx" ]; then - bus_width="16bit" - fi - - module_ram=$(getenv "module_ram") - if [ -z "${module_ram}" ]; then - module_variant=$(getenv "module_variant") - # Determine U-Boot file to program basing on SOM's variant - if [ -n "$module_variant" ] || [ "$module_variant" = "0x00" ]; then - if [ "$module_variant" = "0x01" ] || \ - [ "$module_variant" = "0x04" ] || \ - [ "$module_variant" = "0x05" ]; then - module_ram="1GB" - elif [ "$module_variant" = "0x06" ] || \ - [ "$module_variant" = "0x09" ]; then - module_ram="512MB" - else - module_ram="2GB" - fi - INSTALL_UBOOT_FILENAME="imx-boot-##MACHINE##-${soc_rev}-${module_ram}_${bus_width}.bin" - fi - else - INSTALL_UBOOT_FILENAME="imx-boot-##MACHINE##-${soc_rev}-${module_ram}_${bus_width}.bin" - fi - - # U-Boot when the checked value is empty. - if [ -n "${INSTALL_UBOOT_FILENAME}" ]; then - true - else - # remove redirect - uuu fb: ucmd setenv stdout serial - - echo "" - echo "[ERROR] Cannot determine U-Boot file for this module!" - 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_fw_uuu.sh -u imx-boot-##MACHINE##-${soc_rev}-1GB_32bit.bin" - echo " - For a QuadXPlus CPU with 2GB LPDDR4, run:" - echo " => ./install_linux_fw_uuu.sh -u imx-boot-##MACHINE##-${soc_rev}-2GB_32bit.bin" - echo " - For a DualX CPU with 1GB LPDDR4, run:" - echo " => ./install_linux_fw_uuu.sh -u imx-boot-##MACHINE##-${soc_rev}-1GB_16bit.bin" - echo " - For a DualX CPU with 512MB LPDDR4, run:" - echo " => ./install_linux_fw_uuu.sh -u imx-boot-##MACHINE##-${soc_rev}-512MB_16bit.bin" - echo "" - echo "2. Run the install script again." - echo "" - echo "Aborted" - echo "" - exit - fi + INSTALL_UBOOT_FILENAME="imx-boot-##MACHINE##-${soc_rev}.bin" fi # remove redirect