From 4351db16773294595ed99d51bb1b5e86c2cc9a0a Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Mon, 20 May 2019 15:46:22 +0200 Subject: [PATCH] uboot: add support for new HWID fields to install fw scripts The new HWID fields make U-Boot create new variable 'module_ram'. If it exists use it to select the U-Boot file to use during firmware update. If not, fall back to old method of using the variant code and the hard-coded table of variants. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-6598 --- .../install_linux_fw_sd.txt | 21 +++++++++++++------ .../ccimx8x-sbc-pro/install_linux_fw_sd.txt | 21 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt index f47c90b5f..ad5ecc8d5 100644 --- a/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt +++ b/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccimx8x-sbc-express/install_linux_fw_sd.txt @@ -19,14 +19,23 @@ if test $? -eq 1; then exit; fi -# Determine U-Boot file to program basing on module variant -if test -n "${module_variant}"; then - if test "${module_variant}" = "0x01" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express1GB.bin; - elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express2GB.bin; +# Determine U-Boot file to program basing on SOM's RAM size +if test -n "${module_ram}"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express${module_ram}.bin; +else + # Determine U-Boot file to program basing on SOM's variant + if test -n "${module_variant}"; then + if test "${module_variant}" = "0x01" || + test "${module_variant}" = "0x04" || + test "${module_variant}" = "0x05"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express1GB.bin; + elif test "${module_variant}" = "0x02" || + test "${module_variant}" = "0x03"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express2GB.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 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 1bf32a2ae..9f9fa5ddd 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,14 +19,23 @@ if test $? -eq 1; then exit; fi -# Determine U-Boot file to program basing on module variant -if test -n "${module_variant}"; then - if test "${module_variant}" = "0x01" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro1GB.bin; - elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03"; then - setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro2GB.bin; +# Determine U-Boot file to program basing on SOM's RAM size +if test -n "${module_ram}"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro${module_ram}.bin; +else + # Determine U-Boot file to program basing on SOM's variant + if test -n "${module_variant}"; then + if test "${module_variant}" = "0x01" || + test "${module_variant}" = "0x04" || + test "${module_variant}" = "0x05"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro1GB.bin; + elif test "${module_variant}" = "0x02" || + test "${module_variant}" = "0x03"; then + setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro2GB.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