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

Building yocto image for RPi CM4 #6

Closed
Sourabh1107 opened this issue Jan 27, 2022 · 3 comments
Closed

Building yocto image for RPi CM4 #6

Sourabh1107 opened this issue Jan 27, 2022 · 3 comments

Comments

@Sourabh1107
Copy link

Hello All,

This is help request and not a bug/issue reporting.

I recently got my hands on a RPi CM4 Lite and now I want to build Yocto image with barebox as bootloader. I have few doubts before I get started.

  1. How should I do the Barebox configuration? For example, for raspberrypi3 we can have machine config in conf/local.conf as:

BAREBOX_CONFIG_raspberrypi3 = "rpi_defconfig"
BAREBOX_IMAGE_SRC_raspberrypi3 = "images/barebox-raspberry-pi-3.img"
COMPATIBLE_MACHINE_pn-barebox_raspberrypi3 = "raspberrypi3"

For RPi CM4, I am using MACHINE="raspberrypi4-64". How should this be used for barebox config?

  1. In order to boot from uSD (for CM4 Lite) how should I copy the bootloader files? Will there be any difference between BCM283x RPi like RPi2/3 and BCM2711 based RPi CM4 Lite?

My goal is to build an update with RAUC and Barebox.

Your help will be much appreciated.

Thanks in advance.

@menschel-d
Copy link
Owner

Hello there, and sorry for the late reply.

After searching through the source code and git history, it seems to me that barebox does not yet support the Raspberry Pi 4 and its variants.

The most recent hint that I've found concerning the support for the Raspberry Pi 4 is the following commit1 from January 14th.
Its commit message states (among other things):

[...]
The Raspberry Pi 4 support will be ARM64.
[...]

So it seems that support for the Raspberry Pi 4 is still being worked on.

As for your question about where to copy the bootloader files, the official documentation states that the boot process differs from the previous models2 and that there is an extra section about the "Raspberry Pi 4 Boot Flow"3.

That should get you started.
Hope it helps.

Remember to tell us the solution once you've found it.

Footnotes

  1. https://git.pengutronix.de/cgit/barebox/commit/?id=b267578d0567d26b1bd05d44901f983e0cd167a6

  2. https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#boot-sequence

  3. https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#raspberry-pi-4-boot-flow

@a3f
Copy link

a3f commented Oct 19, 2022

Raspberry Pi 4 support is included in recent releases like v2022.09.0 provided by meta-barebox. If you know how to build barebox for Raspberry Pi 3, it's exactly the same, but tick Raspberry Pi 4 support as well. The resulting barebox-raspberry-pi.img can be booted on both. You can build barebox for either 32-bit or 64-bit. Not everything works, but SD/Network do (no USB yet though).

To get barebox console working, you'll need to tell the VideoCore about your UART. See the integration in DistroKit for reference:

It's called rpi2, because it works for all 32-bit targets from 2 onwards, including Raspberry Pi 4. For 64-bit, you just enable CONFIG_64BIT. I didn't have a CM4 to test on, but if you are willing to help out, drop by at the barebox channel on Libera.Chat/Matrix.

Cheers,

@menschel-d
Copy link
Owner

@Sourabh1107 Have you found a solution by now that you'd like to share with the rest of us?
Is this topic still relevant to you?
If not, I think we can close this help request (after more than 2 years).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants