Loading drivers/usb/dwc3/core.c +13 −0 Original line number Diff line number Diff line Loading @@ -889,6 +889,19 @@ int dwc3_core_init(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); } /* * Workaround for STAR 9001198391 which affects dwc3 core * version 3.20a only. Default HP timer value is incorrectly * set to 3us. Reprogram HP timer value to support USB 3.1 * HP timer ECN. */ if (!dwc3_is_usb31(dwc) && dwc->revision == DWC3_REVISION_320A) { reg = dwc3_readl(dwc->regs, DWC3_GUCTL2); reg &= ~DWC3_GUCTL2_HP_TIMER_MASK; reg |= DWC3_GUCTL2_HP_TIMER(11); dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); } return 0; err2: Loading drivers/usb/dwc3/core.h +3 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,8 @@ /* Global User Control Register 2 */ #define DWC3_GUCTL2_RST_ACTBITLATER (1 << 14) #define DWC3_GUCTL2_HP_TIMER(n) ((n) << 21) #define DWC3_GUCTL2_HP_TIMER_MASK DWC3_GUCTL2_HP_TIMER(0x1f) /* Device Configuration Register */ #define DWC3_DCFG_DEVADDR(addr) ((addr) << 3) Loading Loading @@ -1036,6 +1038,7 @@ struct dwc3 { #define DWC3_REVISION_280A 0x5533280a #define DWC3_REVISION_300A 0x5533300a #define DWC3_REVISION_310A 0x5533310a #define DWC3_REVISION_320A 0x5533320a /* * NOTICE: we're using bit 31 as a "is usb 3.1" flag. This is really Loading drivers/usb/dwc3/dwc3-msm.c +34 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,7 @@ struct dwc3_msm { struct pm_qos_request pm_qos_req_dma; struct delayed_work perf_vote_work; struct delayed_work sdp_check; bool usb_compliance_mode; struct mutex suspend_resume_mutex; }; Loading Loading @@ -2867,6 +2868,13 @@ static void check_for_sdp_connection(struct work_struct *w) if (!mdwc->vbus_active) return; /* USB 3.1 compliance equipment usually repoted as floating * charger as HS dp/dm lines are never connected. Do not * tear down USB stack if compliance parameter is set */ if (mdwc->usb_compliance_mode) return; /* floating D+/D- lines detected */ if (dwc->gadget.state < USB_STATE_DEFAULT && dwc3_gadget_get_link_state(dwc) != DWC3_LINK_STATE_CMPLY) { Loading Loading @@ -3148,6 +3156,31 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr, } static DEVICE_ATTR_RW(speed); static ssize_t usb_compliance_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dwc3_msm *mdwc = dev_get_drvdata(dev); return snprintf(buf, PAGE_SIZE, "%c\n", mdwc->usb_compliance_mode ? 'Y' : 'N'); } static ssize_t usb_compliance_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int ret = 0; struct dwc3_msm *mdwc = dev_get_drvdata(dev); ret = strtobool(buf, &mdwc->usb_compliance_mode); if (ret) return ret; return count; } static DEVICE_ATTR_RW(usb_compliance_mode); static int dwc3_msm_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node, *dwc3_node; Loading Loading @@ -3498,6 +3531,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) device_create_file(&pdev->dev, &dev_attr_mode); device_create_file(&pdev->dev, &dev_attr_speed); device_create_file(&pdev->dev, &dev_attr_usb_compliance_mode); host_mode = usb_get_dr_mode(&mdwc->dwc3->dev) == USB_DR_MODE_HOST; if (!dwc->is_drd && host_mode) { Loading Loading
drivers/usb/dwc3/core.c +13 −0 Original line number Diff line number Diff line Loading @@ -889,6 +889,19 @@ int dwc3_core_init(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); } /* * Workaround for STAR 9001198391 which affects dwc3 core * version 3.20a only. Default HP timer value is incorrectly * set to 3us. Reprogram HP timer value to support USB 3.1 * HP timer ECN. */ if (!dwc3_is_usb31(dwc) && dwc->revision == DWC3_REVISION_320A) { reg = dwc3_readl(dwc->regs, DWC3_GUCTL2); reg &= ~DWC3_GUCTL2_HP_TIMER_MASK; reg |= DWC3_GUCTL2_HP_TIMER(11); dwc3_writel(dwc->regs, DWC3_GUCTL2, reg); } return 0; err2: Loading
drivers/usb/dwc3/core.h +3 −0 Original line number Diff line number Diff line Loading @@ -323,6 +323,8 @@ /* Global User Control Register 2 */ #define DWC3_GUCTL2_RST_ACTBITLATER (1 << 14) #define DWC3_GUCTL2_HP_TIMER(n) ((n) << 21) #define DWC3_GUCTL2_HP_TIMER_MASK DWC3_GUCTL2_HP_TIMER(0x1f) /* Device Configuration Register */ #define DWC3_DCFG_DEVADDR(addr) ((addr) << 3) Loading Loading @@ -1036,6 +1038,7 @@ struct dwc3 { #define DWC3_REVISION_280A 0x5533280a #define DWC3_REVISION_300A 0x5533300a #define DWC3_REVISION_310A 0x5533310a #define DWC3_REVISION_320A 0x5533320a /* * NOTICE: we're using bit 31 as a "is usb 3.1" flag. This is really Loading
drivers/usb/dwc3/dwc3-msm.c +34 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,7 @@ struct dwc3_msm { struct pm_qos_request pm_qos_req_dma; struct delayed_work perf_vote_work; struct delayed_work sdp_check; bool usb_compliance_mode; struct mutex suspend_resume_mutex; }; Loading Loading @@ -2867,6 +2868,13 @@ static void check_for_sdp_connection(struct work_struct *w) if (!mdwc->vbus_active) return; /* USB 3.1 compliance equipment usually repoted as floating * charger as HS dp/dm lines are never connected. Do not * tear down USB stack if compliance parameter is set */ if (mdwc->usb_compliance_mode) return; /* floating D+/D- lines detected */ if (dwc->gadget.state < USB_STATE_DEFAULT && dwc3_gadget_get_link_state(dwc) != DWC3_LINK_STATE_CMPLY) { Loading Loading @@ -3148,6 +3156,31 @@ static ssize_t speed_store(struct device *dev, struct device_attribute *attr, } static DEVICE_ATTR_RW(speed); static ssize_t usb_compliance_mode_show(struct device *dev, struct device_attribute *attr, char *buf) { struct dwc3_msm *mdwc = dev_get_drvdata(dev); return snprintf(buf, PAGE_SIZE, "%c\n", mdwc->usb_compliance_mode ? 'Y' : 'N'); } static ssize_t usb_compliance_mode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { int ret = 0; struct dwc3_msm *mdwc = dev_get_drvdata(dev); ret = strtobool(buf, &mdwc->usb_compliance_mode); if (ret) return ret; return count; } static DEVICE_ATTR_RW(usb_compliance_mode); static int dwc3_msm_probe(struct platform_device *pdev) { struct device_node *node = pdev->dev.of_node, *dwc3_node; Loading Loading @@ -3498,6 +3531,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) device_create_file(&pdev->dev, &dev_attr_mode); device_create_file(&pdev->dev, &dev_attr_speed); device_create_file(&pdev->dev, &dev_attr_usb_compliance_mode); host_mode = usb_get_dr_mode(&mdwc->dwc3->dev) == USB_DR_MODE_HOST; if (!dwc->is_drd && host_mode) { Loading