I want to modify the U-Boot code to enable UART2 (the one in J17 header) to do perform some serial interfacing with a peripheral device during the booting process. I found some discussion on the topic, but most of them are about enabling an alternate uart for debug console. I want it to behave like a normal serial port.
The discussions in the links [1] and [2] points to the steps for enabling an alternate debug port.
Can some body guide me with the steps needed to enable an additional uart during U-boot. I have been struggling with this over a week and would be eager to get any inputs.
Please answer the relevant questions below.
- I understand that I need to enable the UART2 on the device tree. But there is only one serial port mentioned in the device tree file after decompiling.
/Linux_for_Tegra/sources/u-boot/arch/arm/dts/tegra186-p2771-0000-500.dtb
Is this file right and what additional information should be added to this?
serial@3100000 {
compatible = "nvidia,tegra186-uart", "nvidia,tegra20-uart";
reg = <0x0 0x3100000 0x0 0x10000>;
reg-shift = <0x2>;
status = "disabled";
};
-
Are there any changes that I need to do in the file Linux_for_Tegra/p2771-0000.conf.common file? According to [2], I can see a line related to the serial console here.
CMDLINE_ADD=“console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0” -
According to [1] the below file needs to be modified. Does it apply to my case?
Linux_for_Tegra/bootloader/tegra186-mb1-bct-misc-si-l4t.cfg -
Sending and receiving data through a serial port would need the getc, putc functions to be defined for the serial port. Where to define it for the additional serial port UART2 that is enabled? For example, if I have to use UART2 in u-boot/common/autoboot.c file, how should I access the port?