public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/7] Migrate omap_ehci to use phy driver
@ 2022-02-19 23:08 Adam Ford
  2022-02-19 23:08 ` [PATCH 1/7] usb: ehci-omap: Drop dead code Adam Ford
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

With the NOP PHY driver available, it can support toggling the
GPIOS to handle coming out of reset. This series cleans up 
the OMAP EHCI host driver, enables PHY support, and removes
the code to toggle the reset GPIO's.

This series was tested on an OMAP3530, DM3730, and an AM3517.
Users of the omap4_panda, omap3_beagle, omap5_uevm, omap3_evm
are asked to test since I do not have that hardware available
to me and get_maintainer.pl doesn't list the owners of the
affected defconfig files. 

Adam Ford (7):
  usb: ehci-omap: Drop dead code
  usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe
  phy: nop-phy: Fix enabling reset
  usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP
  usb: ehci-omap: Use PHY system to manage phy resets
  usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig
  configs: omap various:  Remove OMAP_EHCI_PHY from defconfigs

 arch/arm/include/asm/ehci-omap.h     |  13 ---
 configs/am3517_evm_defconfig         |   2 -
 configs/omap35_logic_somlv_defconfig |   2 -
 configs/omap3_beagle_defconfig       |   2 -
 configs/omap3_logic_somlv_defconfig  |   2 -
 configs/omap4_panda_defconfig        |   4 -
 configs/omap5_uevm_defconfig         |   4 -
 drivers/phy/nop-phy.c                |   5 +-
 drivers/usb/host/Kconfig             |  36 +-------
 drivers/usb/host/ehci-omap.c         | 126 +++++++++++++--------------
 10 files changed, 66 insertions(+), 130 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/7] usb: ehci-omap: Drop dead code
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-19 23:08 ` [PATCH 2/7] usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe Adam Ford
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

omap_ehci_hcd_stop appears to be dead code, and omap_ehci_hcd_init
is only called by the probe function, so it can be static to that
function.  Remove both from the header along with some additional
checking for DM_USB.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 arch/arm/include/asm/ehci-omap.h | 13 -------------
 drivers/usb/host/ehci-omap.c     | 17 +----------------
 2 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/arch/arm/include/asm/ehci-omap.h b/arch/arm/include/asm/ehci-omap.h
index f970bba937..2b51b5eb99 100644
--- a/arch/arm/include/asm/ehci-omap.h
+++ b/arch/arm/include/asm/ehci-omap.h
@@ -123,17 +123,4 @@ struct omap_ehci {
 	u32 insreg08;		/* 0xb0 */
 };
 
-#if !CONFIG_IS_ENABLED(DM_USB) || !CONFIG_IS_ENABLED(OF_CONTROL)
-/*
- * FIXME: forward declaration of this structs needed because omap got the
- * ehci implementation backwards. move out ehci_hcd_x from board files
- */
-struct ehci_hccr;
-struct ehci_hcor;
-
-int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata,
-		       struct ehci_hccr **hccr, struct ehci_hcor **hcor);
-int omap_ehci_hcd_stop(void);
-#endif
-
 #endif /* _OMAP_COMMON_EHCI_H_ */
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index d5facf10e1..d34c0add4a 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -163,27 +163,12 @@ static inline void omap_ehci_phy_reset(int on, int delay)
 #define omap_ehci_phy_reset(on, delay)	do {} while (0)
 #endif
 
-/* Reset is needed otherwise the kernel-driver will throw an error. */
-int omap_ehci_hcd_stop(void)
-{
-	debug("Resetting OMAP EHCI\n");
-	omap_ehci_phy_reset(1, 0);
-
-	if (omap_uhh_reset() < 0)
-		return -1;
-
-	if (omap_ehci_tll_reset() < 0)
-		return -1;
-
-	return 0;
-}
-
 /*
  * Initialize the OMAP EHCI controller and PHY.
  * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1
  * See there for additional Copyrights.
  */
-int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata)
+static int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata)
 {
 	int ret;
 	unsigned int i, reg = 0, rev = 0;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/7] usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
  2022-02-19 23:08 ` [PATCH 1/7] usb: ehci-omap: Drop dead code Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-19 23:08 ` [PATCH 3/7] phy: nop-phy: Fix enabling reset Adam Ford
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

The OMAP3 hierarchy has the ehci node as a sub-node of the
usbhshost. The usbhshost node contains an ohci and an ehci
subnode.  The configuration of the ehci belongs in the
EHCI node and not its parent.  Move it to the proper probe.

usb start
  starting USB...
  Bus ehci@48064800: USB EHCI 1.00
  Bus usb_otg_hs@480ab000: Port not available.
  scanning bus ehci@48064800 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/usb/host/ehci-omap.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index d34c0add4a..5f79279fe2 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -312,7 +312,7 @@ static int omap_usbhs_probe(struct udevice *dev)
 			omap_usbhs_set_mode(i, mode);
 	}
 
-	return omap_ehci_hcd_init(0, &usbhs_bdata);
+	return 0;
 }
 
 static const struct udevice_id omap_usbhs_dt_ids[] = {
@@ -355,6 +355,7 @@ static int omap_ehci_probe(struct udevice *dev)
 	struct ehci_omap_priv_data *priv = dev_get_priv(dev);
 	struct ehci_hccr *hccr;
 	struct ehci_hcor *hcor;
+	int ret;
 
 	priv->ehci = dev_read_addr_ptr(dev);
 	priv->portnr = dev_seq(dev);
@@ -363,6 +364,10 @@ static int omap_ehci_probe(struct udevice *dev)
 	hccr = (struct ehci_hccr *)&priv->ehci->hccapbase;
 	hcor = (struct ehci_hcor *)&priv->ehci->usbcmd;
 
+	ret = omap_ehci_hcd_init(0, &usbhs_bdata);
+	if (ret)
+		return ret;
+
 	return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
 }
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/7] phy: nop-phy: Fix enabling reset
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
  2022-02-19 23:08 ` [PATCH 1/7] usb: ehci-omap: Drop dead code Adam Ford
  2022-02-19 23:08 ` [PATCH 2/7] usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-19 23:08 ` [PATCH 4/7] usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP Adam Ford
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

The reset function should place the phy into reset, while the
init function should take the phy out of reset.  Currently the
reset function takes it out of reset, and the init calls the
reset.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/phy/nop-phy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/nop-phy.c b/drivers/phy/nop-phy.c
index b08eedd4d4..e2ee6e9206 100644
--- a/drivers/phy/nop-phy.c
+++ b/drivers/phy/nop-phy.c
@@ -28,7 +28,7 @@ static int nop_phy_reset(struct phy *phy)
 	if (!dm_gpio_is_valid(&priv->reset_gpio))
 		return 0;
 
-	return dm_gpio_set_value(&priv->reset_gpio, false);
+	return dm_gpio_set_value(&priv->reset_gpio, true);
 }
 #endif
 
@@ -44,7 +44,8 @@ static int nop_phy_init(struct phy *phy)
 	}
 
 #if CONFIG_IS_ENABLED(DM_GPIO)
-	ret = nop_phy_reset(phy);
+	/* Take phy out of reset */
+	ret = dm_gpio_set_value(&priv->reset_gpio, false);
 	if (ret) {
 		if (CONFIG_IS_ENABLED(CLK))
 			clk_disable_bulk(&priv->bulk);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/7] usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
                   ` (2 preceding siblings ...)
  2022-02-19 23:08 ` [PATCH 3/7] phy: nop-phy: Fix enabling reset Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-19 23:08 ` [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets Adam Ford
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

The USB_EHCI_OMAP driver currently has a series of Kconfig options
which let users specify a GPIO for the reset pin.  Some devices
may have only one reset, while others might have more.

Since there is a nop phy driver, let's selct enable the PHY
system, and imply the nop phy driver.  The nop phy driver can now
toggle the reset pins when putting the phy in and out of reset.

If the gpio is listed under the phy, it will get toggled and
the hard-coded config options specifying the GPIO numbers can
eventually go away.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/usb/host/Kconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 7743c962cf..f0fb66abad 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -191,6 +191,8 @@ config USB_EHCI_MXS
 config USB_EHCI_OMAP
 	bool "Support for OMAP3+ on-chip EHCI USB controller"
 	depends on ARCH_OMAP2PLUS
+	select PHY
+	imply NOP_PHY
 	default y
 	---help---
 	  Enables support for the on-chip EHCI controller on OMAP3 and later
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
                   ` (3 preceding siblings ...)
  2022-02-19 23:08 ` [PATCH 4/7] usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-23  4:28   ` Marek Vasut
  2022-02-19 23:08 ` [PATCH 6/7] usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig Adam Ford
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

There are a few boards that use hard-coded GPIO definitions in
their respective defconfig files.  If the GPIO's are listed
in their device trees, the nop-phy can toggle the GPIO's,
so the EHCI driver does not need to know anything about the
GPIO's. Add functions for getting the phys and remove the GPIO
toggles since the phy will now do that.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/usb/host/ehci-omap.c | 106 ++++++++++++++++++-----------------
 1 file changed, 56 insertions(+), 50 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 5f79279fe2..765336a3c4 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -128,47 +128,25 @@ static void omap_ehci_soft_phy_reset(int port)
 }
 #endif
 
-#if defined(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO) || \
-	defined(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO) || \
-	defined(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO)
-/* controls PHY(s) reset signal(s) */
-static inline void omap_ehci_phy_reset(int on, int delay)
-{
-	/*
-	 * Refer ISSUE1:
-	 * Hold the PHY in RESET for enough time till
-	 * PHY is settled and ready
-	 */
-	if (delay && !on)
-		udelay(delay);
-#ifdef CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
-	gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB PHY1 reset");
-	gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, !on);
-#endif
-#ifdef CONFIG_OMAP_EHCI_PHY2_RESET_GPIO
-	gpio_request(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, "USB PHY2 reset");
-	gpio_direction_output(CONFIG_OMAP_EHCI_PHY2_RESET_GPIO, !on);
-#endif
-#ifdef CONFIG_OMAP_EHCI_PHY3_RESET_GPIO
-	gpio_request(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, "USB PHY3 reset");
-	gpio_direction_output(CONFIG_OMAP_EHCI_PHY3_RESET_GPIO, !on);
-#endif
-
-	/* Hold the PHY in RESET for enough time till DIR is high */
-	/* Refer: ISSUE1 */
-	if (delay && on)
-		udelay(delay);
-}
-#else
-#define omap_ehci_phy_reset(on, delay)	do {} while (0)
+struct ehci_omap_priv_data {
+	struct ehci_ctrl ctrl;
+	struct omap_ehci *ehci;
+#ifdef CONFIG_DM_REGULATOR
+	struct udevice *vbus_supply;
 #endif
+	enum usb_init_type init_type;
+	int portnr;
+	struct phy phy[OMAP_HS_USB_PORTS];
+	int nports;
+};
 
 /*
  * Initialize the OMAP EHCI controller and PHY.
  * Based on "drivers/usb/host/ehci-omap.c" from Linux 3.1
  * See there for additional Copyrights.
  */
-static int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata)
+static int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pdata,
+			      struct udevice *dev)
 {
 	int ret;
 	unsigned int i, reg = 0, rev = 0;
@@ -179,8 +157,9 @@ static int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pda
 	if (ret < 0)
 		return ret;
 
-	/* Put the PHY in RESET */
-	omap_ehci_phy_reset(1, 10);
+	/* Hold the PHY in RESET for enough time till DIR is high */
+	/* Refer: ISSUE1 */
+	udelay(10);
 
 	ret = omap_uhh_reset();
 	if (ret < 0)
@@ -259,7 +238,12 @@ static int omap_ehci_hcd_init(int index, struct omap_usbhs_board_data *usbhs_pda
 		if (is_ehci_hsic_mode(usbhs_pdata->port_mode[i]))
 			omap_usbhs_hsic_init(i);
 
-	omap_ehci_phy_reset(0, 10);
+	/*
+	 * Refer ISSUE1:
+	 * Hold the PHY in RESET for enough time till
+	 * PHY is settled and ready
+	 */
+	udelay(10);
 
 	/*
 	 * An undocumented "feature" in the OMAP3 EHCI controller,
@@ -328,18 +312,6 @@ U_BOOT_DRIVER(usb_omaphs_host) = {
 	.flags	= DM_FLAG_ALLOC_PRIV_DMA,
 };
 
-struct ehci_omap_priv_data {
-	struct ehci_ctrl ctrl;
-	struct omap_ehci *ehci;
-#ifdef CONFIG_DM_REGULATOR
-	struct udevice *vbus_supply;
-#endif
-	enum usb_init_type init_type;
-	int portnr;
-	struct phy phy[OMAP_HS_USB_PORTS];
-	int nports;
-};
-
 static int ehci_usb_of_to_plat(struct udevice *dev)
 {
 	struct usb_plat *plat = dev_get_plat(dev);
@@ -349,6 +321,26 @@ static int ehci_usb_of_to_plat(struct udevice *dev)
 	return 0;
 }
 
+/*
+ * This driver references phys based on the USB port.  If
+ * the port is unused, the corresponding phy is listed as NULL
+ * which generic_phy_init_bulk treats as an error, so we need
+ * a custom one that tolerates empty phys
+ */
+static int omap_ehci_phy_get(struct udevice *dev)
+{
+	struct ehci_omap_priv_data *priv = dev_get_priv(dev);
+	int i, ret;
+
+	for (i = 0; i < OMAP_HS_USB_PORTS; i++) {
+		ret = generic_phy_get_by_index(dev, i, &priv->phy[i]);
+		if (ret && ret != -ENOENT)
+			return ret;
+	};
+
+	return 0;
+};
+
 static int omap_ehci_probe(struct udevice *dev)
 {
 	struct usb_plat *plat = dev_get_plat(dev);
@@ -364,7 +356,21 @@ static int omap_ehci_probe(struct udevice *dev)
 	hccr = (struct ehci_hccr *)&priv->ehci->hccapbase;
 	hcor = (struct ehci_hcor *)&priv->ehci->usbcmd;
 
-	ret = omap_ehci_hcd_init(0, &usbhs_bdata);
+	/* Identify Phys */
+	ret = omap_ehci_phy_get(dev);
+	if (ret) {
+		printf("Failed to get phys\n");
+		return ret;
+	}
+
+	/* Register the EHCI */
+	ret = ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
+	if (ret) {
+		printf("Failed to register EHCI\n");
+		return ret;
+	}
+
+	ret = omap_ehci_hcd_init(0, &usbhs_bdata, dev);
 	if (ret)
 		return ret;
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/7] usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
                   ` (4 preceding siblings ...)
  2022-02-19 23:08 ` [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-19 23:08 ` [PATCH 7/7] configs: omap various: Remove OMAP_EHCI_PHY from defconfigs Adam Ford
  2022-02-22  0:24 ` [PATCH 0/7] Migrate omap_ehci to use phy driver Derald Woods
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

With the omap-ehci driver now using the phy subsystem to enable
and disable reset, the driver no longer needs to know which
GPIO's are used, and they can be removed from Kconfig.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 drivers/usb/host/Kconfig | 34 ----------------------------------
 1 file changed, 34 deletions(-)

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index f0fb66abad..8f77412cc7 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -198,40 +198,6 @@ config USB_EHCI_OMAP
 	  Enables support for the on-chip EHCI controller on OMAP3 and later
 	  SoCs.
 
-if USB_EHCI_OMAP
-
-config HAS_OMAP_EHCI_PHY1_RESET_GPIO
-	bool "PHY #1 requires a GPIO hold to it in RESET while PHY settles"
-	help
-	  Enable this to be able to configure the GPIO number used to hold the
-	  PHY in RESET for enough time until the PHY is settled and ready.
-
-config OMAP_EHCI_PHY1_RESET_GPIO
-	int "GPIO number to hold PHY #1 in RESET"
-	depends on HAS_OMAP_EHCI_PHY1_RESET_GPIO
-
-config HAS_OMAP_EHCI_PHY2_RESET_GPIO
-	bool "PHY #2 requires a GPIO hold to it in RESET while PHY settles"
-	help
-	  Enable this to be able to configure the GPIO number used to hold the
-	  PHY in RESET for enough time until the PHY is settled and ready.
-
-config OMAP_EHCI_PHY2_RESET_GPIO
-	int "GPIO number to hold PHY #2 in RESET"
-	depends on HAS_OMAP_EHCI_PHY2_RESET_GPIO
-
-config HAS_OMAP_EHCI_PHY3_RESET_GPIO
-	bool "PHY #3 requires a GPIO hold to it in RESET while PHY settles"
-	help
-	  Enable this to be able to configure the GPIO number used to hold the
-	  PHY in RESET for enough time until the PHY is settled and ready.
-
-config OMAP_EHCI_PHY3_RESET_GPIO
-	int "GPIO number to hold PHY #3 in RESET"
-	depends on HAS_OMAP_EHCI_PHY3_RESET_GPIO
-
-endif
-
 config USB_EHCI_VF
 	bool "Support for Vybrid on-chip EHCI USB controller"
 	depends on ARCH_VF610
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/7] configs: omap various: Remove OMAP_EHCI_PHY from defconfigs
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
                   ` (5 preceding siblings ...)
  2022-02-19 23:08 ` [PATCH 6/7] usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig Adam Ford
@ 2022-02-19 23:08 ` Adam Ford
  2022-02-22  0:24 ` [PATCH 0/7] Migrate omap_ehci to use phy driver Derald Woods
  7 siblings, 0 replies; 11+ messages in thread
From: Adam Ford @ 2022-02-19 23:08 UTC (permalink / raw)
  To: u-boot; +Cc: marex, trini, woods.technical, Adam Ford

With the Kconfig options being deleted, the references to
OMAP_EHCI_PHY are useless.  Remove them from the various
defconfigs.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
 configs/am3517_evm_defconfig         | 2 --
 configs/omap35_logic_somlv_defconfig | 2 --
 configs/omap3_beagle_defconfig       | 2 --
 configs/omap3_logic_somlv_defconfig  | 2 --
 configs/omap4_panda_defconfig        | 4 ----
 configs/omap5_uevm_defconfig         | 4 ----
 6 files changed, 16 deletions(-)

diff --git a/configs/am3517_evm_defconfig b/configs/am3517_evm_defconfig
index a38dd4ba37..e287e8e6be 100644
--- a/configs/am3517_evm_defconfig
+++ b/configs/am3517_evm_defconfig
@@ -84,8 +84,6 @@ CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY1_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY1_RESET_GPIO=57
 CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_AM35X=y
 CONFIG_BCH=y
diff --git a/configs/omap35_logic_somlv_defconfig b/configs/omap35_logic_somlv_defconfig
index 3937299008..846b30a8f5 100644
--- a/configs/omap35_logic_somlv_defconfig
+++ b/configs/omap35_logic_somlv_defconfig
@@ -90,8 +90,6 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 # CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY1_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY1_RESET_GPIO=4
 CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
diff --git a/configs/omap3_beagle_defconfig b/configs/omap3_beagle_defconfig
index 80e2cc616c..206118e6af 100644
--- a/configs/omap3_beagle_defconfig
+++ b/configs/omap3_beagle_defconfig
@@ -89,8 +89,6 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 # CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY1_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY1_RESET_GPIO=147
 CONFIG_USB_OMAP3=y
 CONFIG_USB_MUSB_GADGET=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
diff --git a/configs/omap3_logic_somlv_defconfig b/configs/omap3_logic_somlv_defconfig
index e5c94f05e1..ecb3d47331 100644
--- a/configs/omap3_logic_somlv_defconfig
+++ b/configs/omap3_logic_somlv_defconfig
@@ -91,8 +91,6 @@ CONFIG_OMAP3_SPI=y
 CONFIG_USB=y
 # CONFIG_SPL_DM_USB is not set
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY1_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY1_RESET_GPIO=4
 CONFIG_USB_MUSB_HOST=y
 CONFIG_USB_MUSB_OMAP2PLUS=y
 CONFIG_TWL4030_USB=y
diff --git a/configs/omap4_panda_defconfig b/configs/omap4_panda_defconfig
index 13df606cc4..03e1a6b70d 100644
--- a/configs/omap4_panda_defconfig
+++ b/configs/omap4_panda_defconfig
@@ -42,10 +42,6 @@ CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY1_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY1_RESET_GPIO=1
-CONFIG_HAS_OMAP_EHCI_PHY2_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY2_RESET_GPIO=62
 CONFIG_USB_OMAP3=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_SMSC95XX=y
diff --git a/configs/omap5_uevm_defconfig b/configs/omap5_uevm_defconfig
index 52f3784c7c..4c66a4cb39 100644
--- a/configs/omap5_uevm_defconfig
+++ b/configs/omap5_uevm_defconfig
@@ -52,10 +52,6 @@ CONFIG_CONS_INDEX=3
 CONFIG_SYS_NS16550=y
 CONFIG_USB=y
 CONFIG_USB_EHCI_HCD=y
-CONFIG_HAS_OMAP_EHCI_PHY2_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY2_RESET_GPIO=80
-CONFIG_HAS_OMAP_EHCI_PHY3_RESET_GPIO=y
-CONFIG_OMAP_EHCI_PHY3_RESET_GPIO=79
 CONFIG_USB_DWC3=y
 CONFIG_USB_DWC3_OMAP=y
 CONFIG_USB_DWC3_PHY_OMAP=y
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/7] Migrate omap_ehci to use phy driver
  2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
                   ` (6 preceding siblings ...)
  2022-02-19 23:08 ` [PATCH 7/7] configs: omap various: Remove OMAP_EHCI_PHY from defconfigs Adam Ford
@ 2022-02-22  0:24 ` Derald Woods
  2022-02-23  4:28   ` Marek Vasut
  7 siblings, 1 reply; 11+ messages in thread
From: Derald Woods @ 2022-02-22  0:24 UTC (permalink / raw)
  To: Adam Ford; +Cc: U-Boot Mailing List, marex, Tom Rini

On Sat, Feb 19, 2022 at 5:09 PM Adam Ford <aford173@gmail.com> wrote:

> With the NOP PHY driver available, it can support toggling the
> GPIOS to handle coming out of reset. This series cleans up
> the OMAP EHCI host driver, enables PHY support, and removes
> the code to toggle the reset GPIO's.
>
> This series was tested on an OMAP3530, DM3730, and an AM3517.
> Users of the omap4_panda, omap3_beagle, omap5_uevm, omap3_evm
> are asked to test since I do not have that hardware available
> to me and get_maintainer.pl doesn't list the owners of the
> affected defconfig files.
>
> Adam Ford (7):
>   usb: ehci-omap: Drop dead code
>   usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe
>   phy: nop-phy: Fix enabling reset
>   usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP
>   usb: ehci-omap: Use PHY system to manage phy resets
>   usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig
>   configs: omap various:  Remove OMAP_EHCI_PHY from defconfigs
>
>  arch/arm/include/asm/ehci-omap.h     |  13 ---
>  configs/am3517_evm_defconfig         |   2 -
>  configs/omap35_logic_somlv_defconfig |   2 -
>  configs/omap3_beagle_defconfig       |   2 -
>  configs/omap3_logic_somlv_defconfig  |   2 -
>  configs/omap4_panda_defconfig        |   4 -
>  configs/omap5_uevm_defconfig         |   4 -
>  drivers/phy/nop-phy.c                |   5 +-
>  drivers/usb/host/Kconfig             |  36 +-------
>  drivers/usb/host/ehci-omap.c         | 126 +++++++++++++--------------
>  10 files changed, 66 insertions(+), 130 deletions(-)
>
> --
> 2.32.0
>
>
Works for me using 'omap3_beagle_defconfig' on Beagle Rev. C4 (3530) and
Beagle xM (3730).

Tested-by: Derald D. Woods <woods.technical@gmail.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets
  2022-02-19 23:08 ` [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets Adam Ford
@ 2022-02-23  4:28   ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2022-02-23  4:28 UTC (permalink / raw)
  To: Adam Ford, u-boot; +Cc: trini, woods.technical

On 2/20/22 00:08, Adam Ford wrote:

[...]

> @@ -364,7 +356,21 @@ static int omap_ehci_probe(struct udevice *dev)
>   	hccr = (struct ehci_hccr *)&priv->ehci->hccapbase;
>   	hcor = (struct ehci_hcor *)&priv->ehci->usbcmd;
>   
> -	ret = omap_ehci_hcd_init(0, &usbhs_bdata);
> +	/* Identify Phys */
> +	ret = omap_ehci_phy_get(dev);
> +	if (ret) {
> +		printf("Failed to get phys\n");
> +		return ret;

It would be good to print the return values here (ret=%d), since in case 
there is an actual failure, you can infer what happened from that return 
value without having to patch the code to add that missing return value 
print.

Subsequent patch would be fine, assuming CI passes.

[...]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/7] Migrate omap_ehci to use phy driver
  2022-02-22  0:24 ` [PATCH 0/7] Migrate omap_ehci to use phy driver Derald Woods
@ 2022-02-23  4:28   ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2022-02-23  4:28 UTC (permalink / raw)
  To: Derald Woods, Adam Ford; +Cc: U-Boot Mailing List, Tom Rini

On 2/22/22 01:24, Derald Woods wrote:
> On Sat, Feb 19, 2022 at 5:09 PM Adam Ford <aford173@gmail.com> wrote:
> 
>> With the NOP PHY driver available, it can support toggling the
>> GPIOS to handle coming out of reset. This series cleans up
>> the OMAP EHCI host driver, enables PHY support, and removes
>> the code to toggle the reset GPIO's.
>>
>> This series was tested on an OMAP3530, DM3730, and an AM3517.
>> Users of the omap4_panda, omap3_beagle, omap5_uevm, omap3_evm
>> are asked to test since I do not have that hardware available
>> to me and get_maintainer.pl doesn't list the owners of the
>> affected defconfig files.
>>
>> Adam Ford (7):
>>    usb: ehci-omap: Drop dead code
>>    usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe
>>    phy: nop-phy: Fix enabling reset
>>    usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP
>>    usb: ehci-omap: Use PHY system to manage phy resets
>>    usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig
>>    configs: omap various:  Remove OMAP_EHCI_PHY from defconfigs
>>
>>   arch/arm/include/asm/ehci-omap.h     |  13 ---
>>   configs/am3517_evm_defconfig         |   2 -
>>   configs/omap35_logic_somlv_defconfig |   2 -
>>   configs/omap3_beagle_defconfig       |   2 -
>>   configs/omap3_logic_somlv_defconfig  |   2 -
>>   configs/omap4_panda_defconfig        |   4 -
>>   configs/omap5_uevm_defconfig         |   4 -
>>   drivers/phy/nop-phy.c                |   5 +-
>>   drivers/usb/host/Kconfig             |  36 +-------
>>   drivers/usb/host/ehci-omap.c         | 126 +++++++++++++--------------
>>   10 files changed, 66 insertions(+), 130 deletions(-)
>>
>> --
>> 2.32.0
>>
>>
> Works for me using 'omap3_beagle_defconfig' on Beagle Rev. C4 (3530) and
> Beagle xM (3730).
> 
> Tested-by: Derald D. Woods <woods.technical@gmail.com>

Thanks, applied all.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-02-23  4:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-19 23:08 [PATCH 0/7] Migrate omap_ehci to use phy driver Adam Ford
2022-02-19 23:08 ` [PATCH 1/7] usb: ehci-omap: Drop dead code Adam Ford
2022-02-19 23:08 ` [PATCH 2/7] usb: ehci-omap: Move omap_ehci_hcd_init to omap_ehci_probe Adam Ford
2022-02-19 23:08 ` [PATCH 3/7] phy: nop-phy: Fix enabling reset Adam Ford
2022-02-19 23:08 ` [PATCH 4/7] usb: ehci-omap: Make Kconfig select PHY if USB_EHCI_OMAP Adam Ford
2022-02-19 23:08 ` [PATCH 5/7] usb: ehci-omap: Use PHY system to manage phy resets Adam Ford
2022-02-23  4:28   ` Marek Vasut
2022-02-19 23:08 ` [PATCH 6/7] usb: ehci-omap: Remove OMAP_EHCI_PHYx_RESET_GPIO from Kconfig Adam Ford
2022-02-19 23:08 ` [PATCH 7/7] configs: omap various: Remove OMAP_EHCI_PHY from defconfigs Adam Ford
2022-02-22  0:24 ` [PATCH 0/7] Migrate omap_ehci to use phy driver Derald Woods
2022-02-23  4:28   ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox