U-boot output on uart4

Hello,

I’m using Buildroot to generate a custom image for RockPi4 A. My image runs main line Linux kernel (v5.10) and main line U-Boot (2021.01).
So far, all seems good, except for one of my requirements. I need to get U-Boot output on uart4 (pins 19 and 21). I have limited experience and knowledge about U-Boot so I need a little push here.

To build U-Boot, I initialize the config with rock-pi-4-rk3399_defconfig.

I thought it would just be a matter of configuration, I looked into it and found this configuration parameter:
CONFIG_DEBUG_UART_BASE
Its value is 0xFF1A0000 (address of uart2).
I changed it to 0xFF370000 (address of uart4).
Adresses deducted from reading the dts file, but it can probably be found in the board’s datasheet also.
This change had no effect, U-Boot is still writting on uart2.

I also altered the device tree source. In file arch/arm/dts/rk3399-rock-pi-4.dtsi in node chosen
I replaced
stdout-path = "serial2:1500000n8";
with
stdout-path = "serial4:1500000n8";

Now U-Boot does not output on uart2 anymore, which is good. But on uart4, I only get some ???? when I power on the board.

Note that the Linux kernel outputs log on uart4 without issue so I don’t see any reason why U-Boot could not do the same.

Also, I thought about applying the console-on-uart4 overlay, but it fails. I believe the reason is that the is no fiq-debugger node in the dts.

I don’t have high hopes that someone has already done what I’m trying to do, but maybe you guys can give me some pointers, ideas or resources that I might have missed.

Thank you!

Sorry for resuming this thread, but have you solved? I need the same

Hi luminosoft,

I have never solved this issue, sorry to have to tell you that. I had to drop it as it was taking too much of my time.
It probably takes a U-Boot experienced user or dev to tell you what changes you should make in order to get what you want. So my advice, if you don’t get an answer on this forum, would be to go and expose your issue on a U-Boot forum, mailing list, or irc.

I will follow your thread, I’m curious to know how you solve this.

Good luck :slight_smile: