#976122 u-boot-rpi: Fails with mini-UART

#976122#5
Date:
2020-11-30 02:07:26 UTC
From:
To:
Appears "standard" device trees for the Raspberry PI 4B connect the
serial pins to the mini-UART.  This is troublesome due to the mini-UART's
baud rate changing when the processor clock changes.

Often Raspberry PI devices have an initial boot phase where the
processor clock is locked at maximum for a period, and then decreased.
If/when that decrease occurs, the baud rate changes and suddenly serial
communication becomes corrupt.

3 strategies come to mind for U-Boot:

1>  Dynamically modify the baud rate register as the processor clock
changes.  If the processor clock is increased, decrease the baud rate
register.  If the processor clock is decreased, increase the baud rate
register.
2>  Peg the processor clock at maximum until EFI boot mode is exited.
3>  Peg the processor clock at minimum until EFI boot mode is exited.

The first is ideal, but requires U-Boot to monitor the processor clock
as it changes dynamically.  The next two are suboptimal, but not too
likely to cause problems.

The likely cause for a bootloader (GRUB) to remain active is user
interaction via the serial port.  In this case a stable baud rate is
crucial.  GRUB is likely to issue halt instructions while waiting and
this should keep processor temperature down.  As such I feel pegging the
processor clock to max is better than pegging to minimum.  Once an OS
takes over, EFI boot services should be exited and then it is no longer
a U-Boot issue.

#976122#10
Date:
2021-05-27 00:17:14 UTC
From:
To:
I found using the dtbs from the upstream firmware appears to work:
http://github.com/raspberrypi/firmware/archive/1.20200902.tar.gz

I then have u-boot use the kernel package's dtbs for when it boots the
kernel.