MLK-14845 mx6/mx7: Not call usb setup functions used by non-DM driver
authorYe Li <ye.li@nxp.com>
Tue, 9 May 2017 05:43:05 +0000 (00:43 -0500)
committerYe Li <ye.li@nxp.com>
Tue, 9 May 2017 08:22:11 +0000 (03:22 -0500)
Use CONFIG_DM_USB to comment out USB setup functions used by non-DM driver. So
they won't be executed when using DM driver.

These USB setup functions may setup power control pins to USB_PWR function not GPIO,
which is different as the GPIO function used by USB vbus-supply. And cause the power control
not work.

Signed-off-by: Ye Li <ye.li@nxp.com>
17 files changed:
board/freescale/mx6dqscm/mx6dqscm.c
board/freescale/mx6qarm2/mx6qarm2.c
board/freescale/mx6qsabreauto/mx6qsabreauto.c
board/freescale/mx6sabresd/mx6sabresd.c
board/freescale/mx6slevk/mx6slevk.c
board/freescale/mx6sll_arm2/mx6sll_arm2.c
board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c
board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c
board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
board/freescale/mx6sxsabresd/mx6sxsabresd.c
board/freescale/mx6sxscm/mx6sxscm.c
board/freescale/mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c
board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c
board/freescale/mx6ul_14x14_lpddr2_arm2/mx6ul_14x14_lpddr2_arm2.c
board/freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c
board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c
board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c

index ffae922..55b8203 100644 (file)
@@ -627,6 +627,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -708,6 +709,7 @@ int board_ehci_power(int port, int on)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -733,7 +735,19 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#else
+       /*
+        * set daisy chain for otg_pin_id on 6q.
+        * for 6dl, this bit is reserved
+        */
+       #ifdef CONFIG_SCMEVB
+               imx_iomux_set_gpr_register(1, 13, 1, 0);
+       #else
+               imx_iomux_set_gpr_register(1, 13, 1, 1);
+       #endif
+#endif
 #endif
 
 #ifdef CONFIG_PCIE_IMX
index 618501a..fe5afae 100644 (file)
@@ -239,6 +239,7 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -274,6 +275,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -288,7 +290,15 @@ int board_init(void)
        gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#else
+       /*
+        * set daisy chain for otg_pin_id on 6q.
+        * for 6dl, this bit is reserved
+        */
+       imx_iomux_set_gpr_register(1, 13, 1, 1);
+#endif
 #endif
 
        return 0;
index 83d86b0..3565780 100644 (file)
@@ -718,7 +718,7 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
-
+#ifndef CONFIG_DM_USB
 iomux_v3_cfg_t const usb_otg_pads[] = {
        MX6_PAD_ENET_RX_ER__USB_OTG_ID | MUX_PAD_CTRL(OTG_ID_PAD_CTRL),
 };
@@ -798,6 +798,7 @@ int board_ehci_power(int port, int on)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -858,7 +859,15 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#else
+       /*
+         * Set daisy chain for otg_pin_id on 6q.
+        *  For 6dl, this bit is reserved.
+        */
+       imx_iomux_set_gpr_register(1, 13, 1, 0);
+#endif
 #endif
 
        return 0;
index 9f11f36..b655347 100644 (file)
@@ -827,6 +827,8 @@ int board_eth_init(bd_t *bis)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -889,6 +891,7 @@ int board_ehci_power(int port, int on)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -914,7 +917,15 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#else
+       /*
+        * set daisy chain for otg_pin_id on 6q.
+        * for 6dl, this bit is reserved
+        */
+       imx_iomux_set_gpr_register(1, 13, 1, 0);
+#endif
 #endif
 
 #ifdef CONFIG_PCIE_IMX
index f5b6646..f60df7f 100644 (file)
@@ -573,6 +573,8 @@ static int setup_fec(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -614,6 +616,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -825,7 +828,9 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#endif
 #endif
 
        return 0;
index 46f16b7..bde8962 100644 (file)
@@ -669,6 +669,8 @@ void epdc_power_off(void)
 
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 iomux_v3_cfg_t const usb_otg1_pads[] = {
@@ -718,6 +720,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
index 50a1949..f863e5d 100644 (file)
@@ -732,6 +732,8 @@ int board_early_init_f(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -768,6 +770,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_init(void)
 {
@@ -800,7 +803,9 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
+#endif
 #endif
        return 0;
 }
index 666bcf0..0404996 100644 (file)
@@ -739,6 +739,8 @@ int board_early_init_f(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -778,6 +780,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_init(void)
 {
@@ -806,8 +809,10 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
 #endif
+#endif
 
 #ifdef CONFIG_FSL_QSPI
        board_qspi_init();
index 09cdd12..648dbf0 100644 (file)
@@ -217,6 +217,8 @@ void ldo_mode_set(int ldo_bypass)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -258,6 +260,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -499,8 +502,10 @@ int board_init(void)
        dm_gpio_set_value(&desc, 0);
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
 #endif
+#endif
 
 #ifdef CONFIG_FSL_QSPI
        board_qspi_init();
index 70e8be4..9563acf 100644 (file)
@@ -486,6 +486,8 @@ void ldo_mode_set(int ldo_bypass)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -527,6 +529,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_phy_config(struct phy_device *phydev)
 {
@@ -930,8 +933,10 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
 #endif
+#endif
 
 #ifdef CONFIG_FSL_QSPI
        board_qspi_init();
index c216a6f..a5a559b 100644 (file)
@@ -527,6 +527,8 @@ void ldo_mode_set(int ldo_bypass)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -568,6 +570,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 int board_phy_config(struct phy_device *phydev)
 {
@@ -911,8 +914,10 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
 #endif
+#endif
 
 #ifdef CONFIG_FSL_QSPI
        board_qspi_init();
index ab98321..645e8d1 100644 (file)
@@ -1010,6 +1010,8 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 iomux_v3_cfg_t const usb_otg1_pads[] = {
@@ -1063,3 +1065,4 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
index 2aea9d0..8b707b6 100644 (file)
@@ -586,6 +586,8 @@ int board_mmc_init(bd_t *bis)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 
@@ -624,6 +626,7 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
 
 #ifdef CONFIG_NAND_MXS
 static iomux_v3_cfg_t const nand_pads[] = {
@@ -864,8 +867,10 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
        setup_usb();
 #endif
+#endif
 
 #ifdef CONFIG_FSL_QSPI
        board_qspi_init();
index 62cb25d..ee6d725 100644 (file)
@@ -947,6 +947,8 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 iomux_v3_cfg_t const usb_otg1_pads[] = {
@@ -1000,3 +1002,4 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
index 8e9630e..3ba85ec 100644 (file)
@@ -1137,6 +1137,8 @@ int checkboard(void)
 }
 
 #ifdef CONFIG_USB_EHCI_MX6
+#ifndef CONFIG_DM_USB
+
 #define USB_OTHERREGS_OFFSET   0x800
 #define UCTRL_PWR_POL          (1 << 9)
 iomux_v3_cfg_t const usb_otg1_pads[] = {
@@ -1190,3 +1192,4 @@ int board_ehci_hcd_init(int port)
        return 0;
 }
 #endif
+#endif
index b3d4621..50b566c 100644 (file)
@@ -456,6 +456,7 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX7
+#ifndef CONFIG_DM_USB
 iomux_v3_cfg_t const usb_otg1_pads[] = {
        MX7D_PAD_GPIO1_IO05__USB_OTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
@@ -470,6 +471,7 @@ static void setup_usb(void)
        imx_iomux_v3_setup_multiple_pads(usb_otg2_pads, ARRAY_SIZE(usb_otg2_pads));
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -481,7 +483,9 @@ int board_early_init_f(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX7
+#ifndef CONFIG_DM_USB
        setup_usb();
+#endif
 #endif
 
        return 0;
index eee112a..b6c2b39 100644 (file)
@@ -442,6 +442,8 @@ int board_spi_cs_gpio(unsigned bus, unsigned cs)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX7
+#ifndef CONFIG_DM_USB
+
 iomux_v3_cfg_t const usb_otg1_pads[] = {
        MX7D_PAD_GPIO1_IO05__USB_OTG1_PWR | MUX_PAD_CTRL(NO_PAD_CTRL),
 };
@@ -456,6 +458,7 @@ static void setup_usb(void)
        imx_iomux_v3_setup_multiple_pads(usb_otg2_pads, ARRAY_SIZE(usb_otg2_pads));
 }
 #endif
+#endif
 
 int board_early_init_f(void)
 {
@@ -467,7 +470,9 @@ int board_early_init_f(void)
 #endif
 
 #ifdef CONFIG_USB_EHCI_MX7
+#ifndef CONFIG_DM_USB
        setup_usb();
+#endif
 #endif
        return 0;
 }