2023-07-16 17:03:46

by Pali Rohár

[permalink] [raw]
Subject: Backporting commits for generating rpi dtb symbols to stable

Hello,

I see that raspberry pi bootloader throws ton of warnings when supplied
DTB file does not contain /__symbols__/ node.

On RPI 1B rev1 it looks like this:

dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found
dterror: no symbols found

Bootloader also propagates these warnings to kernel via dtb property
chosen/user-warnings and they can be read by simple command:

$ cat /sys/firmware/devicetree/base/chosen/user-warnings
...

Upstream Linux kernel build process by default does not generate
/__symbols__/ node for DTB files, but DTB files provided by raspberrypi
foundation have them for a longer time.

I wanted to look at this issue, but I figured out that it is already
solved by just recent Aurelien's patches:

e925743edc0d ("arm: dts: bcm: Enable device-tree overlay support for RPi devices")
3cdba279c5e9 ("arm64: dts: broadcom: Enable device-tree overlay support for RPi devices")

My testing showed that /__symbols__/ node is required by rpi bootloader
for overlay support even when overlayed DTB file does not use any DTB
symbol (and reference everything via full node path). So seems that
/__symbols__/ node is crucial for rpi bootloader even when symbols from
them are not used at all.

So I would like to ask, would you consider backporting these two
raspberry pi specific patches to stable kernel trees? Upstream kernel
would get rid of those bootloader warnings and also allow users to use
overlayed dtbs...

(Btw, do you know if raspberry pi foundation or broadcom provides source
code of that bootloader? It would be interesting to understand it or
maybe also fix it...)


2023-07-16 21:39:38

by Aurelien Jarno

[permalink] [raw]
Subject: Re: Backporting commits for generating rpi dtb symbols to stable

Hi,

On 2023-07-16 18:24, Pali Rohár wrote:
> Hello,
>
> I see that raspberry pi bootloader throws ton of warnings when supplied
> DTB file does not contain /__symbols__/ node.
>
> On RPI 1B rev1 it looks like this:
>
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found
> dterror: no symbols found

Do you have those errors with the default configuration? On a RPI 4,
this only happens when setting uart_2ndstage to 1 in config.txt.
According to the documentation, this option enables diagnostic
information from the main firmware.

Unless this is different on RPI 1B, this means we are talking about a
warning that happens when enabling diagnostic information, so I am not
sure it warrants a change to stable kernels.

Regards
Aurelien

--
Aurelien Jarno GPG: 4096R/1DDD8C9B
[email protected] http://aurel32.net

2023-07-16 21:54:07

by Pali Rohár

[permalink] [raw]
Subject: Re: Backporting commits for generating rpi dtb symbols to stable

On Sunday 16 July 2023 21:47:54 Aurelien Jarno wrote:
> Hi,
>
> On 2023-07-16 18:24, Pali Rohár wrote:
> > Hello,
> >
> > I see that raspberry pi bootloader throws ton of warnings when supplied
> > DTB file does not contain /__symbols__/ node.
> >
> > On RPI 1B rev1 it looks like this:
> >
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
> > dterror: no symbols found
>
> Do you have those errors with the default configuration? On a RPI 4,
> this only happens when setting uart_2ndstage to 1 in config.txt.
> According to the documentation, this option enables diagnostic
> information from the main firmware.

Yes, I have it with default configuration. And I really do not know why
it is happening, I just described observations and that dtc -@ fixes
this issue. Note that this is about 1b rev1 (the first revision); so the
older HW, so maybe this can be a reason?

> Unless this is different on RPI 1B, this means we are talking about a
> warning that happens when enabling diagnostic information, so I am not
> sure it warrants a change to stable kernels.

Well, that is why I asked, if it is something for stable or not.

> Regards
> Aurelien
>
> --
> Aurelien Jarno GPG: 4096R/1DDD8C9B
> [email protected] http://aurel32.net