summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/arm1136/mx31
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-10-20 16:01:29 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-11-03 22:56:18 +0100
commit6d0fb3dbcc4b1ce8437b1e9458ad406636321ef6 (patch)
tree8cb192312571038360dbc4b9e6083868e501803e /arch/arm/cpu/arm1136/mx31
parent1f83d009e4fb086c3ee210f78b2ca601fd2cd0dc (diff)
downloadu-boot-imx-6d0fb3dbcc4b1ce8437b1e9458ad406636321ef6.zip
u-boot-imx-6d0fb3dbcc4b1ce8437b1e9458ad406636321ef6.tar.gz
u-boot-imx-6d0fb3dbcc4b1ce8437b1e9458ad406636321ef6.tar.bz2
mx31: Introduce mx31_set_gpr function
Introduce mx31_set_gpr function for setting the GPR (General Purpose Register) on MX31. This function can be useful for setting a group of pins into tied to some specific peripherals. Reuse this function from the linux kernel. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Diffstat (limited to 'arch/arm/cpu/arm1136/mx31')
-rw-r--r--arch/arm/cpu/arm1136/mx31/generic.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c
index 78df7b9..4f27e25 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -27,6 +27,8 @@
#include <asm/io.h>
#include <asm/arch/sys_proto.h>
+#define IOMUXGPR (IOMUXC_BASE + 0x008)
+
static u32 mx31_decode_pll(u32 reg, u32 infreq)
{
u32 mfi = GET_PLL_MFI(reg);
@@ -141,6 +143,19 @@ void mx31_set_pad(enum iomux_pins pin, u32 config)
}
+void mx31_set_gpr(enum iomux_gp_func gp, char en)
+{
+ u32 l;
+
+ l = readl(IOMUXGPR);
+ if (en)
+ l |= gp;
+ else
+ l &= ~gp;
+
+ writel(l, IOMUXGPR);
+}
+
void mxc_setup_weimcs(int cs, const struct mxc_weimcs *weimcs)
{
struct mx31_weim *weim = (struct mx31_weim *) WEIM_BASE;