Skip to content

Commit

Permalink
boot: Limit the UUU-tagged bootloader image to wic
Browse files Browse the repository at this point in the history
The UUU-tagged bootloader causes problems when used outside of the wic
context. See the fixes below.

Restore the default bootloader image to the untagged version and use
the tagged version only in the wic context.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
  • Loading branch information
thochstein committed Apr 18, 2024
1 parent 80d6f91 commit 6005f1f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
3 changes: 1 addition & 2 deletions classes/uuu_bootloader_tag.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
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}
ln -sf ${UUU_BOOTLOADER_UNTAGGED} ${DEPLOYDIR}/${UUU_BOOTLOADER}
stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED} \
>> ${DEPLOYDIR}/${UUU_BOOTLOADER_TAGGED}
fi
Expand Down
12 changes: 10 additions & 2 deletions conf/machine/include/imx-base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,19 @@ 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"

WIC_BOOTLOADER = " \
${@bb.utils.contains('IMX_DEFAULT_BOOTLOADER', 'imx-boot', 'imx-boot-tagged', \
bb.utils.contains('IMX_DEFAULT_BOOTLOADER', 'u-boot-imx', '${WIC_BOOTLOADER_32BIT}', \
'${UBOOT_BINARY}', d), d)}"
WIC_BOOTLOADER_32BIT = "${UBOOT_BINARY}"
WIC_BOOTLOADER_32BIT:mx6-generic-bsp = "u-boot-tagged.${UBOOT_SUFFIX}"
WIC_BOOTLOADER_32BIT:mx7-generic-bsp = "u-boot-tagged.${UBOOT_SUFFIX}"

WKS_FILE ?= "${SOC_DEFAULT_WKS_FILE}"

SERIAL_CONSOLES = "115200;ttymxc0"
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=${WIC_BOOTLOADER}" --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=${WIC_BOOTLOADER}" --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=${WIC_BOOTLOADER}" --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=${WIC_BOOTLOADER}" --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=${WIC_BOOTLOADER}" --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=${WIC_BOOTLOADER}" --ondisk mmcblk --no-table --align 1
part / --source rootfs --ondisk mmcblk --fstype=ext4 --label root --align 4096

bootloader --ptable msdos

0 comments on commit 6005f1f

Please sign in to comment.