限制USB速度

限制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; 
... 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值