MCF5329 USB Host and NXP ISP1520 - HELP!

cancel
Showing results for 
Search instead for 
Did you mean: 

MCF5329 USB Host and NXP ISP1520 - HELP!

3,187 Views
SD_EE
Contributor I
My associates and I are using the MCF5329 USB host to communicate with an NXP ISP1520 Hub Controller IC. Our software engineers are having difficulty getting the communications to work. Has anyone else used this combination?
 
Does anyone have a recommended list of register settings for the USB host controller?
 
Any help is greatly appreciated.
Labels (1)
0 Kudos
17 Replies

221 Views
SD_EE
Contributor I
jpa,
 
Speed is no concern at all in our application - just need to talk to some sensor modules every few seconds.
 
You may be on to someting with the power requests. Here is an excerpt from the boot log:
 
<7>ehci ehci.0: GetStatus port 1 status e0001803 POWER sig=j CSC CONNECT
<7>hub 2-0:1.0: port 1, status 0101, change 0001, 12 Mb/s
<7>ehci ehci.1: fatal command 010018 (park)=0 ithresh=1 Periodic period=256 HALT
<7>ehci ehci.1: fatal status 4088 Periodic FLR
 
Does any of this look like the problem you had?
 
I've attached the entire USB section of the log. 
 
Thank you so much for the help!
SD
0 Kudos

221 Views
jpa
Contributor IV
SD,

No, but then again, I didn't look at the USB logs at the time.  Make sure the hub is configured for self-power, not bus-powered. 

jpa
0 Kudos

221 Views
ccosby
Contributor I
I have some input on this matter, as I am one of the software guys that SD_EE talks about. I'll try go get down to the heart of the problem here.

We are building a device with the 5329 CPU. It will have up to 3 USB devices connected at any given time, so we need a hub. The hardware guys have built a board with the NXP ISP1520 hub chip on it to provide that. From the software side, we're using the linux-2.6.22-uc1.20070808 kernel along with the patches supplied with the BSP for the M5329EVB. The devices will show up as generic raw hid devices.

Instead of going into detail on what we've tried already, does anyone have a primer of what we *should* be doing to get the host functionality of the 5329 working all the way through the hub? In short, tell me which kernel options to enable, which modules to load that maybe I've missed? We're using the CPU at 180MHz, so do I keep the clock divide at 3 or change it? What's the correct way to force the driver into a low speed mode (we've heard that high and full speed don't work)? Just some pointers.

To the poster who said they were using a different hub chip, maybe grace me with your linux/.config file.

Straws...that's what I'm grasping at here.
0 Kudos

221 Views
jpa
Contributor IV
As you wish...

I'm guessing the attached file is what you want if you're looking for my kernel configuration...if not, let me know...the .config file I found was for the upper level LTIB configuration, so there wasn't anything there concerning USB configuration.

I'm back at 2.6.17.1, based on the 20060705 version of the LTIB with some USB and other patches applied as supplied by Freescale.

jpa
0 Kudos

221 Views
ccosby
Contributor I
Thanks jpa. That's exactly what I wanted. I'll try the old BSP. If it works, I'm gonna kick somebody. Or something. Do you have any additional patches from Freescale or just the ones from that BSP?
0 Kudos

221 Views
jpa
Contributor IV
The files included updating the kernel to 2.6.17.1 and the following:
kernel-2.6.17.1.spec.in
linux-2.6.17-uc0.patch.gz
m5329-flash.patch.gz
m532x-can.patch.gz
m532x-core.patch.gz
m532x-fb.patch.gz
m532x-i2c.patch.gz
m532x-spi.patch.gz
m532x-usb.patch.gz

and did not come with the BSP, as far as I know. 

I'm checking now to see if there's a problem with uploading them to the forum, they're only about 200k other than the kernel source which you must supply, and the instructions, which look like they were handwritten on a tablet pc. 

Any Freescale folks...feel free to jump in with either a "nix to that!" or a link of your own...

jpa
0 Kudos

221 Views
jpa
Contributor IV
Here are the patches that I applied to the 20060705 LTIB and instructions for how to apply them as I received them.

The patches should not be considered official Freescale code, nor do I offer any warranty or support.  They may cause your system to explode and your flowers to wilt, for all I know.  Use at your own risk.  The newer LTIB may have fixed all these problems and more.

jpa
0 Kudos

221 Views
ccosby
Contributor I
Thanks jpa. Got it, tried it. Works on the M5329EVB. Still no luck on our hardware, but at least I have another lead to follow.
0 Kudos

221 Views
obidon
Contributor III
Hi, I'm developing on a custom board based on the 5329EVB and also using the ISP1520 USB Hub. I wrote a driver to initialize the ISP1520 using the I2C port. My project currrently is based on the LTIB 20061117 and works. I'm trying to upgrade from the 2.6.17.7 kernel to the LTIB 20071102 with the 2.6.22 kernel.

# modprobe isp1520
**DW** drivers/i2c/chips/isp1520.c 644 isp1520_init
**DW** drivers/i2c/chips/isp1520.c 665 isp1520_init Setting QSPI low
**DW** drivers/i2c/chips/isp1520.c 675 isp1520_init Setting QSPI low
**DW** drivers/i2c/chips/isp1520.c 583 isp1520_detect i2c_master_send result = 256
**DW** drivers/i2c/chips/isp1520.c 599 isp1520_detect major: 253 dev_id 265289728
usb 1-1: USB disconnect, address 3
# usb 1-1: new full speed USB device using ehci and address 4
usb 1-1: not running at top speed; connect to a high speed hub
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 2 ports detected

#
# hub 1-1:1.0: hub_port_status failed (err = -71)
usb 1-1.2: new full speed USB device using ehci and address 5
usb 1-1.2: not running at top speed; connect to a high speed hub
usb 1-1.2: configuration #1 chosen from 1 choice
scsi0 : SCSI emulation for USB Mass Storage devices
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: Cannot enable port 2. Maybe the USB cable is bad?
hub 1-1:1.0: cannot disable port 2 (err = -71)
usb 1-1.2: reset full speed USB device using ehci and address 5
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: cannot reset port 2 (err = -110)
hub 1-1:1.0: Cannot enable port 2. Maybe the USB cable is bad?
hub 1-1:1.0: cannot disable port 2 (err = -71)
scsi 0:0:0:0: scsi: Device offlined - not ready after error recovery
usb 1-1.2: USB disconnect, address 5

The ISP1520 Hub LED lights up when the I2C commands are sent and ucLinux then detects the hub so everything looks good. When a device is plugged in (I have tried flash drives and a keyboard) the device seems initially to be detected properly. The hub port LED lights and ucLinux will report "Mass storage" or "Keyboard" appropriately, but after a couple of seconds both LEDs go out, and ucLinux reports "cannot reset port".

I may start doing some file compares between the USB drivers on the 20061117 and 20071102 to see if I can find anything. Any other suggestions will be appreciated.

Don
0 Kudos

221 Views
ccosby
Contributor I
My suggestion would be to take all of the stuff that jpa posted and use it. The 2.6.22 kernel will fool you and make you think that you're making headway. All you'll need is a fresh copy of the kernel from kernel.org and those patches and you'll be on your way. I've heard from Freescale that there's an update to the LTIB (possibly with the 2.6.25 or 26 kernel), but it's a few months out. It seems that even though the USB driver layer for the 5329 works properly, the underlying kernel changes (EHCI) make the 5329 flaky with USB.

Oh, and by the way, thanks a million to jpa for getting us up and running. I owe you a <$beverage> if you're ever in Atlanta.
0 Kudos

221 Views
obidon
Contributor III
It looks like those patches will only work for kernel 2.6.17.1. Have you made these work with a newer kernel? I may just stick with 2.6.17.7 for now.

Thanks
0 Kudos

221 Views
SD_EE
Contributor I
We're running uCLinux. I don't know if the software engineers have used LTIB to configure the build. I will ask them what they are using.
 
The host does work with a custom peripheral that we developed - a full speed sensor board.
 
Is the Cypress hub that you have used a full speed or a high speed device? I'm wondering if the difficulties that we are having are occuring during the negotiation to high speed.
 
Thanks from SD!
0 Kudos

221 Views
jpa
Contributor IV
SD,

Please take what I'm saying with a grain of salt...I'm something of a newbie to USB myself...

The Cypress hub I'm using, the CY7C65630, is certainly capable of running at high speed.  It's USB 2.0 with a single transaction translator.  If you've got the EVB, you can try someone else's hub, right?  When we were first bringing up the Cypress hub on our target, we had lots of fun until we got the hub chip configured correctly.  But with the EVB, you can use something off-the-shelf to get it running.  Cypress has an eval board for their hub. 

1) Check out the 5329 device errata (MCF5329DE.PDF).  There's a note (that may now be outdated) that the USB on-chip transceivers do not operate correctly in full-speed mode.  It also says this was corrected on datecodes XXX0618 and higher.  However, I wonder if the uCLinux code wasn't written to work around these early chips, because...

2) With a USB memory stick plugged in, I get the following on the console:
new full speed USB device using ehci and address 3
not running at top speed; connect to a high speed hub

This same message occurs when the stick is plugged directly into the 5329EVB host port, so I'm guessing this is a reflection of the 5329EVB host port's operation speed.

I'm using the 20060705 version of LTIB with Freescale's USB patches.  If you're using the most recent LTIB, then your results may be completely different. 

Hope this helps...

jpa
0 Kudos

221 Views
jpa
Contributor IV
Sorry, I just realized that it was the forum software that labeled you 'newbie' not your own description.  I didn't mean any offense.

jpa
0 Kudos

221 Views
SD_EE
Contributor I
jpa,
 
No offense taken. I am a newbie to the host controller end of things and to uCLinux.
 
As part of our hardware testing efforts, we built a hub test board around the ISP1520. The hub board works fine with a PC running windows and a PC running Linux. We can't get the hub to work with either the Logic PD MCF5329 eval board or with our prototype board.
 
1.) The date codes indicate that we have the latest silicon on our boards, but that doesn't mean that the latest LTIB was used...
 
2.) From the messages you see "not running at top speed; connect to a high speed hub", does this imply that your hub is operating at full speed, not high speed? Did you limit the speed to full speed in the MCF5329 configuration, or was this limited through configuration options of your hub?
 
Thanks,
SD 
0 Kudos

221 Views
jpa
Contributor IV
SD,

Remember, we get this message whether there is a hub connected to the 5329EVB or not, so it has nothing to do with our hub configuration.  I take this message as an indication that the 5329 port is running at full or low speed, but I haven't tried to measure this in any way.  Our application doesn't require much speed on the USB anyway, so it has always been a curiosity, but not something we needed to fix.  I take it you are not getting this message?

As far as I know, I did nothing in the kernel config to explicitly limit USB speed.  The EHCI HCD (USB 2.0) support is enabled, "Full speed ISO transactions (experimental)" is NOT enabled, but my reading of the description tells me this enables a specific way of handling certain transactions, not wholesale full speed support. 

I'm just throwing things out now to see if they stick, but some of the fun we had when bringing up the hub on the target had to do with the power configuration on the hub.  Devices requesting more power than the upstream devices could provide were flat out ignored.  Tell the hub (in its configuration) that it needs lots of power (whether it does or not), and it will request that power from the 5329, the 5329 will say "no thank you" and refuse to talk to the hub anymore.  Could your hub be asking for power that the PCs can provide, but the 5329 cannot?  Have you tried an off-the-shelf hub?  In self-powered mode?


jpa
0 Kudos

221 Views
jpa
Contributor IV
I've not used that specific combination...I do have the 5329 host talking to a Cypress hub under the LTIB / uCLinux, so if the question is 'can it be done?' I'd say the answer is a pretty strong 'yes'.  However I'm not going to be much help with register settings as uCLinux takes care of that for me. 

You don't mention an operating system or USB stack...are you rolling your own? 

Do you have the USB host working with anything?

jpa
0 Kudos