Commit fc5b42a2db9557f5637c56e7ed06337059312eba
1 parent
09d565c4ab
Exists in
smarc_8mq-imx_v2020.04_5.4.24_2.1.0
and in
3 other branches
MLK-21956-3 mx6qdlsabreauto: Enable i2c gpio mux to fix io expander issue
The i2c gpio mux is not enabled, this causes i2c3 not work and all io expander devices on i2c3 not work. So we will meet such as "usb start" fail due to the VBUS is not power up. The patch add the i2c mux and i2c gpio mux configs. And remove codes of controlling i2c steering from board, since i2c gpio mux does same thing. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit 39183dc231e12c3072ffd9a37ac6a6616178e263)
Showing 14 changed files with 54 additions and 20 deletions Side-by-side Diff
- board/freescale/mx6sabreauto/mx6sabreauto.c
- configs/mx6dlsabreauto_defconfig
- configs/mx6dlsabreauto_optee_defconfig
- configs/mx6dlsabreauto_plugin_defconfig
- configs/mx6qpsabreauto_defconfig
- configs/mx6qpsabreauto_optee_defconfig
- configs/mx6qpsabreauto_plugin_defconfig
- configs/mx6qpsabreauto_sata_defconfig
- configs/mx6qsabreauto_defconfig
- configs/mx6qsabreauto_optee_defconfig
- configs/mx6qsabreauto_plugin_defconfig
- configs/mx6qsabreauto_sata_defconfig
- configs/mx6solosabreauto_defconfig
- configs/mx6solosabreauto_optee_defconfig
board/freescale/mx6sabreauto/mx6sabreauto.c
... | ... | @@ -134,10 +134,6 @@ |
134 | 134 | #endif |
135 | 135 | #endif |
136 | 136 | |
137 | -static iomux_v3_cfg_t const i2c3_pads[] = { | |
138 | - IOMUX_PADS(PAD_EIM_A24__GPIO5_IO04 | MUX_PAD_CTRL(NO_PAD_CTRL)), | |
139 | -}; | |
140 | - | |
141 | 137 | static iomux_v3_cfg_t const port_exp[] = { |
142 | 138 | IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | MUX_PAD_CTRL(NO_PAD_CTRL)), |
143 | 139 | }; |
144 | 140 | |
... | ... | @@ -232,9 +228,22 @@ |
232 | 228 | |
233 | 229 | static void setup_iomux_eimnor(void) |
234 | 230 | { |
231 | + int ret; | |
232 | + struct gpio_desc desc; | |
233 | + | |
235 | 234 | SETUP_IOMUX_PADS(eimnor_pads); |
236 | 235 | |
237 | - gpio_direction_output(IMX_GPIO_NR(5, 4), 0); | |
236 | + ret = dm_gpio_lookup_name("GPIO5_4", &desc); | |
237 | + if (ret) { | |
238 | + printf("%s lookup GPIO5_4 failed ret = %d\n", __func__, ret); | |
239 | + return; | |
240 | + } | |
241 | + ret = dm_gpio_request(&desc, "steer ctrl"); | |
242 | + if (ret) { | |
243 | + printf("%s request steer logic failed ret = %d\n", __func__, ret); | |
244 | + return; | |
245 | + } | |
246 | + dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE | GPIOD_ACTIVE_LOW); | |
238 | 247 | |
239 | 248 | eimnor_cs_setup(); |
240 | 249 | } |
241 | 250 | |
... | ... | @@ -596,9 +605,22 @@ |
596 | 605 | |
597 | 606 | void setup_spinor(void) |
598 | 607 | { |
608 | + int ret; | |
609 | + struct gpio_desc desc; | |
610 | + | |
599 | 611 | SETUP_IOMUX_PADS(ecspi1_pads); |
600 | 612 | |
601 | - gpio_direction_output(IMX_GPIO_NR(5, 4), 0); | |
613 | + ret = dm_gpio_lookup_name("GPIO5_4", &desc); | |
614 | + if (ret) { | |
615 | + printf("%s lookup GPIO5_4 failed ret = %d\n", __func__, ret); | |
616 | + return; | |
617 | + } | |
618 | + ret = dm_gpio_request(&desc, "steer ctrl"); | |
619 | + if (ret) { | |
620 | + printf("%s request steer logic failed ret = %d\n", __func__, ret); | |
621 | + return; | |
622 | + } | |
623 | + dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE | GPIOD_ACTIVE_LOW); | |
602 | 624 | } |
603 | 625 | #endif |
604 | 626 | |
... | ... | @@ -631,20 +653,6 @@ |
631 | 653 | setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info2); |
632 | 654 | #endif |
633 | 655 | #endif |
634 | - | |
635 | - /* I2C 3 Steer */ | |
636 | - ret = dm_gpio_lookup_name("GPIO5_4", &desc); | |
637 | - if (ret) { | |
638 | - printf("%s lookup GPIO5_4 failed ret = %d\n", __func__, ret); | |
639 | - return -ENODEV; | |
640 | - } | |
641 | - ret = dm_gpio_request(&desc, "steer logic"); | |
642 | - if (ret) { | |
643 | - printf("%s request steer logic failed ret = %d\n", __func__, ret); | |
644 | - return -ENODEV; | |
645 | - } | |
646 | - dm_gpio_set_dir_flags(&desc, GPIOD_IS_OUT | GPIOD_IS_OUT_ACTIVE); | |
647 | - SETUP_IOMUX_PADS(i2c3_pads); | |
648 | 656 | |
649 | 657 | ret = dm_gpio_lookup_name("GPIO1_15", &desc); |
650 | 658 | if (ret) { |
configs/mx6dlsabreauto_defconfig
configs/mx6dlsabreauto_optee_defconfig
configs/mx6dlsabreauto_plugin_defconfig
configs/mx6qpsabreauto_defconfig
configs/mx6qpsabreauto_optee_defconfig
configs/mx6qpsabreauto_plugin_defconfig
configs/mx6qpsabreauto_sata_defconfig
configs/mx6qsabreauto_defconfig
configs/mx6qsabreauto_optee_defconfig
configs/mx6qsabreauto_plugin_defconfig
configs/mx6qsabreauto_sata_defconfig
configs/mx6solosabreauto_defconfig