diff mbox series

Help: try to set uart3 as uboot console, but fail

Message ID OS0P286MB0641F06A210E69535C495395CDF92@OS0P286MB0641.JPNP286.PROD.OUTLOOK.COM (mailing list archive)
State New
Headers show
Series Help: try to set uart3 as uboot console, but fail | expand

Commit Message

张 宁 June 5, 2024, 12:52 p.m. UTC
Hi,

I try to set uart3 as uboot's console, but fail.
below is my patch, could you help to check where is missing?



----
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/rk3288/rk3288.c b/arch/arm/mach-rockchip/rk3288/rk3288.c
index 70cf5002..19d33196 100644
--- a/arch/arm/mach-rockchip/rk3288/rk3288.c
+++ b/arch/arm/mach-rockchip/rk3288/rk3288.c
@@ -100,10 +100,11 @@  void board_debug_uart_init(void)
 	/* Enable early UART on the RK3288 */
 	struct rk3288_grf * const grf = (void *)GRF_BASE;
 
-	rk_clrsetreg(&grf->gpio7ch_iomux, GPIO7C7_MASK << GPIO7C7_SHIFT |
-		     GPIO7C6_MASK << GPIO7C6_SHIFT,
-		     GPIO7C7_UART2DBG_SOUT << GPIO7C7_SHIFT |
-		     GPIO7C6_UART2DBG_SIN << GPIO7C6_SHIFT);
+	rk_clrsetreg(&grf->gpio7a_iomux, GPIO7A7_MASK << GPIO7A7_SHIFT,
+	                                 GPIO7A7_UART3GPS_SIN << GPIO7A7_SHIFT);
+
+	rk_clrsetreg(&grf->gpio7b_iomux, GPIO7B0_MASK << GPIO7B0_SHIFT,
+	                                 GPIO7B0_UART3GPS_SOUT << GPIO7B0_SHIFT);
 }
 #endif
 
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index 855cf414..234e2812 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -20,7 +20,7 @@  CONFIG_SPL_STACK=0xff718000
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_SPL_SIZE_LIMIT=0x4b000
-CONFIG_DEBUG_UART_BASE=0xff690000
+CONFIG_DEBUG_UART_BASE=0xff1b0000
 CONFIG_DEBUG_UART_CLOCK=24000000
 CONFIG_SYS_LOAD_ADDR=0x800800
 CONFIG_DEBUG_UART=y
@@ -82,7 +82,7 @@  CONFIG_REGULATOR_RK8XX=y
 CONFIG_PWM_ROCKCHIP=y
 CONFIG_RAM=y
 CONFIG_SPL_RAM=y
-CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_DEBUG_UART_SHIFT=3
 CONFIG_SYS_NS16550_MEM32=y
 CONFIG_SYSRESET=y
 CONFIG_USB=y
diff --git a/dts/upstream/src/arm/rockchip/rk3288-tinker.dtsi b/dts/upstream/src/arm/rockchip/rk3288-tinker.dtsi
index 09618bb7..6e65e782 100644
--- a/dts/upstream/src/arm/rockchip/rk3288-tinker.dtsi
+++ b/dts/upstream/src/arm/rockchip/rk3288-tinker.dtsi
@@ -9,7 +9,7 @@ 
 
 / {
 	chosen {
-		stdout-path = "serial2:115200n8";
+		stdout-path = "serial3:115200n8";
 	};
 
 	memory {
@@ -60,6 +60,14 @@ 
 		};
 	};
 
+	fan: pwm-fan {
+		compatible = "pwm-fan";
+		cooling-levels = <0 150 200 255>;
+		#cooling-cells = <2>;
+		pwms = <&pwm2 0 25000 0>;
+		fan-supply = <&vcc_sys>;
+	};
+
 	sdio_pwrseq: sdio-pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		clocks = <&rk808 RK808_CLKOUT1>;
@@ -122,6 +130,34 @@ 
 	};
 };
 
+&cpu_thermal {
+	trips {
+		cpu_warm: cpu_warm {
+			temperature = <55000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+
+		cpu_hot: cpu_hot {
+			temperature = <65000>;
+			hysteresis = <2000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map2 {
+			trip = <&cpu_warm>;
+			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
+		};
+
+		map3 {
+			trip = <&cpu_hot>;
+			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
+		};
+	};
+};
+
 &gmac {
 	assigned-clocks = <&cru SCLK_MAC>;
 	assigned-clock-parents = <&ext_gmac>;
@@ -447,6 +483,10 @@ 
 	status = "okay";
 };
 
+&pwm2 {
+	status = "okay";
+};
+
 &saradc {
 	vref-supply = <&vcc18_ldo1>;
 	status = "okay";
@@ -497,10 +537,6 @@ 
 	status = "okay";
 };
 
-&uart2 {
-	status = "okay";
-};
-
 &uart3 {
 	status = "okay";
 };