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 <hector.palacios@digi.com>

https://jira.digi.com/browse/DEL-6598
This commit is contained in:
Hector Palacios 2019-05-20 15:46:22 +02:00
parent 702bc57cae
commit 4351db1677
2 changed files with 30 additions and 12 deletions

View File

@ -19,14 +19,23 @@ if test $? -eq 1; then
exit; exit;
fi fi
# Determine U-Boot file to program basing on module variant # Determine U-Boot file to program basing on SOM's RAM size
if test -n "${module_variant}"; then if test -n "${module_ram}"; then
if test "${module_variant}" = "0x01" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05"; then setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express${module_ram}.bin;
setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express1GB.bin; else
elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03"; then # Determine U-Boot file to program basing on SOM's variant
setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_express2GB.bin; 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
fi fi
# Use 'test -n ...' because 'test -z ...' does not work well on old versions of # Use 'test -n ...' because 'test -z ...' does not work well on old versions of
# u-boot when the checked value is empty. # u-boot when the checked value is empty.
if test -n "${INSTALL_UBOOT_FILENAME}"; then if test -n "${INSTALL_UBOOT_FILENAME}"; then

View File

@ -19,14 +19,23 @@ if test $? -eq 1; then
exit; exit;
fi fi
# Determine U-Boot file to program basing on module variant # Determine U-Boot file to program basing on SOM's RAM size
if test -n "${module_variant}"; then if test -n "${module_ram}"; then
if test "${module_variant}" = "0x01" || test "${module_variant}" = "0x04" || test "${module_variant}" = "0x05"; then setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro${module_ram}.bin;
setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro1GB.bin; else
elif test "${module_variant}" = "0x02" || test "${module_variant}" = "0x03"; then # Determine U-Boot file to program basing on SOM's variant
setenv INSTALL_UBOOT_FILENAME imx-boot-ccimx8x_sbc_pro2GB.bin; 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
fi fi
# Use 'test -n ...' because 'test -z ...' does not work well on old versions of # Use 'test -n ...' because 'test -z ...' does not work well on old versions of
# u-boot when the checked value is empty. # u-boot when the checked value is empty.
if test -n "${INSTALL_UBOOT_FILENAME}"; then if test -n "${INSTALL_UBOOT_FILENAME}"; then