Thursday, March 31, 2022

[fedora-arm] Re: Change in kernel PPS GPIO handling?

Hi Peter,

Am 31.03.22 um 15:19 schrieb Peter Robinson:
> Hi Stefan,
>>>> At least the 32 bit issues on Raspberry Pi 4 are expected since the
>>>> kernel config doesn't have ARM_LPAE enabled.
>>> Okay, here is the explanation for the different behavior on Raspberry Pi
>>> 400 and Raspberry Pi 4 B. The Raspberry Pi 400 has a newer BCM2711 SoC
>>> (Stepping C0), which have less DMA restrictions for the emmc2 interface
>>> (responsible for SD card access). For the Raspberry Pi 4 B there are
>>> older boards which have Stepping B0 and all the new boards should have
>>> Stepping C0 [1].
>>> Unfortunately there is no 100% reliable way to detect the stepping from
>>> the kernel side. So currently the Raspberry Pi firmware patches the
>>> dma-ranges in the firmware DT [2]. So in case U-Boot [3] or another
>>> bootloader ignores this firmware DT and read a fresh DTB the right
>>> dma-ranges get lost. Finally this results in unexpected behavior as soon
>>> the emmc2 switches to DMA mode [4].
>> Okay, at least i found a fix [1] for the 64 bit boot issues (Original
>> Fedora 35, Linux 5.14) with RPi 400/RPi 4 Stepping C0. This requires the
>> DTB files to be updated and U-Boot to choose between the B0 and the C0
>> variant of the Rpi 4 DTB file.
> Thanks for the update on this, great news. In the case of the RPi-400
> are they all the C0 stepping? I don't see the 400 in your patch.

Yes, please look at [1]

The patch changes makes bcm2711.dtsi default to C0. So all including RPi
4 boards (RPi 4, CM4, RPi 400) will be affected and all new boards don't
need to care about it.

> Is there a documented way of detecting the stepping that can be used
> in U-Boot I can use to create a patch there, or did you have a test
> patch for this?
I searched in the Raspberry Pi forum and there was the statement that
there is no direct (official) way to detect the SoC stepping. A
possibility might be to detect the DMA range provided by the firmware
FDT (U-Boot has dev_get_dma_range() for this) and based on the value
decide which DTB should be loaded (bcm2711-rpi-4-b.dtb for C0 and
bcm2711-rpi-4-b-b0.dtb for B0).
> Do you plan to send this patch upstream, if so feel free to add me to
> the cc and in the mean time I'll test it.

Yes. I didn't send it yet, because the merge window is currently open
and i want to rebase it on 5.18-rc1. The patch itself is a little bit
controversial (fix which introduce new file and change behavior).

Best regards

>> Unfortunately this doesn't fix the SD card issues on 32 bit.
> That's less of a problem, Fedora 36 will be the last version of Fedora
> to support 32 bit and I've always suggested people run 64 bit Fedora
> on their RPi4 and most people do tend to do that.
> Thanks,
> Peter
[1] -
arm mailing list --
To unsubscribe send an email to
Fedora Code of Conduct:
List Guidelines:
List Archives:
Do not reply to spam on the list, report it:

No comments:

Post a Comment