summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Alonso <aalonso@freescale.com>2012-08-28 14:40:23 -0500
committerAdrian Alonso <aalonso@freescale.com>2012-08-29 14:05:41 -0500
commit8b8362b43812c39af173c3d899804c619f9534da (patch)
treeae3dbf227763fe8f3274902f537e053f8cc955fc
parent3bd28a982614215fdf088d87e055e950eca5eeb9 (diff)
downloadu-boot-imx-8b8362b43812c39af173c3d899804c619f9534da.zip
u-boot-imx-8b8362b43812c39af173c3d899804c619f9534da.tar.gz
u-boot-imx-8b8362b43812c39af173c3d899804c619f9534da.tar.bz2
ENGR00219316-2: mx6q sabreauto enable lvds backlight by default
* Enable lvds backlight by default, configure io_expander A to enable backlight. * As weimnor_d18, spinor_d18, i2c3_sda share the pad MX6Q_PAD_EIM_D18 if wiemnor or spinor is enabled it overrides i2c3 settings and kernel fails to configure io_expander causing read/write errors. * This commit allows a default configuration on control lines behind io_expander A. Signed-off-by: Adrian Alonso <aalonso@freescale.com>
-rw-r--r--board/freescale/mx6q_sabreauto/mx6q_sabreauto.c57
1 files changed, 32 insertions, 25 deletions
diff --git a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c
index 3fb68cd..8dec1d2 100644
--- a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c
+++ b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c
@@ -62,6 +62,14 @@
#include <imx_otp.h>
#endif
+#ifdef CONFIG_MXC_GPIO
+#include <asm/gpio.h>
+#include <asm/arch/gpio.h>
+#endif
+
+#define I2C_EXP_RST IMX_GPIO_NR(1, 15)
+#define I2C3_STEER IMX_GPIO_NR(5, 4)
+
DECLARE_GLOBAL_DATA_PTR;
static enum boot_device boot_dev;
@@ -277,7 +285,6 @@ static void setup_uart(void)
#endif
}
-#ifdef CONFIG_VIDEO_MX5
#ifdef CONFIG_I2C_MXC
static void setup_i2c(unsigned int module_base)
{
@@ -336,14 +343,11 @@ static void setup_i2c(unsigned int module_base)
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_D18__I2C3_SDA);
/* EIM_A24__GPIO_5_4 steer logic enable */
mxc_iomux_v3_setup_pad(MX6Q_PAD_EIM_A24__GPIO_5_4);
- reg = readl(GPIO5_BASE_ADDR + GPIO_GDIR);
- reg |= (1 << 4);
- /* Set GPIO_5_4 as output */
- writel(reg, GPIO5_BASE_ADDR + GPIO_GDIR);
- reg = readl(GPIO5_BASE_ADDR + GPIO_DR);
- reg |= (1 << 4);
- /* Enable I2C3 SDA route path */
- writel(reg, GPIO5_BASE_ADDR + GPIO_DR);
+ /* I2C steer reset */
+ mxc_iomux_v3_setup_pad(MX6Q_PAD_SD2_DAT0__GPIO_1_15);
+ gpio_direction_output(I2C_EXP_RST, 1);
+ /* Enable I2C2 SDA route path */
+ gpio_direction_output(I2C3_STEER, 1);
}
#elif defined CONFIG_MX6DL
/* GPIO_3 for I2C3_SCL */
@@ -355,14 +359,11 @@ static void setup_i2c(unsigned int module_base)
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_D18__I2C3_SDA);
/* EIM_A24__GPIO_5_4 steer logic enable */
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_A24__GPIO_5_4);
- reg = readl(GPIO5_BASE_ADDR + GPIO_GDIR);
- reg |= (1 << 4);
- /* Set GPIO_5_4 as output */
- writel(reg, GPIO5_BASE_ADDR + GPIO_GDIR);
- reg = readl(GPIO5_BASE_ADDR + GPIO_DR);
- reg |= (1 << 4);
+ /* I2C steer reset */
+ mxc_iomux_v3_setup_pad(MX6DL_PAD_SD2_DAT0__GPIO_1_15);
+ gpio_direction_output(I2C_EXP_RST, 1);
/* Enable I2C3 SDA route path */
- writel(reg, GPIO5_BASE_ADDR + GPIO_DR);
+ gpio_direction_output(I2C3_STEER, 1);
}
#endif
/* Enable i2c clock */
@@ -393,7 +394,6 @@ void setup_lvds_poweron(void)
#endif
}
#endif
-#endif
s32 spi_get_cfg(struct imx_spi_dev_t *dev)
{
@@ -464,8 +464,11 @@ void spi_io_init(struct imx_spi_dev_t *dev)
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_EB2__ECSPI1_SS0);
else if (dev->ss == 1)
mxc_iomux_v3_setup_pad(MX6DL_PAD_EIM_D19__ECSPI1_SS1);
-
#endif
+ if (!mx6_board_is_reva()) {
+ /* Enable spi-nor route path */
+ gpio_set_value(I2C3_STEER, 0);
+ }
break;
case ECSPI2_BASE_ADDR:
case ECSPI3_BASE_ADDR:
@@ -699,6 +702,12 @@ static void setup_nor(void)
mxc_iomux_v3_setup_multiple_pads(nor_pads,
ARRAY_SIZE(nor_pads));
+
+ if (!mx6_board_is_reva()) {
+ /* Enable weim-nor route path */
+ gpio_set_value(I2C3_STEER, 0);
+ }
+
weim_norflash_cs_setup();
}
#endif
@@ -955,6 +964,11 @@ int board_init(void)
setup_uart();
+#ifdef CONFIG_I2C_MXC
+ setup_i2c(CONFIG_SYS_I2C_PORT);
+ /* Enable lvds power */
+ setup_lvds_poweron();
+#endif
#ifdef CONFIG_CMD_WEIMNOR
setup_nor();
#endif
@@ -963,13 +977,6 @@ int board_init(void)
#endif
#ifdef CONFIG_VIDEO_MX5
-
-#ifdef CONFIG_I2C_MXC
- setup_i2c(CONFIG_SYS_I2C_PORT);
- /* Enable lvds power */
- setup_lvds_poweron();
-#endif
-
panel_info_init();
gd->fb_base = CONFIG_FB_BASE;