Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
[oweals/u-boot.git] / arch / arm / imx-common / iomux-v3.c
index b59b802830677b240af7ce915394b41a8a1a1831..22cd11aa04867c47c8d7356683889324d8ad6a25 100644 (file)
@@ -11,6 +11,9 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
+#if !defined(CONFIG_MX25) && !defined(CONFIG_VF610)
+#include <asm/arch/sys_proto.h>
+#endif
 #include <asm/imx-common/iomux-v3.h>
 
 static void *base = (void *)IOMUXC_BASE_ADDR;
@@ -30,6 +33,14 @@ void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
                (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT;
        u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT;
 
+#if defined CONFIG_MX6SL
+       /* Check whether LVE bit needs to be set */
+       if (pad_ctrl & PAD_CTL_LVE) {
+               pad_ctrl &= ~PAD_CTL_LVE;
+               pad_ctrl |= PAD_CTL_LVE_BIT;
+       }
+#endif
+
        if (mux_ctrl_ofs)
                __raw_writel(mux_mode, base + mux_ctrl_ofs);
 
@@ -46,12 +57,23 @@ void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
 #endif
 }
 
+/* configures a list of pads within declared with IOMUX_PADS macro */
 void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
                                      unsigned count)
 {
        iomux_v3_cfg_t const *p = pad_list;
+       int stride;
        int i;
 
-       for (i = 0; i < count; i++)
-               imx_iomux_v3_setup_pad(*p++);
+#if defined(CONFIG_MX6QDL)
+       stride = 2;
+       if (!is_cpu_type(MXC_CPU_MX6Q) && !is_cpu_type(MXC_CPU_MX6D))
+               p += 1;
+#else
+       stride = 1;
+#endif
+       for (i = 0; i < count; i++) {
+               imx_iomux_v3_setup_pad(*p);
+               p += stride;
+       }
 }