public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Marek Vasut <marek.vasut+renesas@mailbox.org>, u-boot@lists.denx.de
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Angus Ainslie <angus@akkea.ca>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Eugen Hristev <eugen.hristev@collabora.com>,
	Igor Prusov <ivprusov@salutedevices.com>,
	Nishanth Menon <nm@ti.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Simon Glass <sjg@chromium.org>,
	Stefan Bosch <stefan_b@posteo.net>,
	Svyatoslav Ryhel <clamor95@gmail.com>,
	Tom Rini <trini@konsulko.com>,
	kernel@puri.sm
Subject: Re: [PATCH 2/2] usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts
Date: Thu, 21 Mar 2024 11:02:17 +0100	[thread overview]
Message-ID: <875xxfoqc6.fsf@baylibre.com> (raw)
In-Reply-To: <20240317044357.547037-2-marek.vasut+renesas@mailbox.org>

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

  reply	other threads:[~2024-03-21 10:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xxfoqc6.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=angus@akkea.ca \
    --cc=caleb.connolly@linaro.org \
    --cc=clamor95@gmail.com \
    --cc=eugen.hristev@collabora.com \
    --cc=ivprusov@salutedevices.com \
    --cc=kernel@puri.sm \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=nm@ti.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=stefan_b@posteo.net \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox