Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuu_bootloader_tag.bbclass: Add UUU_BOOTLOADER_UNTAGGED #1762

Merged

Conversation

hiagofranco
Copy link
Contributor

Add UUU_BOOTLOADER_UNTAGGED flag to add the possibility to deploy a imx-boot binary without the tagged footer
'UUUBURNXXOEUZX7+A-XY5601QQWWZ%sEN' at the end.

The addition of the footer 'UUUBURNXXOEUZX7+A-XY5601QQWWZ%sEN' at the end causes issues when the binary is loaded into RAM memory, this footer may cause issues where the binary size exceeds the typical USB package size used by UUU (1021 bytes).

As example, if the footer is split across two distinct USB packages, such as sending 'UUUBURNXXXOE' in the last packet and 'UZX7+A-XY5601QQWWZ%sEND' in the next one, it can lead to UUU halting while waiting for a response in SDPS mode.

After sending 'UUUBURNXXXOE', iMX8MP's boot room starts SPL, not waiting for the next packet ('UZX7+A-XY5601QQWWZ%sEND'), leading to UUU breaking.

Therefore, deploy both binaries separately (-tagged and -untagged) to allow users to choose the appropriate binary.

(cherry picked from commit 5a90636)
Signed-off-by: Hiago De Franco [email protected]

Add UUU_BOOTLOADER_UNTAGGED flag to add the possibility to deploy a
imx-boot binary without the tagged footer
'UUUBURNXXOEUZX7+A-XY5601QQWWZ%sEN' at the end.

The addition of the footer 'UUUBURNXXOEUZX7+A-XY5601QQWWZ%sEN' at the end
causes issues when the binary is loaded into RAM memory, this footer may
cause issues where the binary size exceeds the typical USB package size
used by UUU (1021 bytes).

As example, if the footer is split across two distinct USB packages,
such as sending 'UUUBURNXXXOE' in the last packet and
'UZX7+A-XY5601QQWWZ%sEND' in the next one, it can lead to UUU halting
while waiting for a response in SDPS mode.

After sending 'UUUBURNXXXOE', iMX8MP's boot room starts SPL, not waiting
for the next packet ('UZX7+A-XY5601QQWWZ%sEND'), leading to UUU
breaking.

Therefore, deploy both binaries separately (-tagged and -untagged) to
allow users to choose the appropriate binary.

(cherry picked from commit 5a90636)
Signed-off-by: Hiago De Franco <[email protected]>
@@ -4,6 +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}
stat -L -cUUUBURNXXOEUZX7+A-XY5601QQWWZ%sEND ${DEPLOYDIR}/${UUU_BOOTLOADER} \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use UUU_BOOTLOADER_TAGGED here to make the code more specific and saying.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MrCry0, it's a valid point, however this was already merged into master and I'm just backporting it to kitkstone now. Let's keep it like this and we can fix it on master and backport the change, if required.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hiagofranco please prepare a PR fixing this as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, PR opened: #1764

Copy link
Contributor

@MrCry0 MrCry0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the optional note, LGTM

@otavio otavio merged commit e7167f2 into Freescale:kirkstone Mar 9, 2024
@hiagofranco hiagofranco deleted the backport_fix_uuu_bootloader_tag branch March 9, 2024 14:17
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Apr 18, 2024
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 <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Aug 13, 2024
The UUU tag on the default bootloader image causes problems when the
bootloader is used outside of the Wic context.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged, and only the Wic image will use the tagged
binaries.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Aug 22, 2024
The UUU tag on the default bootloader image causes problems when the
bootloader is used outside of the Wic context.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged, and only the Wic image will use the tagged
binaries.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Sep 9, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Sep 11, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Signed-off-by: Tom Hochstein <[email protected]>
otavio added a commit that referenced this pull request Sep 14, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: #1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
otavio added a commit that referenced this pull request Sep 15, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: #1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Sep 15, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Sep 16, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
thochstein added a commit to nxp-upstream/meta-freescale that referenced this pull request Sep 16, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: Freescale#1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
github-actions bot pushed a commit that referenced this pull request Sep 17, 2024
Using the UUU-tagged bootloader image directly with UUU can cause UUU
to hang. The bootloader image is split on a certain transmit size, and
the hang occurs if the tag does not fit with the final bytes of the
bootloader image and must be split into a new transmit package.

The UUU tag is needed by UUU only in the SD Card image file itself so
that UUU can find the end of the boot partition.

Rework the design so the default bootloader and the default imx-boot
binaries are not tagged.

Also, extend the UUU tagging to fslc so it can gain the same benefit.

Fixes: #1762
Fixes: nxp-imx/mfgtools#416
Co-authored-by: Otavio Salvador <[email protected]>
Signed-off-by: Tom Hochstein <[email protected]>
(cherry picked from commit ef8b4c4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants