Disable console output to ttyS0 and read/write ttyS0 as UART device.

Hi,

I use L4T 32.2 and want to disable console output from kernel, and make ttyS0

Have tried this: https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fkernel_boot_time.html%23wwpID0E0YB0HA

but still get the output from kernel and have ttyS0,115200n8 in /proc/cmdline.

$ cat /proc/cmdline
tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 tegra_fbmem=0x800000@0x92cb3000 is_hdmi_initialised=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 fbcon=map:0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 fbcon=map:0 net.ifnames=0 quiet

Follow this:
https://devtalk.nvidia.com/default/topic/1025894/jetson-tx2/uart1-acts-as-default-debug-port-on-tx2-r28-1/post/5220368/#5220368

By modify kernel_src/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
Kernel log stops output to ttyS0, but I can’t do any read/write.

diff --git a/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi b/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
index 9ff3f7a..743bbbe 100644
--- a/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
+++ b/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-porg-p3448-common.dtsi
@@ -667,7 +667,7 @@
        };
 
        serial@70006000 { /* UART-A : UART1: Debug */
-               compatible = "nvidia,tegra210-uart", "nvidia,tegra114-hsuart", "nvidia,tegra20-uart";
+               compatible = "nvidia,tegra210-uart", "nvidia,tegra114-hsuart";
                console-port;
                sqa-automation-port;
                /delete-property/ resets;
@@ -676,7 +676,7 @@
        };
 
        serial@70006040 { /* UART-B : UART2 40 pin header */
-               compatible = "nvidia,tegra114-hsuart";
+               compatible = "nvidia,tegra114-hsuart", "nvidia,tegra20-uart";
                status = "okay";
        };
# echo "hello" > /dev/ttyS0
bash: echo: write error: Input/output error

Anyone can give me a help? Thank you.

hello imbrandon,

Confirmed that UART logs disabled after remove console=ttyS0 from the config file.
you should have modification as below, and flashing the board again to take effect.
thanks

CMDLINE_ADD="console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

Hi JerryChang,

Thanks for your quick reply.

I’m now in L4T 32.2 with Nano production module with eMMC.
Followed your hint and still not work.

For more detail, please see below.

Modify Linux_for_Tegra/p3448-0000.conf.common as follow:

diff --git a/p3448-0000.conf.common b/p3448-0000.conf.common
index 2986b41..276a59b 100644
--- a/p3448-0000.conf.common
+++ b/p3448-0000.conf.common
@@ -72,7 +72,7 @@ if [ -z "${USE_UBOOT}" ]; then
        USE_UBOOT=1;
 fi;
 ROOTFSSIZE=14GiB;
-CMDLINE_ADD="console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0";
+CMDLINE_ADD="console=tty0 fbcon=map:0 net.ifnames=0";
 target_board="t210ref";
 ROOT_DEV="mmcblk0p1 ------------ external SDCARD. (SKU0)
         mmcblk0p1 ------------ internal eMMC. (SKU2)

and then (re-make system.img and wait for few minutes…)

sudo ./flash.sh <b>jetson-nano-emmc</b> mmcblk0p1

After boot, still have output from console:

U-Boot 2016.07-tegra (Nov 28 2019 - 17:42:03 +0800)

TEGRA210
Model: NVIDIA P3450-Porg
Board: NVIDIA P3450-PORG
DRAM:  4 GiB
MMC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1
Using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
MMC: no card present
** Bad device mmc 1 **
Hit any key to stop autoboot:  0 
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
733 bytes read in 153 ms (3.9 KiB/s)
L4T boot options
1:	primary kernel
Enter choice: 1:	primary kernel
Retrieving file: /boot/initrd
5562393 bytes read in 189 ms (28.1 MiB/s)
Retrieving file: /boot/Image
34179080 bytes read in 806 ms (40.4 MiB/s)
append: tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 tegra_fbmem=0x800000@0x92cb3000 is_hdmi_initialised=1  root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0    root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 quiet
## Flattened Device Tree blob at 83100000
   Booting using the fdt blob at 0x83100000
   reserving fdt memory region: addr=80000000 size=20000
   Using Device Tree in place at 0000000083100000, end 000000008317723c

Starting kernel ...

<hit enter to activate fiq debugger>
[    1.092086] tegradc tegradc.1: dpd enable lookup fail:-19
[    1.242937] imx219 7-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.242965] imx219 7-0010: board setup failed
[    1.266757] imx219 8-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.266784] imx219 8-0010: board setup failed
[    1.883064] cgroup: cgroup2: unknown option "nsdelegate"
[    2.918777] using random self ethernet address
[    2.931506] using random host ethernet address
[    2.963596] using random self ethernet address
[    2.968262] using random host ethernet address
[    3.257496] random: crng init done
[    3.260932] random: 7 urandom warning(s) missed due to ratelimiting
[    6.873933] Please complete system configuration setup on desktop to proceed...

And then check on Nano:
(without modification in p3448-0000.conf.common,
there were total 3 sets of “console=ttyS0,115200n8” in /proc/cmdline. Now just 1 set left)

$ cat /proc/cmdline
tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 tegra_fbmem=0x800000@0x92cb3000 is_hdmi_initialised=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 quiet

I’ve done extract package again for a clean environment.

  1. L4T (Jetson-210_Linux_R32.2.0_aarch64.tbz2)
  2. Tegra_Linux_Sample-Root-Filesystem_R32.2.0_aarch64.tbz2
    Then modify and flash again.
    The result is the same.

Could you kindly give me a hint which version of L4T have confirmed?
Many thanks.

hello imbrandon,

it’s verified with with l4t-r32.2.3

Hello @imbrandon,

Did you solve your problem? I have the exact same issue with L4T-R32.3.1. Modifying the CMDLINE_ADD argument in the configuration removed two occurrences in the bootargs but there’s still one:

$ cat /proc/cmdline | grep ttyS0
tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 tegra_fbmem2=0x800000@0x92cb1000 is_hdmi_initialised=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 quiet

Indeed, my kernel log show that the console is enabled:

$ dmesg | grep tty
[ 0.000000] Kernel command line: tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,2 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 tegra_fbmem2=0x800000@0x92cb1000 is_hdmi_initialised=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 quiet
[ 0.001199] console [tty0] enabled
[ 0.919043] console [ttyS0] disabled
[ 0.919086] 70006000.serial: ttyS0 at MMIO 0x70006000 (irq = 63, base_baud = 25500000) is a Tegra
[ 0.919142] console [ttyS0] enabled
[ 0.919984] 70006040.serial: ttyTHS1 at MMIO 0x70006040 (irq = 64, base_baud = 0) is a TEGRA_UART
[ 0.920301] 70006200.serial: ttyTHS2 at MMIO 0x70006200 (irq = 65, base_baud = 0) is a TEGRA_UART
[ 0.920613] 70006300.serial: ttyTHS3 at MMIO 0x70006300 (irq = 66, base_baud = 0) is a TEGRA_UART

@JerryChang, could you please post your kernel log and /proc/cmdline ?

Thank you!