From 32d4060f845d189308d3431a7df4931ab4bd8f01 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Tue, 9 May 2017 00:43:05 -0500 Subject: [PATCH] MLK-14845 mx6/mx7: Not call usb setup functions used by non-DM driver 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 --- board/freescale/mx6dqscm/mx6dqscm.c | 14 ++++++++++++++ board/freescale/mx6qarm2/mx6qarm2.c | 10 ++++++++++ board/freescale/mx6qsabreauto/mx6qsabreauto.c | 11 ++++++++++- board/freescale/mx6sabresd/mx6sabresd.c | 11 +++++++++++ board/freescale/mx6slevk/mx6slevk.c | 5 +++++ board/freescale/mx6sll_arm2/mx6sll_arm2.c | 3 +++ .../freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c | 5 +++++ .../freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c | 5 +++++ board/freescale/mx6sxsabreauto/mx6sxsabreauto.c | 5 +++++ board/freescale/mx6sxsabresd/mx6sxsabresd.c | 5 +++++ board/freescale/mx6sxscm/mx6sxscm.c | 5 +++++ .../mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c | 3 +++ board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c | 5 +++++ .../mx6ul_14x14_lpddr2_arm2.c | 3 +++ .../freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c | 3 +++ .../mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c | 4 ++++ .../mx7d_19x19_lpddr3_arm2.c | 5 +++++ 17 files changed, 101 insertions(+), 1 deletion(-) diff --git a/board/freescale/mx6dqscm/mx6dqscm.c b/board/freescale/mx6dqscm/mx6dqscm.c index ffae922f8d..55b8203658 100644 --- a/board/freescale/mx6dqscm/mx6dqscm.c +++ b/board/freescale/mx6dqscm/mx6dqscm.c @@ -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 diff --git a/board/freescale/mx6qarm2/mx6qarm2.c b/board/freescale/mx6qarm2/mx6qarm2.c index 618501aa1d..fe5afae9fc 100644 --- a/board/freescale/mx6qarm2/mx6qarm2.c +++ b/board/freescale/mx6qarm2/mx6qarm2.c @@ -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; diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 83d86b0206..3565780999 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -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; diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 9f11f368c9..b65534728a 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -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 diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index f5b6646b0c..f60df7fee8 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -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; diff --git a/board/freescale/mx6sll_arm2/mx6sll_arm2.c b/board/freescale/mx6sll_arm2/mx6sll_arm2.c index 46f16b7554..bde8962ef9 100644 --- a/board/freescale/mx6sll_arm2/mx6sll_arm2.c +++ b/board/freescale/mx6sll_arm2/mx6sll_arm2.c @@ -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) { diff --git a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c index 50a19493e7..f863e5d340 100644 --- a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c +++ b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c @@ -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; } diff --git a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c index 666bcf0dbf..0404996102 100644 --- a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c +++ b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c @@ -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(); diff --git a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c index 09cdd12aaa..648dbf06ea 100644 --- a/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c +++ b/board/freescale/mx6sxsabreauto/mx6sxsabreauto.c @@ -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(); diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 70e8be4ce6..9563acfd2c 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -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(); diff --git a/board/freescale/mx6sxscm/mx6sxscm.c b/board/freescale/mx6sxscm/mx6sxscm.c index c216a6fad4..a5a559b864 100644 --- a/board/freescale/mx6sxscm/mx6sxscm.c +++ b/board/freescale/mx6sxscm/mx6sxscm.c @@ -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(); diff --git a/board/freescale/mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c b/board/freescale/mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c index ab9832112c..645e8d1465 100644 --- a/board/freescale/mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c +++ b/board/freescale/mx6ul_14x14_ddr3_arm2/mx6ul_14x14_ddr3_arm2.c @@ -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 diff --git a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c index 2aea9d0fe2..8b707b6c9c 100644 --- a/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c +++ b/board/freescale/mx6ul_14x14_evk/mx6ul_14x14_evk.c @@ -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(); diff --git a/board/freescale/mx6ul_14x14_lpddr2_arm2/mx6ul_14x14_lpddr2_arm2.c b/board/freescale/mx6ul_14x14_lpddr2_arm2/mx6ul_14x14_lpddr2_arm2.c index 62cb25dbde..ee6d725bf9 100644 --- a/board/freescale/mx6ul_14x14_lpddr2_arm2/mx6ul_14x14_lpddr2_arm2.c +++ b/board/freescale/mx6ul_14x14_lpddr2_arm2/mx6ul_14x14_lpddr2_arm2.c @@ -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 diff --git a/board/freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c b/board/freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c index 8e9630e5a4..3ba85ec3c6 100644 --- a/board/freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c +++ b/board/freescale/mx6ull_ddr3_arm2/mx6ull_ddr3_arm2.c @@ -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 diff --git a/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c b/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c index b3d4621cf5..50b566c1e6 100644 --- a/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c +++ b/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c @@ -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; diff --git a/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c b/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c index eee112a3b4..b6c2b39c22 100644 --- a/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c +++ b/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c @@ -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; } -- 2.17.1