Skip to content

Commit 7dff332

Browse files
authored
Merge pull request torvalds#83 from miodragdinic/ci20-v3.18-dwc2-fixes
Ci20 v3.18 dwc2 fixes
2 parents 3c61f45 + 3b1379f commit 7dff332

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

arch/mips/boot/dts/jz4780.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@
770770

771771
phys = <&usb_phy>;
772772
phy-names = "usb2-phy";
773+
g-rx-fifo-size = <256>;
773774
g-tx-fifo-size = <256 256 256 256>;
774775
};
775776
};

arch/mips/configs/ci20_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ CONFIG_USBIP_CORE=m
716716
CONFIG_USBIP_VHCI_HCD=m
717717
CONFIG_USBIP_HOST=m
718718
CONFIG_USB_DWC2=y
719+
CONFIG_USB_DWC2_DISABLE_VOD=y
719720
CONFIG_USB_SERIAL=m
720721
CONFIG_USB_SERIAL_GENERIC=y
721722
CONFIG_USB_SERIAL_AIRCABLE=m

drivers/usb/dwc2/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,10 @@ config USB_DWC2_DEBUG_PERIODIC
9797
non-periodic transfers, but of course the debug logs will be
9898
incomplete. Note that this also disables some debug messages
9999
for which the transfer type cannot be deduced.
100+
101+
config USB_DWC2_DISABLE_VOD
102+
bool "Disable VBUS overcurrent detection"
103+
help
104+
Say Y here to switch off VBUS overcurrent detection. It enables USB
105+
functionality blocked by overcurrent detection.
100106
endif

drivers/usb/dwc2/core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,13 @@ void dwc2_core_host_init(struct dwc2_hsotg *hsotg)
715715
otgctl &= ~GOTGCTL_HSTSETHNPEN;
716716
writel(otgctl, hsotg->regs + GOTGCTL);
717717

718+
#ifdef CONFIG_USB_DWC2_DISABLE_VOD
719+
otgctl = readl(hsotg->regs + GOTGCTL);
720+
otgctl |= GOTGCTL_VB_VALID_OV_VAL;
721+
otgctl |= GOTGCTL_VB_VALID_OV_EN;
722+
writel(otgctl, hsotg->regs + GOTGCTL);
723+
#endif
724+
718725
if (hsotg->core_params->dma_desc_enable <= 0) {
719726
int num_channels, i;
720727
u32 hcchar;

drivers/usb/dwc2/hcd_intr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg)
350350
dev_vdbg(hsotg->dev,
351351
"--Port Interrupt HPRT0=0x%08x Port Connect Detected--\n",
352352
hprt0);
353+
if (hsotg->lx_state != DWC2_L0)
354+
usb_hcd_resume_root_hub(hsotg->priv);
355+
353356
hsotg->flags.b.port_connect_status_change = 1;
354357
hsotg->flags.b.port_connect_status = 1;
355358
hprt0_modify |= HPRT0_CONNDET;

drivers/usb/dwc2/hw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
#define GOTGCTL_HSTSETHNPEN (1 << 10)
5353
#define GOTGCTL_HNPREQ (1 << 9)
5454
#define GOTGCTL_HSTNEGSCS (1 << 8)
55+
#define GOTGCTL_VB_VALID_OV_VAL (1 << 3)
56+
#define GOTGCTL_VB_VALID_OV_EN (1 << 2)
5557
#define GOTGCTL_SESREQ (1 << 1)
5658
#define GOTGCTL_SESREQSCS (1 << 0)
5759

0 commit comments

Comments
 (0)