How to bind the physical serial port uartc to the default debug serial console ttyTCU0

Hi ,

I want to know how to bind the physical serial port UARTC to the default debug serial console ttyTCU0.I did not find the relevant UARTC settings in the device tree. I found the driver of ttyTCU.

static struct of_device_id tegra_combined_uart_of_match = {
{
.compatible = “nvidia,tegra186-combined-uart”,
}, {
},
};
static struct console tegra_combined_uart_console = {
.name = “ttyTCU”,
.device = uart_console_device,
#ifdef CONFIG_SERIAL_LOGLEVEL_PRINT
.flags = CON_PRINTBUFFER | CON_ANYTIME | CON_FORCE_LEVEL,
#else
.flags = CON_PRINTBUFFER | CON_ANYTIME,
#endif
.index = -1,
.write = tegra_combined_uart_console_write,
.setup = tegra_combined_uart_console_setup,
.data = &tegra_combined_uart_driver,
};

static struct uart_driver tegra_combined_uart_driver = {
.owner = THIS_MODULE,
.driver_name = “tegra-combined-uart”,
.dev_name = “ttyTCU”,
.major = TTY_MAJOR,
.minor = 143,
.cons = &tegra_combined_uart_console,
.nr = 1,
};

#ifdef CONFIG_PM
static const struct dev_pm_ops tegra_combined_uart_pm_ops = {
.suspend = tegra_combined_uart_suspend,
.resume = tegra_combined_uart_resume,
};
#endif

static struct platform_driver tegra_combined_uart_platform_driver = {
.probe = tegra_combined_uart_probe,
.remove = tegra_combined_uart_remove,
.driver = {
.name = “tegra-combined-uart”,
. of_match_table = of_match_ptr(tegra_combined_uart_of_match),
#ifdef CONFIG_PM
.pm = &tegra_combined_uart_pm_ops,
#endif
},
};

In the device tree ,

combined-uart {
compatible = “nvidia,tegra186-combined-uart”;
reg = <0x0 0x3c10000 0x0 0x4 /* TOP0_HSP_SM_0_1_BASE /
0x0 0xc168000 0x0 0x4 /
AON_HSP_SM_1_BASE /
0x0 0x3c00000 0x0 0x1000>; /
TOP0_HSP_COMMON_BASE */
interrupts = <0 TEGRA194_IRQ_TOP0_HSP_SHARED_0 0x04>;
status = “disabled”;
};
combined-uart {
console-port;
combined-uart;
status = “okay”;
};

Can someone tell me the answer? Thank you

hello 840764397,

you may refer to kernel initial messages, check all mounted serial ports,
for example,

$ dmesg | grep THS
[    1.637719] 3100000.serial: ttyTHS0 at MMIO 0x3100000 (irq = 51, base_baud = 0) is a TEGRA_UART
[    1.638901] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 52, base_baud = 0) is a TEGRA_UART
[    1.639652] 3140000.serial: ttyTHS4 at MMIO 0x3140000 (irq = 53, base_baud = 0) is a TEGRA_UART

here’s configuration files for combined uart,
you can have modification in cfg files to change combine uart settings,

$Linux_for_Tegra/bootloader/tegra194-mb1-bct-misc-l4t.cfg
enable_combined_uart = 1; 

you may also refer to device tree for the relationships.
for example,
$L4T_Sources/r32.4.2/Linux_for_Tegra/source/public/hardware/nvidia/soc/t19x/kernel-dts/tegra194-soc/tegra194-soc-uart.dtsi

1 Like