Skip to contentSkip to conversation

arm64: dts: amlogic: meson-s4: Set stdout-path to uart_b

PATCH New Sean Anderson 1 participant 1 message Sep 29

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: amlogic: meson-s4: Set stdout-path to uart_b

If stdout-path is not set then bootloaders such as U-Boot may fail to boot when they cannot find the serial console. Normally, this would be added to the board devicetree, but in this case the boot ROM, first-stage bootloader, ATF, and TEE all use this serial port with this baud rate [1]. All of the listed components are signed by Amlogic and can't be modified by OEMs. So while someone might want to use a different port, they can't prevent previous stages of the boot process from printing to this port. Therefore, set the serial port in the SoC devicetree. Boards can override it in their devicetree if necessary.

[1] Actually, the baud rate used by the ROM et al. is 888888, but some userspace tools (such as agetty) choke on non-standard baud rates, so we use 921600 which is close enough for most serial adapters.

---

 arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts    | 8 --------
 .../boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts    | 5 -----
 arch/arm64/boot/dts/amlogic/meson-s4.dtsi                | 9 ++++++++-
 3 files changed, 8 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/amlogic/meson-s4-s805x2-aq222.dts +0 -8
index 0a3f81ea0fb0a..15bf143317a2d 100644
@@ -14,10 +14,6 @@ / {
 	#address-cells = <2>;
 	#size-cells = <2>;
 
-	aliases {
-		serial0 = &uart_b;
-	};
-
 	memory@0 {
 		device_type = "memory";
 		reg = <0x0 0x0 0x0 0x40000000>;
@@ -141,10 +137,6 @@ &pwm_ij {
 	status = "okay";
 };
 
-&uart_b {
-	status = "okay";
-};
-
 &ir {
 	status = "okay";
 	pinctrl-0 = <&remote_pins>;
arch/arm64/boot/dts/amlogic/meson-s4-s905y4-khadas-vim1s.dts +0 -5
index 99d5df71b9cd4..c602091bca0a6 100644
@@ -22,7 +22,6 @@ aliases {
 		mmc2 = &sdio; /* SDIO */
 		rtc0 = &rtc;
 		rtc1 = &vrtc;
-		serial0 = &uart_b;
 	};
 
 	memory@0 {
@@ -334,7 +333,3 @@ bluetooth {
 		clock-names = "lpo";
 	};
 };
-
-&uart_b {
-	status = "okay";
-};
arch/arm64/boot/dts/amlogic/meson-s4.dtsi +8 -1
index 2a6fbd5308362..3e432e232a76a 100644
@@ -13,6 +13,14 @@
 #include <dt-bindings/reset/amlogic,meson-s4-reset.h>
 
 / {
+	aliases {
+		serial0 = &uart_b;
+	};
+
+	chosen {
+		stdout-path = "serial0:921600n8";
+	};
+
 	cpus {
 		#address-cells = <2>;
 		#size-cells = <0>;
@@ -794,7 +802,6 @@ uart_b: serial@7a000 {
 				interrupts = <GIC_SPI 169 IRQ_TYPE_EDGE_RISING>;
 				clocks = <&xtal>, <&clkc_periphs CLKID_UART_B>, <&xtal>;
 				clock-names = "xtal", "pclk", "baud";
-				status = "disabled";
 			};
 
 			reset: reset-controller@2000 {

---
base-commit: 6f8319e3e9a44dd537d17f41565a8453c560a581
branch: s4_stdout

Signature · 1 line
2.53.0