AM625: How to change the default Linux kernel console from uart0 to uart3 using ti sdk 10.x

Part Number: AM625

Tool/software:

Dear TI Teams:

     I want to change the default Linux kernel console, from uart0 to uart3. The u-boot console still remain uart0.

     I use ti sdk 10.x (ti-processor-sdk-linux-rt-am62xx-evm-10.00.07.04-Linux-x86-Install).

     I use our custom board based on AM6254ATGFHIAMCRQ1. The linux kernel booting through  uart0 console has no propblem. And I use stty to test the uart3 and other serials, which all working without problems.

     so how can I do to just change Linux kernel default console serail to uart3. The following patch is how i changed before according to some related form, and it is not work. 

     The Linux kernel patch:

diff --git a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
index 8be252991..07dfb4dc2 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-main.dtsi
@@ -387,7 +387,7 @@ main_uart1: serial@2810000 {
 		power-domains = <&k3_pds 152 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 152 0>;
 		clock-names = "fclk";
-		status = "disabled";
+		status = "okay";
 	};
 
 	main_uart2: serial@2820000 {
@@ -397,7 +397,7 @@ main_uart2: serial@2820000 {
 		power-domains = <&k3_pds 153 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 153 0>;
 		clock-names = "fclk";
-		status = "disabled";
+		status = "okay";
 	};
 
 	main_uart3: serial@2830000 {
@@ -407,7 +407,7 @@ main_uart3: serial@2830000 {
 		power-domains = <&k3_pds 154 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 154 0>;
 		clock-names = "fclk";
-		status = "disabled";
+		status = "okay";
 	};
 
 	main_uart4: serial@2840000 {
@@ -417,7 +417,7 @@ main_uart4: serial@2840000 {
 		power-domains = <&k3_pds 155 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 155 0>;
 		clock-names = "fclk";
-		status = "disabled";
+		status = "okay";
 	};
 
 	main_uart5: serial@2850000 {
@@ -427,7 +427,7 @@ main_uart5: serial@2850000 {
 		power-domains = <&k3_pds 156 TI_SCI_PD_EXCLUSIVE>;
 		clocks = <&k3_clks 156 0>;
 		clock-names = "fclk";
-		status = "disabled";
+		status = "okay";
 	};
 
 	main_uart6: serial@2860000 {
diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
index 57fbcd689..3e60cb371 100644
--- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi
@@ -13,6 +13,10 @@
 / {
 	aliases {
 		serial2 = &main_uart0;
+		serial4 = &main_uart2;
+		serial5 = &main_uart3;
+		serial6 = &main_uart4;
+		
 		mmc0 = &sdhci0;
 		mmc1 = &sdhci1;
 		mmc2 = &sdhci2;
@@ -28,7 +32,8 @@ chosen {
 		#size-cells = <2>;
 		ranges;
 
-		stdout-path = "serial2:115200n8";
+		stdout-path = "serial5:115200n8";
+		bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02830000";
 
 		framebuffer0: framebuffer@0 {
 			compatible = "simple-framebuffer";
@@ -194,6 +199,27 @@ AM62X_IOPAD(0x1ac, PIN_INPUT, 2) /* (E19/D15) MCASP0_AFSR.UART1_RXD */
 			AM62X_IOPAD(0x1b0, PIN_OUTPUT, 2) /* (A20/D16) MCASP0_ACLKR.UART1_TXD */
 		>;
 	};
+	
+	main_uart2_pins_default: main-uart2-default-pins {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x224, PIN_INPUT, 3) /* (MMC1_DAT3/C19) UART0_RXD  */
+			AM62X_IOPAD(0x228, PIN_OUTPUT, 3) /* (MMC1_DAT2/B20) UART0_TXD */
+		>;
+	};
+	
+	main_uart3_pins_default: main_uart3-default-pins {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0234, PIN_INPUT, 3) /* (A20) MMC1_CLK.UART3_RXD */
+			AM62X_IOPAD(0x023c, PIN_OUTPUT, 3) /* (C18) MMC1_CMD.UART3_TXD */
+		>;
+	};
+	
+	main_uart4_pins_default: main_uart4-default-pins {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x0124, PIN_INPUT, 3) /* (D20) MMC2_SDCD.UART4_RXD */
+			AM62X_IOPAD(0x0128, PIN_OUTPUT, 3) /* (C20) MMC2_SDWP.UART4_TXD */
+		>;
+	};
 
 	main_i2c0_pins_default: main-i2c0-default-pins {
 		pinctrl-single,pins = <
@@ -374,12 +400,32 @@ &main_uart0 {
+&main_uart2 {
+	//bootph-pre-ram;
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_uart2_pins_default>;
+};
+
+&main_uart3 {
+	//bootph-pre-ram;
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_uart3_pins_default>;
+};
+
+&main_uart4 {
+	//bootph-pre-ram;
+	status = "okay";
+	pinctrl-names = "default";
+	pinctrl-0 = <&main_uart4_pins_default>;
+};
+

  The Uboot patch:

diff --git a/board/HOLLYSYS/VM0210/VM0210.env b/board/xxxxx/VM0210/VM0210.env
index 269be870..9bb1a066 100644
--- a/board/xxxx/VM0210/VM0210.env
+++ b/board/xxxx/VM0210/VM0210.env
@@ -8,7 +8,8 @@
 
 name_kern=Image
 console=ttyS2,115200n8
-args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
+args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02830000
 	${mtdparts}
 run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}

    I also changed the bootargs and env of console in u-boot bootargs and kernel device tree, from ttyS2 to ttyS3, ttyS4 and ttyS5. It's all not work well. The boot log still stoped at "Starting Kernel ....."