限制USB速度:
1.add max speed property in dts file
...
2084 dwc3@7000000 {
2085 compatible = "snps,dwc3";
2086 reg = <0x07000000 0xc8d0>;
2087 interrupt-parent = <&intc>;
2088 interrupts = <0 140 0>;
2089 usb-phy = <&qusb_phy>, <&ssphy>;
2090 tx-fifo-resize;
++ maximum-speed = "full-speed";
2091 snps,usb3-u1u2-disable;
2092 snps,nominal-elastic-buffer;
2093 snps,is-utmi-l1-suspend;
2094 snps,hird-threshold = /bits/ 8 <0x0>;
2095 };
2. add usb speed limit in core.c
static int dwc3_init_usb_phys(struct dwc3 *dwc)
{
int ret;
/* Bring up PHYs */
ret = usb_phy_init(dwc->usb2_phy);
if (ret) {
pr_err("%s: usb_phy_init(dwc->usb2_phy) returned %d\n",
__func__, ret);
return ret;
}
ret = usb_phy_init(dwc->usb3_phy);
if (ret == -EBUSY) {
/*
* Setting Max speed as high when USB3 PHY initialiation
* is failing and USB superspeed can't be supported.
*/
dwc->maximum_speed = USB_SPEED_HIGH;
} else if (ret) {
pr_err("%s: usb_phy_init(dwc->usb3_phy) returned %d\n",
__func__, ret);
return ret;
}
++ dwc->maximum_speed = USB_SPEED_FULL;
...