diff options
author | Stefano Babic <sbabic@denx.de> | 2010-10-06 08:59:26 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2010-10-13 18:11:30 +0200 |
commit | f76888c29427c2fbb0a7df700cd50c558b49b108 (patch) | |
tree | 06497f7366d8094270e442e63bc50373c27d6405 /arch/arm/cpu | |
parent | b9eb3fdf2f545626525b85953d322b2f8d67d319 (diff) | |
download | u-boot-imx-f76888c29427c2fbb0a7df700cd50c558b49b108.zip u-boot-imx-f76888c29427c2fbb0a7df700cd50c558b49b108.tar.gz u-boot-imx-f76888c29427c2fbb0a7df700cd50c558b49b108.tar.bz2 |
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')
-rw-r--r-- | arch/arm/cpu/arm1136/mx31/generic.c | 17 |
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) { |