diff options
-rw-r--r-- | board/freescale/mx6q_sabreauto/mx6q_sabreauto.c | 57 |
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; |