diff options
author | Ye Li <ye.li@nxp.com> | 2017-05-15 04:04:07 -0500 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-05-15 04:08:54 -0500 |
commit | 25515dfb16d987931152c1d93aed3a16f7197921 (patch) | |
tree | 8a8e0f632da27a13dd9f3190657f493796fcd57c /board | |
parent | 09f2bc9e534bd9235a298bac6f0df940b315e9b6 (diff) | |
download | u-boot-imx-25515dfb16d987931152c1d93aed3a16f7197921.zip u-boot-imx-25515dfb16d987931152c1d93aed3a16f7197921.tar.gz u-boot-imx-25515dfb16d987931152c1d93aed3a16f7197921.tar.bz2 |
MLK-14890 i2c: Enable I2C force idle bus
This patch enables the I2C force idle bus for all i.MX6 and i.MX7 boards to avoid
i2c bus problem during reboot. To use it, we must add some i2c properties in DTB file
and the GPIO pinctrl for i2c.
For mx6qsabreauto, mx6slevk, mx6sxsabresd and mx6sxscm, these boards call the
setup_i2c. To remove conflict, change to use "setup_i2c" only for non-DM i2c driver.
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/mx6qsabreauto/mx6qsabreauto.c | 9 | ||||
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 7 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 4 | ||||
-rw-r--r-- | board/freescale/mx6sxscm/mx6sxscm.c | 4 |
4 files changed, 15 insertions, 9 deletions
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 3565780..159d9f3 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -130,7 +130,6 @@ static struct i2c_pads_info i2c_pad_info1 = { .gp = IMX_GPIO_NR(4, 13) } }; -#endif #ifndef CONFIG_SYS_FLASH_CFI /* @@ -150,6 +149,7 @@ static struct i2c_pads_info i2c_pad_info2 = { } }; #endif +#endif static iomux_v3_cfg_t const i2c3_pads[] = { MX6_PAD_EIM_A24__GPIO5_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL), @@ -819,16 +819,15 @@ int board_init(void) #ifdef CONFIG_SYS_I2C /* I2C 2 and 3 setup - I2C 3 hw mux with EIM */ setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); +#ifndef CONFIG_SYS_FLASH_CFI + setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); +#endif #endif /* I2C 3 Steer */ gpio_request(IMX_GPIO_NR(5, 4), "steer logic"); gpio_direction_output(IMX_GPIO_NR(5, 4), 1); imx_iomux_v3_setup_multiple_pads(i2c3_pads, ARRAY_SIZE(i2c3_pads)); - -#ifndef CONFIG_SYS_FLASH_CFI - setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); -#endif gpio_request(IMX_GPIO_NR(1, 15), "expander en"); gpio_direction_output(IMX_GPIO_NR(1, 15), 1); diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index 108305e..f541425 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -362,6 +362,7 @@ int board_mmc_init(bd_t *bis) #endif } +#ifdef CONFIG_SYS_I2C #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) /* I2C1 for PMIC */ struct i2c_pads_info i2c_pad_info1 = { @@ -376,6 +377,7 @@ struct i2c_pads_info i2c_pad_info1 = { .gp = IMX_GPIO_NR(3, 12), }, }; +#endif #ifdef CONFIG_POWER int power_init_board(void) @@ -817,11 +819,12 @@ int board_init(void) /* address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100; -#ifdef CONFIG_SYS_I2C_MXC +#ifdef CONFIG_SYS_I2C setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); - setup_elan_pads(); #endif + setup_elan_pads(); + #ifdef CONFIG_FEC_MXC setup_fec(); #endif diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 9563acf..f99048a 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -269,6 +269,7 @@ int board_eth_init(bd_t *bis) return cpu_eth_init(bis); } +#ifdef CONFIG_SYS_I2C #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) /* I2C1 for PMIC */ static struct i2c_pads_info i2c_pad_info1 = { @@ -297,6 +298,7 @@ struct i2c_pads_info i2c_pad_info2 = { .gp = IMX_GPIO_NR(1, 3), }, }; +#endif #ifdef CONFIG_POWER int power_init_board(void) @@ -927,7 +929,7 @@ int board_init(void) gpio_request(IMX_GPIO_NR(4, 16), "peri_3v3"); gpio_direction_output(IMX_GPIO_NR(4, 16) , 1); -#ifdef CONFIG_SYS_I2C_MXC +#ifdef CONFIG_SYS_I2C setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); #endif diff --git a/board/freescale/mx6sxscm/mx6sxscm.c b/board/freescale/mx6sxscm/mx6sxscm.c index a5a559b..36d527d 100644 --- a/board/freescale/mx6sxscm/mx6sxscm.c +++ b/board/freescale/mx6sxscm/mx6sxscm.c @@ -271,6 +271,7 @@ int mx6_rgmii_rework(struct phy_device *phydev) return 0; } +#ifdef CONFIG_SYS_I2C #define PC MUX_PAD_CTRL(I2C_PAD_CTRL) /* I2C1 for PMIC */ static struct i2c_pads_info i2c_pad_info1 = { @@ -313,6 +314,7 @@ struct i2c_pads_info i2c_pad_info4 = { .gp = IMX_GPIO_NR(1, 21), }, }; +#endif #ifdef CONFIG_POWER int power_init_board(void) @@ -907,7 +909,7 @@ int board_init(void) gpio_request(IMX_GPIO_NR(4, 16), "peri_3v3"); gpio_direction_output(IMX_GPIO_NR(4, 16) , 1); -#ifdef CONFIG_SYS_I2C_MXC +#ifdef CONFIG_SYS_I2C setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1); setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); setup_i2c(3, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info4); |