summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2012-07-26 15:32:14 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 16:49:40 -0400
commit5ccf1d7f416f5b3be5854eba0e43eb31992ab977 (patch)
treebecd9e29fb56c0a4811217acc982866bdcabb426 /arch
parente426e71b4fe2b2907cba29f7be472e68efe2e47e (diff)
ENGR00180931-2 mvf: add IOMUX definiation and initialization
Add IOMUX definiation and initialization. Add the iomux initialization support for Faraday. Define the io pad settings for some function modules. Those pad ctrl settings may need to adjust during the feature tuning process. Signed-off-by: Jason Jin <Jason.jin@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-mxc/include/mach/iomux-v3.h33
-rw-r--r--arch/arm/plat-mxc/iomux-v3.c18
2 files changed, 50 insertions, 1 deletions
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index 60fb82ecbc1b..78b8aa2503f5 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
* <armlinux@phytec.de>
+ * Copyright 2012 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -114,6 +115,38 @@ typedef u64 iomux_v3_cfg_t;
#define PAD_CTL_SRE_FAST (1 << 0)
#define PAD_CTL_SRE_SLOW (0 << 0)
+#elif defined(CONFIG_ARCH_MVF)
+#define PAD_CTL_SPEED_LOW (1 << 12)
+#define PAD_CTL_SPEED_MED (2 << 12)
+#define PAD_CTL_SPEED_HIGH (3 << 12)
+
+#define PAD_CTL_SRE_FAST (1 << 11)
+#define PAD_CTL_SRE_SLOW (0 << 11)
+
+#define PAD_CTL_ODE (1 << 10)
+#define PAD_CTL_HYS (1 << 9)
+
+#define PAD_CTL_DSE_DISABLE (0 << 6)
+#define PAD_CTL_DSE_150ohm (1 << 6)
+#define PAD_CTL_DSE_75ohm (2 << 6)
+#define PAD_CTL_DSE_50ohm (3 << 6)
+#define PAD_CTL_DSE_37ohm (4 << 6)
+#define PAD_CTL_DSE_30ohm (5 << 6)
+#define PAD_CTL_DSE_25ohm (6 << 6)
+#define PAD_CTL_DSE_20ohm (7 << 6)
+
+#define PAD_CTL_PUS_100K_DOWN (0 << 4)
+#define PAD_CTL_PUS_47K_UP (1 << 4)
+#define PAD_CTL_PUS_100K_UP (2 << 4)
+#define PAD_CTL_PUS_22K_UP (3 << 4)
+
+#define PAD_CTL_PKE (1 << 3)
+#define PAD_CTL_PUE (1 << 2)
+
+#define PAD_CTL_OBE_ENABLE (1 << 1)
+#define PAD_CTL_IBE_ENABLE (1 << 0)
+#define PAD_CTL_OBE_IBE_ENABLE (3 << 0)
+
#else
#define PAD_CTL_DVS (1 << 13)
#define PAD_CTL_HYS (1 << 8)
diff --git a/arch/arm/plat-mxc/iomux-v3.c b/arch/arm/plat-mxc/iomux-v3.c
index f7bc8718684b..6646cf573dfd 100644
--- a/arch/arm/plat-mxc/iomux-v3.c
+++ b/arch/arm/plat-mxc/iomux-v3.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2011 Freescale Semiconductor, Inc.
+ * Copyright 2004-2012 Freescale Semiconductor, Inc.
* Copyright (C) 2008 by Sascha Hauer <kernel@pengutronix.de>
* Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik GmbH,
* <armlinux@phytec.de>
@@ -43,6 +43,21 @@ int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
u32 pad_ctrl_ofs = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT;
u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT;
+#ifdef CONFIG_SOC_MVFA5
+ u32 mvf_mux_mode;
+
+ if (!pad_ctrl)
+ pad_ctrl = __raw_readl(base + mux_ctrl_ofs) & 0xffff;
+
+ mvf_mux_mode = (mux_mode << 20) | pad_ctrl;
+
+ if (mux_ctrl_ofs)
+ __raw_writel(mvf_mux_mode, base + mux_ctrl_ofs);
+
+ if (sel_input_ofs)
+ __raw_writel(sel_input, base + sel_input_ofs);
+#else
+
if (mux_ctrl_ofs)
__raw_writel(mux_mode, base + mux_ctrl_ofs);
@@ -51,6 +66,7 @@ int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
if (!(pad_ctrl & NO_PAD_CTRL) && pad_ctrl_ofs)
__raw_writel(pad_ctrl, base + pad_ctrl_ofs);
+#endif
return 0;
}