uboot: add support for new HWID fields to boot scripts

The new HWID fields make U-Boot create new variable 'module_ram'.

If it exists calculate new HWID fields to check if the SOM has
Wi-Fi, Bluetooth, etc. in order to select the device tree file.
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 12:48:30 +02:00
parent 8c0aaf79b6
commit 702bc57cae
2 changed files with 50 additions and 18 deletions

View File

@ -9,20 +9,33 @@ if test -n "${board_id}"; then
setenv fdt_file ccimx8x-sbc-express-id${board_id}.dtb setenv fdt_file ccimx8x-sbc-express-id${board_id}.dtb
else else
# #
# Set device tree filename depending on the hardware variant # Set device tree filename depending on the hardware capabilities
# #
if test "${module_variant}" = "0x01"; then if test -n "${module_ram}"; then
setenv fdt_file ccimx8x-sbc-express-wb.dtb setexpr module_has_wifi ${hwid_3} \& 1
elif test "${module_variant}" = "0x02"; then setexpr module_has_bt ${hwid_3} \& 2
setenv fdt_file ccimx8x-sbc-express-wb.dtb setexpr module_has_bt ${module_has_bt} / 2
elif test "${module_variant}" = "0x03"; then
setenv fdt_file ccimx8x-sbc-express.dtb if test "${module_has_wifi}" = "1" &&
elif test "${module_variant}" = "0x04"; then test "${module_has_bt}" = "1"; then
setenv fdt_file ccimx8x-sbc-express-wb.dtb setenv fdt_file ccimx8x-sbc-express-wb.dtb
elif test "${module_variant}" = "0x05"; then else
setenv fdt_file ccimx8x-sbc-express.dtb setenv fdt_file ccimx8x-sbc-express.dtb
fi
else else
setenv fdt_file ccimx8x-sbc-express-wb.dtb #
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x01" ||
test "${module_variant}" = "0x02" ||
test "${module_variant}" = "0x04"; then
setenv fdt_file ccimx8x-sbc-express-wb.dtb
elif test "${module_variant}" = "0x03" ||
test "${module_variant}" = "0x05"; then
setenv fdt_file ccimx8x-sbc-express.dtb
else
setenv fdt_file ccimx8x-sbc-express-wb.dtb
fi
fi fi
fi fi

View File

@ -9,14 +9,33 @@ if test -n "${board_id}"; then
setenv fdt_file ccimx8x-sbc-pro-id${board_id}.dtb setenv fdt_file ccimx8x-sbc-pro-id${board_id}.dtb
else else
# #
# Set device tree filename depending on the hardware variant # Set device tree filename depending on the hardware capabilities
# #
if test "${module_variant}" = "0x01" || test "${module_variant}" = "0x02" || test "${module_variant}" = "0x04"; then if test -n "${module_ram}"; then
setenv fdt_file ccimx8x-sbc-pro-wb.dtb setexpr module_has_wifi ${hwid_3} \& 1
elif test "${module_variant}" = "0x03" || test "${module_variant}" = "0x05"; then setexpr module_has_bt ${hwid_3} \& 2
setenv fdt_file ccimx8x-sbc-pro.dtb setexpr module_has_bt ${module_has_bt} / 2
if test "${module_has_wifi}" = "1" &&
test "${module_has_bt}" = "1"; then
setenv fdt_file ccimx8x-sbc-pro-wb.dtb
else
setenv fdt_file ccimx8x-sbc-pro.dtb
fi
else else
setenv fdt_file ccimx8x-sbc-pro-wb.dtb #
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x01" ||
test "${module_variant}" = "0x02" ||
test "${module_variant}" = "0x04"; then
setenv fdt_file ccimx8x-sbc-pro-wb.dtb
elif test "${module_variant}" = "0x03" ||
test "${module_variant}" = "0x05"; then
setenv fdt_file ccimx8x-sbc-pro.dtb
else
setenv fdt_file ccimx8x-sbc-pro-wb.dtb
fi
fi fi
fi fi