ccmp1: add support to DT overlays for ccmp1 platforms

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2022-10-07 12:09:04 +02:00
parent b0db58fe53
commit b3d46473df
4 changed files with 54 additions and 131 deletions

View File

@ -45,7 +45,14 @@ FIP_UBOOT_CONFIG = "optee"
# Define list of devicetree per board
STM32MP_DEVICETREE ??= "ccmp13-dvk"
# Extra DTB for board - need to specify it with .dtb ...
STM32MP_KERNEL_DEVICETREE:ccmp13-dvk += "ccmp133-dvk.dtb"
STM32MP_KERNEL_DEVICETREE:ccmp13-dvk += " \
ccmp133-dvk.dtb \
_ov_board_microe-accel2-click_ccmp13.dtbo \
_ov_board_microe-gyro-click_ccmp13.dtbo \
_ov_board_microe-i2c-2-spi_ccmp13.dtbo \
_ov_som_bt_ccmp13.dtbo \
_ov_som_wifi_ccmp13.dtbo \
"
# =========================================================================
# Machine features

View File

@ -45,8 +45,20 @@ FIP_UBOOT_CONFIG = "optee"
# Define list of devicetree per board
STM32MP_DEVICETREE ??= "ccmp15-dvk"
# Extra DTB for board - need to specify it with .dtb ...
STM32MP_KERNEL_DEVICETREE:ccmp15-dvk += "ccmp157-dvk.dtb"
STM32MP_KERNEL_DEVICETREE:ccmp15-dvk += "ccmp151-dvk.dtb"
STM32MP_KERNEL_DEVICETREE:ccmp15-dvk += " \
ccmp151-dvk.dtb \
ccmp157-dvk.dtb \
_ov_board_can2_ccmp15-dvk.dtbo \
_ov_board_eth0-10-100_ccmp15-dvk.dtbo \
_ov_board_fusion10-parallel_ccmp15-dvk.dtbo \
_ov_board_fusion7-parallel_ccmp15-dvk.dtbo \
_ov_board_g101evn010-lvds_ccmp15-dvk.dtbo \
_ov_board_microe-accel2-click_ccmp15.dtbo \
_ov_board_microe-gyro-click_ccmp15.dtbo \
_ov_board_microe-i2c-2-spi_ccmp15.dtbo \
_ov_som_bt_ccmp15.dtbo \
_ov_som_wifi_ccmp15.dtbo \
"
# =========================================================================
# Machine features

View File

@ -2,74 +2,26 @@
# U-Boot bootscript for NAND images created by Yocto.
#
# As the first step in the boot script, check if we are using DualBoot and
# if an upgrade is available. This requires the script to change some variables
# and save them, while the rest of the script changes variables only temporarily
# without saving them.
# Dual boot update verification
if test "${dualboot}" = "yes"; then
if test "${upgrade_available}" = "1"; then
echo "Update detected; Booting new system in ${active_system} (try ${bootcount})"
else
if test "${active_system}" = "linux_a"; then
echo "Booting from system A"
setenv mtdbootpart ${active_system}
setenv mtdrootfspart ${rootfsvol_a}
setenv rootfsvol ${rootfsvol_a}
else
echo "Booting from system B"
setenv mtdbootpart ${active_system}
setenv mtdrootfspart ${rootfsvol_b}
setenv rootfsvol ${rootfsvol_b}
fi
fi
else
if test "${mtdbootpart}" = "recovery"; then
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
true
fi
fi
# Back up environment variables
setenv ORIG_extra_bootargs ${extra_bootargs}
setenv ORIG_overlays ${overlays}
#
# Set device tree filename depending on the board ID (if defined)
# Determine overlays to apply depending on the hardware capabilities
# described by the HWID, SOM version, and carrier board version.
#
if test -n "${board_id}"; then
setenv fdt_file imx6ul-ccimx6ulsbc-id${board_id}.dtb
else
#
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x02"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x03"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
elif test "${module_variant}" = "0x04"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x05"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
elif test "${module_variant}" = "0x06"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x07"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x08"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x09"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x0a"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
else
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
fi
setexpr module_has_wifi ${hwid_2} \& 20000
setexpr module_has_wifi ${module_has_wifi} / 20000
setexpr module_has_bt ${hwid_2} \& 40000
setexpr module_has_bt ${module_has_bt} / 40000
if test "${module_has_bt}" = "1" && test -z "${disable_bt}"; then
setenv overlays _ov_som_bt_ccmp13.dtbo,${overlays}
fi
if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then
setenv overlays _ov_som_wifi_ccmp13.dtbo,${overlays}
fi
setenv extra_bootargs fbcon=logo-pos:center ${extra_bootargs}
dboot linux nand ${mtdbootpart}
@ -77,5 +29,5 @@ dboot linux nand ${mtdbootpart}
# We only get here in case of an error on the dboot command.
# Undo changes to environment variables
setenv extra_bootargs ${ORIG_extra_bootargs}
setenv ORIG_extra_bootargs
setenv overlays ${ORIG_overlays}
setenv ORIG_overlays

View File

@ -2,74 +2,26 @@
# U-Boot bootscript for NAND images created by Yocto.
#
# As the first step in the boot script, check if we are using DualBoot and
# if an upgrade is available. This requires the script to change some variables
# and save them, while the rest of the script changes variables only temporarily
# without saving them.
# Dual boot update verification
if test "${dualboot}" = "yes"; then
if test "${upgrade_available}" = "1"; then
echo "Update detected; Booting new system in ${active_system} (try ${bootcount})"
else
if test "${active_system}" = "linux_a"; then
echo "Booting from system A"
setenv mtdbootpart ${active_system}
setenv mtdrootfspart ${rootfsvol_a}
setenv rootfsvol ${rootfsvol_a}
else
echo "Booting from system B"
setenv mtdbootpart ${active_system}
setenv mtdrootfspart ${rootfsvol_b}
setenv rootfsvol ${rootfsvol_b}
fi
fi
else
if test "${mtdbootpart}" = "recovery"; then
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
else
true
fi
fi
# Back up environment variables
setenv ORIG_extra_bootargs ${extra_bootargs}
setenv ORIG_overlays ${overlays}
#
# Set device tree filename depending on the board ID (if defined)
# Determine overlays to apply depending on the hardware capabilities
# described by the HWID, SOM version, and carrier board version.
#
if test -n "${board_id}"; then
setenv fdt_file imx6ul-ccimx6ulsbc-id${board_id}.dtb
else
#
# Set device tree filename depending on the hardware variant
#
if test "${module_variant}" = "0x02"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x03"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
elif test "${module_variant}" = "0x04"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x05"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
elif test "${module_variant}" = "0x06"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x07"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x08"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x09"; then
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
elif test "${module_variant}" = "0x0a"; then
setenv fdt_file imx6ul-ccimx6ulsbc.dtb
else
setenv fdt_file imx6ul-ccimx6ulsbc-wb.dtb
fi
setexpr module_has_wifi ${hwid_2} \& 20000
setexpr module_has_wifi ${module_has_wifi} / 20000
setexpr module_has_bt ${hwid_2} \& 40000
setexpr module_has_bt ${module_has_bt} / 40000
if test "${module_has_bt}" = "1" && test -z "${disable_bt}"; then
setenv overlays _ov_som_bt_ccmp15.dtbo,${overlays}
fi
if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then
setenv overlays _ov_som_wifi_ccmp15.dtbo,${overlays}
fi
setenv extra_bootargs fbcon=logo-pos:center ${extra_bootargs}
dboot linux nand ${mtdbootpart}
@ -77,5 +29,5 @@ dboot linux nand ${mtdbootpart}
# We only get here in case of an error on the dboot command.
# Undo changes to environment variables
setenv extra_bootargs ${ORIG_extra_bootargs}
setenv ORIG_extra_bootargs
setenv overlays ${ORIG_overlays}
setenv ORIG_overlays