All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] usb: dwc2: disable erroneous overcurrent condition
Date: Sat, 05 Mar 2016 00:12:53 +0100	[thread overview]
Message-ID: <56DA1675.9040904@denx.de> (raw)
In-Reply-To: <1457125525-14091-1-git-send-email-dinguyen@opensource.altera.com>

On 03/04/2016 10:05 PM, dinguyen at opensource.altera.com wrote:
> From: Dinh Nguyen <dinguyen@opensource.altera.com>
> 
> For the case where an external VBUS is used, we should enable the external
> VBUS comparator in the driver. This would prevent an unnecessary overcurrent
> error which would then disable the host port.
> 
> The overcurrent condition was happening on the SoCFPGA Cyclone5 devkit, thus
> USB was not working on the devkit. This patch fixes that problem.
> 
> Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
> ---
>  drivers/usb/host/dwc2.c |    2 ++
>  drivers/usb/host/dwc2.h |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> index c6727c3..d9a8d2d 100644
> --- a/drivers/usb/host/dwc2.c
> +++ b/drivers/usb/host/dwc2.c
> @@ -264,6 +264,8 @@ static void dwc_otg_core_init(struct dwc2_core_regs *regs)
>  	/* Program the ULPI External VBUS bit if needed */
>  #ifdef CONFIG_DWC2_PHY_ULPI_EXT_VBUS
>  	usbcfg |= DWC2_GUSBCFG_ULPI_EXT_VBUS_DRV;
> +	usbcfg |= (DWC2_GUSBCFG_ULPI_INT_VBUS_INDICATOR |
> +		   DWC2_GUSBCFG_INDICATOR_PASSTHROUGH);

Well why don't you wrap it into the previous usbcfg |= , one line above?

Can you send a V2 real quick or shall I fix it ?/

>  #else
>  	usbcfg &= ~DWC2_GUSBCFG_ULPI_EXT_VBUS_DRV;
>  #endif
> diff --git a/drivers/usb/host/dwc2.h b/drivers/usb/host/dwc2.h
> index 594757b..4482dc6 100644
> --- a/drivers/usb/host/dwc2.h
> +++ b/drivers/usb/host/dwc2.h
> @@ -152,6 +152,8 @@ struct dwc2_core_regs {
>  #define DWC2_GUSBCFG_ULPI_INT_VBUS_INDICATOR_OFFSET	21
>  #define DWC2_GUSBCFG_TERM_SEL_DL_PULSE			(1 << 22)
>  #define DWC2_GUSBCFG_TERM_SEL_DL_PULSE_OFFSET		22
> +#define DWC2_GUSBCFG_INDICATOR_PASSTHROUGH		(1 << 24)
> +#define DWC2_GUSBCFG_INDICATOR_PASSTHROUGH_OFFSET	24
>  #define DWC2_GUSBCFG_IC_USB_CAP				(1 << 26)
>  #define DWC2_GUSBCFG_IC_USB_CAP_OFFSET			26
>  #define DWC2_GUSBCFG_IC_TRAFFIC_PULL_REMOVE		(1 << 27)
> 


-- 
Best regards,
Marek Vasut

      reply	other threads:[~2016-03-04 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 21:05 [U-Boot] usb: dwc2: disable erroneous overcurrent condition dinguyen at opensource.altera.com
2016-03-04 23:12 ` Marek Vasut [this message]

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=56DA1675.9040904@denx.de \
    --to=marex@denx.de \
    --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 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.