Skip to content

Commit

Permalink
Merge pull request #1791 from nxp-upstream/uuu
Browse files Browse the repository at this point in the history
Restore default bootloader to untagged version
  • Loading branch information
otavio authored Sep 17, 2024
2 parents 1cbbde1 + ef8b4c4 commit d725383
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion classes/imx-boot-container.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ do_deploy:append() {
if [ ! -f "${DEPLOYDIR}/imx-boot" ]; then
ln -sf flash.bin-${MACHINE}-${type} flash.bin
ln -sf flash.bin-${MACHINE}-${type} imx-boot

ln -sf flash.bin.tagged imx-boot.tagged
else
bbwarn "Use custom wks.in for $UBOOT_CONFIG = $type"
fi
Expand Down
24 changes: 16 additions & 8 deletions classes/uuu_bootloader_tag.bbclass
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Append a tag to the bootloader image used in the SD card image. The tag
# contains the size of the bootloader image so UUU can easily find the end of
# the bootloader in the SD card image.
# Create a tagged boot partition file for the SD card image file. The tag
# contains the size of the boot partition image so UUU can easily find
# the end of it in the SD card image file.
#
# IMPORTANT: The tagged boot partition file should never be used directly with
# UUU, as it can cause UUU to hang.

UUU_BOOTLOADER = "${UBOOT_BINARY}"
UUU_BOOTLOADER:mx8-generic-bsp = "${@d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0' and 'imx-boot' or 'flash.bin'}"
UUU_BOOTLOADER:mx9-generic-bsp = "${@d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0' and 'imx-boot' or 'flash.bin'}"

do_deploy:append() {
if [ "${UUU_BOOTLOADER}" != "" ]; then
cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED}
cp ${DEPLOYDIR}/${UUU_BOOTLOADER} ${DEPLOYDIR}/${UUU_BOOTLOADER_UNTAGGED}
ln -sf ${UUU_BOOTLOADER_TAGGED} ${DEPLOYDIR}/${UUU_BOOTLOADER}
stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} \
>> ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED}
cp ${DEPLOYDIR}/${UUU_BOOTLOADER} \
${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged
stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND \
${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged \
>> ${DEPLOYDIR}/${UUU_BOOTLOADER}.tagged
fi
}
4 changes: 2 additions & 2 deletions conf/machine/include/imx-base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,9 @@ WKS_FILE_DEPENDS:append:imx-generic-bsp:mx9-generic-bsp = " \
${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '0', 'imx-boot', '')} \
"

SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx8-generic-bsp ?= "imx-imx-boot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE ?= "imx-uboot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mxs-generic-bsp ?= "imx-uboot-mxs-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx8-generic-bsp ?= "imx-imx-boot-bootpart.wks.in"
SOC_DEFAULT_WKS_FILE:mx9-generic-bsp ?= "imx-imx-boot-bootpart.wks.in"

WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"
Expand Down
18 changes: 7 additions & 11 deletions recipes-bsp/imx-mkimage/imx-boot_1.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ DEPENDS += " \
DEPENDS += "xxd-native"
DEPENDS:append:mx8m-generic-bsp = " u-boot-mkimage-native dtc-native"
DEPENDS:append:mx93-generic-bsp = " u-boot-mkimage-native dtc-native"
BOOT_NAME = "imx-boot"
PROVIDES = "${BOOT_NAME}"

inherit deploy uuu_bootloader_tag

UUU_BOOTLOADER = "${BOOT_NAME}"
UUU_BOOTLOADER_TAGGED = "${BOOT_NAME}-tagged"
UUU_BOOTLOADER_UNTAGGED = "${BOOT_NAME}-untagged"
UUU_BOOTLOADER = "imx-boot"

# Add CFLAGS with native INCDIR & LIBDIR for imx-mkimage build
CFLAGS = "-O2 -Wall -std=c99 -I ${STAGING_INCDIR_NATIVE} -L ${STAGING_LIBDIR_NATIVE}"
Expand Down Expand Up @@ -222,7 +218,7 @@ do_compile() {
UBOOT_DTB_NAME_EXTRA="${dtb_name}"
fi
UBOOT_NAME_EXTRA="u-boot-${MACHINE}.bin-${UBOOT_CONFIG_EXTRA}"
BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"
BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"

for target in ${IMXBOOT_TARGETS}; do
compile_${SOC_FAMILY}
Expand Down Expand Up @@ -273,7 +269,7 @@ do_install () {
bbnote "UBOOT_CONFIG = $type"

UBOOT_CONFIG_EXTRA="$type"
BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"
BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"

for target in ${IMXBOOT_TARGETS}; do
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target} ${D}/boot/
Expand Down Expand Up @@ -380,7 +376,7 @@ do_deploy() {
for type in ${UBOOT_CONFIG}; do
UBOOT_CONFIG_EXTRA="$type"
UBOOT_NAME_EXTRA="u-boot-${MACHINE}.bin-${UBOOT_CONFIG_EXTRA}"
BOOT_CONFIG_MACHINE_EXTRA="${BOOT_NAME}-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"
BOOT_CONFIG_MACHINE_EXTRA="imx-boot-${MACHINE}-${UBOOT_CONFIG_EXTRA}.bin"

if [ -e ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG_EXTRA} ] ; then
install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG_EXTRA} \
Expand All @@ -399,9 +395,9 @@ do_deploy() {
install -m 0644 ${S}/${BOOT_CONFIG_MACHINE_EXTRA}-${target} ${DEPLOYDIR}
done

# The first UBOOT_CONFIG listed will be the ${BOOT_NAME} binary
if [ ! -f "${DEPLOYDIR}/${UUU_BOOTLOADER}" ]; then
ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${BOOT_NAME}
# The first UBOOT_CONFIG listed will be the imx-boot binary
if [ ! -f "${DEPLOYDIR}/imx-boot" ]; then
ln -sf ${BOOT_CONFIG_MACHINE_EXTRA}-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/imx-boot
else
bbwarn "Use custom wks.in for $UBOOT_CONFIG = $type"
fi
Expand Down
5 changes: 3 additions & 2 deletions recipes-bsp/u-boot/u-boot-fslc_2024.07.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ order to provide support for some backported features and fixes, or because it \
was submitted for revision and it takes some time to become part of a stable \
version, or because it is not applicable for upstreaming."

inherit ${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '1', 'imx-boot-container', '')}

DEPENDS += "bc-native dtc-native python3-setuptools-native gnutls-native"

PROVIDES += "u-boot u-boot-mfgtool"
Expand All @@ -21,5 +19,8 @@ EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CPPFLAGS}" \
HOSTLDFLAGS="${BUILD_LDFLAGS}" \
HOSTSTRIP=true'

inherit ${@oe.utils.ifelse(d.getVar('UBOOT_PROVIDES_BOOT_CONTAINER') == '1', 'imx-boot-container', '')}
inherit uuu_bootloader_tag

PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(imx-generic-bsp)"
13 changes: 4 additions & 9 deletions recipes-bsp/u-boot/u-boot-imx_2024.04.bb
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ PROVIDES += "u-boot u-boot-mfgtool"

inherit uuu_bootloader_tag

UUU_BOOTLOADER = ""
UUU_BOOTLOADER:mx6-generic-bsp = "${UBOOT_BINARY}"
UUU_BOOTLOADER:mx7-generic-bsp = "${UBOOT_BINARY}"
UUU_BOOTLOADER_TAGGED = ""
UUU_BOOTLOADER_TAGGED:mx6-generic-bsp = "u-boot-tagged.${UBOOT_SUFFIX}"
UUU_BOOTLOADER_TAGGED:mx7-generic-bsp = "u-boot-tagged.${UBOOT_SUFFIX}"
UUU_BOOTLOADER_UNTAGGED = ""
UUU_BOOTLOADER_UNTAGGED:mx6-generic-bsp = "u-boot-untagged.${UBOOT_SUFFIX}"
UUU_BOOTLOADER_UNTAGGED:mx7-generic-bsp = "u-boot-untagged.${UBOOT_SUFFIX}"
# The UUU tag goes on the boot partition. For 8+, the boot partition image
# is imx-boot, so disable UUU-tagging here
UUU_BOOTLOADER:mx8-generic-bsp = ""
UUU_BOOTLOADER:mx9-generic-bsp = ""

do_deploy:append:mx8m-generic-bsp() {
# Deploy u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary
Expand Down
2 changes: 1 addition & 1 deletion wic/imx-imx-boot-bootpart.wks.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 0 | 8MiB 72MiB 72MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
# ${IMX_BOOT_SEEK} 32 or 33kiB, see reference manual
#
part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part u-boot --source rawcopy --sourceparams="file=imx-boot.tagged" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 8192 --size 64
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 8192

Expand Down
2 changes: 1 addition & 1 deletion wic/imx-imx-boot.wks.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 0 | 8MiB 8MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
# ${IMX_BOOT_SEEK} 32 or 33kiB, see reference manual
#
part u-boot --source rawcopy --sourceparams="file=imx-boot" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part u-boot --source rawcopy --sourceparams="file=imx-boot.tagged" --ondisk mmcblk --no-table --align ${IMX_BOOT_SEEK}
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 8192

bootloader --ptable msdos
2 changes: 1 addition & 1 deletion wic/imx-uboot-bootpart.wks.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# | | | |
# 0 1kiB 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}.tagged" --ondisk mmcblk --no-table --align 1
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

Expand Down
2 changes: 1 addition & 1 deletion wic/imx-uboot-spl-bootpart.wks.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 0 1kiB 69kiB 4MiB 16MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 69
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}.tagged" --ondisk mmcblk --no-table --align 69
part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 16
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

Expand Down
2 changes: 1 addition & 1 deletion wic/imx-uboot-spl.wks.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# 0 1kiB 69kiB 4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part SPL --source rawcopy --sourceparams="file=SPL" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}" --ondisk mmcblk --no-table --align 69
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}.tagged" --ondisk mmcblk --no-table --align 69
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos
2 changes: 1 addition & 1 deletion wic/imx-uboot.wks
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# | | | |
# 0 1kiB 4MiB + rootfs + IMAGE_EXTRA_SPACE (default 10MiB)
#
part u-boot --source rawcopy --sourceparams="file=u-boot.imx" --ondisk mmcblk --no-table --align 1
part u-boot --source rawcopy --sourceparams="file=${UBOOT_BINARY}.tagged" --ondisk mmcblk --no-table --align 1
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

0 comments on commit d725383

Please sign in to comment.