Open FFBoard
Open source force feedback firmware
ehci.h File Reference

Go to the source code of this file.

Classes

union  ehci_link_t
 Link pointer. More...
 
struct  ehci_qtd_t
 
struct  ehci_registers_t
 
struct  ehci_cap_registers_t
 

Enumerations

enum  { EHCI_QTYPE_ITD = 0 , EHCI_QTYPE_QHD , EHCI_QTYPE_SITD , EHCI_QTYPE_FSTN }
 
enum  { EHCI_PID_OUT = 0 , EHCI_PID_IN , EHCI_PID_SETUP }
 EHCI PID. More...
 
enum  {
  EHCI_INT_MASK_USB = TU_BIT(0) , EHCI_INT_MASK_ERROR = TU_BIT(1) , EHCI_INT_MASK_PORT_CHANGE = TU_BIT(2) , EHCI_INT_MASK_FRAMELIST_ROLLOVER = TU_BIT(3) ,
  EHCI_INT_MASK_PCI_HOST_SYSTEM_ERROR = TU_BIT(4) , EHCI_INT_MASK_ASYNC_ADVANCE = TU_BIT(5) , EHCI_INT_MASK_NXP_SOF = TU_BIT(7) , EHCI_INT_MASK_HC_HALTED = TU_BIT(12) ,
  EHCI_INT_MASK_RECLAIMATION = TU_BIT(13) , EHCI_INT_MASK_PERIODIC_SCHED_STATUS = TU_BIT(14) , EHCI_INT_MASK_ASYNC_SCHED_STATUS = TU_BIT(15) , EHCI_INT_MASK_ALL
}
 
enum  { EHCI_USBCMD_FRAMELIST_SIZE_SHIFT = 2 , EHCI_USBCMD_CHIPIDEA_FRAMELIST_SIZE_MSB_SHIFT = 15 , EHCI_USBCMD_INTERRUPT_THRESHOLD_SHIFT = 16 }
 
enum  {
  EHCI_USBCMD_RUN_STOP = TU_BIT(0) , EHCI_USBCMD_HCRESET = TU_BIT(1) , EHCI_USBCMD_PERIOD_SCHEDULE_ENABLE = TU_BIT(4) , EHCI_USBCMD_ASYNC_SCHEDULE_ENABLE = TU_BIT(5) ,
  EHCI_USBCMD_INTR_ON_ASYNC_ADVANCE_DOORBELL = TU_BIT(6)
}
 
enum  {
  EHCI_PORTSC_MASK_CURRENT_CONNECT_STATUS = TU_BIT(0) , EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE = TU_BIT(1) , EHCI_PORTSC_MASK_PORT_EANBLED = TU_BIT(2) , EHCI_PORTSC_MASK_PORT_ENABLE_CHANGE = TU_BIT(3) ,
  EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE = TU_BIT(5) , EHCI_PORTSC_MASK_FORCE_RESUME = TU_BIT(6) , EHCI_PORTSC_MASK_PORT_SUSPEND = TU_BIT(7) , EHCI_PORTSC_MASK_PORT_RESET = TU_BIT(8) ,
  EHCI_PORTSC_MASK_PORT_POWER = TU_BIT(12) , EHCI_PORTSC_MASK_W1C
}
 

Functions

 TU_VERIFY_STATIC (sizeof(ehci_link_t)==4, "size is not correct")
 
 TU_VERIFY_STATIC (sizeof(ehci_qtd_t)==32, "size is not correct")
 
struct TU_ATTR_ALIGNED (32)
 Queue Head. More...
 
 TU_VERIFY_STATIC (sizeof(ehci_qhd_t)==64, "size is not correct")
 
 TU_VERIFY_STATIC (sizeof(ehci_itd_t)==64, "size is not correct")
 
 TU_VERIFY_STATIC (sizeof(ehci_sitd_t)==32, "size is not correct")
 
 TU_VERIFY_STATIC (sizeof(ehci_cap_registers_t)==16, "size is not correct")
 

Variables

 C
 
 ehci_qhd_t
 
 ehci_itd_t
 
 ehci_sitd_t
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EHCI_QTYPE_ITD 
EHCI_QTYPE_QHD 
EHCI_QTYPE_SITD 
EHCI_QTYPE_FSTN 

Definition at line 59 of file ehci.h.

◆ anonymous enum

anonymous enum

EHCI PID.

Enumerator
EHCI_PID_OUT 
EHCI_PID_IN 
EHCI_PID_SETUP 

Definition at line 68 of file ehci.h.

◆ anonymous enum

anonymous enum
Enumerator
EHCI_INT_MASK_USB 
EHCI_INT_MASK_ERROR 
EHCI_INT_MASK_PORT_CHANGE 
EHCI_INT_MASK_FRAMELIST_ROLLOVER 
EHCI_INT_MASK_PCI_HOST_SYSTEM_ERROR 
EHCI_INT_MASK_ASYNC_ADVANCE 
EHCI_INT_MASK_NXP_SOF 
EHCI_INT_MASK_HC_HALTED 
EHCI_INT_MASK_RECLAIMATION 
EHCI_INT_MASK_PERIODIC_SCHED_STATUS 
EHCI_INT_MASK_ASYNC_SCHED_STATUS 
EHCI_INT_MASK_ALL 

Definition at line 265 of file ehci.h.

◆ anonymous enum

anonymous enum
Enumerator
EHCI_USBCMD_FRAMELIST_SIZE_SHIFT 
EHCI_USBCMD_CHIPIDEA_FRAMELIST_SIZE_MSB_SHIFT 
EHCI_USBCMD_INTERRUPT_THRESHOLD_SHIFT 

Definition at line 287 of file ehci.h.

◆ anonymous enum

anonymous enum
Enumerator
EHCI_USBCMD_RUN_STOP 
EHCI_USBCMD_HCRESET 
EHCI_USBCMD_PERIOD_SCHEDULE_ENABLE 
EHCI_USBCMD_ASYNC_SCHEDULE_ENABLE 
EHCI_USBCMD_INTR_ON_ASYNC_ADVANCE_DOORBELL 

Definition at line 293 of file ehci.h.

◆ anonymous enum

anonymous enum
Enumerator
EHCI_PORTSC_MASK_CURRENT_CONNECT_STATUS 
EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE 
EHCI_PORTSC_MASK_PORT_EANBLED 
EHCI_PORTSC_MASK_PORT_ENABLE_CHANGE 
EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE 
EHCI_PORTSC_MASK_FORCE_RESUME 
EHCI_PORTSC_MASK_PORT_SUSPEND 
EHCI_PORTSC_MASK_PORT_RESET 
EHCI_PORTSC_MASK_PORT_POWER 
EHCI_PORTSC_MASK_W1C 

Definition at line 301 of file ehci.h.

Function Documentation

◆ TU_ATTR_ALIGNED()

struct TU_ATTR_ALIGNED ( 32  )

Queue Head.

Split (Full-Speed) Isochronous Transfer Descriptor.

Highspeed Isochronous Transfer Descriptor (section 3.3)

< device address

< Only valid for Periodic with Full/Slow speed

< EP number

< 0: Full, 1: Low, 2: High

< 0: use DT in qHD, 1: use DT in qTD

< Head of the queue

< Max packet size

< 1 if is Full/Low speed control endpoint

< Used by HC

< Interrupt Schedule Mask

< Split Completion Mask for Full/Slow speed

< Hub Address for Full/Slow speed

< Hub Port for Full/Slow speed

< Transaction per micro frame

Due to the fact QHD is 32 bytes aligned but occupies only 48 bytes

thus there are 16 bytes padding free that we can make use of.

< This field is a value that is an offset, expressed in bytes, from the beginning of a buffer.

< These bits are set by software to indicate which of the buffer page pointers the offset field in this slot should be concatenated to produce the starting memory address for this transaction. The valid range of values for this field is 0 to 6

< If this bit is set to a one, it specifies that when this transaction completes, the Host Controller should issue an interrupt at the next interrupt threshold

< For an OUT, this field is the number of data bytes the host controller will send during the transaction. The host controller is not required to update this field to reflect the actual number of bytes transferred during the transfer

< For an IN, the initial value of the field is the number of bytes the host expects the endpoint to deliver. During the status update, the host controller writes back the number of bytes successfully received. The value in this register is the actual byte count

< Set to a one by the Host Controller during status update in the case where the host did not receive a valid response from the device (Timeout, CRC, Bad PID, etc.). This bit may only be set for isochronous IN transactions.

< Set to a 1 by the Host Controller during status update when a babble is detected during the transaction

< Set to a 1 by the Host Controller during status update to indicate that the Host Controller is unable to keep up with the reception of incoming data (overrun) or is unable to supply data fast enough during transmission (underrun).

< Set to 1 by software to enable the execution of an isochronous transaction by the Host Controller

< This field selects the specific device serving as the data source or sink.

< reserved

< This 4-bit field selects the particular endpoint number on the device serving as the data source or sink.

< This field is reserved and should be set to zero.

< This field holds the device address of the transaction translators’ hub.

< reserved

< This field is the port number of the recipient transaction translator.

< 0 = OUT; 1 = IN. This field encodes whether the full-speed transaction should be an IN or OUT.

< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute complete-split transactions

< This field (along with the Activeand SplitX-statefields in the Statusbyte) are used to determine during which micro-frames the host controller should execute start-split transactions.

< reserved

< This field is used by the host controller to record which split-completes have been executed. See Section 4.12.3.3.2 for behavioral requirements.

< This field is initialized by software to the total number of bytes expected in this transfer. Maximum value is 1023

< reserved

< Used to indicate which data page pointer should be concatenated with the CurrentOffsetfield to construct a data buffer pointer

< Do not interrupt when transaction is complete. 1 = Do interrupt when transaction is complete

Word 4-5: Buffer Pointer List

SITD is 32-byte aligned but occupies only 28 --> 4 bytes for storing extra data

Definition at line 126 of file ehci.h.

◆ TU_VERIFY_STATIC() [1/6]

TU_VERIFY_STATIC ( sizeof(ehci_cap_registers_t = =16,
"size is not correct"   
)

◆ TU_VERIFY_STATIC() [2/6]

TU_VERIFY_STATIC ( sizeof(ehci_itd_t = =64,
"size is not correct"   
)

◆ TU_VERIFY_STATIC() [3/6]

TU_VERIFY_STATIC ( sizeof(ehci_link_t = =4,
"size is not correct"   
)

◆ TU_VERIFY_STATIC() [4/6]

TU_VERIFY_STATIC ( sizeof(ehci_qhd_t = =64,
"size is not correct"   
)

◆ TU_VERIFY_STATIC() [5/6]

TU_VERIFY_STATIC ( sizeof(ehci_qtd_t = =32,
"size is not correct"   
)

◆ TU_VERIFY_STATIC() [6/6]

TU_VERIFY_STATIC ( sizeof(ehci_sitd_t = =32,
"size is not correct"   
)

Variable Documentation

◆ C

C
extern
Initial value:
{
#endif
enum {
EHCI_MAX_ITD = 4,
EHCI_MAX_SITD = 16
}

◆ ehci_itd_t

ehci_itd_t

Definition at line 205 of file ehci.h.

◆ ehci_qhd_t

ehci_qhd_t

Definition at line 173 of file ehci.h.

◆ ehci_sitd_t

ehci_sitd_t

Definition at line 258 of file ehci.h.