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

Add Raspberry Pi 5 #1237

Merged
merged 8 commits into from Jan 25, 2024
Merged

Add Raspberry Pi 5 #1237

merged 8 commits into from Jan 25, 2024

Conversation

floion
Copy link
Contributor

@floion floion commented Oct 25, 2023

- What I did

- How I did it

Copy link
Collaborator

@kraj kraj left a comment

Choose a reason for hiding this comment

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

Lgtm

@agherzan
Copy link
Owner

Would you mind adding the relevant machines in the CI too? https://github.com/agherzan/meta-raspberrypi/blob/master/.github/workflows/yocto-builds.yml#L17 It will help us validate in one go.

@floion floion force-pushed the add_rpi5 branch 2 times, most recently from 4a0bc52 to 26308f9 Compare November 2, 2023 08:04
@floion
Copy link
Contributor Author

floion commented Nov 2, 2023

Done @agherzan

Copy link
Collaborator

@kraj kraj left a comment

Choose a reason for hiding this comment

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

lgtm

@agherzan
Copy link
Owner

@floion, it looks like the builds fail. Could it be that we missed the kernel bump?

Copy link
Owner

@agherzan agherzan left a comment

Choose a reason for hiding this comment

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

rPI 5 builds fail with missing dts

@agherzan
Copy link
Owner

There is also a kernel recipe version bump that landed in master today, so we will need to rebase this PR.

@leon-anavi
Copy link
Contributor

Hi,

I received a Raspberry Pi 5 kit with the official power supply today. The first thing that I tried was this GitHub pull request. Here are my test results:

  • machine raspberrypi5: I was able to build core-image-minimal but the image fails to boot (stuck at the bootloader). There is no output on the serial console at all.

  • machine raspberrypi5-64: linux-raspberrypi_6.1.bb fails to compile

  • machine raspberrypi5-64 2nd try: locally I cherry-picked commit 0e1e77c to the current meta-raspberrypi branch master which contains Khem's commit that updates the kernel linux-raspberrypi_6.1.bb: Update to 6.1.61 release #1245. The image builds successfully but again fails to boot like for machine raspberrypi5.

I will continue investigation the issues tomorrow.

Best regards,
Leon

@agherzan
Copy link
Owner

@leon-anavi can you try with the commits @floion just pushed?

@leon-anavi
Copy link
Contributor

@leon-anavi can you try with the commits @floion just pushed?

For Raspberry Pi 5 64-bit we also need to set ARMSTUB ?= "armstub8-2712.bin" in raspberrypi5-64.conf. I created a GitHub request for this change to @floion's fork: floion#1

I'm investigating further but some changes are also needed it in config.txt.

@leon-anavi
Copy link
Contributor

leon-anavi commented Nov 15, 2023

My previous comment related to ARMSTUB seems to be caused by a corner case which doesn't impact the general workflow so I close my proposed change. Still remains the mystery why my Raspberry Pi 5 fails to boot out of the box with image core-image-minimal-raspberrypi5-64.rootfs.wic.bz2 and the default config.txt in it. It seems to be somehow weirdly related to number of lines in config.txt because when comments are removed the board boots. I know there is a 98-character line length limit for entries for config.txt but is there a line count or file size limit too?

@floion
Copy link
Contributor Author

floion commented Nov 16, 2023

@leon-anavi yeah iirc it's related to config.txt size somehow

@leon-anavi
Copy link
Contributor

@leon-anavi yeah iirc it's related to config.txt size somehow

Do you experience the same issue with config.txt size? To avoid this issue on my setup locally I added sed -i '/^##/d' $CONFIG to do_deploy of rpi-config_git.bb. With it images for machine raspberrypi5-64 boot.

I am having other issues with machine raspberrypi5. Do image for it boot on your side?

@leon-anavi
Copy link
Contributor

Based on my further debugging today on Raspberry Pi 5 I am proposing some minor and some temporary changes floion#2

  • Added overlays/vc4-kms-v3d-pi5.dtbo to use vc4-kms-v3d driver on Raspberry Pi 5. Tested it for raspberrypi5-64 and core-image-weston.
  • u-boot_%.bbappend: temporary avoid Raspberry Pi 5 machines because U-Boot has not been ported to them yet.
  • rpi-config: Removed some comments to reduce config.txt file size to avoid file corruption and make sure Raspberry Pi 5 will boot successfully.

@floion
Copy link
Contributor Author

floion commented Nov 17, 2023

Hi @leon-anavi for the u-boot change I think it's enough you make sure you don't have RPI_USE_U_BOOT set. Can you check if you have that set somehow in your local.conf? If you don't have it set then you should not need the temporary u-boot hack.

@leon-anavi
Copy link
Contributor

Hi @leon-anavi for the u-boot change I think it's enough you make sure you don't have RPI_USE_U_BOOT set. Can you check if you have that set somehow in your local.conf? If you don't have it set then you should not need the temporary u-boot hack.

I want to make sure an error will appear during building images if RPI_USE_U_BOOT is set for Raspberry Pi 5. I think this is user/developer-friendly until we have U-Boot ported to Raspberry Pi 5. As of the moment with RPI_USE_U_BOOT and without the temporary u-boot hack the build will succeed but the image won't boot which may confuse and annoy many developers.

@floion
Copy link
Contributor Author

floion commented Nov 17, 2023

On the proposed change about the u-boot skipping floion@60b9be8 I'll let @agherzan @kraj have a say

@floion
Copy link
Contributor Author

floion commented Nov 17, 2023

@leon-anavi what size if the config.txt that fails for you? Can you attach it here? Thinking about opening an issue upstream about the size problem

@agherzan
Copy link
Owner

@leon-anavi @floion I like the idea of erroring out on uboot to avoid known limitations constantly reported. The vc4 dtb is required too, yes.

@leon-anavi
Copy link
Contributor

@leon-anavi what size if the config.txt that fails for you? Can you attach it here? Thinking about opening an issue upstream about the size problem

Without the change to remove the comments config.txt file size is 36K: config.txt.

As a result my Raspberry Pi 5 doesn't boot with. It shows the screen as if Raspberry Pi 5 has been booted without a microSD card at all.

@floion
Copy link
Contributor Author

floion commented Nov 20, 2023

Ok @agherzan I'll add Leon's commits to the PR

@agherzan agherzan mentioned this pull request Jan 12, 2024
@cordlandwehr
Copy link

Hi, I did a test of this branch (including the latest changes from floion#4), but I do get a fully reproducible bootup hang at

platform axi:gpu: bcm2712_iommu_attach_dev: MMU 1000005200.iommu
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_probe: Success
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_ini: DEBUG_INFO = 0x20804774
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_probe: Success
vc4-drm axi:gpu: bcm2712_iommu_of_xlate: MMU 1000005200.iommu

after that no further boot output. Has anybody an idea what might go wrong? I am on nanbield with meta-raspberrypi put to this patchset.

@kraj
Copy link
Collaborator

kraj commented Jan 12, 2024

Hi, I did a test of this branch (including the latest changes from floion#4), but I do get a fully reproducible bootup hang at

platform axi:gpu: bcm2712_iommu_attach_dev: MMU 1000005200.iommu
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_probe: Success
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_ini: DEBUG_INFO = 0x20804774
bcm2712_-iommu 1000005280.iommu: bcm2712_iommu_probe: Success
vc4-drm axi:gpu: bcm2712_iommu_of_xlate: MMU 1000005200.iommu

after that no further boot output. Has anybody an idea what might go wrong? I am on nanbield with meta-raspberrypi put to this patchset.

Try all master for best results

@cordlandwehr
Copy link

Thanks for the hint! Together with poky master I got core-image-weston running.

@mcbullisisu
Copy link

Thanks for the hint! Together with poky master I got core-image-weston running.

I can also confirm that I was able to boot an image derived from core-image-base. UART & HDMI output seem to work fine. I didn't test any further since my sample camera app is built on top of legacy python3-picamera, which needs some COMPATIBLE_HOST and/or dependency chain updates for the Pi 5.

Commits used:

Copy link
Collaborator

@kraj kraj left a comment

Choose a reason for hiding this comment

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

@agherzan I think its ready for merge.

floion and others added 7 commits January 21, 2024 11:48
Signed-off-by: Florin Sarbu <florin@balena.io>
Add overlays/vc4-kms-v3d-pi5.dtbo to use vc4-kms-v3d driver on
Raspberry Pi 5.

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Temporary avoid Raspberry Pi 5 machines because U-Boot has not been
ported to it yet.

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Remove some comments to reduce config.txt file size to avoid file
corruption and make sure Raspberry Pi 5 will boot successfully.

The issue with large config.txt has been reported to related
projects:
raspberrypi/firmware#1848
Evilpaul/RPi-config#9

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Use bcm2711_defconfig instead of bcm2712_defconfig for Raspberry
Pi 5 as per the instructions in the documentation:
https://www.raspberrypi.com/documentation/computers/linux_kernel.html#kernel-configuration

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Set SDIMG_KERNELIMAGE to kernel_2712.img instead of kernel8.img.
Raspberry Pi 5 firmware defaults to loading kernel_2712.img because
this image contains optimisations specific to Raspberry Pi 5
(e.g. 16K page-size). For more details:
https://www.raspberrypi.com/documentation/computers/config_txt.html#kernel

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Set SERIAL_CONSOLES to ttyAMA10. This fixes login on the UART
no matter if systemd is used.

This work was sponsored by GOVCERT.LU.

Suggested-by: Gael PORTAY <gael.portay@rtone.fr>
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
@leon-anavi
Copy link
Contributor

leon-anavi commented Jan 21, 2024

@agherzan I think its ready for merge.

@kraj I think we still need this patch for KERNEL_IMAGETYPE_DIRECT that I have been trying to merge in Florin's repo for this GitHub pull request: floion@db4bb8d floion#4

@kraj
Copy link
Collaborator

kraj commented Jan 21, 2024

@agherzan I think its ready for merge.

@kraj I think we still need this patch for KERNEL_IMAGETYPE_DIRECT that I have been trying to merge in Florin's repo for this GitHub pull request: floion@db4bb8d floion#4

I would suggest that we retarget that as an incremental patch directly as a fresh pull after the merge.

@agherzan
Copy link
Owner

@kraj CI won't pass without, and it is going to complain in all the PR later. @floion do you have a timeline for including @leon-anavi 's patch?

@kraj
Copy link
Collaborator

kraj commented Jan 23, 2024

@kraj CI won't pass without, and it is going to complain in all the PR later. @floion do you have a timeline for including @leon-anavi 's patch?

if we can do a new combined PR ? where this PR and added patches are put together ?
@leon-anavi can you help putting that together ? Sadly, I dont have a rpi5 to do it on my own

@leon-anavi
Copy link
Contributor

@kraj CI won't pass without, and it is going to complain in all the PR later. @floion do you have a timeline for including @leon-anavi 's patch?

if we can do a new combined PR ? where this PR and added patches are put together ? @leon-anavi can you help putting that together ? Sadly, I dont have a rpi5 to do it on my own

Ok, yes, I will give it a try tomorrow and provide a combined PR.

"zImage" not supported on arm64 so set KERNEL_IMAGETYPE_DIRECT to
"Image" for Raspberry Pi 5 and avoid the following errors:

| make: *** No rule to make target 'zImage'.  Stop.
| ERROR: oe_runmake failed

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
auto-merge was automatically disabled January 24, 2024 21:40

Head branch was pushed to by a user without write access

@floion
Copy link
Contributor Author

floion commented Jan 24, 2024

@kraj @agherzan @leon-anavi I added the requested commit to this PR

@leon-anavi
Copy link
Contributor

@kraj @agherzan @leon-anavi I added the requested commit to this PR

Thank you. Today I updated and I tested again this PR on Raspberry Pi 5. I was able to successfully build core-image-minimal and boot it. It looks good and I have no remarks.

@agherzan agherzan enabled auto-merge (rebase) January 25, 2024 11:58
@agherzan
Copy link
Owner

Looks good. I've triggered CI, and it will merge if it succeeds.

@agherzan agherzan merged commit fe7592f into agherzan:master Jan 25, 2024
19 checks passed
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.

None yet

8 participants