summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/arm1136/mx31
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2010-10-06 06:59:26 (GMT)
committerStefano Babic <sbabic@denx.de>2010-10-13 16:11:30 (GMT)
commitf76888c29427c2fbb0a7df700cd50c558b49b108 (patch)
tree06497f7366d8094270e442e63bc50373c27d6405 /arch/arm/cpu/arm1136/mx31
parentb9eb3fdf2f545626525b85953d322b2f8d67d319 (diff)
downloadu-boot-fsl-qoriq-f76888c29427c2fbb0a7df700cd50c558b49b108.tar.xz
MX31: add support for setting pin pads
The patch adds a utility function and defines to set the pad as it is done in linux. Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'arch/arm/cpu/arm1136/mx31')
-rw-r--r--arch/arm/cpu/arm1136/mx31/generic.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
index 1415d6c..cbe8243 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <asm/arch/mx31-regs.h>
+#include <asm/io.h>
static u32 mx31_decode_pll(u32 reg, u32 infreq)
{
@@ -90,6 +91,22 @@ void mx31_gpio_mux(unsigned long mode)
__REG(reg) = tmp;
}
+void mx31_set_pad(enum iomux_pins pin, u32 config)
+{
+ u32 field, l;
+ void *reg;
+
+ pin &= IOMUX_PADNUM_MASK;
+ reg = (IOMUXC_BASE + 0x154) + (pin + 2) / 3 * 4;
+ field = (pin + 2) % 3;
+
+ l = __raw_readl(reg);
+ l &= ~(0x1ff << (field * 10));
+ l |= config << (field * 10);
+ __raw_writel(l, reg);
+
+}
+
#if defined(CONFIG_DISPLAY_CPUINFO)
int print_cpuinfo (void)
{