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

[RPI] Initial support of RPI5 (WIP) #211

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

BohdanBuinich
Copy link
Contributor

@BohdanBuinich BohdanBuinich commented Jan 28, 2024

This commit introduces initial support for the Raspberry Pi 5 Model B in Buildroot. While part of the work has been completed, several outstanding issues must be addressed. I have for you below a detailed description of the current status and the identified issues.

Completed Work

  • Basic system configuration for Raspberry Pi 5
  • Integration of necessary drivers and modules for initial boot.

To-Do List and Issues

1. Kernel Error with cma=384M flag: (resolved by 321c263)
A kernel error occurs when the cma=384M flag is set. The error log is as follows:

[    1.861421] Hardware name: Raspberry Pi Foundation Raspberry Pi 5 Model B/Raspberry Pi 5 Model B, BIOS v0.2 01/05/2024
[    1.861421] pstate: 60401009 (nZCv daif +PAN -UAO -TCO -DIT +SSBS BTYPE=--)
[    1.861423] pc : dma_alloc_from_pool+0x114/0x1ac
[    1.861425] lr : dma_alloc_from_pool+0x114/0x1ac
[    1.861427] sp : ffffc00008043940
[    1.861427] x29: ffffc00008043940 x28: ffffc00008314000 x27: ffffc00008043a10
[    1.861429] x26: ffffe1e18e14e000 x25: ffffe1e18d03dccc x24: ffffe1e18e963000
[    1.861432] x23: ffffff8000000000 x22: ffffe1e18e14eb90 x21: 0000000000004000
[    1.861433] x20: 00000000e8100000 x19: ffff8f368078cb00 x18: ffffffffffffffff
[    1.861436] x17: 00000000b1986ad8 x16: 00000000b53bfc67 x15: ffffc000080438b0
[    1.861437] x14: 0000000000000000 x13: 20726f66206c6f6f x12: 7020656c62617469
[    1.861440] x11: fffffffffffe0000 x10: 000000000000000a x9 : ffffe1e18d012df0
[    1.861441] x8 : 000000000000000a x7 : 00000000ffffffff x6 : 00000000fffff1f5
[    1.861443] x5 : 00000000fffff1f5 x4 : ffffc00008043730 x3 : 0000000000000000
[    1.861445] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff8f3680280000
[    1.861447] Call trace:
[    1.861447]  dma_alloc_from_pool+0x114/0x1ac
[    1.861449]  dma_direct_alloc+0x9c/0x340
[    1.861451]  dma_alloc_attrs+0x88/0xf0
[    1.861452]  rpi_firmware_property_list+0x70/0x264
[    1.861455]  rpi_firmware_property+0x78/0x11c
[    1.861458]  rpi_rtc_probe+0x184/0x260
[    1.861460]  platform_probe+0x70/0xc8
[    1.861463]  really_probe+0xc4/0x2e0
[    1.861465]  __driver_probe_device+0x80/0x120
[    1.861467]  driver_probe_device+0x44/0x16c
[    1.861469]  __driver_attach+0x9c/0x1b8
[    1.861472]  bus_for_each_dev+0x7c/0xe0
[    1.861473]  driver_attach+0x2c/0x38
[    1.861475]  bus_add_driver+0x15c/0x20c
[    1.861477]  driver_register+0x80/0x140
[    1.861479]  __platform_driver_register+0x30/0x3c
[    1.861482]  rpi_rtc_driver_init+0x24/0x30
[    1.861485]  do_one_initcall+0x60/0x310
[    1.861487]  kernel_init_freeable+0x234/0x2a0
[    1.861489]  kernel_init+0x2c/0x140
[    1.861491]  ret_from_fork+0x10/0x20
[    1.861493] ---[ end trace 0000000000000000 ]---
[    1.861495] rpi-rtc soc:rpi_rtc: failed to set trickle charge voltage to 0uV: -12
[    1.861497] ------------[ cut here ]------------
[    1.861498] Failed to get suitable pool for soc:firmware
[    1.861500] WARNING: CPU: 3 PID: 1 at kernel/dma/pool.c:279 dma_alloc_from_pool+0x114/0x1ac
[    1.861503] Modules linked in:
[    1.861503] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G        W          6.1.73-rt22-ovos-buildroot

The issue seems to be related to DMA allocation failures.

  1. Kernel Boot Stuck with console=console flag in grub.cfg:
    The kernel can get stuck during boot if the console=console flag is set in grub.cfg. This issue needs further investigation to determine the cause and find a solution.

3. Service Failures during Boot: (resolved by a424e64)

  • ovos-zram service fails to start.
  • connectivity-check service fails during boot.
    These service failures need to be analyzed and resolved to ensure smooth system initialization.
  1. Audio HAT WM8960 Initialization Issue:
    The Audio HAT WM8960 does not initialize properly. This issue might be related to driver compatibility (???) or configuration settings in Buildroot for Raspberry Pi 5.

  2. USB SDD disconnects randomly:

[ 2025.215737] EXT4-fs error (device sda5): ext4_journal_check_start:83: comm podman: Detected aborted journal
[ 2025.215789] EXT4-fs (sda5): Remounting filesystem read-only
[ 2025.219207] EXT4-fs error (device sda5) in ext4_reserve_inode_write:5868: Journal has aborted
[ 2025.219226] EXT4-fs error (device sda5): ext4_dirty_inode:6072: inode #189934: comm podman: mark_inode_dirty error
[ 2025.293872] EXT4-fs error (device sda5): __ext4_find_entry:1682: inode #130817: comm sh: reading directory 
[ 2025.587455] EXT4-fs error (device sda5): __ext4_find_entry:1682: inode #130817: comm systemd: reading directory lblock 0
[ 2025.595454] EXT4-fs error (device sda4): __ext4_find_entry:1682: inode #33337: comm systemd: reading directory lblock 0
  1. raspi-gpio is not supported on Pi 5:
    @j1nx what do you think about replacing raspi-gpio with adafruit-blinka with libgpiod (need to add/update package)
    currently, we have only one script - xvf3510-flash which depends from raspi-gpio

@BohdanBuinich BohdanBuinich marked this pull request as draft January 28, 2024 02:46
@goldyfruit goldyfruit added the enhancement New feature or request label Jan 28, 2024
Copy link
Member

@j1nx j1nx left a comment

Choose a reason for hiding this comment

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

If this get you a somewhat working version for the rpi5, I have no problems in merging this and tackle the issues when the solution become available.

There is still A LOT of work going on over at the kernel development, so it will only get better over time.

@@ -1 +1 @@
cma=384M mitigations=off snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0 dwc_otg.lpm_enable=0 acpi=off cgroup_enable=memory psi=1 usb-storage.quirks=174c:55aa:u,2109:0715:u,152d:0578:u,152d:0579:u,152d:1561:u,174c:0829:u,14b0:0206:u
mitigations=off snd_bcm2835.enable_headphones=1 snd_bcm2835.enable_hdmi=1 snd_bcm2835.enable_compat_alsa=0 dwc_otg.lpm_enable=0 acpi=off cgroup_enable=memory psi=1 usb-storage.quirks=174c:55aa:u,2109:0715:u,152d:0578:u,152d:0579:u,152d:1561:u,174c:0829:u,14b0:0206:u,0bda:9210:u
Copy link
Member

Choose a reason for hiding this comment

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

Out of interest, which USB device did you added here to the quircks list?

Copy link
Contributor Author

@BohdanBuinich BohdanBuinich Feb 3, 2024

Choose a reason for hiding this comment

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

it is Ugreen ssd M.2 case

https://eu.ugreen.com/products/ugreen-m2-nvme-10-gbps-ssd-enclosure?variant=40296225636435

going to remove it from here, I think it is not needed

buildroot-external/board/ovos/raspberrypi/rpi3/config.txt Outdated Show resolved Hide resolved
buildroot-external/package/rpi-eeprom/rpi-eeprom.mk Outdated Show resolved Hide resolved
@BohdanBuinich
Copy link
Contributor Author

If this get you a somewhat working version for the rpi5, I have no problems in merging this and tackle the issues when the solution become available.

There is still A LOT of work going on over at the kernel development, so it will only get better over time.

I'm going to make small PRs common issues so that this PR is clearly related only to RPI 5 support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants