Hi David,
Thanks for the information below on usb client working on Verdex.
I am also trying to make the USB gadget mass storage driver working on a
Verdex XLP6.
Made the kernel changes+removing FB2 from breakout-vx as described below and
loaded the g_file_storage driver, but unfortunately no Voila for me.
I have enabled some of the debug prints in the driver and this is how it
looks like:
After loading the driver:
+---------------------+
g_file_storage gadget-lun0: open backing file: /dev/mmcblk0p1
udc: pxa27x_config_ep is called
udc: usb endpoint descriptor is:
bLength:7
bDescriptorType:5
bEndpointAddress:80
bmAttributes:2
wMaxPacketSize:0
udc: UDCCR: 0xf2600404 is 0x200d103
udc: pxa27x_config_ep is called
udc: usb endpoint descriptor is:
bLength:7
bDescriptorType:5
bEndpointAddress:0
bmAttributes:2
wMaxPacketSize:0
udc: UDCCR: 0xf2600408 is 0x2014103
g_file_storage gadget: File-backed Storage Gadget, version: 28 November 2005
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget-lun0: ro=0, file: /dev/mmcblk0p1
g_file_storage gadget: transport=Bulk-only (x50)
g_file_storage gadget: protocol=Transparent SCSI (x06)
g_file_storage gadget: VendorID=x0525, ProductID=xa4a5, Release=x0311
g_file_storage gadget: removable=1, stall=1, buflen=16384
g_file_storage gadget: I/O thread pid: 432
udc: registered gadget driver 'g_file_storage'
udc: EP0_IDLE, udcicr B8000000.03, udcsir 00.00, udcfnr 00
udc: udccr 0x00000003 = uda ude, con=0,inter=0,altinter=0
udc: ep0 driver 'g_file_storage'
udc: udccsr0 EP0_IDLE 0x00000000 =
udc: ep0 IN 0/0, OUT 0/0
udc: udccs1 = 00
udc: udccs2 = 0
After Connecting to the Host PC:
+------------------------------+
udc: Interrupt, UDCISR0:0x00000000, UDCISR1:0x08000000, UDCCR:0x00000001
udc: USB reset start
udc: Trace path 1
g_file_storage gadget: disconnect or port reset
udc: USB reset
g_file_storage gadget-lun0: fdatasync ->
Please advise if I am missing something here.
On another thread on Nabble I am happen to read that USB client will not
work on Verdex due to PXA270 related bugs.
Really appreciate any hint/pointers in getting the USB mass storage working
with Verdex.
Thanks,
Shameer
David Kilp wrote:
>
> Apologize in advance for the length of this but I think there is some good
> information here for those people trying to get USB client mode working on
> Verdex boards.
>
> I have searched through the mailing list and the wiki regarding using the
> USB client on the Verdex (PXA270) and noticed that no one seems to have it
> working yet and even claims that it won't work. However, there was a post
> (http://article.gmane.org/gmane.linux.distributions.gumstix.general/23659/match=voila)
> in which Craig said:
>
>> By the way, the Product Comparison Chart for the breakout-vx says
>> it has
>> USB Client. Someone might want to fix that.
>
> It does have USB client. Plug a breakout-vx into a verdex and load
> the usb gadget driver on the verdex. Voila, USB client.
>
> ----
>
> Well, I tried this but no voila for me.
>
> I need this to work (at least I would like to use the g_ether and
> g_file_storage gadgets) so I did a bit of investigation. I am using the
> combination of a Verdex XM4-BT motherboard + breakout-vx. Normally this
> combination will provide USB host which seems to work pretty well. Looking
> through the PXA270 documentation to get a USB client, it seems like the
> D+/D- USB lines (USBH_P1/USBH_N1) on the 60-pin connector) are used for
> BOTH USB host and USB client depending on how the software controls it.
> Therefore, I figured that USB client SHOULD work as Craig said. However,
> further investigation showed that the gumstix.h defines the following:
>
> #define GPIO_GUMSTIX_USB_GPIOn 35
> #define GPIO_GUMSTIX_USB_GPIOx 41
>
> the first (GPIOn) is used to detect cable presence, the 2nd (GPIOx) is use
> to connect a pull-up on the D+ line to signal to the host that client is
> connected. These are correct for a PXA255 board (the older gumstix boards)
>
> However, the definitions are wrong for the Verdex boards. According to the
> 60-pin connector these should be:
>
> #define GPIO_GUMSTIX_USB_GPIOn 100
> #define GPIO_GUMSTIX_USB_GPIOx 27
>
> (GPIO41 is also used for the OTG_ID which I'm not considering here)
>
> I changed the lines above, rebuilt my kernel and also removed FB2 from my
> breakout-vx board so that cable detect circuit would work (rather than be
> a host supplying USB +5V)
>
> Next, I loaded up the g_file_storage gadget driver to see if the mass
> storage device would work and low and behold it showed up as a removable
> storage device on my desktop just like a regular flash drive! Now voila!
>
> I next tried the g_ether gadget driver (CDC Ethernet) and usbnet on host
> but there seems to be some problem that configuration. While the host
> would do the detection and the usb0 devices were created on both ends they
> wouldn't talk to each other. A usb monitor showed a constant stream of USB
> NAK messages which I haven't investigated further. It seems like it's
> pretty close though. Perhaps someone with expertise in this area could get
> it working (hint, hint...).
>
> Therefore, it seems like the definitions for the cable detect and pull-up
> resistor are wrong. I was using the verdex build that came with my board
> (r1321 in my case). However, I just checked the latest mainline build
> (r1457) and the definitions are still wrong.
>
> Perhaps someone can put some #ifdef's for the Verdex board in the
> gumstix.h file to correct the problem
>
> One other thought regarding these GPIO's. The PXA270 device has an
> internal pull-up resistor (UP2OCR_DPPUE) that can be used to signal client
> mode. I understand you are trying to create a compatible board between the
> PXA270 and PXA255. However, for the breakout-vx board you could have left
> GPIO27 available and used the internal D+ pull up to signal client status
> in udc_enable() in pxa27x_udc.c by adding a line like this:
> UP2OCR = UP2OCR_HXOE | UP2OCR_DPPUE; // set to non-otg client mode
> and set D+ pull-up
>
>
> Regards,
>
> --David Kilp
>
--
View this message in context: http://www.nabble.com/Verdex-%2B-USB-client-tp11643240p24252464.html
Sent from the Gumstix mailing list archive at Nabble.com.
|