I want to enable additional uart (the one on J17 header) during uboot process.
- From previous posts, as a first step, I have made the below dtb changes to the /Linux_for_Tegra/sources/u-boot/arch/arm/dts/tegra186-p2771-0000-500.dtb file to enable the UART2. I have added the serial@0xc280000 serial controller.
[i]serial@3100000 {
compatible = "nvidia,tegra186-uart", "nvidia,tegra20-uart";
reg = <0x0 0x3100000 0x0 0x10000>;
reg-shift = <0x2>;
status = "disabled";
};
[/i]
[b] serial@0xc280000 {
compatible = "nvidia,tegra186-uart", "nvidia,tegra20-uart";
reg = <0x0 0xc280000 0x0 0x10000>;
reg-shift = <0x2>;
status = "okay";[/b]
};
-
For now, I wanted to assume the base address and offsets of the serial controller is correct and move on to create a custom getc, puts function to access the serial port.
-
However, I have not been able to figure out a way to do this. The post reminds me that the uart is just a memory location (a register) where you can copy the bytes into the memory and set some “start transfer” register to send the data. Setting the baud rate would be a matter of setting the right value to some other register. This is what I would be doing for a bare metal coding in a micro controller. But I expected that u-boot might already have the low-level stuff covered and let me access the uart using a file read write operation.
-
The organization of uboot code is confusing and after 'grep’ing through various files from different vendor boards, I am still not sure how to write a wrapper for the sending data to additional UART2. Some vendors have explicit functions to enable_uart. But I am unable to find one for tegra-186 (TX2)
-
There was a post on a different forum that talks about using the serial.h file to get access to eserial#_device.puts(" ") . But, I was unable to compile the uboot code after following the instructions.
-
So w.r.t. TX2, where does the uart that was enabled in the device tree, get mapped to the functions like getc, putc? or How to use the existing definitions in uboot code to access different UARTs?