How to enable schmitt mode

Hi guys! I wonder how to enable the schmitt mode. I’ve tried the following:

  1. I add nvidia,schmitt = <TEGRA_PIN_ENABLE>; to a pin node in Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi as follow:
			soc_gpio25_pp6 {
				nvidia,pins = "soc_gpio25_pp6";
				nvidia,function = "vi0";
				nvidia,schmitt = <TEGRA_PIN_ENABLE>;
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_ENABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};
  1. I add a pin config under pinmux@2430000 node. The config is as following:
/{
	tegra_pinctrl: pinmux@2430000 {
		pinctrl-0 = <&kenexs_gpio>;
		kenexs_gpio: kenexs-gpio {
			IN0 {
				nvidia,pins = "soc_gpio25_pp6";
				nvidia,schmitt = <TEGRA_PIN_ENABLE>;
			};
		};
	};
};

But it seems none of the above configs takes effect. Following this. I know the mapped address of the soc_gpio25 is 0x02430030. So I read the register’s value. it gives me 0x00000050 which means that the pin is not configured with schmitt mode. Also I checked by the following command as said in this post

kenexs@V700:~$ sudo cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups |grep soc_gpio25_pp6 -A 14
140 (soc_gpio25_pp6):
        pull=0
        tristate=1
        enable-input=1
        open-drain=0
        io-reset=0
        rcv-sel=0
        io-hv=0
        loopback=0
        schmitt=0
        pull-down-strength=0
        pull-up-strength=0
        drive-type=0
        func=vi0
        pad-power=1

pinmux_dts.tar.gz (5.1 KB)

By the way, I can config it with devmem 0x02430030 16 0x1050 to enable the schmitt mode, but I think it is not a formal way to do so.

Hi,

Sure it’s not the formal way doing so, but can you please confirm whether it works by directly setting register.
We don’t seem to have tested Schmitt Trigger on T234, nor have we enabled it in any of device trees in T234, so we need to check how to enable it correctly.

Thanks with that.

I’m not sure if it takes effect to hardware, but knowing from the value read from the register, it works. We are going to test with noise signal to see if it increases the noise immunity.

root@V700:~# devmem 0x02430030 16 0x1050
root@V700:~# devmem 0x02430030                                                                                                                                                                                                            
0x00001050
kenexs@V700:~$ sudo cat /sys/kernel/debug/pinctrl/2430000.pinmux/pinconf-groups |grep soc_gpio25_pp6 -A 14
140 (soc_gpio25_pp6):
        pull=0
        tristate=1
        enable-input=1
        open-drain=0
        io-reset=0
        rcv-sel=0
        io-hv=0
        loopback=0
        schmitt=1
        pull-down-strength=0
        pull-up-strength=0
        drive-type=0
        func=vi0
        pad-power=1

Hi, DaveYYY

We use a PLC to test Schmitt mode. The gpios we tested are as follow:

IN PORT DTS PIN NAME COMPLETE PIN NAME OFFSET BIT PAD CONTROL BLOCK PADCTL BASE ADDR REGISTER ADDR
IN0 soc_gpio25_pp6 PADCTL_G3_SOC_GPIO25_0 0x30 12 G3 PADCTL_A0 0x02430000 0x02430030
IN1 spi2_miso_pcc1 PADCTL_AO_SPI2_MISO_0 0x50 12 AO PADCTL_A14 0x0c302000 0x0c302050

When IN0 is not configured with Schmitt mode, the number of false triggers in 2000 times is 12 times. When Schmitt mode is turned on, there is no false triggering. But at the same time, IN1 is not falsely triggered. I don’t know if it is related to the different resistance before the optocoupler or the pin properties, but in any case, Schmitt mode is effective.

we need to check how to enable it correctly

If you guys have any ideas please let me know. I would be very grateful if you could do so.

Hi,

We are currently checking with our internal team.
Will inform you given any updates.
Please directly set register as a workaround for now if it works for you.

Got it. Thanks a lot!