Skip to content

Allow UBOOT without UART on pi 5 - #1623

Open
Faalangst26 wants to merge 1 commit into
agherzan:wrynosefrom
Faalangst26:wrynose
Open

Faalangst26 wants to merge 1 commit into
agherzan:wrynosefrom
Faalangst26:wrynose

Conversation

@Faalangst26

Copy link
Copy Markdown

Fixes #1582

Like @tjallingt, I noticed that disabling UART when using UBOOT causes the build to fail when building for the pi 5. This whilst on pi 5 it is explicitly supported to do so according to the docs:
https://meta-raspberrypi.readthedocs.io/en/latest/extra-build-config.html#boot-to-u-boot

In my own testing, I found that the pi 5 actually refuses to boot on kernel 6.18 when UART and UBOOT are both enabled in combination with the RAUC layer. Disabling the UART fixes this.

- What I did
Changed the machine config for pi 5 to use an unique UBOOT_MACHINE target, instead of sharing it with pi 1, 2 and 3.

- How I did it
Updated the value in conf/machine/raspberrypi5.conf, this causes the case in the URAT check in the rpi_config_git.bb to fall through, and continue to build, without altering other variables.
I did a global search in the project for other places UBOOT_MACHINE is used, and found no other references, so I believe it is safe to update it here.

Comment thread conf/machine/raspberrypi5.conf Outdated
KERNEL_BOOTCMD ?= "booti"

UBOOT_MACHINE = "rpi_arm64_config"
UBOOT_MACHINE = "rpi_5_arm64_config"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

UBOOT_MACHINE is used to specify configuration of U-Boot. rpi_arm64_config is the same as rpi_arm64_defconfig and is a valid configuration for U-Boot.
rpi_5_arm64_config doesn't exist. So this change breaks u-boot build.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Shoot! Must've been my build cache, because it works on my end.
Would it be an idea to add an extra variable like
'U_BOOT_REQUIRES_UART'
And check on that? That'd avoid influencing other processes.
I'd be happy to update the PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good. TBH checking UBOOT_MACHINE in rpi-config looks weird. So something like this would be better (sorry if indentation is broken, typing from the phone):

if [ $RPI_USE_U_BOOT = 1 ] && [ $UBOOT_REQUIRES_UART = 1 ] && [ $ENABLE_UART != 1 ]; then
    bbfatal "..."
fi

But maybe maintainers have a better idea.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Shall we drop this?

@Faalangst26

Copy link
Copy Markdown
Author

Changed the U_BOOT_MACHINE config back to the existing rpi_arm64_config to avoid breaking the U_BOOT build. Instead, added an extra variable explicitly for the check of combining UART and U_BOOT. I am unable to validate boards other than the Pi 5 right now, so for safety I've set the U_BOOT_REQUIRES_UART to 1 for all machines except the Pi 5, thereby keeping the old behaviour.

@AndreyLalaev

Copy link
Copy Markdown
Contributor

@Faalangst26 could you please update your commits according to the contribution guides in the repo? (Messages, signed-off-by etc)

I see it as 2 commits:

  • introduce UBOOT_REQUIRES_UART to all machines
  • update rpi-config-git.bb to use the variable

The first commit can be dropped.

@agherzan agherzan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Happy to see a new contributor. Thanks for raising this. Could you please follow the documented contribution guidelines and cleanup your commits?

echo "enable_uart=1" >>$CONFIG
;;
esac
if [ "${RPI_USE_U_BOOT}" = "1" ] && [ "${U_BOOT_REQUIRES_UART}" = "1" ] && [ "${ENABLE_UART}" != "1" ]; then

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is a nice cleanup. Happy to see it.


UBOOT_MACHINE = "rpi_5_arm64_config"
U_BOOT_REQUIRES_UART = "0"
UBOOT_MACHINE = "rpi_arm64_config"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This would be the wrong place to revert this.

@agherzan agherzan self-assigned this Oct 14, 2026
@Faalangst26

Copy link
Copy Markdown
Author

Hopefully I did the git operation successfully. If it's easier I'll just drop this PR and create a new one with just the one commit.

@AndreyLalaev

Copy link
Copy Markdown
Contributor

@Faalangst26 looks like something went wrong because this PR now brings 22 commits instead of 1 or 2.
I think you can fix it with git rebase --onto (please see the manual for the correct parameters)

@Faalangst26

Copy link
Copy Markdown
Author

Thanks for the pointer to rebase --onto, I'm not used to these kind of git operations. I think it's correct now, only one commit

@agherzan agherzan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This looks nice and clean now. Thanks!

@agherzan agherzan left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ouch. It looks like you need to fix your commit's author email:

	sign-off not found for commit author: Berne Gerrits 31410921+Faalangst26@users.noreply.github.com; found: ['Berne Gerrits <berne@volga.nl>']

https://meta-raspberrypi.readthedocs.io/en/latest/extra-build-config.html#boot-to-u-boot

Aligns the check for UART to apply only to those hardware platforms that actually require it, as stated in the docs. This was archieved by adding a new variable in each machines' config 'U_BOOT_REQUIRES_UART' which is set to '1' on all current configs except the Pi 5.

This also allows to slighly simplify the rpi-config_git check for UART, by checking agains the new variable instead of keeping a compatability list in the .bb file

Signed-off-by: Berne Gerrits <berne@volga.nl>
@Faalangst26

Copy link
Copy Markdown
Author

This is the first time for me committing to a 'serious' open source project, so thank you all for being so helpful (and patient)! I believe the commit author email should be fixed now.

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.

3 participants