* [U-Boot] [PATCHv2] usb: dwc2: disable erroneous overcurrent condition
@ 2016-03-05 0:57 dinguyen at opensource.altera.com
2016-03-05 1:22 ` Marek Vasut
0 siblings, 1 reply; 2+ messages in thread
From: dinguyen at opensource.altera.com @ 2016-03-05 0:57 UTC (permalink / raw
To: u-boot
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>
---
v2: consolidate bit OR into a single line
---
drivers/usb/host/dwc2.c | 4 +++-
drivers/usb/host/dwc2.h | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index c6727c3..b2f4bc6 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -263,7 +263,9 @@ 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_EXT_VBUS_DRV |
+ DWC2_GUSBCFG_ULPI_INT_VBUS_INDICATOR |
+ DWC2_GUSBCFG_INDICATOR_PASSTHROUGH);
#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)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCHv2] usb: dwc2: disable erroneous overcurrent condition
2016-03-05 0:57 [U-Boot] [PATCHv2] usb: dwc2: disable erroneous overcurrent condition dinguyen at opensource.altera.com
@ 2016-03-05 1:22 ` Marek Vasut
0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2016-03-05 1:22 UTC (permalink / raw
To: u-boot
On 03/05/2016 01:57 AM, 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>
> ---
> v2: consolidate bit OR into a single line
Applied, thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-05 1:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-05 0:57 [U-Boot] [PATCHv2] usb: dwc2: disable erroneous overcurrent condition dinguyen at opensource.altera.com
2016-03-05 1:22 ` Marek Vasut
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.