?? ohci.equ
字號:
ECHO -- Including: OHCI.EQU
;***************************************************************************;
;***************************************************************************;
;** **;
;** (C)Copyright 1985-2002, American Megatrends, Inc. **;
;** **;
;** All Rights Reserved. **;
;** **;
;** 6145-F Northbelt Pkwy, Norcross, GA 30071 **;
;** **;
;** Phone (770)-246-8600 **;
;** **;
;***************************************************************************;
;***************************************************************************;
;***************************************************************************;
; $Header: /BIOS/Corebin/800/Modules/USB2/Template/Core/OHCI.EQU 3 3/25/03 5:22p Sivagarn $
;
; $Revision: 3 $
;
; $Date: 3/25/03 5:22p $
;***************************************************************************;
; Revision History
; ----------------
; $Log: /BIOS/Corebin/800/Modules/USB2/Template/Core/OHCI.EQU $
;
; 3 3/25/03 5:22p Sivagarn
; Added new equates for KBC emulation support
;
; 2 11/27/02 6:05p Sivagarn
; - New equates to support port 60h/64h trapping is added
;
; 1 9/15/02 5:39p Sivagarn
; Initial AMIUSB 2.20 check-in
;
;***************************************************************************;
; Global equates for OHCI
;-------------------------------------------------------------------------
OHCI_FRAME_LIST_SIZE EQU 32 ; Number of DWORDs in interrupt list
MAX_OHCI_BULK_DATA_SIZE EQU (4 * 1024) ; 4K
; HCCA - Host Controller Commumications Area
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: OHCIHCCA
;
; Description: OHCI host controller communications area is used by the
; host controller driver(BIOS) to communicate with the
; OHCI based host controller. This data area should be
; bus master capable. Refer OHCI data sheet for more
; information.
;
; Fields: Name Type Description
; ------------------------------------------------------------
; INTERRUPTLIST ARRAY 32 entries of periodic transfer pointer
; HCCAFRAMENUMBER WORD Current frame number
; HCCAPAD1 WORD Reserved
; HCCADONEHEAD DWORD Location where the done head
; pointers will be placed
; RES_HCCA ARRAY 120 bytes of reserved data
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
OHCIHCCA STRUC
INTERRUPTLIST DD OHCI_FRAME_LIST_SIZE DUP (?)
HCCAFRAMENUMBER DW ?
HCCAPAD1 DW ?
HCCADONEHEAD DD ?
RES_HCCA DB 120 DUP (?)
OHCIHCCA ENDS
;----------------------------------------------------------------------------
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: OHCIDescriptors
;
; Description: Descriptors structure is used to hold the host controller
; instance specific general transfer descriptor and endpoint
; descriptor pointers. The following structure defines such
; the descriptors for OHCI based host controller instances.
;
; Fields: Name Type Description
; ------------------------------------------------------------
; ED1ms OHCI_ED ED scheduled in 1ms timeframe
; ED2ms OHCI_ED ED scheduled in 2ms timeframe
; ED8ms OHCI_ED ED scheduled in 8ms timeframe
; ED32ms OHCI_ED ED scheduled in 32ms timeframe
; TD32ms OHCI_TD TD scheduled in 32ms timeframe
; EDRepeat OHCI_ED ED scheduled for keyboard repeat rate generator
; TDRepeat OHCI_TD TD scheduled for keybord repeat rate generator
; TDRepeat OHCI_TD TD associated with generation of repeat data
; EDControl OHCI_ED ED associated for control transfer
; TDControlSetup OHCI_TD TD associated with control setup
; TDControlData OHCI_TD TD associated with control data
; TDControlStatus OHCI_TD TD associated with control status
; EDInterrupt OHCI_ED ED associated for interrupt transfer
; TDInterruptData OHCI_TD TD associated to transfer interrupt data
; EDBulk OHCI_ED ED associated for bulk transfer
; TDBulkData OHCI_TD TD associated to transfer bulk data
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
OHCIDescriptors STRUC
ED1ms DW ?
ED2ms DW ?
ED8ms DW ?
; Do not change the following order of ED32ms and TD32ms
ED32ms DW ?
TD32ms DW ?
; Do not change the following order of EDRepeat and TDRepeat
EDRepeat DW ?
TDRepeat DW ?
EDControl DW ?
TDControlSetup DW ?
TDControlData DW ?
TDControlStatus DW ?
EDInterrupt DW ?
TDInterruptData DW ?
EDBulk DW ?
TDBulkData DW ?
OHCIDescriptors ENDS
USB_OHCI_DESCRIPTOR_SIZE_BLK EQU ((SIZE OHCIDescriptors + \
USB_MEM_BLK_SIZE - 1) SHR \
USB_MEM_BLK_SIZE_SHIFT)
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: OHCI_ED
;
; Description: OHCI Endpoint descriptor structure. This structure is needed
; for all the USB transaction. This structure had the
; information regarding the transfer. Refer to OHCI specification
; for more information
;
; Fields: Name Type Description
; ------------------------------------------------------------
; Control DWORD ED control fields (refer OHCI_ED_CONTROL)
; TailPointer DWORD TD queue tail pointer
; HeadPointer DWORD TD queue head pointer
; LinkPointer DWORD Pointer to the next ED
; Reserved ARRAY 16 bytes of reserved data
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
OHCI_ED STRUC
Control DD ? ; ED control fields
TailPointer DD ? ; TD queue tail pointer
HeadPointer DD ? ; TD queue head pointer
LinkPointer DD ? ; Pointer to next ED
Reserved DB 16 dup(?)
OHCI_ED ENDS
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: OHCI_ED_CONTROL
;
; Description: Bit definition for OHCI_ED control field
;
; Fields: Name Type Description
; ------------------------------------------------------------
; FuncAddress BITS:06-00 USB device address
; EndpointNum BITS:10-07 Endpoint number
; Direction BITS:12-11 Direction of data flow
; Speed BITS:13 Endpoint speed
; Skip BITS:14 If set ED will be skipped
; Format BITS:15 Set for isochronous endpoint
; MaxPacketSize BITS:26-16 Endpoint max packet size
; Reserved BITS:31-27 Reserved bits
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
; Bit definitions for endpoint descriptor control field
;-------------------------------------------------------------------------
ED_FUNCTION_ADDRESS EQU 0000007fh
ED_ENDPOINT EQU 00000780h
ED_DIRECTION EQU 00001800h
ED_OUT_PACKET EQU 00000800h
ED_IN_PACKET EQU 00001000h
ED_LOW_SPEED EQU 00002000h
ED_SKIP_TDQ EQU 00004000h
ED_FORMAT EQU 00008000h
ED_MAX_PACK_SIZE EQU 07ff0000h
; Bit definition for endpoint descriptor direction
;-------------------------------------------------------------------------
ED_DATA_OUT EQU 01b
ED_DATA_IN EQU 10b
; Bit definition for endpoint descriptor TD queue tail pointer
;-------------------------------------------------------------------------
ED_HALTED EQU 00000001h
ED_TOGGLE_CARRY EQU 00000002h
;Bit define for general pointer
;-------------------------------------------------------------------------
OHCI_TERMINATE EQU 00000000h
; General Transfer Descriptor (TD) structure
;-------------------------------------------------------------------------
FUNCCALLBACK PROTO NEAR C
; Function prototype for TD call back routine
FUNCTDCALLBACK TYPEDEF PROTO NEAR C pHCStruc:NEAR, pDevInfo:NEAR,
pTD:NEAR
PTRFUNCTDCALLBACK TYPEDEF PTR FUNCTDCALLBACK
;<AMI_SHDR_START>
;----------------------------------------------------------------------------
; Name: OHCI_TD
;
; Description: OHCI general transfer descriptor structure. This structure is
; used for bulk, interrupt and control transfers. This structure
; holds the information needed for the transfer like buffer
; size, address etc. Refer to OHCI specification for more
; information. The last sixteen bytes in the structure (after
; BufferEnd) is AMIBIOS internal data structure.
;
; Fields: Name Type Description
; ------------------------------------------------------------
; ControlStatus DWORD Control & status (OHCI_TD_CONTROL)
; CurrentBufferPointer DWORD Current buffer pointer
; LinkPointer DWORD Pointer to the next GTD
; BufferEnd DWORD Pointer to the end of the buffer
; CSReloadValue DWORD Copy of control status during scheduling
; pCallback NEAR Pointer to call back function
; ActiveFlag BYTE Non-zero value indicates TD is active
; DeviceAddress BYTE USB device address
; SetupData ARRAY 8 byte setup data buffer
;
;----------------------------------------------------------------------------
;<AMI_SHDR_END>
OHCI_TD STRUC
ControlStatus DD ? ; Control and status fields
CurrentBufferPointer DD ? ; Current buffer pointer
LinkPointer DD ? ; Pointer to the next TD
BufferEnd DD ? ; End pointer of data buffer
CSReloadValue DD ? ; Reload value for control
pCallback PTRFUNCTDCALLBACK ? ; Routine to call on completion
ActiveFlag DB ? ; If nonzero, TD is active
DeviceAddress DB ? ; Device address
SetupData DB 8 dup (?) ; Used for setup packet
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -