Escolar Documentos
Profissional Documentos
Cultura Documentos
EHCI Specification
and Testing
EHCI Specification
and Testing
John S. Howard
John S. Howard
Engineering Manager
Engineering Manager
Intel Corporation
Intel Corporation
June 12, 2002 3
Agenda
Agenda
!
!
EHCI Development Overview
EHCI Development Overview
!
!
EHCI Architecture/Key Features
EHCI Architecture/Key Features
!
!
Top 10 Developer
Top 10 Developer
FAQs
FAQs
!
!
USB2 Host Controller Compliance Program
USB2 Host Controller Compliance Program
!
!
Top Issues Identified with Compliance Tests
Top Issues Identified with Compliance Tests
!
!
Summary
Summary
June 12, 2002 4
What is The EHCI Spec.?
What is The EHCI Spec.?
!
!
Enhanced Host Controller Specification for USB
Enhanced Host Controller Specification for USB
NEC, Lucent (
NEC, Lucent (
Agere
Agere
), Philips, HP, Compaq
), Philips, HP, Compaq
and Microsoft
and Microsoft
Queue semantics
Queue semantics
!
!
Packet
Packet
-
-
oriented ( Isochronous )
oriented ( Isochronous )
Asynchronous schedule
Asynchronous schedule
Shared Memory Work Schedules
Shared Memory Work Schedules Shared Memory Work Schedules
Periodic Schedule
Periodic Schedule Periodic Schedule
Asynchronous Schedule
Asynchronous Schedule Asynchronous Schedule
June 12, 2002 15
Periodic Schedule Overview
Periodic Schedule Overview
! ! Binary Binary- -tree structure tree structure
Traversal from leaf level to root Traversal from leaf level to root
Frame List Frame List is the Leaf level is the Leaf level
Each level in tree is a poll rate Each level in tree is a poll rate
interval interval
! ! Objects linked relative to the Objects linked relative to the Frame Frame
List List, are at correct poll rate , are at correct poll rate
! ! Transfer Types Supported Transfer Types Supported
HS Isochronous ( HS Isochronous (iTD iTD), ),
HS Interrupt ( HS Interrupt (Queue Heads Queue Heads) )
FS/LS Interrupt ( FS/LS Interrupt (Queue Heads Queue Heads), ),
FS Isochronous ( FS Isochronous (siTD siTD) )
! ! Other Support Other Support
Dynamic Rebalancing of FS/LS Dynamic Rebalancing of FS/LS
Frame Frame- -Spanning Split Transactions Spanning Split Transactions
4
4 4
Poll Rate: N Poll Rate: N ! !1 1
Periodic Frame List Periodic Frame List
4
4 4
4
4 4
4
4 4
2
2 2
2
2 2
1
1 1
June 12, 2002 16
Periodic Frame List
Periodic Frame List
!
!
Array of schedule object pointers
Array of schedule object pointers
!
!
Represents a rolling window
Represents a rolling window
of time
of time
Each location is base pointer for Each location is base pointer for
one frames worth of work one frames worth of work
(8 micro (8 micro- -frames) frames)
Frame work for establishing Frame work for establishing
time time- -oriented oriented reachability reachability
!
!
HC builds an offset into the
HC builds an offset into the
Periodic Frame list from:
Periodic Frame list from:
Periodic frame list base address Periodic frame list base address
Frame Index Register [12:3] Frame Index Register [12:3]
" " Increments once each frame (1ms) Increments once each frame (1ms)
Frame List Base Frame List Base
12 12 31 31 13 13 12 12
3 3 0 0
Frame Index Frame Index
31 31 12 12 11 11 2 2
Periodic Frame List Periodic Frame List
To schedule graph To schedule graph
Accesses same offset 8 micro Accesses same offset 8 micro- -
frames before preceding to next frames before preceding to next
location location
Micro-frame select
June 12, 2002 17
High Speed Isochronous
High Speed Isochronous
!
!
Packet
Packet
-
-
oriented Data
oriented Data
Structure
Structure
!
!
8 Transaction Records
8 Transaction Records
per
per
iTD
iTD
(one per Micro
(one per Micro
-
-
Frame)
Frame)
Transaction Record 0 Transaction Record 0
Transaction Record 1 Transaction Record 1
Transaction Record 7 Transaction Record 7
Memory Pointers, addressing, Memory Pointers, addressing,
transfer state, etc. transfer state, etc.
Isochronous Isochronous
Transfer Descriptor Transfer Descriptor
( (iTD iTD) )
13 13 12 12
3 3 0 0
Frame Index Frame Index
Selects Selects
Transaction Transaction
Record Record
Selects Frame List Selects Frame List
Offset Offset
June 12, 2002 18
Periodic Split Transactions
Periodic Split Transactions
!
!
Used to service data streams through TT periodic
Used to service data streams through TT periodic
pipeline(s)
pipeline(s)
!
!
Requirement on Host is to:
Requirement on Host is to:
Micro
Micro
-
-
frame masks which encode which micro
frame masks which encode which micro
-
-
frames to
frames to
execute Starts & Complete splits
execute Starts & Complete splits
Micro
Micro
-
-
state to track progress (to detect lost data, etc.)
state to track progress (to detect lost data, etc.)
!
!
Projection of core
Projection of core
-
-
spec bus frame boundaries into the
spec bus frame boundaries into the
host schedule created many scheduling boundary
host schedule created many scheduling boundary
conditions, so
conditions, so
June 12, 2002 19
7 7 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1 0 0
CS CS CS CS CS CS CS CS SS SS CS CS CS CS CS CS CS CS
7 7 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1 2 2
HS Bus HS Bus
Frames Frames
HC Periodic HC Periodic
Schedule Schedule
Micro Micro - - frames frames
HS/FS/LS Bus HS/FS/LS Bus
Frame Boundaries Frame Boundaries
HC Periodic Schedule HC Periodic Schedule
Frame Boundaries Frame Boundaries
SS SS
B B- -Frame N Frame N B B- - Frame N+1 Frame N+1
Interface Data Interface Data
Structure Structure
H H - - Frame N Frame N
Interface Data Interface Data
Structure Structure
H H - - Frame N+1 Frame N+1
Bus Frame View Vs.
Host Frame View
Bus Frame View Vs.
Host Frame View
! ! In order to simplify host for TT periodic pipeline support we ha In order to simplify host for TT periodic pipeline support we had to offset the d to offset the
Hosts view of frame boundaries by one micro Hosts view of frame boundaries by one micro- -frame from Buss view frame from Buss view
Full/Low-Speed
Transaction
Full/Low-Speed
Transaction
Full/Low-Speed
Transaction
Full/Low-Speed
Transaction
June 12, 2002 20
FS Isochronous IN
Frame-Wrap Example
FS Isochronous IN
Frame-Wrap Example
Start Start- -Mask Mask 08h 08h
Complete Complete- -Mask Mask C3h C3h
siTD
X
siTD
X+1
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1 2 2
H H- -Frame X Frame X
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 0 0 1 1
B B- -Frame Y Frame Y
7 7
SS SS CS CS
0 0
CS CS
1 1
CS CS
2 2
CS CS
3 3
H H- -Frame X+1 Frame X+1
B B- -Frame Y+1 Frame Y+1
Back Pointer Back Pointer
June 12, 2002 21
FS/LS Interrupt IN
Frame-wrap Example
FS/LS Interrupt IN
Frame-wrap Example
Start Start- -Mask Mask 40h 40h
Complete Complete- -Mask Mask 03h 03h
Must be reachable from Must be reachable from
consecutive Frame list locations: consecutive Frame list locations:
0,1, 8,9, 16,17 (poll period of 8) 0,1, 8,9, 16,17 (poll period of 8)
Queue Head Queue Head
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
0 0 0
1 1 1
2 2 2
H-Frame H H- -Frame Frame
0 0 0
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
0 0 0
1 1 1
B-Frame B B- -Frame Frame
7 7 7
SS SS SS
CS
0
CS CS
0 0
CS
1
CS CS
1 1
Requires use Requires use
of FSTN of FSTN
June 12, 2002 22
FSTN Example
FSTN Example
FSTNs FSTNs are specific routing data structures to are specific routing data structures to
allow system software to describe alternate allow system software to describe alternate
traversal on necessary frame traversal on necessary frame- -wrap wrap
boundaries boundaries
8A.0 8A.0
8B.0 8B.0
8C.0 8C.0
8D.0 8D.0
8F.0 8F.0
8G.0 8G.0
8H.0 8H.0
8I.0 8I.0
4A.0 4A.0 4A.1 4A.1 4A.2 4A.2
2A.0 2A.0
1A.0 1A.0
4B.0 4B.0 4B.1 4B.1 4B.2 4B.2
4C.0 4C.0 4C.1 4C.1
4D.0 4D.0 4D.1 4D.1
2B.0 2B.0
4 4
4 4
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
8 8
8 8
8 8
8 8
8 8
8 8
8 8
4 4
4 4
4 4
4 4
2 2
2 2
1 1
4 4
4 4
4 4
4 4
N N- -ptr ptr
B B- -ptr ptr
(push) (push)
FSTN FSTN
N N- -ptr ptr
B B- -ptr ptr
(pop) (pop)
FSTN FSTN
Push FSTN, B Push FSTN, B- -ptr ptr is traversed (only in is traversed (only in
Micro Micro- -frame 0, 1). frame 0, 1).
Pop FSTN, HC returns to Push location Pop FSTN, HC returns to Push location
and follows N and follows N- -Ptr Ptr
June 12, 2002 23
FS/LS Interrupt
Rebalance Lockout
FS/LS Interrupt
Rebalance Lockout
!
!
When there are changes in
When there are changes in
active endpoints below a TT
active endpoints below a TT
System software recalculates System software recalculates
TT budget TT budget
Active endpoints may require Active endpoints may require
rebalancing rebalancing
" " New start New start- - and complete and complete- -split split
masks masks
!
!
Queue Head
Queue Head
I
I
-
-
Bit
Bit
Feature makes
Feature makes
rebalancing easy to manage
rebalancing easy to manage
Software sets Software sets I I- -Bit Bit in queue head in queue head
to a one, indicating HC must to a one, indicating HC must
deactivate Queue Head before deactivate Queue Head before
starting another split transaction starting another split transaction
Very easy for system software to Very easy for system software to
detect when data structure is safe detect when data structure is safe
to update, then reactivate to update, then reactivate
Set Active
Set Active
to zero
to zero
Do Complete
Do Complete
Last CS
Last CS
No change
No change
to Active
to Active
Do Complete
Do Complete
Not Last CS
Not Last CS
Sets Active
Sets Active
to zero
to zero
Do Start
Do Start
Queue Head State & Queue Head State &
Transaction Result Transaction Result
Side Effect to Queue Side Effect to Queue
Head Active bit Head Active bit
June 12, 2002 24
Async. Schedule Overview
Async. Schedule Overview
!
!
HS, FS, LS Bulk & Control
HS, FS, LS Bulk & Control
Micro
Micro
-
-
machine to track split
machine to track split
transaction progress
transaction progress
See foil
See foil
!
!
How do I map
How do I map
qHD
qHD
state to specific error conditions?
state to specific error conditions?
See foil
See foil
!
!
Getting horrible Bulk throughput, why?
Getting horrible Bulk throughput, why?
Ans
Ans
: use for FS/LS Interrupt. Used to implement budgeted
: use for FS/LS Interrupt. Used to implement budgeted
execution footprint See Budgeting presentation
execution footprint See Budgeting presentation
!
!
The specified operation of the Configured Bit causes
The specified operation of the Configured Bit causes
OSs
OSs
to impose load ordering why did you do this?
to impose load ordering why did you do this?
Long story
Long story
June 12, 2002 29
Adding qTDs to qTD Chain
Adding qTDs to qTD Chain
!
!
Dummy
Dummy
qHD
qHD
Always leave inactive Always leave inactive qTD qTD on on
qTD qTD chain chain
When adding new work, use the When adding new work, use the
existing dummy existing dummy qTD qTD as the first as the first
qTD qTD for next buffer for next buffer
Add additional Add additional qTDs qTDs for for
remaining buffer remaining buffer
Add new dummy Add new dummy qTD qTD
Activate all Activate all qTDs qTDs (except (except
dummy) dummy)
Alt.Next pointers always point Alt.Next pointers always point
to the new dummy to the new dummy qTD qTD
!
!
Manage
Manage
qTDs
qTDs
as a pre
as a pre
-
-
linked
linked
circular list
circular list
Use software head & tail pointers Use software head & tail pointers
Head pointer tells software which Head pointer tells software which
qTD qTD to use next to use next
Tail pointer tells software which Tail pointer tells software which
qTD qTD is next one to reap (transfer is next one to reap (transfer
results) results)
When adding new work must make When adding new work must make
Alt.Next pointers reference new Alt.Next pointers reference new
Head Head qTD qTD
Requirement is to add work to a queue without hitting race condi
Requirement is to add work to a queue without hitting race condi
tions
tions
June 12, 2002 30
qHD State Mapping
qHD State Mapping
0 0
>0 >0
>0 >0
>0 >0
>0 >0
>0 >0
CErr CErr
1 1
1 1
1 1
0 0
0 0
0 0
Halted Halted
1 1
1 1
0 0
1 1
0 0
0 0
XactErr XactErr
>=0 >=0
>0 >0
>0 >0
>= 0 >= 0
>0 >0
0 0
Bytes2Xfer Bytes2Xfer
Three consecutive bus transactions errors Three consecutive bus transactions errors
(any of bad (any of bad pid pid, timeout, data , timeout, data crc crc, etc.) , etc.)
STALL response (same assumption) during STALL response (same assumption) during
some bus transaction during the buffer a some bus transaction during the buffer a
timeout, etc. was encountered timeout, etc. was encountered
Assuming no other status bits are set, this Assuming no other status bits are set, this
was a STALL response. was a STALL response.
( (nc nc or sp) with one or more retries for or sp) with one or more retries for
XactErrors XactErrors detected detected
Short packet (sp) Short packet (sp)
Normal ( Normal (nc nc) )
Explanation Explanation
June 12, 2002 31
Top 5 HW Developer FAQs
Top 5 HW Developer FAQs
!
!
What does Caching of data structures mean?
What does Caching of data structures mean?
Ans Ans: the model is more of a : the model is more of a prefetch prefetch buffer, with no implied buffer, with no implied
coherency mechanisms coherency mechanisms
!
!
Is the
Is the
Typ
Typ
field in a Queue Head Horizontal Pointer used in the
field in a Queue Head Horizontal Pointer used in the
Asynchronous Schedule?
Asynchronous Schedule?
Ans Ans: NO : NO
!
!
Where is the counter for immediate retries on split
Where is the counter for immediate retries on split
isochronous kept?
isochronous kept?
Ans Ans: internal to HC, no room in : internal to HC, no room in siTD siTD
!
!
When does the HC set/clear the
When does the HC set/clear the
Asynch
Asynch
& Periodic
& Periodic
Sched
Sched
.
.
Status bits?
Status bits?
Ans Ans: They are essentially a hardware : They are essentially a hardware ack ack that the HC has seen the enable at that the HC has seen the enable at
a 1, or has seen the enable at a 0 a 1, or has seen the enable at a 0
!
!
Must the Debug Port work on only one port?
Must the Debug Port work on only one port?
Ans Ans: It may optionally work on any port, but it MUST work on the : It may optionally work on any port, but it MUST work on the
port indicated port indicated
June 12, 2002 32
Agenda
Agenda
!
!
EHCI Development Overview
EHCI Development Overview
!
!
EHCI Architecture/Key Features
EHCI Architecture/Key Features
!
!
Top 10 Developer
Top 10 Developer
FAQs
FAQs
!
!
USB2 Host Controller Compliance Program
USB2 Host Controller Compliance Program
!
!
Top Issues Identified with Compliance Tests
Top Issues Identified with Compliance Tests
!
!
Summary
Summary
June 12, 2002 33
EHCI Compliance Program
EHCI Compliance Program
!
!
Goal is to ensure uniform HC
Goal is to ensure uniform HC
functional behavior
functional behavior
!
!
Eliminate need for
Eliminate need for
Implementation
Implementation
-
-
specific
specific
HC Driver Software
HC Driver Software
!
!
Provide tools to help HC
Provide tools to help HC
implementers get it right
implementers get it right
!
!
Not a performance test
Not a performance test
!
!
Self
Self
-
-
Test for EHCI
Test for EHCI
Functional Testing
Functional Testing
(not 3 (not 3
rd rd
Party Test Houses)** Party Test Houses)**
USB USB- -IF IF
Host/Systems Host/Systems
Testing Testing
USB USB- -IF IF
2.0 Hub (TT) 2.0 Hub (TT)
Testing Testing
EHCI Functional EHCI Functional
Testing Testing
Enhanced Host Controller Interface
Enhanced Host Controller Interface
Compliance
Compliance
June 12, 2002 34
EHCI Compliance Prog.
EHCI Compliance Prog.
!
!
Self
Self
-
-
Test for EHCI Compliance Test Suite for Functional Testing is
Test for EHCI Compliance Test Suite for Functional Testing is
not yet released, so
not yet released, so
!
!
Intel Labs is providing EHCI Functional Testing, as a convenienc
Intel Labs is providing EHCI Functional Testing, as a convenienc
e
e
to the USB2 industry until the Self
to the USB2 industry until the Self
-
-
Test Program is in place
Test Program is in place
Must be an an Adopter of the EHCI Specification (e.g. a License Must be an an Adopter of the EHCI Specification (e.g. a Licensee) e)
A Corporate Non Disclosure Agreement (CNDA) must be in place A Corporate Non Disclosure Agreement (CNDA) must be in place
To submit products for testing at Intel Labs, must sign an EHCI To submit products for testing at Intel Labs, must sign an EHCI Testing Testing
Services Agreement Services Agreement
Prior to release, EHCI software is being made available via Rest Prior to release, EHCI software is being made available via Restricted Use ricted Use
License. License.
Details, contacts and forms on these requirements available on: Details, contacts and forms on these requirements available on:
http://developer.intel.com/technology/usb http://developer.intel.com/technology/usb
Continued
Continued
June 12, 2002 35
EHCI Test Methodology
EHCI Test Methodology
!
!
Test Specification derived from EHCI Specification
Test Specification derived from EHCI Specification
Test Assertions Test Assertions
" " Short, Short, concise concise, unambiguous statement. Derived from specification , unambiguous statement. Derived from specification
Test Descriptions Test Descriptions
" " Outlines test, pass/fail criteria and which assertions are exerc Outlines test, pass/fail criteria and which assertions are exercised ised
!
!
Test Software
Test Software
!
!
Special purpose test peripherals for the compliance tests
Special purpose test peripherals for the compliance tests
Test
Assertions
Test Test
Assertions Assertions
Test
Descriptions
Test Test
Descriptions Descriptions
EHCI
Specification
EHCI EHCI
Specification Specification
EHCI Test
Specification
EHCI Test EHCI Test
Specification Specification E
H
C
I
C
o
m
p
l
i
a
n
c
e
E
H
C
I
C
o
m
p
l
i
a
n
c
e
T
e
s
t
s
T
e
s
t
s
June 12, 2002 36
EHCI Compliance Software
EHCI Compliance Software
!
!
Test Executive
Test Executive
Simplifies details of
Simplifies details of
developing/maintaining tests
developing/maintaining tests
!
!
Special
Special
-
-
purpose host
purpose host
controller driver
controller driver
EHCI Under Test
EHCI Under Test EHCI Under Test
Compliance HCD
Compliance HCD
Test Services
Test Services Test Services
Test Executive Test Executive
EHCI Tests EHCI Tests
Results
Logs
Results Results
Logs Logs
June 12, 2002 37
Compliance Peripherals
Compliance Peripherals
!
!
Special purpose test stack requires dedicated,
Special purpose test stack requires dedicated,
special purpose compliance peripherals
special purpose compliance peripherals
!
!
USB2 Compliance Device Specification
USB2 Compliance Device Specification
!
!
Defines the interface and operational model for
Defines the interface and operational model for
special purpose peripheral used with the EHCI and
special purpose peripheral used with the EHCI and
USB
USB
-
-
IF TT test software.
IF TT test software.
!
!
Implementations of compliance devices for all
Implementations of compliance devices for all
speeds have been provided by Cypress
speeds have been provided by Cypress
Over 30 Licensees
Over 30 Licensees
!
!
Compliance program up and running
Compliance program up and running