UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer jskth
Observer
12,245 Views
Registered: ‎01-17-2008

Device Tree for c67x00

Hi,

 

 one of my big problems when developing for the ml403 is that I never managed to make the USB to work. In particular, I never managed to make the c67x00 driver to work in Linux, although I managed to made the usb keyboard example code(from EDK) to run together with the SystemACE ( they share some lines ) with no OS. One of the reason for upgrading to arch=powerpc has been this. I little question to begin with ( I might come with more of this later ) is, how should the device tree should look so to load the c67x00 hcd driver? I have tried with something like: 

 

 

xps_epc_0: usb@80800000 { compatible = "cypress,c67x00"; interrupt-parent = <&xps_intc_0>; interrupts = < 0 2 >; reg = < 0x80800000 0x10000 >; xlnx,family = "virtex4"; } ;

 I have tried playing with some of the things there, with no luck.I managed to load it before with the xparameters.h , but I don't that much how device-trees work regarding to this.

 

 This is for me one of the parts I liked less from using the ml403, the lack of support for the USB. Of course there is an Xapp to make it work,but alone, without the System_Ace and that is for some us useless. If I manage to make it work I wouldn't mind to write a document about it ( hw/sw instructions) since it doesn't seem to be any information on the whole internet about it.

 

Any ideas? 


Thx!

 

 

Tags (4)
0 Kudos
16 Replies
Anonymous
Not applicable
12,236 Views

Re: Device Tree for c67x00

What does "no luck" mean? Does linux report anything about USB when it comes up?  I've not used that USB chip before, but I have used another vendor's hooked up via the EPC, and your .dts entry looks similar to what I used - assuming "interrupts" is set correctly.

 

Terry

 

Observer jskth
Observer
12,203 Views
Registered: ‎01-17-2008

Re: Device Tree for c67x00

With no luck I mean that the driver doesn't load. I am using a merged branch between DENX+Adeos 2.6.29.4 (Xenomai) and Xilinx development. This is my boot sequence:

 

 

Linux/PowerPC load: console=ttyUL0 root=/dev/xsa2 noinitrd rootfstype=ext3 rw

Finalizing device tree... flat tree at 0x5e9300

Using Xilinx Virtex machine description
Linux version 2.6.29.4 (xxx@xxx) (gcc version 4.2.2) #6 PREEMPT Fri Jun 26 17:47:04 CEST 2009
Zone PFN ranges:
DMA 0x00000000 -> 0x00004000
Normal 0x00004000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
0: 0x00000000 -> 0x00004000
MMU: Allocated 1088 bytes of context maps for 255 contexts
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttyUL0 root=/dev/xsa2 noinitrd rootfstype=ext3 rw
Xilinx intc at 0x81800000 mapped to 0xfdfff000
PID hash table entries: 256 (order: 8, 1024 bytes)
clocksource: timebase mult[d55555] shift[22] registered
I-pipe 2.6-02: pipeline enabled.
Console: colour dummy device 80x25
console [ttyUL0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60644k/65536k available (3808k kernel code, 4828k reserved, 144k data, 244k bss, 152k init)
SLUB: Genslabs=10, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Calibrating delay loop... 593.92 BogoMIPS (lpj=296960)
Mount-cache hash table entries: 512
net_namespace: 520 bytes
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
XGpio: /plb@0/gpio@81460000: registered
XGpio: /plb@0/gpio@81440000: registered
XGpio: /plb@0/gpio@81420000: registered
XGpio: /plb@0/gpio@81400000: registered
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
I-pipe: Domain Xenomai registered.
Xenomai: hal/powerpc started.
Xenomai: real-time nucleus v2.4.8 (Lords Of Karma) loaded.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
fuse init (API version 7.11)
msgmni has been set to 118
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
84000000.serial: ttyUL0 at MMIO 0x84000003 (irq = 16) is a uartlite
brd: module loaded
loop: module loaded
xsysace 83600000.sysace: Xilinx SystemACE revision 1.0.12
xsysace 83600000.sysace: capacity: 4001760 sectors
xsa: xsa1 xsa2 xsa3
Xilinx SystemACE device driver, major=254
xilinx_emaclite 81000000.ethernet: Device Tree Probing
xilinx_emaclite 81000000.ethernet: MAC address is now 2: 0: 0: 0: 0: 0
eth0 (): not using net_device_ops yet
xilinx_emaclite 81000000.ethernet: Xilinx EmacLite at 0x81000000 mapped to 0xC5080000, irq=18
Generic platform RAM MTD, (c) 2004 Simtec Electronics
xilinx-xps-spi 81818000.xps-spi: at 0x81818000 mapped to 0xC503A000, irq=19
usbmon: debugfs is not available
usbcore: registered new interface driver cypress_cy7c63
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
Device Tree Probing 'i2c'
81620000.i2c #0 at 0x81620000 mapped to 0xC50A0000, irq=20
Device Tree Probing 'i2c'
81600000.i2c #0 at 0x81600000 mapped to 0xC50C0000, irq=21
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
kjournald starting. Commit interval 5 seconds
EXT3 FS on xsa2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) on device 254:2.
Freeing unused kernel memory: 152k init

 

The device-tree script doesn't generate anything for the cypress so I added it myself with some references that I found in maillists of linuxppc-dev. For me it clearly doesn't seem to load. I have given the interrupt 0 to the hpi interrupt from the cypress. The signals to the FPGA are muxed based in some glue-logic I found in the ML403 reference design.

 

 

 

Message Edited by jskth on 06-29-2009 06:01 AM
Message Edited by jskth on 06-29-2009 06:01 AM
0 Kudos
Observer jskth
Observer
12,198 Views
Registered: ‎01-17-2008

Re: Device Tree for c67x00

One more thing. When I managed to load the driver in PPC, I had something like:

 

 

/*
* Cypress USB C67x00 shortcut macro for single instance
*/
#define XPAR_C67x00_USB(num) { \
.name = "c67x00", \
.id = num, \
.num_resources = 2, \
.resource = (struct resource[]) { \
{ \
.start = XPAR_C67X00_USB_PRH##num##_BASEADDR, \
.end = XPAR_C67X00_USB_PRH##num##_BASEADDR + 0xf, \
.flags = IORESOURCE_MEM, \
}, \
{ \
.start = XPAR_OPB_INTC_0_SYSTEM_USB_HPI_INT_PIN_INTR, \
.end = XPAR_OPB_INTC_0_SYSTEM_USB_HPI_INT_PIN_INTR, \
.flags = IORESOURCE_IRQ, \
}, \
}, \
.dev.platform_data = &(struct c67x00_platform_data) { \
.sie_config = C67X00_SIE1_HOST | C67X00_SIE2_PERIPHERAL_A, \
.hpi_regstep = 0x02, /* A0 not connected on 16bit bus */ \
}, \
}

 But I don't know that well how that should translate to .dts notation...

 

 

Message Edited by jskth on 06-29-2009 03:33 AM
0 Kudos
Observer jskth
Observer
12,175 Views
Registered: ‎01-17-2008

Re: Device Tree for c67x00

Well, I will answer this question myself. Looking into the driver i have found that there is no openfirmware (OF) support for this so the system is not going to load c67x00 from the device-tree without it. I am working on a patch for it right now, whenever I have it working I'll try to publish it for review.

 

If someone is thinking about doing it ( or has done it), please let me know.

0 Kudos
Visitor pierre_usb
Visitor
9,576 Views
Registered: ‎02-23-2011

Re: Device Tree for c67x00

Hello,

 

I try to modify the dts file because, like you, I try to use the CY7C67300 driver but the controller is not recognised by Linux.

Is your patch done?

Have you information about the .dts file?

How can I know the port number between the Cypress controller and the interrupt controller (xps_intc)? It's not indicated in the mhs file...

 

Thank you.

 

Regards

 

Pierre

0 Kudos
Observer jskth
Observer
9,572 Views
Registered: ‎01-17-2008

Re: Device Tree for c67x00

Hi,

 

yes, I got this working some time ago. However I don't have the patch now and I won't have until next week( out-of-the office ATM). One reminder here in 1.5weeks and I'll try to get it.

 

 

0 Kudos
Visitor pierre_usb
Visitor
9,570 Views
Registered: ‎02-23-2011

Re: Device Tree for c67x00

Hi,

 

Ok thank you very much

 

Regards

Pierre

0 Kudos
Visitor pierre_usb
Visitor
9,460 Views
Registered: ‎02-23-2011

Re: Device Tree for c67x00

Hi,

 

I begin to modify the c67x00 driver for ".dts" file but i have some problems with the interrupt.

Have you found your patch?

 

Thank you

Pierre

0 Kudos
Adventurer
Adventurer
9,123 Views
Registered: ‎03-16-2010

Re: Device Tree for c67x00

I am trying to use the Cypress USB controller in host mode as well. The current kernel does not support DTS initialisation of the c67x00 driver - you can compile it but it gets never loaded. The patch everyone seems to implements bypasses the DTS init and just hardwires the driver to start.

 

I got a more elegant way by modifying the driver to accept parameters from the DTS and register itself with the platform loader to get started like other drivers. While that seems to work, I also have issues with the interrupt on the Cypress/xps_epc device.

 

In my case it seems to keep firing events. Switching from edge to level triggers does not seem to do anything. Does anybody have a solution?

 

BTW my own thread is over here: Use ML605 Cypress USB controller as EHCI host in linux

0 Kudos
Adventurer
Adventurer
6,416 Views
Registered: ‎03-16-2010

Re: Device Tree for c67x00

I solved my problem, see the thread I linked before for information and a patch to "fix" the Cypress driver to use the DTS properly.

0 Kudos
Visitor pierre_usb
Visitor
6,414 Views
Registered: ‎02-23-2011

Re: Device Tree for c67x00

Hello,

 

Ok thanks for the "patch".

I succeeded to use C67x00 driver but without to use the device tree. I will try to use the "patch" to use device tree support.

Have you fixed your interrupt error?

 

I have a very slow USB bandwidth... Have you problems with reading, writing or bandwidth?

 

Best regards.

 

Pierre

0 Kudos
Adventurer
Adventurer
6,412 Views
Registered: ‎03-16-2010

Re: Device Tree for c67x00

The interrupt error was due to unconnected pins which prevented the clearing of the interrupt.

 

The bandwidth is not extremely high (due to the lack of DMA, I think I read that somewhere) but enough to drive a USB headset for example.

0 Kudos
Visitor pierre_usb
Visitor
6,410 Views
Registered: ‎02-23-2011

Re: Device Tree for c67x00

 

Ok,

 

The bandwidth for me was 600 kbytes/s before I reduced the value TOTAL_FRAME_BW in the driver from 12000 to 4096 because I had writing errors... After that, I obtained a bandwidth of 120 kbytes/s but without reading or writing errors.

 

Thanks.

 

Pierre

0 Kudos
Visitor rekikamal
Visitor
6,240 Views
Registered: ‎03-09-2012

Re: Device Tree for c67x00

hi

I have the same problem as you

I'm working with the ML507 FPGA with power pc processor

Im trying to use the usb port using the linux2.6 kernel

and i have problem with the generator of the device tree

could you please give me some information how make the usb port working with CYPRESS c67x00

thanks

amal
0 Kudos
Visitor mikertetc
Visitor
6,180 Views
Registered: ‎05-08-2012

Re: Device Tree for c67x00

I am also working with the C67x00 on the microblaze. I saw your post concerning unconnected interrupt pins. Could you tell me which pins were unconnected? I am seeing pretty much the same problem and would like to point the way for the hardware guy.
0 Kudos
Visitor hooligan1989
Visitor
6,091 Views
Registered: ‎08-07-2012

Re: Device Tree for c67x00

I have the same problem as you do.

I tried almost everyway I found on the forum, although there are not many.

Have you solved the problem?

Thank you!

 

Xiangyu

0 Kudos