tizen: rpi: add support for RPi5 console 71/307171/2 accepted/tizen/unified/20240315.111201 accepted/tizen/unified/20240315.155124 accepted/tizen/unified/x/20240319.055506
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 5 Mar 2024 13:56:21 +0000 (14:56 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 14 Mar 2024 08:31:57 +0000 (09:31 +0100)
RPi5 board uses different drivers for the serial console than RPi4, so
the kernel's console parameter has to be adjusted depending on the
detected board and its configuration.

On RPi5 there are 2 serial ports available for debug messages:

1. Dedicated debug UART port. Used by firmware and u-boot
unconditionally. It is instantiated as /dev/ttyAMA10. By default it is
also used for kernel's earlycon and serial console.

2. Standard UART available on GPIO14 & GPIO15 lines (pins 8 & 10 on the
40-pin header, like on the RPi4). This can be enabled by adding
"dtoverlay=uart0-pi5" line to "config.txt" on "boot" partition. It is
instantiated as /dev/ttyAMA0. It can be used only for the standard Linux
kernel console and serial login.

Change-Id: I34aa978148fb593f5f88d3ed6471c8c3c7a74a38
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
tizen/bootscript/tizen-boot-rpi4.scr

index eb9d000..d2bb38b 100644 (file)
@@ -85,7 +85,17 @@ fi
 
 # setting console device if noting is set
 if test -z "${console}"; then;
-       setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0xfe215040"
+       if test "$board_name" = "5 Model B"; then;
+               fdt addr $fdt_addr;
+               fdt get value uart "/axi/pcie@120000/rp1/serial@30000" status;
+               if test "$uart" = "okay"; then;
+                       setenv console "console=ttyAMA0,115200n8";
+               else
+                       setenv console "console=ttyAMA10,115200n8 earlycon";
+               fi
+       else
+               setenv console "console=ttyS0,115200n8 earlycon=uart8250,mmio32,0xfe215040";
+       fi
 fi
 echo "console: ${console}"