linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: ti: k3-pinctrl: Enable Schmitt Trigger by default
@ 2025-07-01 10:54 A. Sverdlin
  2025-07-09 10:35 ` Vignesh Raghavendra
  0 siblings, 1 reply; 2+ messages in thread
From: A. Sverdlin @ 2025-07-01 10:54 UTC (permalink / raw)
  To: devicetree
  Cc: Alexander Sverdlin, Nishanth Menon, Vignesh Raghavendra,
	Tero Kristo, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-arm-kernel, linux-kernel

From: Alexander Sverdlin <alexander.sverdlin@siemens.com>

Switch Schmitt Trigger functions for PIN_INPUT* macros by default. This is
HW PoR configuration, the slew rate requirements without ST enabled are
pretty tough for these devices. We've noticed spurious GPIO interrupts even
with noise-free edges but not meeting slew rate requirements (3.3E+6 V/s
for 3.3v LVCMOS).

It's not obvious why one might want to disable the PoR-enabled ST on any
pin. Just enable it by default. As it's not possible to provide OR-able
macros to disable the ST, shall anyone require it, provide a set of
new macros with _NOST suffix.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
---
This patch could be considered a v2 of [1] but the subject has been changed.

[1] Link: https://lore.kernel.org/all/20250627131332.2806026-1-alexander.sverdlin@siemens.com/

 arch/arm64/boot/dts/ti/k3-pinctrl.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
index cac7cccc11121..38590188dd51c 100644
--- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
+++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
@@ -8,6 +8,7 @@
 #ifndef DTS_ARM64_TI_K3_PINCTRL_H
 #define DTS_ARM64_TI_K3_PINCTRL_H
 
+#define ST_EN_SHIFT		(14)
 #define PULLUDEN_SHIFT		(16)
 #define PULLTYPESEL_SHIFT	(17)
 #define RXACTIVE_SHIFT		(18)
@@ -19,6 +20,10 @@
 #define DS_PULLUD_EN_SHIFT	(27)
 #define DS_PULLTYPE_SEL_SHIFT	(28)
 
+/* Schmitt trigger configuration */
+#define ST_DISABLE		(0 << ST_EN_SHIFT)
+#define ST_ENABLE		(1 << ST_EN_SHIFT)
+
 #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
 #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
 
@@ -32,9 +37,13 @@
 #define PIN_OUTPUT		(INPUT_DISABLE | PULL_DISABLE)
 #define PIN_OUTPUT_PULLUP	(INPUT_DISABLE | PULL_UP)
 #define PIN_OUTPUT_PULLDOWN	(INPUT_DISABLE | PULL_DOWN)
-#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN	(INPUT_EN | PULL_DOWN)
+#define PIN_INPUT		(INPUT_EN | ST_ENABLE | PULL_DISABLE)
+#define PIN_INPUT_PULLUP	(INPUT_EN | ST_ENABLE | PULL_UP)
+#define PIN_INPUT_PULLDOWN	(INPUT_EN | ST_ENABLE | PULL_DOWN)
+/* Input configurations with Schmitt Trigger disabled */
+#define PIN_INPUT_NOST		(INPUT_EN | PULL_DISABLE)
+#define PIN_INPUT_PULLUP_NOST	(INPUT_EN | PULL_UP)
+#define PIN_INPUT_PULLDOWN_NOST	(INPUT_EN | PULL_DOWN)
 
 #define PIN_DEBOUNCE_DISABLE	(0 << DEBOUNCE_SHIFT)
 #define PIN_DEBOUNCE_CONF1	(1 << DEBOUNCE_SHIFT)
-- 
2.50.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64: dts: ti: k3-pinctrl: Enable Schmitt Trigger by default
  2025-07-01 10:54 [PATCH] arm64: dts: ti: k3-pinctrl: Enable Schmitt Trigger by default A. Sverdlin
@ 2025-07-09 10:35 ` Vignesh Raghavendra
  0 siblings, 0 replies; 2+ messages in thread
From: Vignesh Raghavendra @ 2025-07-09 10:35 UTC (permalink / raw)
  To: devicetree, Alexander Sverdlin
  Cc: Vignesh Raghavendra, Nishanth Menon, Tero Kristo, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, linux-arm-kernel, linux-kernel

Hi A. Sverdlin,

On Tue, 01 Jul 2025 12:54:35 +0200, A. Sverdlin wrote:
> Switch Schmitt Trigger functions for PIN_INPUT* macros by default. This is
> HW PoR configuration, the slew rate requirements without ST enabled are
> pretty tough for these devices. We've noticed spurious GPIO interrupts even
> with noise-free edges but not meeting slew rate requirements (3.3E+6 V/s
> for 3.3v LVCMOS).
> 
> It's not obvious why one might want to disable the PoR-enabled ST on any
> pin. Just enable it by default. As it's not possible to provide OR-able
> macros to disable the ST, shall anyone require it, provide a set of
> new macros with _NOST suffix.
> 
> [...]

I have applied the following to branch ti-k3-dts-next on [1].
Thank you!

[1/1] arm64: dts: ti: k3-pinctrl: Enable Schmitt Trigger by default
      commit: 5b272127884bded21576a6ddceca13725a351c63

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-09 12:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-01 10:54 [PATCH] arm64: dts: ti: k3-pinctrl: Enable Schmitt Trigger by default A. Sverdlin
2025-07-09 10:35 ` Vignesh Raghavendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).