Disabling interactive debug UART

Currently we get the kernel debug output over the debug UART usb (FTDI) port on the development board. We also noticed the communication works the other way around, so you can actually execute shell commands on the SoM over UART with a serial terminal like cutecom.
This feature is very useful for development, but we would like to turn it off for production without actually disabling the kernel output (dmesg) that is being sent over UART. Is there a way to achieve this via some config files or devicetree changes?

Not sure this is the best way.
But you can modify the msm8996-pins.dtsi file and swap the default pinctrl configuration :

-	blsp2_uart1_2pins_default: blsp2_uart1_2pins {
+      blsp2_uart1_2pins_sleep: blsp2_uart1_2pins_sleep {
		pinmux {
			function = "blsp_uart8";
			pins = "gpio4", "gpio5";
		};
		pinconf {
			pins = "gpio4", "gpio5";
			drive-strength = <16>;
			bias-disable;
		};
	};

-	blsp2_uart1_2pins_sleep: blsp2_uart1_2pins_sleep {
+      blsp2_uart1_2pins_default: blsp2_uart1_2pins {
		pinmux {
			function = "gpio";
			pins = "gpio4", "gpio5";
		};
		pinconf {
			pins = "gpio4", "gpio5";
			drive-strength = <2>;
			bias-disable;
		};
        };

But doesn’t this disables the UART all together? However, your answer did got me thinking, can we remove the gpio5 (UART RX) from the blsp2_uart1_2pins_default pin configuration in msm8996-pins.dtsi?

No, it will disabled only this UART. Or you can set the status to disabled in the others dtsi files, it’s easier.
Try it, I bet it is :wink:

That’s smart ;-), the pin would not be routed to the UART, and so preventing input…

You can also try this:

systemctl mask serial-getty@ttyMSM0

(if ttyMSM0 is the console)