Loading Documentation/devicetree/bindings/usb/dwc3.txt +2 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ Optional properties: - snps,ssphy-clear-auto-suspend-on-disconnect: If present, clear auto suspend feaure with ssusb phy during cable disconnect. - snps,usb3-u1u2-disable: If present, disable u1u2 low power modes for DWC3 core controller in SS mode. - snps,hird_thresh: If present, will determine the value of DCTL[HIRD_Thresh] which, in turn, controls the UTMI sleep mechanism vs. the PHY. Default value is 12. This is usually a subnode to DWC3 glue to which it is connected. Loading @@ -33,6 +35,4 @@ dwc3@4a030000 { usb-phy = <&usb2_phy>, <&usb3,phy>; tx-fifo-resize; snps,hsphy-auto-suspend-disable; snps,ssphy-clear-auto-suspend-on-disconnect; snps,usb3-u1u2-disable; }; drivers/usb/dwc3/core.c +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ #include "debug.h" #define DWC3_DCTL_HIRD_THRES_DEFAULT 12 /* -------------------------------------------------------------------------- */ void dwc3_set_mode(struct dwc3 *dwc, u32 mode) Loading Loading @@ -606,6 +608,9 @@ static int dwc3_probe(struct platform_device *pdev) dwc->usb3_u1u2_disable = of_property_read_bool(node, "snps,usb3-u1u2-disable"); dwc->maximum_speed = of_usb_get_maximum_speed(node); ret = of_property_read_u8(node, "snps,hird_thresh", &dwc->hird_thresh); if (res) dwc->hird_thresh = DWC3_DCTL_HIRD_THRES_DEFAULT; if (node) { dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0); Loading drivers/usb/dwc3/core.h +4 −2 Original line number Diff line number Diff line Loading @@ -770,6 +770,8 @@ struct dwc3_scratchpad_array { * @ssphy_clear_auto_suspend_on_disconnect: if true, clear ssphy autosuspend bit * during disconnect and set it after device is configured. * @usb3_u1u2_disable: if true, disable U1U2 low power modes in Superspeed mode. * @hird_thresh: value to configure in DCTL[HIRD_Thresh] * @in_lpm: if 1, indicates that the controller is in low power mode (no clocks) */ struct dwc3 { struct usb_ctrlrequest *ctrl_req; Loading Loading @@ -880,9 +882,9 @@ struct dwc3 { bool ssphy_clear_auto_suspend_on_disconnect; bool usb3_u1u2_disable; bool enable_suspend_event; struct dwc3_gadget_events dbg_gadget_events; u8 hird_thresh; atomic_t in_lpm; struct dwc3_gadget_events dbg_gadget_events; }; /* -------------------------------------------------------------------------- */ Loading drivers/usb/dwc3/gadget.c +1 −7 Original line number Diff line number Diff line Loading @@ -2835,13 +2835,7 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN); /* * TODO: This should be configurable. For now using * maximum allowed HIRD threshold value of 0b1100 */ reg |= DWC3_DCTL_HIRD_THRES(12); reg |= DWC3_DCTL_HIRD_THRES(dwc->hird_thresh); dwc3_writel(dwc->regs, DWC3_DCTL, reg); } Loading Loading
Documentation/devicetree/bindings/usb/dwc3.txt +2 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ Optional properties: - snps,ssphy-clear-auto-suspend-on-disconnect: If present, clear auto suspend feaure with ssusb phy during cable disconnect. - snps,usb3-u1u2-disable: If present, disable u1u2 low power modes for DWC3 core controller in SS mode. - snps,hird_thresh: If present, will determine the value of DCTL[HIRD_Thresh] which, in turn, controls the UTMI sleep mechanism vs. the PHY. Default value is 12. This is usually a subnode to DWC3 glue to which it is connected. Loading @@ -33,6 +35,4 @@ dwc3@4a030000 { usb-phy = <&usb2_phy>, <&usb3,phy>; tx-fifo-resize; snps,hsphy-auto-suspend-disable; snps,ssphy-clear-auto-suspend-on-disconnect; snps,usb3-u1u2-disable; };
drivers/usb/dwc3/core.c +5 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ #include "debug.h" #define DWC3_DCTL_HIRD_THRES_DEFAULT 12 /* -------------------------------------------------------------------------- */ void dwc3_set_mode(struct dwc3 *dwc, u32 mode) Loading Loading @@ -606,6 +608,9 @@ static int dwc3_probe(struct platform_device *pdev) dwc->usb3_u1u2_disable = of_property_read_bool(node, "snps,usb3-u1u2-disable"); dwc->maximum_speed = of_usb_get_maximum_speed(node); ret = of_property_read_u8(node, "snps,hird_thresh", &dwc->hird_thresh); if (res) dwc->hird_thresh = DWC3_DCTL_HIRD_THRES_DEFAULT; if (node) { dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0); Loading
drivers/usb/dwc3/core.h +4 −2 Original line number Diff line number Diff line Loading @@ -770,6 +770,8 @@ struct dwc3_scratchpad_array { * @ssphy_clear_auto_suspend_on_disconnect: if true, clear ssphy autosuspend bit * during disconnect and set it after device is configured. * @usb3_u1u2_disable: if true, disable U1U2 low power modes in Superspeed mode. * @hird_thresh: value to configure in DCTL[HIRD_Thresh] * @in_lpm: if 1, indicates that the controller is in low power mode (no clocks) */ struct dwc3 { struct usb_ctrlrequest *ctrl_req; Loading Loading @@ -880,9 +882,9 @@ struct dwc3 { bool ssphy_clear_auto_suspend_on_disconnect; bool usb3_u1u2_disable; bool enable_suspend_event; struct dwc3_gadget_events dbg_gadget_events; u8 hird_thresh; atomic_t in_lpm; struct dwc3_gadget_events dbg_gadget_events; }; /* -------------------------------------------------------------------------- */ Loading
drivers/usb/dwc3/gadget.c +1 −7 Original line number Diff line number Diff line Loading @@ -2835,13 +2835,7 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc) reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN); /* * TODO: This should be configurable. For now using * maximum allowed HIRD threshold value of 0b1100 */ reg |= DWC3_DCTL_HIRD_THRES(12); reg |= DWC3_DCTL_HIRD_THRES(dwc->hird_thresh); dwc3_writel(dwc->regs, DWC3_DCTL, reg); } Loading