LS1021A-TWR : U-boot console output not working with LPUART1 set as stdout.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LS1021A-TWR : U-boot console output not working with LPUART1 set as stdout.

跳至解决方案
250 次查看
saichaithanyav
Contributor I

Hi NXP Team,

I'm upgrading U-boot on LS10121A-TWR to lf_v2024.04 ( from https://github.com/nxp-qoriq/u-boot.git)

I'm facing an issue with Uboot console not working when LPUART1 is used . Uboot console is flooded with junk data. I'm using the same rcw_1000.bin which works with the old "U-Boot 2016.09." , on LPUART1

Ex:- 

▒▒Tt▒n▒▒
#▒▒Xjx▒P 
`▒P▒+c▒-▒▒h▒j▒▒絁▒Ѫ▒4tʡ▒tʡ▒t 

However, if LPUART0 is set as  stdout-path , then UBoot console output works perfectly.

Ex:- 

U-Boot 2024.04 (Oct 03 2025 - 17:23:45 +1000)

CPU: Freescale LayerScape LS1020E, Version: 2.0, (0x87081020)
Clock Configuration:
CPU0(ARMV7):1000 MHz,
Bus:300 MHz, DDR:800 MHz (1600 MT/s data rate),
Reset Configuration Word (RCW):
00000000: 0608000a 00000000 00000000 00000000
00000010: 60000000 00407900 e0025a00 21046000
00000020: 00000000 00000000 00000000 09230800
00000030: 00000100 5084d540 00000000 00000000
Model: LS1021A TWR Board
Board: LS1021ATWR
CPLD: Vfb.fb
PCBA: Vfb.0
VBank: 1
DRAM: 1 GiB

Attached the dts and rcw patches. The attached RCW patch works correctly with U-Boot 2016.09 version. The RCW patch is applied on top of the below commit

commit 43c79c98d706a13572864bb4554df78c4fc24fe7 (HEAD, tag: LSDK-17.09-update-103017)
rcw: ls1088aqds: Add RCW PBL_QSPI_1600_700_2100_0x15_0x0d.bin

 

Below are the steps used to construct a unified [ rcw + uboot ] image.

cp rcw_1000.bin u-boot-new.bin  
truncate -s 1M u-boot-new.bin
cat u-boot.bin >> u-boot-new.bin  

Can you please guide me how to get the LPUART1 working.


Thanks

Sai Chaithanya

0 项奖励
回复
1 解答
94 次查看
Oswalag
NXP TechSupport
NXP TechSupport

Hello,

You are correct, 

Junk characters on the console typically indicate baud rate mismatches, which are often caused by incorrect clock sources or frequencies.


Since LPUART0 works fine, and both nodes are similar except for the clock source, this strongly points to a clocking issue for LPUART1.

 

Regards. 

 

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
200 次查看
saichaithanyav
Contributor I

Hi Oswalag,

Thanks for the response.

There's no change w.r.t node name and address between 2016.09 and 2024.04. The difference is seen in the clock field only for both lpuart0 and lpuart1. However, lpuart0 works without any issues. 

Do you suspect any issue w.r.t clock ?

Uboot-2024.04 - 

lpuart1: serial@2960000 {
compatible = "fsl,ls1021a-lpuart";
reg = <0x2960000 0x1000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clockgen 4 1>;
clock-names = "ipg";
status = "disabled";
};

 

U-boot-2016.09 - 


lpuart1: serial@2960000 {
compatible = "fsl,ls1021a-lpuart";
reg = <0x2960000 0x1000>;
interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&platform_clk 1>;
clock-names = "ipg";
status = "disabled";
};

 

Thanks
Sai Chaithanya

0 项奖励
回复
95 次查看
Oswalag
NXP TechSupport
NXP TechSupport

Hello,

You are correct, 

Junk characters on the console typically indicate baud rate mismatches, which are often caused by incorrect clock sources or frequencies.


Since LPUART0 works fine, and both nodes are similar except for the clock source, this strongly points to a clocking issue for LPUART1.

 

Regards. 

 

 

0 项奖励
回复
72 次查看
saichaithanyav
Contributor I
Thanks Oswalag.

Its indeed change of clock frequency in our custom board.

The LPUART1 is connected to the clock that's running at 150Mhz, but in the DTS its being referred to system-clock which is running at 100mhz.

The below is the fix that resolved the issue and the logging on LPUART1 console is working and functional.

@@ -101,7 +101,8 @@ static void lpuart_write32(u32 flags, u32 *addr, u32 val)
u32 __weak get_lpuart_clk(void)

{
- return get_board_sys_clk();
+ //return get_board_sys_clk();
+ return (CONFIG_SYS_CLK_FREQ + (CONFIG_SYS_CLK_FREQ / 2));

}


Thanks
Sai Chaithanya
0 项奖励
回复
227 次查看
Oswalag
NXP TechSupport
NXP TechSupport

Hello,

If the same RCW works with LPUART1 on u-boot 2016.09, compare the DTS used in 2016.09 vs 2024.04. There might be changes in node naming or address mapping for LPUART1.

0 项奖励
回复