完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>
ralink的SDK提供的uboot是支持u***相关命令的,只需要在config.mk打开相应的开关即可。一开始以为只需要这样做:
RALINK_USB = ON
RALINK_EHCI = ON
RALINK_OHCI = ON
编译烧写后,发现u***相关命令已经出现在uboot中了,但是每次u*** reset,都扫描不到storage存储设备。
MT7620 # u***reset
(Re)start USB...
USB: scanning bus for devices... ## RH_GET_DESCRIPTOR
##RH_SET_ADDRESS
##RH_GET_DESCRIPTOR
##RH_GET_DESCRIPTOR
##RH_GET_DESCRIPTOR
##RH_SET_CONFIGURA
tiON
##RH_GET_DESCRIPTOR
## RH_GET_DESCRIPTOR
##RH_GET_DESCRIPTOR | RH_CLASS
##RH_GET_DESCRIPTOR | RH_CLASS
## RH_GET_STATUS| RH_CLASS
1 USB Device(s)found
scanning bus for storage devices... 0 Storage Device(s) found
u*** info中,product和vendor id均为0,太怪异了!
MT7620 # u***info
1: Hub, USB Revision 1.10
- OHCIRoot Hub
- Class: Hub
- PacketSize: 8 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 0.0
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Settings 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 2 Interval 255ms
并且发现uboot识别的u*** host只有12M/s的速度
MT7620 # u***tree
Device Tree:
1 Hub(12 Mb/s, 0mA)
OHCI Root Hub
按理说,MT7620的u***应该是2.0的高速设备,不可能是12M/s的。仔细分析了一下代码,发现只要开启了RALINK_OHCI,RALINK_EHCI就会失效。so,只打开EHCI,关闭OHCI。
RALINK_USB = ON
RALINK_EHCI = ON
RALINK_OHCI =OFF
编译烧录,发现问题更离奇:
U-Boot 1.1.3(Jun 9 2014 - 17:38:01)
MT7620 # u***reset
(Re)start USB...
USB: in u***_lowlevel_init
Error, couldn't init Lowlevel part
看来调用u***_lowlevel_init失败!为了分析问题,在u***_lowlevel_init的代码中加入一些printf信息,:
发现,u***_lowlevel_init返回-1,于是发现u***_lowlevel_init调用了如下代码:
位于ehci-ra.c中
int ehci_hcd_init(void)
{
#if defined(RT3352_ASIC_BOARD) || defined(RT3883_ASIC_BOARD)|| defined(RT5350_ASIC_BOARD)
leave_power_saving();
mdelay(100);
rt_set_host();
mdelay(100);
hccr = (struct ehci_hccr *)(0xb01c0000);
hcor = (struct ehci_hcor *)((uint32_t) hccr +HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
printf("Mediatek/Ralink USB EHCI host inithccr %x and hcor %x hc_length %dn", (uint32_t)hccr, (uint32_t)hcor,(uint32_t)HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
return 0;
#else
return -1;
#endif
}
不知道问题在哪,直接屏蔽掉主控的控制,终于有东西了
MT7620 # u***reset
(Re)start USB...
USB: in u***_lowlevel_init
Mediatek/RalinkUSB EHCI host init hccr b01c0000 and hcor b01c0010 hc_length 16
Register 1111NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found
MT7620 # u***info
1: Hub, USB Revision 0.2
- u-boot EHCI Host Controller
- Class: Hub
- PacketSize: 64 Configurations: 1
- Vendor: 0x0000 Product 0x0000 Version 0.1
Configuration: 1
- Interfaces: 1 Self Powered 0mA
Interface: 0
- Alternate Settings 0, Endpoints: 1
- Class Hub
- Endpoint 1 In Interrupt MaxPacket 8 Interval 0ms
2: MassStorage, USB Revision 2.0
- HP USB 2.0 Flash 00CCCBB99999
- Class: (from Interface) Mass Storage
- PacketSize: 64 Configurations: 1
- Vendor: 0x0204 Product 0x6025 Version 1.0
Configuration: 1
- Interfaces: 1 Bus Powered 100mA
Interface: 0
- Alternate Settings 0, Endpoints: 2
- Class Mass Storage, Transp. SCSI, Bulk only
- Endpoint 1 Out Bulk MaxPacket 512
- Endpoint 1 In Bulk MaxPacket 512
速度也正确了!
MT7620 # u***tree
Device Tree:
1 Hub(480 Mb/s, 0mA)
| u-boot EHCI Host Controller
|
+-2 Mass Storage (480 Mb/s, 100mA)
HP USB 2.0 Flash 00CCCBB99999
在ehci-ra.c的ehci_hcd_init中加入MT7620_ASIC_BOARD定义。
|
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
655 浏览0 评论
【KV260视觉入门套件试用体验】四、KV260 视觉入门套件和固件更新
1070 浏览0 评论
【KV260视觉入门套件试用体验】Vitis AI Library体验之OCR识别
779 浏览0 评论
【KV260视觉入门套件试用体验】Vitis AI 通过迁移学习训练自定义模型
1026 浏览0 评论
【KV260视觉入门套件试用体验】KV260系列之Petalinux镜像+Resnet 50探索
787 浏览0 评论
小黑屋|手机版|Archiver|德赢Vwin官网(湘ICP备2023018690号)
GMT+8, 2024-8-21 21:24, Processed in 0.583656 second(s), Total 70, Slave 54 queries .
Powered by德赢Vwin官网 网
© 2015bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号