Change UBOOT terminal from UART0 to UART1

Hello to everyone,

I’m working on a custom board assembled with Arria5 (SX).
Does anyone know how i change the Uboot terminal to printout through UART1 instead UART0 ? is it possible ?
I can’t find the relevant files.

Thanks in advance,
Moran.

Have you tried to modify the bootargs in the device tree source?
I think you have to change the ttyS0 to ttyS1 or similar.
I’m using Socrates Board and have following in the beginning of my dts file:


/dts-v1/;

/memreserve/ 0x0000000000000000 0x0000000000001000;
/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
model = “EBV SOCrates”;
compatible = “ebv,socrates”, “altr,socfpga-cyclone5”, “altr,socfpga”;

chosen {
    bootargs = "console=ttyS0,115200";
};

Hi!!
you can also change it in your boot source file using the kernel parameter console.
example: setenv bootargs console=ttyS1,115200
bye

Hi … thanks you both for your reply,

I want to see the Preloader and Uboot printouts through UART1 instead of UART0.

So it should be involve with uboot compilation (maybe changing some header file) as far as i understand.

Please advise,

In case this problem isn’t solved yet, here’s how to do it:
Edit “socfpga_common.h” file (below directory is just a sample on where to find the file)

C:\altera\14.1\embedded\examples\hardware\av_soc_devkit_ghrd\software\spl_bsp\uboot-socfpga\include\configs

BEFORE
File Name:socfpga_common.h
Line 179 :Change Linux BootLinux startup boot log output destination
from ttyS0 to ttyS1
Line 351:Change console destination of preloader and Uboot
from UART0 Address (0xffc02000) to UART1 Address (0xffc03000)

00174|/*
00175| * arguments passed to the bootz command. The value of
00176| * CONFIG_BOOTARGS goes into the environment value “bootargs”.
00177| * Do note the value will overide also the chosen node in FDT blob.
00178| */
00179|#define CONFIG_BOOTARGS “console=ttyS0,” __stringify(CONFIG_BAUDRATE)
00180|

00349|#define CONFIG_SYS_NS16550
00350|#ifdef CONFIG_SYS_NS16550
00351|#define UART0_BASE SOCFPGA_UART0_ADDRESS
00352|#define CONFIG_SYS_NS16550_SERIAL
00353|#define CONFIG_SYS_NS16550_REG_SIZE -4

AFTER
File Name:socfpga_common.h

00174|/*
00175| * arguments passed to the bootz command. The value of
00176| * CONFIG_BOOTARGS goes into the environment value “bootargs”.
00177| * Do note the value will overide also the chosen node in FDT blob.
00178| */
00179|#define CONFIG_BOOTARGS “console=ttyS1,” __stringify(CONFIG_BAUDRATE)
00180|

00349|#define CONFIG_SYS_NS16550
00350|#ifdef CONFIG_SYS_NS16550
00351|#define UART0_BASE SOCFPGA_UART1_ADDRESS
00352|#define CONFIG_SYS_NS16550_SERIAL
00353|#define CONFIG_SYS_NS16550_REG_SIZE -4

Thanks alot Jason,

I’ll try it and let you know if it worked.

Hi Jason,

Im trying to use UART1 as debug console on Arria10 SoC.

I have configured CONFIG_BOOTARGS “console=ttyS1,” and SOCFPGA_UART1_ADDRESS in u-boot source, U-boot is prints are still seen on UART0. Do I need to make any other change to make it work??!!

Thank you.
Regards,
Ambika

Hi Ambika,

As I did this only for Arria V, I’m not aware of other necessary changes in case of Arria 10. For Arria V it worked after the above described changes for socfpga_common.h are implemented. Sorry not to be of much help but I hope you’ll eventually figure it out. I would appreciate if you can share your result too once you’ve figured it out (as we’ll probably be upgrading to Arria 10 too at some point). Thanks.

Regards,
Jason

hey jason,

Thanks for the reply

Im still debugging on this, tried disabling UART0 and the your implementation works perfect when only UART1 is enabled.

Do you have any thought on why u-boot is choosing UART0 as a debug console when both UART0 and UART1 are enabled?

I appreciate your support.

Regards,
Ambika

Hello Ambika,

I am also facing same issue, I am using custom board which took reference from Arria 10 and using UART1 as console. Could you please help with the changes you did in your configuration other than above changes?
Are there any additional changes required to be done in quartus tool , to make uart1 as the debug port?

Thanks and Regards,
Priya