]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: tegra: add function to enable input clamping on tristate
authorStephen Warren <swarren@nvidia.com>
Tue, 22 Apr 2014 20:37:54 +0000 (14:37 -0600)
committerTom Warren <twarren@nvidia.com>
Tue, 13 May 2014 17:41:31 +0000 (10:41 -0700)
The HW-defined procedure for booting Tegra requires that
CLAMP_INPUTS_WHEN_TRISTATED be enabled before programming the pinmux.
Add a function to the pinmux driver to allow boards to do this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/tegra-common/pinmux-common.c
arch/arm/include/asm/arch-tegra/pinmux.h

index 6d7a7d907b16164278ed1c2c971263433a223a3f..6e3ab0c14ca2b477451d1b8b0bd7004938daff00 100644 (file)
 #define IO_RESET_SHIFT 8
 #define RCV_SEL_SHIFT  9
 
+#if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
+/* This register/field only exists on Tegra114 and later */
+#define APB_MISC_PP_PINMUX_GLOBAL_0 0x40
+#define CLAMP_INPUTS_WHEN_TRISTATED 1
+
+void pinmux_set_tristate_input_clamping(void)
+{
+       u32 *reg = _R(APB_MISC_PP_PINMUX_GLOBAL_0);
+       u32 val;
+
+       val = readl(reg);
+       val |= CLAMP_INPUTS_WHEN_TRISTATED;
+       writel(val, reg);
+}
+#endif
+
 void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func)
 {
        u32 *reg = MUX_REG(pin);
index 035159d665371fa6100bebf6ed60eea8c5ff65eb..da477697bf029513db8fe4a605a8fc46c54ae3d9 100644 (file)
@@ -80,6 +80,11 @@ struct pmux_pingrp_config {
 #endif
 };
 
+#if !defined(CONFIG_TEGRA20) && !defined(CONFIG_TEGRA30)
+/* Set the pinmux CLAMP_INPUTS_WHEN_TRISTATED bit */
+void pinmux_set_tristate_input_clamping(void);
+#endif
+
 /* Set the mux function for a pin group */
 void pinmux_set_func(enum pmux_pingrp pin, enum pmux_func func);