Rpi4 and dtb files

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

Rpi4 and dtb files

Postby quark » Sun Dec 12, 2021 2:43 pm

I'm trying to add some overlays that I need and while trying to figure out how to do it I noticed that there's two different bcm2711-rpi-4-b.dtb files in /boot, and both seem to be required.

Seems uboot first reads the one in /boot then loads the one in /boot/dtbs/broadcom/. Also when I update the kernel only the one in /boot/dtbs/broadcom gets updated.
Do they both need to be the same? Should I copy the one in "broadcom" directory over the one in /boot ?
If the one in /boot is missing then uboot completely fails to start. If the one in /boot/dtbs/broadcom is missing then uboot fails to boot Pi and complains about missing /boot/dtbs/broadcom/bcm2711-rpi-4-b.dtb file.

If I put the one in the "broadcom" folder in the /boot folder the system starts ok. If I put the one in /boot in place of the one in broadcom directory then uboot fails to load the kernel, and that makes sense since the one in "broadcom" is created at the same time as the kernel.
So what is the purpose of the one in /boot, is it just to give uboot some info about the system? Would it be ok to replace it constantly with the ones generated by compiling the kernel?
quark
 
Posts: 60
Joined: Thu Nov 25, 2021 8:26 am

Re: Rpi4 and dtb files

Postby quark » Sun Dec 12, 2021 3:20 pm

When uboot starts with the original /boot file the startup info looks like this:
$this->bbcode_second_pass_code('', 'U-Boot 2021.04-1 (May 27 2021 - 18:44:02 +0000) Arch Linux ARM

DRAM: 1.9 GiB
RPI 4 Model B (0xb03111)
MMC: mmc@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
PCIe BRCM: link down
starting USB...
No working controllers found
Hit any key to stop autoboot: 0')

When I replace the /boot file with the one in the broadcom directory it looks like this:

$this->bbcode_second_pass_code('', 'U-Boot 2021.04-1 (May 27 2021 - 18:44:02 +0p00) Arch Linux ARM

DRAM: 1.9 GiB
RPI 4 Model B (0xb03111)
MMC: mmc@7e300000: 0, mmc@7e340000: 1
Loading Environment from FAT... Card did not respond to voltage select! : -110
In: serial
Out: serial
Err: serial
Net: No ethernet found.
PCIe BRCM: link down
starting USB...
Bus usb@7e980000: USB DWC2
scanning bus usb@7e980000 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0')

So uboot gets updated info for the system from the one in the broadcom directory. It sees the USB 2 bus from bcm2711. This with a stock config.txt file.
Decompiling both of these dtb files shows that the stock one from /boot has more info, but the newer one from broadcom directory makes uboot see the USB bus at startup.
I'm also trying to install two simple i2s driver overlays, and I want to know if that's possible at this point. Some i2s stuff is missing from the one generated by the kernel compilation process, but it seems that one is the most accurate one from the two.
I was curious, is there any chance we the users can modify the dtb file generated by the kernel compilation such that uboot doesn't error out when trying to load the dtbo overlays?
For me this might decide if stay with the 64bit raspbian or keep messing with 64bit arch trying to load the i2s drivers.
quark
 
Posts: 60
Joined: Thu Nov 25, 2021 8:26 am

Re: Rpi4 and dtb files

Postby quark » Tue Dec 14, 2021 12:09 am

So, is i2s working on aarch64 Archlinux ARM? Anyone got it working?
quark
 
Posts: 60
Joined: Thu Nov 25, 2021 8:26 am


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 13 guests