Author Topic: SuperSpeed, host and device clock.  (Read 23727 times)

ChongHan

  • Member
  • ***
  • Posts: 41
SuperSpeed, host and device clock.
« on: May 09, 2014, 12:03:55 am »
Hi all, I have several question about SuperSpeed Clock.

1) Host's bus interval clock is different to each active devices?
2) How to add a external clock to a SuperSpeed USB system. Just install it as a peripheral device that provide clock for host and other devices?
3) Bus interval boundary is mark using a clock tick, and ITP is send at each boundary of bus interval's boundary according to the same clock tick that create the bus interval's boundary? Between. how to check/explore host's clock and device's clock?

Thanks in advance.

Regards
Chong Han

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: SuperSpeed, host and device clock.
« Reply #1 on: May 09, 2014, 08:40:28 am »
A host uses the same bus intervals for all devices on the bus.

You can use an external timing source or derive a clock from an timing source if available.

What are you trying to accomplish? What problem are you attempting to solve by checking the host's clock and device's clock?

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #2 on: May 09, 2014, 03:59:11 pm »
1. I don't know exactly what the spec is, but I'm pretty sure the implementations I worked on used the same clock for each device.

2. Again, I don't know if the spec allows it, but the implementation I worked on did not allow for this.

3. I don't know what the question is here.

As Jan said, what's the actual problem you're trying to solve. I think you're probably headed in the wrong direction.

Bret

  • Frequent Contributor
  • ****
  • Posts: 68
Re: SuperSpeed, host and device clock.
« Reply #3 on: May 09, 2014, 08:14:05 pm »
My understanding is that the only "clock" you can control is for the entire bus, not a single device.  And, even then, you are not actually controlling a clock -- you are simply adjusting how many clock oscillations occur between USB Start-of-Frame packets.  You normally do not need to mess with this timing at all,
unless you are trying to synchronize/slave the USB bus to some external timing source.

I didn't realize you could even use an external timing source, though I suppose some hardware implementations could allow for that.  The only hardware I've ever seen has an oscillator built onto the card/motherboard.

As Jan and Barry stated, you should probably clearly state the actual problem you are trying to solve.  If you are needing some sort of highly synchronized or highly precise timing characteristics, USB may be ill-suited to the task.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #4 on: May 12, 2014, 03:10:39 am »
"you are simply adjusting how many clock oscillations occur between USB Start-of-Frame packets".

My actual problem is something like above statement but is in USB 3.0. To adjust the how many clock oscillation, I need to know how is the clock is (but how to check host's clock?). How the host create a bus interval using the clock. How many period of clock in a bus interval.

Is that the bus interval of all connected devices is same to each other and also same in both IN and OUT direction?

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #5 on: May 12, 2014, 01:19:33 pm »
You still haven't said what the actual problem you're trying to solve is. I don't think you're going to get anywhere with your current thinking.

Are you considering using the Bus Interval Adjustment Message? (As specified in 8.5.6.6.)

You should note in the 3.1 spec it says:

Quote
The Bus Interval Adjustment Message may be sent only by devices operating at Gen 1 speed and shall be ignored by hosts that are not operating at Gen 1 speed. Note that this notification will be deprecated in a future release.

I was surprised to see it included in the spec, similar language was included in the 1.x spec, and then not included in the 2.0 spec, so I thought the idea was dead. It looks like they're trying to kill it again. I'm not aware of any host which implements the message, I know our host implementation didn't.

It seems pretty clear to me reading that section that the BusIntervalAdjustmentGranularity unit is not specified at the device is required to see what happens when it changes the bus interval and work that out itself.

If no host implements the message, then you're not going to see any adjustment.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #6 on: May 13, 2014, 02:34:13 am »
Yes. But i want to try it for using this Message.
 
Yes I know too the USB3.1 Spec already stated that it will deprecated in future release. So i am planning to do only in USB 3.0 host and device' controller only.

So this function is stated in the USB3.0 Spec. Therefore it should work in practical right? Just maybe it can't be too precise. Am I right?

And for now, I am actually didn't know about the bus interval in USB. How they create bus interval, and why to use it. If using clock, then how the clock create the bus interval in USB bus?

Thanks everyone in advance.

Best Regards
Chong Han

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #7 on: May 13, 2014, 07:07:24 pm »
You still haven't said why you want to use the message. What problem you're trying to solve. I don't think its going to work.

As I said, this may very well be not implemented on the host. I didn't implement it on the host stack I worked on. I would be quite surprised if you did find a host on which it was implemented.

I don't understand the rest of the question. The bus interval is defined as 125µs, which is a hold over from USB 2. Its there to give isochronous devices a clock. The rest sounds like you're asking for implementation details, which you shouldn't be concerned with, and by definition depend on the implementation.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #8 on: May 13, 2014, 09:54:31 pm »
Hi

I want to use these message to synchronize multiple device which I can trigger them in the same time. Therefore I want to adjust bus interval so that all the command from the host will reach all the connected devices to start work at the same time.

For the host controller, how can I know it support the Bus Interval Adjustment Message or not?

Thanks.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #9 on: May 13, 2014, 11:45:50 pm »
If all you want to do is synchronise devices why are you worrying about adjusting the bus interval? The ITP is broadcast to all devices with the intention of providing synchronisation. It would seem to do exactly what you want without messing with the timing.

To receive ITPs you have to make sure the link is in U0, and don't take any notice of ITPs with the delayed bit set. That's about it.

The host controller must support the Bus Interval Adjustment Message, but the host software doesn't have to do anything with it. (My software just logs the message, and ignores it.) The only way you'd know if the host software is doing anything with it is if the bus interval changes.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #10 on: May 26, 2014, 11:01:02 pm »
Hi

Transmission of ITP is via control endpoint or isochronous endpoint?

So ITP provide timing for synchronization of between multiple devices to, but not only one to one between host and device. Am i right?

Any method I can use to check the ITP packet transmission activity?

Thanks in advance.

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #11 on: May 26, 2014, 11:05:04 pm »
The ITP is not transmitted to any endpoint or to any device. Its a packet which is broadcast to all devices.

I don't understand the rest of the question.

You can check the ITP packets with a bus analyser, like any other packets on the bus.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #12 on: May 26, 2014, 11:50:24 pm »
So the ITP will be multicast to all devices automatically and we no need to ask host to send?

How can I derive the timing info from ITP in device if there is no endpoint to receive it?

Barry Twycross

  • Frequent Contributor
  • ****
  • Posts: 263
Re: SuperSpeed, host and device clock.
« Reply #13 on: May 27, 2014, 12:34:40 am »
The ITP is sent automatically to all devices with links in U0.

The device has to know how to receive the packet, much like USB1/2 devices take note of SOFs. You may find your device chip has a register which tells you the value of the last timestamp received.

ChongHan

  • Member
  • ***
  • Posts: 41
Re: SuperSpeed, host and device clock.
« Reply #14 on: June 09, 2014, 04:07:05 am »
Hi me again.

Thanks again to all for answering my question. So for synchronization, we just need to use the info from ITP?
The ITP mark the timestamp when packet leave the host. So from the device's side, we just compare the timestamp which receive the ITP packet with the value in ITP right? Therefore we can use the calculated result to adjust the clock tick(period) in the device right?