All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
@ 2024-03-17  4:42 Marek Vasut
  2024-03-17  4:42 ` [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Marek Vasut @ 2024-03-17  4:42 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Angus Ainslie, Caleb Connolly, Eugen Hristev,
	Igor Prusov, Mattijs Korpershoek, Nishanth Menon,
	Patrice Chotard, Simon Glass, Stefan Bosch, Svyatoslav Ryhel,
	Tom Rini, kernel

The dm_usb_gadget_handle_interrupts() has no place in board code. Move
this into DWC3 driver. The OMAP implementation is special, add new weak
dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
handling should be called, and override it in OMAP DWC3 code, to repair
the special OMAP interrupt handling code until OMAP gets switched over
to DM UDC proper.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Caleb Connolly <caleb.connolly@linaro.org>
Cc: Eugen Hristev <eugen.hristev@collabora.com>
Cc: Igor Prusov <ivprusov@salutedevices.com>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Bosch <stefan_b@posteo.net>
Cc: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: kernel@puri.sm
---
 board/purism/librem5/spl.c        |  6 ------
 board/samsung/common/exynos5-dt.c |  6 ------
 board/st/stih410-b2260/board.c    |  6 ------
 board/ti/am43xx/board.c           | 11 -----------
 drivers/usb/dwc3/core.c           | 25 +++++++++++++++++++++----
 drivers/usb/dwc3/dwc3-omap.c      |  4 ++--
 include/dwc3-omap-uboot.h         |  1 -
 include/dwc3-uboot.h              |  1 +
 8 files changed, 24 insertions(+), 36 deletions(-)

diff --git a/board/purism/librem5/spl.c b/board/purism/librem5/spl.c
index 581f0929662..9aadc553302 100644
--- a/board/purism/librem5/spl.c
+++ b/board/purism/librem5/spl.c
@@ -418,12 +418,6 @@ out:
 	return rv;
 }
 
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-	dwc3_uboot_handle_interrupt(dev);
-	return 0;
-}
-
 static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3)
 {
 	u32 RegData;
diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c
index 95cf6d2acc2..b3e87c93751 100644
--- a/board/samsung/common/exynos5-dt.c
+++ b/board/samsung/common/exynos5-dt.c
@@ -122,12 +122,6 @@ static struct dwc3_device dwc3_device_data = {
 	.index = 0,
 };
 
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-	dwc3_uboot_handle_interrupt(dev);
-	return 0;
-}
-
 int board_usb_init(int index, enum usb_init_type init)
 {
 	struct exynos_usb3_phy *phy = (struct exynos_usb3_phy *)
diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c
index e21cbc270e9..82817571ae3 100644
--- a/board/st/stih410-b2260/board.c
+++ b/board/st/stih410-b2260/board.c
@@ -50,12 +50,6 @@ static struct dwc3_device dwc3_device_data = {
 	.index = 0,
 };
 
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-	dwc3_uboot_handle_interrupt(dev);
-	return 0;
-}
-
 int board_usb_init(int index, enum usb_init_type init)
 {
 	int node;
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index ea0d0b92088..a4679a2e294 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -759,17 +759,6 @@ static struct ti_usb_phy_device usb_phy2_device = {
 	.usb2_phy_power = (void *)USB2_PHY2_POWER,
 	.index = 1,
 };
-
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-	u32 status;
-
-	status = dwc3_omap_uboot_interrupt_status(dev);
-	if (status)
-		dwc3_uboot_handle_interrupt(dev);
-
-	return 0;
-}
 #endif /* CONFIG_USB_DWC3 */
 
 #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 4b4fcd8a22e..09737be9a9c 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -983,6 +983,11 @@ void dwc3_uboot_exit(int index)
 	}
 }
 
+MODULE_ALIAS("platform:dwc3");
+MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
+
 /**
  * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
  * @dev: device of this controller
@@ -1004,10 +1009,22 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
 	}
 }
 
-MODULE_ALIAS("platform:dwc3");
-MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
+#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
+__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
+{
+	return 1;
+}
+
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
+{
+	if (!dwc3_uboot_interrupt_status(dev))
+		return 0;
+
+	dwc3_uboot_handle_interrupt(dev);
+
+	return 0;
+}
+#endif
 
 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
 int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 4fadb4a3e20..53c4d4826b4 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -428,7 +428,7 @@ void dwc3_omap_uboot_exit(int index)
 }
 
 /**
- * dwc3_omap_uboot_interrupt_status - check the status of interrupt
+ * dwc3_uboot_interrupt_status - check the status of interrupt
  * @dev: device of this controller
  *
  * Checks the status of interrupts and returns true if an interrupt
@@ -436,7 +436,7 @@ void dwc3_omap_uboot_exit(int index)
  *
  * Generally called from board file.
  */
-int dwc3_omap_uboot_interrupt_status(struct udevice *dev)
+int dwc3_uboot_interrupt_status(struct udevice *dev)
 {
 	struct dwc3_omap *omap = NULL;
 
diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h
index ed92bfc5a97..f220705ef7b 100644
--- a/include/dwc3-omap-uboot.h
+++ b/include/dwc3-omap-uboot.h
@@ -27,5 +27,4 @@ struct dwc3_omap_device {
 
 int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
 void dwc3_omap_uboot_exit(int index);
-int dwc3_omap_uboot_interrupt_status(struct udevice *dev);
 #endif /* __DWC3_OMAP_UBOOT_H_ */
diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h
index 35cfbb93b29..5f13f5bcf40 100644
--- a/include/dwc3-uboot.h
+++ b/include/dwc3-uboot.h
@@ -44,6 +44,7 @@ struct dwc3_device {
 
 int dwc3_uboot_init(struct dwc3_device *dev);
 void dwc3_uboot_exit(int index);
+int dwc3_uboot_interrupt_status(struct udevice *dev);
 void dwc3_uboot_handle_interrupt(struct udevice *dev);
 
 struct phy;
-- 
2.43.0


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

* [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts
  2024-03-17  4:42 [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Marek Vasut
@ 2024-03-17  4:42 ` Marek Vasut
  2024-03-21 10:02   ` Mattijs Korpershoek
  2024-03-18 12:47 ` [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Caleb Connolly
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2024-03-17  4:42 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, Angus Ainslie, Caleb Connolly, Eugen Hristev,
	Igor Prusov, Mattijs Korpershoek, Nishanth Menon,
	Patrice Chotard, Simon Glass, Stefan Bosch, Svyatoslav Ryhel,
	Tom Rini, kernel

The only call site of dwc3_uboot_handle_interrupt() is the
dm_usb_gadget_handle_interrupts(), fold the former into the
later. This makes dwc3_uboot_handle_interrupt() unavailable
to be called from board code as well.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Angus Ainslie <angus@akkea.ca>
Cc: Caleb Connolly <caleb.connolly@linaro.org>
Cc: Eugen Hristev <eugen.hristev@collabora.com>
Cc: Igor Prusov <ivprusov@salutedevices.com>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefan Bosch <stefan_b@posteo.net>
Cc: Svyatoslav Ryhel <clamor95@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: kernel@puri.sm
---
 drivers/usb/dwc3/core.c | 27 +++++++++++----------------
 include/dwc3-uboot.h    |  1 -
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 09737be9a9c..96e850b7170 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -988,18 +988,27 @@ MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
 
+#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
+__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
+{
+	return 1;
+}
+
 /**
- * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
+ * dm_usb_gadget_handle_interrupts - handle dwc3 core interrupt
  * @dev: device of this controller
  *
  * Invokes dwc3 gadget interrupts.
  *
  * Generally called from board file.
  */
-void dwc3_uboot_handle_interrupt(struct udevice *dev)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
 {
 	struct dwc3 *dwc = NULL;
 
+	if (!dwc3_uboot_interrupt_status(dev))
+		return 0;
+
 	list_for_each_entry(dwc, &dwc3_list, list) {
 		if (dwc->dev != dev)
 			continue;
@@ -1007,20 +1016,6 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
 		dwc3_gadget_uboot_handle_interrupt(dwc);
 		break;
 	}
-}
-
-#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
-__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
-{
-	return 1;
-}
-
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-	if (!dwc3_uboot_interrupt_status(dev))
-		return 0;
-
-	dwc3_uboot_handle_interrupt(dev);
 
 	return 0;
 }
diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h
index 5f13f5bcf40..3689d60ae7f 100644
--- a/include/dwc3-uboot.h
+++ b/include/dwc3-uboot.h
@@ -45,7 +45,6 @@ struct dwc3_device {
 int dwc3_uboot_init(struct dwc3_device *dev);
 void dwc3_uboot_exit(int index);
 int dwc3_uboot_interrupt_status(struct udevice *dev);
-void dwc3_uboot_handle_interrupt(struct udevice *dev);
 
 struct phy;
 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
-- 
2.43.0


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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-17  4:42 [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Marek Vasut
  2024-03-17  4:42 ` [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts Marek Vasut
@ 2024-03-18 12:47 ` Caleb Connolly
  2024-03-20 20:18   ` Marek Vasut
  2024-03-21 10:01 ` Mattijs Korpershoek
  2024-04-02  9:13 ` Mattijs Korpershoek
  3 siblings, 1 reply; 11+ messages in thread
From: Caleb Connolly @ 2024-03-18 12:47 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Angus Ainslie, Eugen Hristev, Igor Prusov, Mattijs Korpershoek,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel



On 17/03/2024 04:42, Marek Vasut wrote:
> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
> this into DWC3 driver. The OMAP implementation is special, add new weak
> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
> handling should be called, and override it in OMAP DWC3 code, to repair
> the special OMAP interrupt handling code until OMAP gets switched over
> to DM UDC proper.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
> Cc: Angus Ainslie <angus@akkea.ca>
> Cc: Caleb Connolly <caleb.connolly@linaro.org>
> Cc: Eugen Hristev <eugen.hristev@collabora.com>
> Cc: Igor Prusov <ivprusov@salutedevices.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Bosch <stefan_b@posteo.net>
> Cc: Svyatoslav Ryhel <clamor95@gmail.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: kernel@puri.sm
> ---
>  board/purism/librem5/spl.c        |  6 ------
>  board/samsung/common/exynos5-dt.c |  6 ------
>  board/st/stih410-b2260/board.c    |  6 ------
>  board/ti/am43xx/board.c           | 11 -----------
>  drivers/usb/dwc3/core.c           | 25 +++++++++++++++++++++----
>  drivers/usb/dwc3/dwc3-omap.c      |  4 ++--
>  include/dwc3-omap-uboot.h         |  1 -
>  include/dwc3-uboot.h              |  1 +
>  8 files changed, 24 insertions(+), 36 deletions(-)
> 
> diff --git a/board/purism/librem5/spl.c b/board/purism/librem5/spl.c
> index 581f0929662..9aadc553302 100644
> --- a/board/purism/librem5/spl.c
> +++ b/board/purism/librem5/spl.c
> @@ -418,12 +418,6 @@ out:
>  	return rv;
>  }
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3)
>  {
>  	u32 RegData;
> diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c
> index 95cf6d2acc2..b3e87c93751 100644
> --- a/board/samsung/common/exynos5-dt.c
> +++ b/board/samsung/common/exynos5-dt.c
> @@ -122,12 +122,6 @@ static struct dwc3_device dwc3_device_data = {
>  	.index = 0,
>  };
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  int board_usb_init(int index, enum usb_init_type init)
>  {
>  	struct exynos_usb3_phy *phy = (struct exynos_usb3_phy *)
> diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c
> index e21cbc270e9..82817571ae3 100644
> --- a/board/st/stih410-b2260/board.c
> +++ b/board/st/stih410-b2260/board.c
> @@ -50,12 +50,6 @@ static struct dwc3_device dwc3_device_data = {
>  	.index = 0,
>  };
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  int board_usb_init(int index, enum usb_init_type init)
>  {
>  	int node;
> diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
> index ea0d0b92088..a4679a2e294 100644
> --- a/board/ti/am43xx/board.c
> +++ b/board/ti/am43xx/board.c
> @@ -759,17 +759,6 @@ static struct ti_usb_phy_device usb_phy2_device = {
>  	.usb2_phy_power = (void *)USB2_PHY2_POWER,
>  	.index = 1,
>  };
> -
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	u32 status;
> -
> -	status = dwc3_omap_uboot_interrupt_status(dev);
> -	if (status)
> -		dwc3_uboot_handle_interrupt(dev);
> -
> -	return 0;
> -}
>  #endif /* CONFIG_USB_DWC3 */
>  
>  #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 4b4fcd8a22e..09737be9a9c 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -983,6 +983,11 @@ void dwc3_uboot_exit(int index)
>  	}
>  }
>  
> +MODULE_ALIAS("platform:dwc3");
> +MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
> +
>  /**
>   * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
>   * @dev: device of this controller
> @@ -1004,10 +1009,22 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
>  	}
>  }
>  
> -MODULE_ALIAS("platform:dwc3");
> -MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
> +#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
> +__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
> +{
> +	return 1;
> +}
> +
> +int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> +{
> +	if (!dwc3_uboot_interrupt_status(dev))
> +		return 0;
> +
> +	dwc3_uboot_handle_interrupt(dev);
> +
> +	return 0;
> +}
> +#endif
>  
>  #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
>  int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys)
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 4fadb4a3e20..53c4d4826b4 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -428,7 +428,7 @@ void dwc3_omap_uboot_exit(int index)
>  }
>  
>  /**
> - * dwc3_omap_uboot_interrupt_status - check the status of interrupt
> + * dwc3_uboot_interrupt_status - check the status of interrupt
>   * @dev: device of this controller
>   *
>   * Checks the status of interrupts and returns true if an interrupt
> @@ -436,7 +436,7 @@ void dwc3_omap_uboot_exit(int index)
>   *
>   * Generally called from board file.
>   */
> -int dwc3_omap_uboot_interrupt_status(struct udevice *dev)
> +int dwc3_uboot_interrupt_status(struct udevice *dev)
>  {
>  	struct dwc3_omap *omap = NULL;
>  
> diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h
> index ed92bfc5a97..f220705ef7b 100644
> --- a/include/dwc3-omap-uboot.h
> +++ b/include/dwc3-omap-uboot.h
> @@ -27,5 +27,4 @@ struct dwc3_omap_device {
>  
>  int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
>  void dwc3_omap_uboot_exit(int index);
> -int dwc3_omap_uboot_interrupt_status(struct udevice *dev);
>  #endif /* __DWC3_OMAP_UBOOT_H_ */
> diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h
> index 35cfbb93b29..5f13f5bcf40 100644
> --- a/include/dwc3-uboot.h
> +++ b/include/dwc3-uboot.h
> @@ -44,6 +44,7 @@ struct dwc3_device {
>  
>  int dwc3_uboot_init(struct dwc3_device *dev);
>  void dwc3_uboot_exit(int index);
> +int dwc3_uboot_interrupt_status(struct udevice *dev);
>  void dwc3_uboot_handle_interrupt(struct udevice *dev);
>  
>  struct phy;

-- 
// Caleb (they/them)

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-18 12:47 ` [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Caleb Connolly
@ 2024-03-20 20:18   ` Marek Vasut
  2024-03-21 17:05     ` Caleb Connolly
  0 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2024-03-20 20:18 UTC (permalink / raw)
  To: Caleb Connolly, Marek Vasut, u-boot
  Cc: Angus Ainslie, Eugen Hristev, Igor Prusov, Mattijs Korpershoek,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel

On 3/18/24 1:47 PM, Caleb Connolly wrote:
> 
> 
> On 17/03/2024 04:42, Marek Vasut wrote:
>> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
>> this into DWC3 driver. The OMAP implementation is special, add new weak
>> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
>> handling should be called, and override it in OMAP DWC3 code, to repair
>> the special OMAP interrupt handling code until OMAP gets switched over
>> to DM UDC proper.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> 
> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>

Thank you. If you have a hardware with DWC3 , can you please also test 
this series ? I am afraid this may break things, although it is likely 
to break mostly select MX8M boards.

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-17  4:42 [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Marek Vasut
  2024-03-17  4:42 ` [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts Marek Vasut
  2024-03-18 12:47 ` [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Caleb Connolly
@ 2024-03-21 10:01 ` Mattijs Korpershoek
  2024-03-21 19:38   ` Marek Vasut
  2024-04-02  9:13 ` Mattijs Korpershoek
  3 siblings, 1 reply; 11+ messages in thread
From: Mattijs Korpershoek @ 2024-03-21 10:01 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Marek Vasut, Angus Ainslie, Caleb Connolly, Eugen Hristev,
	Igor Prusov, Nishanth Menon, Patrice Chotard, Simon Glass,
	Stefan Bosch, Svyatoslav Ryhel, Tom Rini, kernel

Hi Marek,

Thank you for the patch.

On dim., mars 17, 2024 at 05:42, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:

> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
> this into DWC3 driver. The OMAP implementation is special, add new weak
> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
> handling should be called, and override it in OMAP DWC3 code, to repair
> the special OMAP interrupt handling code until OMAP gets switched over
> to DM UDC proper.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

Tested that I could scan for usb mass storage and that I can use
fastboot:

=> fastboot usb 0
crq->brequest:0x0
=> usb start
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

=> usb storage
  Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
            Type: Removable Hard Disk
            Capacity: 29328.0 MB = 28.6 GB (60063744 x 512)

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3

> ---
> Cc: Angus Ainslie <angus@akkea.ca>
> Cc: Caleb Connolly <caleb.connolly@linaro.org>
> Cc: Eugen Hristev <eugen.hristev@collabora.com>
> Cc: Igor Prusov <ivprusov@salutedevices.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Bosch <stefan_b@posteo.net>
> Cc: Svyatoslav Ryhel <clamor95@gmail.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: kernel@puri.sm
> ---
>  board/purism/librem5/spl.c        |  6 ------
>  board/samsung/common/exynos5-dt.c |  6 ------
>  board/st/stih410-b2260/board.c    |  6 ------
>  board/ti/am43xx/board.c           | 11 -----------
>  drivers/usb/dwc3/core.c           | 25 +++++++++++++++++++++----
>  drivers/usb/dwc3/dwc3-omap.c      |  4 ++--
>  include/dwc3-omap-uboot.h         |  1 -
>  include/dwc3-uboot.h              |  1 +
>  8 files changed, 24 insertions(+), 36 deletions(-)
>
> diff --git a/board/purism/librem5/spl.c b/board/purism/librem5/spl.c
> index 581f0929662..9aadc553302 100644
> --- a/board/purism/librem5/spl.c
> +++ b/board/purism/librem5/spl.c
> @@ -418,12 +418,6 @@ out:
>  	return rv;
>  }
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3)
>  {
>  	u32 RegData;
> diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c
> index 95cf6d2acc2..b3e87c93751 100644
> --- a/board/samsung/common/exynos5-dt.c
> +++ b/board/samsung/common/exynos5-dt.c
> @@ -122,12 +122,6 @@ static struct dwc3_device dwc3_device_data = {
>  	.index = 0,
>  };
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  int board_usb_init(int index, enum usb_init_type init)
>  {
>  	struct exynos_usb3_phy *phy = (struct exynos_usb3_phy *)
> diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c
> index e21cbc270e9..82817571ae3 100644
> --- a/board/st/stih410-b2260/board.c
> +++ b/board/st/stih410-b2260/board.c
> @@ -50,12 +50,6 @@ static struct dwc3_device dwc3_device_data = {
>  	.index = 0,
>  };
>  
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	dwc3_uboot_handle_interrupt(dev);
> -	return 0;
> -}
> -
>  int board_usb_init(int index, enum usb_init_type init)
>  {
>  	int node;
> diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
> index ea0d0b92088..a4679a2e294 100644
> --- a/board/ti/am43xx/board.c
> +++ b/board/ti/am43xx/board.c
> @@ -759,17 +759,6 @@ static struct ti_usb_phy_device usb_phy2_device = {
>  	.usb2_phy_power = (void *)USB2_PHY2_POWER,
>  	.index = 1,
>  };
> -
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	u32 status;
> -
> -	status = dwc3_omap_uboot_interrupt_status(dev);
> -	if (status)
> -		dwc3_uboot_handle_interrupt(dev);
> -
> -	return 0;
> -}
>  #endif /* CONFIG_USB_DWC3 */
>  
>  #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP)
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 4b4fcd8a22e..09737be9a9c 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -983,6 +983,11 @@ void dwc3_uboot_exit(int index)
>  	}
>  }
>  
> +MODULE_ALIAS("platform:dwc3");
> +MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
> +MODULE_LICENSE("GPL v2");
> +MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
> +
>  /**
>   * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
>   * @dev: device of this controller
> @@ -1004,10 +1009,22 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
>  	}
>  }
>  
> -MODULE_ALIAS("platform:dwc3");
> -MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
> +#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
> +__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
> +{
> +	return 1;
> +}
> +
> +int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> +{
> +	if (!dwc3_uboot_interrupt_status(dev))
> +		return 0;
> +
> +	dwc3_uboot_handle_interrupt(dev);
> +
> +	return 0;
> +}
> +#endif
>  
>  #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
>  int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys)
> diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
> index 4fadb4a3e20..53c4d4826b4 100644
> --- a/drivers/usb/dwc3/dwc3-omap.c
> +++ b/drivers/usb/dwc3/dwc3-omap.c
> @@ -428,7 +428,7 @@ void dwc3_omap_uboot_exit(int index)
>  }
>  
>  /**
> - * dwc3_omap_uboot_interrupt_status - check the status of interrupt
> + * dwc3_uboot_interrupt_status - check the status of interrupt
>   * @dev: device of this controller
>   *
>   * Checks the status of interrupts and returns true if an interrupt
> @@ -436,7 +436,7 @@ void dwc3_omap_uboot_exit(int index)
>   *
>   * Generally called from board file.
>   */
> -int dwc3_omap_uboot_interrupt_status(struct udevice *dev)
> +int dwc3_uboot_interrupt_status(struct udevice *dev)
>  {
>  	struct dwc3_omap *omap = NULL;
>  
> diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h
> index ed92bfc5a97..f220705ef7b 100644
> --- a/include/dwc3-omap-uboot.h
> +++ b/include/dwc3-omap-uboot.h
> @@ -27,5 +27,4 @@ struct dwc3_omap_device {
>  
>  int dwc3_omap_uboot_init(struct dwc3_omap_device *dev);
>  void dwc3_omap_uboot_exit(int index);
> -int dwc3_omap_uboot_interrupt_status(struct udevice *dev);
>  #endif /* __DWC3_OMAP_UBOOT_H_ */
> diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h
> index 35cfbb93b29..5f13f5bcf40 100644
> --- a/include/dwc3-uboot.h
> +++ b/include/dwc3-uboot.h
> @@ -44,6 +44,7 @@ struct dwc3_device {
>  
>  int dwc3_uboot_init(struct dwc3_device *dev);
>  void dwc3_uboot_exit(int index);
> +int dwc3_uboot_interrupt_status(struct udevice *dev);
>  void dwc3_uboot_handle_interrupt(struct udevice *dev);
>  
>  struct phy;
> -- 
> 2.43.0

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

* Re: [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts
  2024-03-17  4:42 ` [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts Marek Vasut
@ 2024-03-21 10:02   ` Mattijs Korpershoek
  0 siblings, 0 replies; 11+ messages in thread
From: Mattijs Korpershoek @ 2024-03-21 10:02 UTC (permalink / raw)
  To: Marek Vasut, u-boot
  Cc: Marek Vasut, Angus Ainslie, Caleb Connolly, Eugen Hristev,
	Igor Prusov, Nishanth Menon, Patrice Chotard, Simon Glass,
	Stefan Bosch, Svyatoslav Ryhel, Tom Rini, kernel

Hi Marek,

Thank you for the patch.

On dim., mars 17, 2024 at 05:42, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:

> The only call site of dwc3_uboot_handle_interrupt() is the
> dm_usb_gadget_handle_interrupts(), fold the former into the
> later. This makes dwc3_uboot_handle_interrupt() unavailable
> to be called from board code as well.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> ---
> Cc: Angus Ainslie <angus@akkea.ca>
> Cc: Caleb Connolly <caleb.connolly@linaro.org>
> Cc: Eugen Hristev <eugen.hristev@collabora.com>
> Cc: Igor Prusov <ivprusov@salutedevices.com>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Stefan Bosch <stefan_b@posteo.net>
> Cc: Svyatoslav Ryhel <clamor95@gmail.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: kernel@puri.sm

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

Tested that I could scan for usb mass storage and that I can use
fastboot:

=> fastboot usb 0
crq->brequest:0x0
=> usb start
starting USB...
Bus usb@ff500000: Register 3000140 NbrPorts 3
Starting the controller
USB XHCI 1.10
scanning bus usb@ff500000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

=> usb storage
  Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
            Type: Removable Hard Disk
            Capacity: 29328.0 MB = 28.6 GB (60063744 x 512)

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3

> ---
>  drivers/usb/dwc3/core.c | 27 +++++++++++----------------
>  include/dwc3-uboot.h    |  1 -
>  2 files changed, 11 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index 09737be9a9c..96e850b7170 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -988,18 +988,27 @@ MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
>  MODULE_LICENSE("GPL v2");
>  MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
>  
> +#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
> +__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
> +{
> +	return 1;
> +}
> +
>  /**
> - * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
> + * dm_usb_gadget_handle_interrupts - handle dwc3 core interrupt
>   * @dev: device of this controller
>   *
>   * Invokes dwc3 gadget interrupts.
>   *
>   * Generally called from board file.
>   */
> -void dwc3_uboot_handle_interrupt(struct udevice *dev)
> +int dm_usb_gadget_handle_interrupts(struct udevice *dev)
>  {
>  	struct dwc3 *dwc = NULL;
>  
> +	if (!dwc3_uboot_interrupt_status(dev))
> +		return 0;
> +
>  	list_for_each_entry(dwc, &dwc3_list, list) {
>  		if (dwc->dev != dev)
>  			continue;
> @@ -1007,20 +1016,6 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
>  		dwc3_gadget_uboot_handle_interrupt(dwc);
>  		break;
>  	}
> -}
> -
> -#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
> -__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
> -{
> -	return 1;
> -}
> -
> -int dm_usb_gadget_handle_interrupts(struct udevice *dev)
> -{
> -	if (!dwc3_uboot_interrupt_status(dev))
> -		return 0;
> -
> -	dwc3_uboot_handle_interrupt(dev);
>  
>  	return 0;
>  }
> diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h
> index 5f13f5bcf40..3689d60ae7f 100644
> --- a/include/dwc3-uboot.h
> +++ b/include/dwc3-uboot.h
> @@ -45,7 +45,6 @@ struct dwc3_device {
>  int dwc3_uboot_init(struct dwc3_device *dev);
>  void dwc3_uboot_exit(int index);
>  int dwc3_uboot_interrupt_status(struct udevice *dev);
> -void dwc3_uboot_handle_interrupt(struct udevice *dev);
>  
>  struct phy;
>  #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
> -- 
> 2.43.0

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-20 20:18   ` Marek Vasut
@ 2024-03-21 17:05     ` Caleb Connolly
  2024-03-21 19:38       ` Marek Vasut
  0 siblings, 1 reply; 11+ messages in thread
From: Caleb Connolly @ 2024-03-21 17:05 UTC (permalink / raw)
  To: Marek Vasut, Marek Vasut, u-boot
  Cc: Angus Ainslie, Eugen Hristev, Igor Prusov, Mattijs Korpershoek,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel



On 20/03/2024 20:18, Marek Vasut wrote:
> On 3/18/24 1:47 PM, Caleb Connolly wrote:
>>
>>
>> On 17/03/2024 04:42, Marek Vasut wrote:
>>> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
>>> this into DWC3 driver. The OMAP implementation is special, add new weak
>>> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
>>> handling should be called, and override it in OMAP DWC3 code, to repair
>>> the special OMAP interrupt handling code until OMAP gets switched over
>>> to DM UDC proper.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
>>
>> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
> 
> Thank you. If you have a hardware with DWC3 , can you please also test
> this series ? I am afraid this may break things, although it is likely
> to break mostly select MX8M boards.

heh yeah it looked like it would be fine for qcom, but better safe than
sorry :P

Thanks for the ping.

Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # qcom sdm845

-- 
// Caleb (they/them)

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-21 17:05     ` Caleb Connolly
@ 2024-03-21 19:38       ` Marek Vasut
  0 siblings, 0 replies; 11+ messages in thread
From: Marek Vasut @ 2024-03-21 19:38 UTC (permalink / raw)
  To: Caleb Connolly, Marek Vasut, u-boot
  Cc: Angus Ainslie, Eugen Hristev, Igor Prusov, Mattijs Korpershoek,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel

On 3/21/24 6:05 PM, Caleb Connolly wrote:
> 
> 
> On 20/03/2024 20:18, Marek Vasut wrote:
>> On 3/18/24 1:47 PM, Caleb Connolly wrote:
>>>
>>>
>>> On 17/03/2024 04:42, Marek Vasut wrote:
>>>> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
>>>> this into DWC3 driver. The OMAP implementation is special, add new weak
>>>> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
>>>> handling should be called, and override it in OMAP DWC3 code, to repair
>>>> the special OMAP interrupt handling code until OMAP gets switched over
>>>> to DM UDC proper.
>>>>
>>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
>>>
>>> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
>>
>> Thank you. If you have a hardware with DWC3 , can you please also test
>> this series ? I am afraid this may break things, although it is likely
>> to break mostly select MX8M boards.
> 
> heh yeah it looked like it would be fine for qcom, but better safe than
> sorry :P
> 
> Thanks for the ping.
> 
> Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # qcom sdm845

Thank you!

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-21 10:01 ` Mattijs Korpershoek
@ 2024-03-21 19:38   ` Marek Vasut
  2024-03-22  9:32     ` Mattijs Korpershoek
  0 siblings, 1 reply; 11+ messages in thread
From: Marek Vasut @ 2024-03-21 19:38 UTC (permalink / raw)
  To: Mattijs Korpershoek, Marek Vasut, u-boot
  Cc: Angus Ainslie, Caleb Connolly, Eugen Hristev, Igor Prusov,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel

On 3/21/24 11:01 AM, Mattijs Korpershoek wrote:
> Hi Marek,
> 
> Thank you for the patch.
> 
> On dim., mars 17, 2024 at 05:42, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:
> 
>> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
>> this into DWC3 driver. The OMAP implementation is special, add new weak
>> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
>> handling should be called, and override it in OMAP DWC3 code, to repair
>> the special OMAP interrupt handling code until OMAP gets switched over
>> to DM UDC proper.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
> 
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> 
> Tested that I could scan for usb mass storage and that I can use
> fastboot:
> 
> => fastboot usb 0
> crq->brequest:0x0
> => usb start
> starting USB...
> Bus usb@ff500000: Register 3000140 NbrPorts 3
> Starting the controller
> USB XHCI 1.10
> scanning bus usb@ff500000 for devices... 3 USB Device(s) found
>         scanning usb for storage devices... 1 Storage Device(s) found
> 
> => usb storage
>    Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
>              Type: Removable Hard Disk
>              Capacity: 29328.0 MB = 28.6 GB (60063744 x 512)
> 
> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3

Thank you!

Please feel free to pick this via DFU tree in a week or two, so others 
can comment on this and test this too.

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-21 19:38   ` Marek Vasut
@ 2024-03-22  9:32     ` Mattijs Korpershoek
  0 siblings, 0 replies; 11+ messages in thread
From: Mattijs Korpershoek @ 2024-03-22  9:32 UTC (permalink / raw)
  To: Marek Vasut, Marek Vasut, u-boot
  Cc: Angus Ainslie, Caleb Connolly, Eugen Hristev, Igor Prusov,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel

On jeu., mars 21, 2024 at 20:38, Marek Vasut <marek.vasut@mailbox.org> wrote:

> On 3/21/24 11:01 AM, Mattijs Korpershoek wrote:
>> Hi Marek,
>> 
>> Thank you for the patch.
>> 
>> On dim., mars 17, 2024 at 05:42, Marek Vasut <marek.vasut+renesas@mailbox.org> wrote:
>> 
>>> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
>>> this into DWC3 driver. The OMAP implementation is special, add new weak
>>> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
>>> handling should be called, and override it in OMAP DWC3 code, to repair
>>> the special OMAP interrupt handling code until OMAP gets switched over
>>> to DM UDC proper.
>>>
>>> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
>> 
>> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
>> 
>> Tested that I could scan for usb mass storage and that I can use
>> fastboot:
>> 
>> => fastboot usb 0
>> crq->brequest:0x0
>> => usb start
>> starting USB...
>> Bus usb@ff500000: Register 3000140 NbrPorts 3
>> Starting the controller
>> USB XHCI 1.10
>> scanning bus usb@ff500000 for devices... 3 USB Device(s) found
>>         scanning usb for storage devices... 1 Storage Device(s) found
>> 
>> => usb storage
>>    Device 0: Vendor: SanDisk Rev: 1.00 Prod: Ultra
>>              Type: Removable Hard Disk
>>              Capacity: 29328.0 MB = 28.6 GB (60063744 x 512)
>> 
>> Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3
>
> Thank you!
>
> Please feel free to pick this via DFU tree in a week or two, so others 
> can comment on this and test this too.

Will do!

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

* Re: [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
  2024-03-17  4:42 [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Marek Vasut
                   ` (2 preceding siblings ...)
  2024-03-21 10:01 ` Mattijs Korpershoek
@ 2024-04-02  9:13 ` Mattijs Korpershoek
  3 siblings, 0 replies; 11+ messages in thread
From: Mattijs Korpershoek @ 2024-04-02  9:13 UTC (permalink / raw)
  To: u-boot, Marek Vasut
  Cc: Angus Ainslie, Caleb Connolly, Eugen Hristev, Igor Prusov,
	Nishanth Menon, Patrice Chotard, Simon Glass, Stefan Bosch,
	Svyatoslav Ryhel, Tom Rini, kernel

Hi,

On Sun, 17 Mar 2024 05:42:52 +0100, Marek Vasut wrote:
> The dm_usb_gadget_handle_interrupts() has no place in board code. Move
> this into DWC3 driver. The OMAP implementation is special, add new weak
> dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
> handling should be called, and override it in OMAP DWC3 code, to repair
> the special OMAP interrupt handling code until OMAP gets switched over
> to DM UDC proper.
> 
> [...]

Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu-next)

[1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/4d158980897085a5b0255ab910208d8afc8522dc
[2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts
      https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/12ac51cdb788b9f8e50cbc4fa3681102882ade33

--
Mattijs

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

end of thread, other threads:[~2024-04-02  9:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-17  4:42 [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Marek Vasut
2024-03-17  4:42 ` [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts Marek Vasut
2024-03-21 10:02   ` Mattijs Korpershoek
2024-03-18 12:47 ` [PATCH 1/2] usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget Caleb Connolly
2024-03-20 20:18   ` Marek Vasut
2024-03-21 17:05     ` Caleb Connolly
2024-03-21 19:38       ` Marek Vasut
2024-03-21 10:01 ` Mattijs Korpershoek
2024-03-21 19:38   ` Marek Vasut
2024-03-22  9:32     ` Mattijs Korpershoek
2024-04-02  9:13 ` Mattijs Korpershoek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.