📄 xsusbhostapi.h
字号:
/******************************************************************************
**
** COPYRIGHT (C) 2000, 2001, 2002 Intel Corporation.
**
** This software as well as the software described in it is furnished under
** license and may only be used or copied in accordance with the terms of the
** license. The information in this file is furnished for informational use
** only, is subject to change without notice, and should not be construed as
** a commitment by Intel Corporation. Intel Corporation assumes no
** responsibility or liability for any errors or inaccuracies that may appear
** in this document or any software that may be provided in association with
** this document.
** Except as permitted by such license, no part of this document may be
** reproduced, stored in a retrieval system, or transmitted in any form or by
** any means without the express written consent of Intel Corporation.
**
** FILENAME: XsUsbHostAPI.h
**
** PURPOSE: This file contain the constants, types, and function prototypes
** to be used with USB Host Interface Controller.
**
** LAST MODIFIED: $Modtime: 7/17/03 1:01p $
******************************************************************************/
#ifndef _XsUsbHostAPI_h
#define _XsUsbHostAPI_h
/*
************************************************************************************
* CONSTANTS
************************************************************************************
*/
#ifdef BOARD_SRAM
// Mainstone board SRAM base address
#define SRAM_BASE 0x0A000000
#else
// Internal SRAM base address
#define SRAM_BASE 0x5C000000
#endif
// SA1101 is non OpenHCI compliant, fix register space definitions
#define USB_RegisterStride(a)
// USB host port register definitions
typedef enum USB_HostControllerFunctionalState_E {
UsbReset = 0,
UsbResume = 1,
UsbOperational = 2,
UsbSuspend = 3
} USB_HostControllerFunctionalState_T;
typedef struct USB_HostPortRegs_S {
// 1.1 Control and Status Partition
union {
struct HcRevision_S {
#define USBHostControllerRevision 0x10
unsigned int Revision : 8;
unsigned int Reserved : 24;
} rw;
unsigned int d;
} HcRevision;
USB_RegisterStride(HcRevision)
union {
struct HcControl_S {
unsigned int ControlBulkServiceRatio : 2;
unsigned int PeriodicListEnable : 1;
unsigned int IsochronousEnable : 1;
unsigned int ControlListEnable : 1;
unsigned int BulkListEnable : 1;
unsigned int HostControllerFunctionalState : 2;
unsigned int InterruptRouting : 1;
unsigned int RemoteWakeupConnected : 1;
unsigned int RemoteWakeupEnable : 1;
unsigned int Reserved : 21;
} rw;
unsigned int d;
} HcControl;
USB_RegisterStride(HcControl)
union {
struct HcCommandStatus_S {
unsigned int HostControllerReset : 1;
unsigned int ControlListFilled : 1;
unsigned int BulkListFilled : 1;
unsigned int OwnershipChangeRequest : 1;
unsigned int Reserved1 : 12;
unsigned int SchedulingOverrunCount : 2;
unsigned int Reserved2 : 14;
} rw;
unsigned int d;
} HcCommandStatus;
USB_RegisterStride(HcCommandStatus)
union {
struct HcInterruptStatus_S {
unsigned int SchedulingOverrun : 1;
unsigned int WritebackDoneHead : 1;
unsigned int StartofFrame : 1;
unsigned int ResumeDetected : 1;
unsigned int UnrecoverableError : 1;
unsigned int FrameNumberOverflow : 1;
unsigned int RootHubStatusChange : 1;
unsigned int Reserved : 23;
unsigned int OwnershipChange : 1;
unsigned int Zero : 1;
} rw;
unsigned int d;
} HcInterruptStatus;
USB_RegisterStride(HcInterruptStatus)
union {
struct HcInterruptEnable_S {
unsigned int SchedulingOverrun : 1;
unsigned int WritebackDoneHead : 1;
unsigned int StartofFrame : 1;
unsigned int ResumeDetected : 1;
unsigned int UnrecoverableError : 1;
unsigned int FrameNumberOverflow : 1;
unsigned int RootHubStatusChange : 1;
unsigned int Reserved : 23;
unsigned int OwnershipChange : 1;
unsigned int MasterInterruptEnable : 1;
} rw;
unsigned int d;
} HcInterruptEnable;
USB_RegisterStride(HcInterruptEnable)
union {
struct HcInterruptDisable_S {
unsigned int SchedulingOverrun : 1;
unsigned int WritebackDoneHead : 1;
unsigned int StartofFrame : 1;
unsigned int ResumeDetected : 1;
unsigned int UnrecoverableError : 1;
unsigned int FrameNumberOverflow : 1;
unsigned int RootHubStatusChange : 1;
unsigned int Reserved : 23;
unsigned int OwnershipChange : 1;
unsigned int MasterInterruptDisable : 1;
} rw;
unsigned int d;
} HcInterruptDisable;
USB_RegisterStride(HcInterruptDisable)
// 1.2 Memory Pointer Partition
union {
struct HcHCCA_S {
unsigned Zero : 8;
unsigned HCCA : 24;
} rw;
unsigned int d;
void * p;
} HcHCCA;
USB_RegisterStride(HcHCCA)
union {
struct HcPeriodCurrentED_S {
unsigned int Zero : 4;
unsigned int PeriodCurrentED : 28;
} rw;
unsigned int d;
void * p;
} HcPeriodCurrentED;
USB_RegisterStride(HcPeriodCurrentED)
union {
struct HcControlHeadED_S {
unsigned int Zero : 4;
unsigned int ControlHeadED : 28;
} rw;
unsigned int d;
void * p;
} HcControlHeadED;
USB_RegisterStride(HcControlHeadED)
union {
struct HcControlCurrentED_S {
unsigned int Zero : 4;
unsigned int ControlCurrentED : 28;
} rw;
unsigned int d;
void * p;
} HcControlCurrentED;
USB_RegisterStride(HcControlCurrentED)
union {
struct HcBulkHeadED_S {
unsigned int Zero : 4;
unsigned int BulkHeadED : 28;
} rw;
unsigned int d;
void * p;
} HcBulkHeadED;
USB_RegisterStride(HcBulkHeadED)
union {
struct HcBulkCurrentED_S {
unsigned int Zero : 4;
unsigned int BulkCurrentED : 28;
} rw;
unsigned int d;
void * p;
} HcBulkCurrentED;
USB_RegisterStride(HcBulkCurrentED)
union {
struct HcDoneHead_S {
unsigned int Zero : 4;
unsigned int DoneHead : 28;
} rw;
unsigned int d;
void * p;
} HcDoneHead;
USB_RegisterStride(HcDoneHead)
// 1.3 Frame Counter Partition
// This register must be written atomically. The structure may be used as a staging
// area and then written to the register using the unsigned data element.
union {
struct HcFmIntervalR_S {
unsigned int FrameInterval : 14;
unsigned int Reserved : 2;
unsigned int FSLargestDataPacket : 15;
unsigned int FrameIntervalToggle : 1;
} r;
struct HcFmIntervalW_S {
unsigned int FrameInterval : 14;
unsigned int Reserved : 2;
unsigned int FSLargestDataPacket : 15;
unsigned int FrameIntervalToggle : 1;
} w_DoNotUse_SeeAbove;
unsigned int d;
} HcFmInterval;
USB_RegisterStride(HcFmInterval)
union {
struct HcFmRemaining_S {
unsigned int FrameRemaining : 14;
unsigned int Reserved : 17;
unsigned int FrameRemainingToggle : 1;
} rw;
unsigned int d;
} HcFmRemaining;
USB_RegisterStride(HcFmRemaining)
union {
struct HcFmNumber_S {
unsigned int FrameNumber : 16;
unsigned int Reserved : 16;
} rw;
unsigned int d;
} HcFmNumber;
USB_RegisterStride(HcFmNumber)
union {
struct HcPeriodicStart_S {
unsigned int PeriodicStart : 14;
unsigned int Reserved : 18;
} rw;
unsigned int d;
} HcPeriodicStart;
USB_RegisterStride(HcPeriodicStart)
union {
struct HcLSThreshold_S {
unsigned int LSThreshold : 12;
unsigned int Reserved : 20;
} rw;
unsigned int d;
} HcLSThreshold;
USB_RegisterStride(HcLSThreshold)
// 1.4 Root Hub Partition
union {
struct HcRhDescriptorA_S {
unsigned int NumberDownstreamPorts : 8;
unsigned int PowerSwitchingMode : 1;
unsigned int NoPowerSwitching : 1;
unsigned int DeviceType : 1;
unsigned int OverCurrentProtectionMode : 1;
unsigned int NoOverCurrentProtection : 1;
unsigned int Reserved : 11;
unsigned int PowerOnToPowerGoodTime : 8;
} rw;
unsigned int d;
} HcRhDescriptorA;
USB_RegisterStride(HcRhDescriptorA)
union {
struct HcRhDescriptorB_S {
unsigned int DeviceRemovable : 16;
unsigned int PortPowerControlMask : 16;
} rw;
unsigned int d;
} HcRhDescriptorB;
USB_RegisterStride(HcRhDescriptorB)
/*
* Note, this register has write side effects and can not be accessed via bit
* descriptors. Therefore make sure all accesses only set the desired bits.
*/
union {
struct HcRhStatusR_S {
unsigned int LocalPowerStatus : 1;
unsigned int OverCurrentIndicator : 1;
unsigned int Reserved1 : 13;
unsigned int DeviceRemoteWakeupEnable : 1;
unsigned int LocalPowerStatusChange : 1;
unsigned int OverCurrentIndicatorChange : 1;
unsigned int Reserved2 : 14;
} r;
struct HcRhStatusW_S {
#define USB_ClearGlobalPower_M (1 << 0)
#define USB_SetRemoteWakeupEnable_M (1 << 15)
#define USB_SetGlobalPower_M (1 << 16)
#define USB_OverCurrentIndicatorChange_M (1 << 17)
#define USB_ClearRemoteWakeupEnable_M (1 << 31)
unsigned int ClearGlobalPower : 1;
unsigned int Reserved1 : 14;
unsigned int SetRemoteWakeupEnable : 1;
unsigned int SetGlobalPower : 1;
unsigned int OverCurrentIndicatorChange : 1;
unsigned int Reserved2 : 13;
unsigned int ClearRemoteWakeupEnable : 1;
} w_DoNotUseThis_SeeAbove;
unsigned int d;
} HcRhStatus;
USB_RegisterStride(HcRhStatus)
/*
* Note, this register has write side effects and can not be accessed via bit
* descriptors. Therefore make sure all accesses only set the desired bits.
*/
union {
struct HcRhPortStatusR_S {
unsigned int CurrentConnectStatus : 1;
unsigned int PortEnableStatus : 1;
unsigned int PortSuspendStatus : 1;
unsigned int PortOverCurrentIndicator : 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -