Hello,
I'm trying to enable USB in u-boot according to what is described in this thread:
http://forums.xilinx.com/t5/Embedded-Processors-and/How-to-enable-USB-support-in-U-Boot-for-Zynq/td-p/265322
I haven't succeeded yet and I need help on the init sequences required to set the USB controller in a usable state. Here's the point I have reached using kernel xusbps driver information and modifying ehci-fsl.c:
--------------------------------------------------------------------------------------------
ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB_ADDR;
hccr = (struct ehci_hccr *)((uint32_t)&ehci->caplength);
hcor = (struct ehci_hcor *)((uint32_t)hccr +
HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
setbits_le32(&ehci->usbmode, CM_HOST);
mdelay(10);
setbits_le32(&ehci->portsc, USB_EN);
mdelay(10);
ulpi_vp.viewport_addr = (u32)&ehci->ulpi_viewpoint;
ulpi_vp.port_num = 0;
ret = ulpi_init(&ulpi_vp);
if (ret) {
printf("zynq-7000 USB ULPI initialization failed
");
return 1;
}
--------------------------------------------------------------------------------------------
"usb start" command succeeds with the following output:
--------------------------------------------------------------------------------------------
zynq-uboot> usb start
(Re)start USB...
ULPI transceiver ID 0x1507:0x0451
Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... New Device 0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0x40
req=6 (0x6), type=128 (0x80), value=256, index=0
USB_DT_DEVICE request
set address 1
usb_control_msg: request: 0x5, requesttype: 0x0, value 0x1 index 0x0 length 0x0
req=5 (0x5), type=0 (0x0), value=1, index=0
USB_REQ_SET_ADDRESS
Len is 0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x100 index 0x0 length 0x12
req=6 (0x6), type=128 (0x80), value=256, index=0
USB_DT_DEVICE request
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x9
req=6 (0x6), type=128 (0x80), value=512, index=0
USB_DT_CONFIG config
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x200 index 0x0 length 0x19
req=6 (0x6), type=128 (0x80), value=512, index=0
USB_DT_CONFIG config
get_conf_no 0 Result 25, wLength 25
if 0, ep 0
##EP epmaxpacketin[1] = 8
set configuration 1
usb_control_msg: request: 0x9, requesttype: 0x0, value 0x1 index 0x0 length 0x0
req=9 (0x9), type=0 (0x0), value=1, index=0
USB_REQ_SET_CONFIGURATION
Len is 0
new device strings: Mfr=1, Product=2, SerialNumber=0
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x300 index 0x0 length 0xFF
req=6 (0x6), type=128 (0x80), value=768, index=0
USB_DT_STRING config
USB device number 1 default language ID 0x1
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x301 index 0x1 length 0xFF
req=6 (0x6), type=128 (0x80), value=769, index=1
USB_DT_STRING config
usb_control_msg: request: 0x6, requesttype: 0x80, value 0x302 index 0x1 length 0xFF
req=6 (0x6), type=128 (0x80), value=770, index=1
USB_DT_STRING config
Manufacturer u-boot
Product EHCI Host Controller
SerialNumber
USB hub found
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 0x4
req=6 (0x6), type=160 (0xa0), value=10496, index=0
USB_DT_HUB config
usb_control_msg: request: 0x6, requesttype: 0xA0, value 0x2900 index 0x0 length 0x8
req=6 (0x6), type=160 (0xa0), value=10496, index=0
USB_DT_HUB config
1 ports detected
individual port power switching
standalone hub
global over-current protection
power on to power good time: 20ms
hub controller current requirement: 0mA
port 1 is removable
usb_control_msg: request: 0x0, requesttype: 0xA0, value 0x0 index 0x0 length 0x4
req=0 (0x0), type=160 (0xa0), value=0, index=0
get_hub_status returned status 1, change 8101
local power source is lost (inactive)
no over-current condition exists
enabling power on all ports
usb_control_msg: request: 0x3, requesttype: 0x23, value 0x8 index 0x1 length 0x0
req=3 (0x3), type=35 (0x23), value=8, index=1
Len is 0
port 1 returns 0
usb_control_msg: request: 0x0, requesttype: 0xA3, value 0x0 index 0x1 length 0x4
req=0 (0x0), type=163 (0xa3), value=0, index=1
Port 1 Status 502 Change 0
1 USB Device(s) found
scan end
zynq-uboot>
--------------------------------------------------------------------------------------------
Unfortunately "usb tree" doesn't report plugged device.
-------------------------------------------------------------------------
zynq-uboot> usb tree
Device Tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller
-------------------------------------------------------------------------
I guess init sequences are missing, but I'm clueless on what should be done. Any ideas ?