* [PATCH] u-boot: Fix serial console on Raspberry Pi 4
@ 2026-11-13 0:14 Antonio Quartulli
0 siblings, 0 replies; only message in thread
From: Antonio Quartulli @ 2026-11-13 0:14 UTC (permalink / raw)
To: development; +Cc: Antonio Quartulli
boot.cmd only selects the mini UART (ttyS1) for the Pi 3B/3B+ dtbs and
falls back to ttyAMA0 on every other Pi. On boards with Bluetooth
(4B, 400, 3A+, Zero 2 W) ttyAMA0 is the PL011 wired to the BT module, so
the kernel console disappears after "Starting kernel ...".
Pick the console from the stdout-path of the dtb being booted instead:
serial1 is the mini UART on the pin header (ttyS1), serial0 the PL011.
Fixes: #13052
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
Notes:
- The core update needs to ship /boot/boot.cmd and the regenerated
/boot/boot.scr (built from boot.cmd by lfs/u-boot). I didn't touch
the filelists.
config/u-boot/boot.cmd | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/config/u-boot/boot.cmd b/config/u-boot/boot.cmd
index 929d30862..924e34d01 100644
--- a/config/u-boot/boot.cmd
+++ b/config/u-boot/boot.cmd
@@ -48,19 +48,22 @@ if test "${board}" = "sunxi"; then
fi;
fi;
+fatload ${boot_dev} ${boot_part} ${fdt_addr_r} dtb-${KVER}/${fdtfile};
+
# Check if serial console is enabled
if test "${SERIAL-CONSOLE}" = "ON"; then
if test ${console} = ""; then
if test "${board}" = "rpi"; then
if test ${cpu} = "armv8"; then
- if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b-plus.dtb"; then
+ # Use the UART the device tree routes to the pin header:
+ # serial1 is the mini UART (ttyS1), serial0 the PL011 (ttyAMA0)
+ setenv stdout_path;
+ fdt addr ${fdt_addr_r};
+ fdt get value stdout_path /chosen stdout-path;
+ if test "${stdout_path}" = "serial1:115200n8"; then
setenv console ttyS1,115200n8;
else
- if test "${fdtfile}" = "broadcom/bcm2837-rpi-3-b.dtb"; then
- setenv console ttyS1,115200n8;
- else
- setenv console ttyAMA0,115200n8;
- fi;
+ setenv console ttyAMA0,115200n8;
fi;
fi;
else
@@ -79,7 +82,6 @@ if test ${fdt_high} = ""; then
fi;
fatload ${boot_dev} ${boot_part} ${kernel_addr_r} vmlinuz-${KVER};
-fatload ${boot_dev} ${boot_part} ${fdt_addr_r} dtb-${KVER}/${fdtfile};
if test "${FDTCMDS}" = ""; then
echo ;
--
2.56.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-13 0:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 0:14 [PATCH] u-boot: Fix serial console on Raspberry Pi 4 Antonio Quartulli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox