Hi,because of some reason,I’m planning to use Uart1 to communicate with FPGA in UEFI. I checked UEFI source code and found the TegraUartDxe driver.There are three kind of uart driver-- ‘SerialSbsa.c’,'Serial16550.c’ and SerialTCU.c. But I don’t know which one I should choose to drive UART1.
Is there any reference?
Hi Bryan_Zhong,
SerialSbsa.c is not supported for Xavier.
SerialTCU.c is Tegra Combined UART, which is used for logging.
You could use Serial16550.c for your use case.
Please enable uart through the configuration in dtb .
The UART1 has been enabled in dtb. Because I can even see log at uart1.
The ttyTCU0 start to output log since power on. And the UART1 start to output since Jetson System firmware boot.
I need to use uart1 to communicate with FPGA in UEFI, so I want to close the log at uart1.
Where can I change this configurtaion?
Could you help to confirm which UART do you want to use for AGX Xavier?
Are you using UART1 which is located on expansion header?
Yes,I am using UART1 which is located on expansion header.
There are four uart handler when I use command ‘sermode’ to find uart. But None of them is UART1. When I try to change baudRate of every uart to 9600, but UART1 and TCU0 are still working well at 115200. Because I am using UART1 and TCU0 for debugging at 115200.
That means the command ‘sermode’ couldnot find uart or TCU0. Do you know the reason?
The baudRate uart 13F could not be changed. Maybe it uart1 or TCU0.But I am not sure.
Could you share the dtb in use for further check?
tegra194-p2888-0008-p2822-0000.dtb (385.7 KB)
I didn’t change the dtb. I use AGX industrial now. I guess that the dtb should be tegra194-p2888-0008-p2822-0000.dtb.
When I flash device,I use command :
sudo ./flash.sh -r jetson-agx-xavier-industrial mmcblk0p1
I also check that by viewing bootloader/flash.xml
bootloader-dtb and kernel-dtb are the same.
Could you try to decompile the dtb and modify the following?
serial@3100000 {
- compatible = "nvidia,tegra194-hsuart";
+ compatible = "nvidia,tegra20-uart";
After I change dtb file according your suggestion. I replace Linux_for_Tegra/kernel/dtb/tegra194-p2888-0008-p2822-0000.dtb and Linux_for_Tegra/bootloader/tegra194-p2888-0008-p2822-0000.dtb with the new one.
Then I relashed the bootloader-dtb part with command
“sudo ./flash.sh -r -k bootloader-dtb jetson-agx-xavier-industrial mmcblk0p1”.
It seems like bootloader-dtb has been updated.
But the UART1 still start to output log since Jetson System firmware boot. So It is still used to output log.
and can still be used as a debug uart.
After the device booted .I replaced /boot/dtb/kernel-tegra194-p2888-0008-p2822-0000.dtb with the new one .
I just used ‘cp new.dtb /boot/dtb/kernel-tegra194-p2888-0008-p2822-0000.dtb’.
Then I find that even if the UART1 still start to output log since Jetson System firmware boot. but UART1 can not be used as a debug uart. The device name of UART has been change from /dev/ttyTHS0 to /dev/ttyS0.
So I suspect that it maybe failed to update bootloader-dtb .or when uefi booted ,it did not use DTB from bootloader-dtb file. Whatever ,It confused me.
My purpose is to close the output log in UART1.
I appreciate it that if you have any other suggestion.
Currently, the bootloader(UEFI) and kernel use the same dtb.
If you do a full flash, it would copy the Linux_for_Tegra/kernel/dtb/tegra194-p2888-0008-p2822-0000.dtb to Linux_for_Tegra/bootloader/tegra194-p2888-0008-p2822-0000.dtb, so that you just need to replace the first one.
May I know what’s your exactly use case?
Do you want to disable the log output from UART1 in UEFI or kernel?
Please also share the result of the following command.
$ cat /proc/cmdline
I want to disable the log output from UART1 in UEFI .
~$ cat /proc/cmdline
root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 video=efifb:off nv-auto-config androidboot.serialno=1424821067873
~$
I’m planning to use Uart1 to communicate with FPGA in UEFI. If it is ok, I will make a specific application function about how to use it. I want to make it clear about uart communication in UEFI firstly.
After tried a full flash, I find that there still has the log output from UART1 in UEFI , but no output log in kernel.
The output log from UART1 in UEFI like following picture(right).
Actually, I just want to disable the log output from UART1 in UEFI and use UART1 as a communication way in UEFI. I don’t care about UART1 after kernel booted.
If you want to use UART1 as normal UART to communicate with peripherals (like FPGA you mentioned), you have to write your driver and create a device node for it.
Before doing that, you could set the status “disabled” of serial node in dtb for bootloader (UEFI) to disable the log output. Currently, the serial is using the following library: edk2-nvidia/Silicon/NVIDIA/Library/TegraSerialPortLib at main · NVIDIA/edk2-nvidia · GitHub.
Thanks for your reply.
It seems that it is kind of difficult for me. I will think it again.
I will keep you informed if I have any other progress.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.