* Garbage UART output on RPI 4 with upstream kernel DTB
@ 2019-12-20 13:58 Stefan Wahren
2019-12-23 18:51 ` Stefan Wahren
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2019-12-20 13:58 UTC (permalink / raw)
To: u-boot
Hi,
i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
garbage on the debug UART (pin 14 & 15). Using the DTB from the
downstream kernel has a proper UART output. The config.txt contains
debug_uart=1
I compared both and identified an offending Linux commit:
ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
Best regards
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-20 13:58 Garbage UART output on RPI 4 with upstream kernel DTB Stefan Wahren
@ 2019-12-23 18:51 ` Stefan Wahren
2019-12-23 20:20 ` Matthias Brugger
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2019-12-23 18:51 UTC (permalink / raw)
To: u-boot
Am 20.12.19 um 14:58 schrieb Stefan Wahren:
> Hi,
>
> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
> garbage on the debug UART (pin 14 & 15). Using the DTB from the
> downstream kernel has a proper UART output. The config.txt contains
> debug_uart=1
>
> I compared both and identified an offending Linux commit:
> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>
> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
After hours of playing with the DTB, i finally found the reason why the
upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
compiled with flag "-@".
It isn't clear to me, why this is necessary but it would be nice to make
U-Boot work without this.
Regards
Stefan
>
> Best regards
> Stefan
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-23 18:51 ` Stefan Wahren
@ 2019-12-23 20:20 ` Matthias Brugger
2019-12-24 11:56 ` Stefan Wahren
0 siblings, 1 reply; 7+ messages in thread
From: Matthias Brugger @ 2019-12-23 20:20 UTC (permalink / raw)
To: u-boot
Hi Stefan,
On 23/12/2019 19:51, Stefan Wahren wrote:
> Am 20.12.19 um 14:58 schrieb Stefan Wahren:
>> Hi,
>>
>> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
>> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
>> garbage on the debug UART (pin 14 & 15). Using the DTB from the
>> downstream kernel has a proper UART output. The config.txt contains
>> debug_uart=1
>>
>> I compared both and identified an offending Linux commit:
>> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>>
>> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
>
> After hours of playing with the DTB, i finally found the reason why the
> upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
> compiled with flag "-@".
>
> It isn't clear to me, why this is necessary but it would be nice to make
> U-Boot work without this.
>
Can you provide the exact command you are using?
Regards,
Matthias
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-23 20:20 ` Matthias Brugger
@ 2019-12-24 11:56 ` Stefan Wahren
2019-12-24 12:38 ` Matthias Brugger
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2019-12-24 11:56 UTC (permalink / raw)
To: u-boot
Hi Matthias,
Am 23.12.19 um 21:20 schrieb Matthias Brugger:
> Hi Stefan,
>
> On 23/12/2019 19:51, Stefan Wahren wrote:
>> Am 20.12.19 um 14:58 schrieb Stefan Wahren:
>>> Hi,
>>>
>>> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
>>> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
>>> garbage on the debug UART (pin 14 & 15). Using the DTB from the
>>> downstream kernel has a proper UART output. The config.txt contains
>>> debug_uart=1
>>>
>>> I compared both and identified an offending Linux commit:
>>> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>>>
>>> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
>> After hours of playing with the DTB, i finally found the reason why the
>> upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
>> compiled with flag "-@".
>>
>> It isn't clear to me, why this is necessary but it would be nice to make
>> U-Boot work without this.
>>
> Can you provide the exact command you are using?
i didn't call dtc directly via command line. I just added this Makefile
hack [1] to the Linux upstream tree. This will add a __symbols__ section
to the DTB which is required for overlays. You can verify this with dtdiff.
Since the upstream kernel boots without the __symbols__ section, i think
this garbage output issue could be fixed in u-boot.
Regards
Stefan
[1] -
https://github.com/raspberrypi/linux/blob/b85f76a63d5f1b13220c61244469d55487db84f1/arch/arm/boot/dts/Makefile#L1231
>
> Regards,
> Matthias
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-24 11:56 ` Stefan Wahren
@ 2019-12-24 12:38 ` Matthias Brugger
2019-12-25 13:55 ` Stefan Wahren
0 siblings, 1 reply; 7+ messages in thread
From: Matthias Brugger @ 2019-12-24 12:38 UTC (permalink / raw)
To: u-boot
On 24/12/2019 12:56, Stefan Wahren wrote:
> Hi Matthias,
>
> Am 23.12.19 um 21:20 schrieb Matthias Brugger:
>> Hi Stefan,
>>
>> On 23/12/2019 19:51, Stefan Wahren wrote:
>>> Am 20.12.19 um 14:58 schrieb Stefan Wahren:
>>>> Hi,
>>>>
>>>> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
>>>> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
>>>> garbage on the debug UART (pin 14 & 15). Using the DTB from the
>>>> downstream kernel has a proper UART output. The config.txt contains
>>>> debug_uart=1
>>>>
>>>> I compared both and identified an offending Linux commit:
>>>> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>>>>
>>>> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
>>> After hours of playing with the DTB, i finally found the reason why the
>>> upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
>>> compiled with flag "-@".
>>>
>>> It isn't clear to me, why this is necessary but it would be nice to make
>>> U-Boot work without this.
>>>
>> Can you provide the exact command you are using?
>
> i didn't call dtc directly via command line. I just added this Makefile
> hack [1] to the Linux upstream tree. This will add a __symbols__ section
> to the DTB which is required for overlays. You can verify this with dtdiff.
>
> Since the upstream kernel boots without the __symbols__ section, i think
> this garbage output issue could be fixed in u-boot.
>
Little by little I grasp what you are doing. So you compile the DTB in the
kernel, then pass the blob to u-boot and add it with OF_EMBED? Is that correct?
Regards,
Matthias
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-24 12:38 ` Matthias Brugger
@ 2019-12-25 13:55 ` Stefan Wahren
2020-01-13 12:45 ` Matthias Brugger
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Wahren @ 2019-12-25 13:55 UTC (permalink / raw)
To: u-boot
Am 24.12.19 um 13:38 schrieb Matthias Brugger:
>
> On 24/12/2019 12:56, Stefan Wahren wrote:
>> Hi Matthias,
>>
>> Am 23.12.19 um 21:20 schrieb Matthias Brugger:
>>> Hi Stefan,
>>>
>>> On 23/12/2019 19:51, Stefan Wahren wrote:
>>>> Am 20.12.19 um 14:58 schrieb Stefan Wahren:
>>>>> Hi,
>>>>>
>>>>> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
>>>>> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
>>>>> garbage on the debug UART (pin 14 & 15). Using the DTB from the
>>>>> downstream kernel has a proper UART output. The config.txt contains
>>>>> debug_uart=1
>>>>>
>>>>> I compared both and identified an offending Linux commit:
>>>>> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>>>>>
>>>>> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
>>>> After hours of playing with the DTB, i finally found the reason why the
>>>> upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
>>>> compiled with flag "-@".
>>>>
>>>> It isn't clear to me, why this is necessary but it would be nice to make
>>>> U-Boot work without this.
>>>>
>>> Can you provide the exact command you are using?
>> i didn't call dtc directly via command line. I just added this Makefile
>> hack [1] to the Linux upstream tree. This will add a __symbols__ section
>> to the DTB which is required for overlays. You can verify this with dtdiff.
>>
>> Since the upstream kernel boots without the __symbols__ section, i think
>> this garbage output issue could be fixed in u-boot.
>>
> Little by little I grasp what you are doing. So you compile the DTB in the
> kernel, then pass the blob to u-boot and add it with OF_EMBED? Is that correct?
I use a recent Raspbian image, replace the bcm2711 DTB with the upstream
kernel ones (yes build with make dtbs) and kernel7.img with u-boot.bin
(renamed all the other kernel binaries to make sure kernel7.img is
really used). Also use a boot.scr from here, but not sure this have an
influence [1]. I used the rpi_4_32b_defconfig without any modifications
like OF_EMBED. I assume u-boot uses the FDT image passed by the
Raspberry Pi bootloader.
[1] - https://andrei.gherzan.ro/linux/uboot-on-rpi/
>
> Regards,
> Matthias
^ permalink raw reply [flat|nested] 7+ messages in thread
* Garbage UART output on RPI 4 with upstream kernel DTB
2019-12-25 13:55 ` Stefan Wahren
@ 2020-01-13 12:45 ` Matthias Brugger
0 siblings, 0 replies; 7+ messages in thread
From: Matthias Brugger @ 2020-01-13 12:45 UTC (permalink / raw)
To: u-boot
Hi Stefan,
sorry for the delay, answers inside.
On 25/12/2019 14:55, Stefan Wahren wrote:
> Am 24.12.19 um 13:38 schrieb Matthias Brugger:
>>
>> On 24/12/2019 12:56, Stefan Wahren wrote:
>>> Hi Matthias,
>>>
>>> Am 23.12.19 um 21:20 schrieb Matthias Brugger:
>>>> Hi Stefan,
>>>>
>>>> On 23/12/2019 19:51, Stefan Wahren wrote:
>>>>> Am 20.12.19 um 14:58 schrieb Stefan Wahren:
>>>>>> Hi,
>>>>>>
>>>>>> i tried to run current U-Boot (rpi_4_32b_defconfig) on my RPi 4 with
>>>>>> bcm2711-rpi-4-b.dtb from the upstream kernel. Unfortunately i only see
>>>>>> garbage on the debug UART (pin 14 & 15). Using the DTB from the
>>>>>> downstream kernel has a proper UART output. The config.txt contains
>>>>>> debug_uart=1
>>>>>>
>>>>>> I compared both and identified an offending Linux commit:
>>>>>> ARM: dts: bcm283x: Remove brcm,bcm2835-pl011 compatible
>>>>>>
>>>>>> Unfortunately reverting this patch still doesn't fix the issue. Any ideas?
>>>>> After hours of playing with the DTB, i finally found the reason why the
>>>>> upstream kernel DTB doesn't work with U-Boot on RPI 4. The DTS must be
>>>>> compiled with flag "-@".
>>>>>
>>>>> It isn't clear to me, why this is necessary but it would be nice to make
>>>>> U-Boot work without this.
>>>>>
>>>> Can you provide the exact command you are using?
>>> i didn't call dtc directly via command line. I just added this Makefile
>>> hack [1] to the Linux upstream tree. This will add a __symbols__ section
>>> to the DTB which is required for overlays. You can verify this with dtdiff.
>>>
>>> Since the upstream kernel boots without the __symbols__ section, i think
>>> this garbage output issue could be fixed in u-boot.
>>>
>> Little by little I grasp what you are doing. So you compile the DTB in the
>> kernel, then pass the blob to u-boot and add it with OF_EMBED? Is that correct?
>
> I use a recent Raspbian image, replace the bcm2711 DTB with the upstream
> kernel ones (yes build with make dtbs) and kernel7.img with u-boot.bin
> (renamed all the other kernel binaries to make sure kernel7.img is
> really used). Also use a boot.scr from here, but not sure this have an
> influence [1]. I used the rpi_4_32b_defconfig without any modifications
> like OF_EMBED. I assume u-boot uses the FDT image passed by the
> Raspberry Pi bootloader.
Yes exactly, FDT image is taken from the bootloader.
Can you please double check your config.txt especially the force_turbo and
initial_trubo options.
I can see garbage on the serial console when the initial_turbo time is over
(when setting force_turbo=0).
If I set force_turbo=1 I don't observe this behavior.
Regards,
Matthias
>
> [1] - https://andrei.gherzan.ro/linux/uboot-on-rpi/
>
>>
>> Regards,
>> Matthias
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-01-13 12:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-20 13:58 Garbage UART output on RPI 4 with upstream kernel DTB Stefan Wahren
2019-12-23 18:51 ` Stefan Wahren
2019-12-23 20:20 ` Matthias Brugger
2019-12-24 11:56 ` Stefan Wahren
2019-12-24 12:38 ` Matthias Brugger
2019-12-25 13:55 ` Stefan Wahren
2020-01-13 12:45 ` Matthias Brugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox