TianoCore EDK2 master
Loading...
Searching...
No Matches
UhciReg.h File Reference

Go to the source code of this file.

Macros

#define UHCI_FRAME_NUM   1024
 
#define USB_BAR_INDEX   4
 
#define USBCMD_OFFSET   0
 
#define USBSTS_OFFSET   2
 
#define USBINTR_OFFSET   4
 
#define USBPORTSC_OFFSET   0x10
 
#define USB_FRAME_NO_OFFSET   6
 
#define USB_FRAME_BASE_OFFSET   8
 
#define USB_EMULATION_OFFSET   0xC0
 
#define SETUP_PACKET_ID   0x2D
 
#define INPUT_PACKET_ID   0x69
 
#define OUTPUT_PACKET_ID   0xE1
 
#define ERROR_PACKET_ID   0x55
 
#define USBPORTSC_CCS   BIT0
 
#define USBPORTSC_CSC   BIT1
 
#define USBPORTSC_PED   BIT2
 
#define USBPORTSC_PEDC   BIT3
 
#define USBPORTSC_LSL   BIT4
 
#define USBPORTSC_LSH   BIT5
 
#define USBPORTSC_RD   BIT6
 
#define USBPORTSC_LSDA   BIT8
 
#define USBPORTSC_PR   BIT9
 
#define USBPORTSC_SUSP   BIT12
 
#define USB_MAX_ROOTHUB_PORT   0x0F
 
#define USBCMD_RS   BIT0
 
#define USBCMD_HCRESET   BIT1
 
#define USBCMD_GRESET   BIT2
 
#define USBCMD_EGSM   BIT3
 
#define USBCMD_FGR   BIT4
 
#define USBCMD_SWDBG   BIT5
 
#define USBCMD_CF   BIT6
 
#define USBCMD_MAXP   BIT7
 
#define USBSTS_USBINT   BIT0
 
#define USBSTS_ERROR   BIT1
 
#define USBSTS_RD   BIT2
 
#define USBSTS_HSE   BIT3
 
#define USBSTS_HCPE   BIT4
 
#define USBSTS_HCH   BIT5
 
#define USBTD_ACTIVE   BIT7
 
#define USBTD_STALLED   BIT6
 
#define USBTD_BUFFERR   BIT5
 
#define USBTD_BABBLE   BIT4
 
#define USBTD_NAK   BIT3
 
#define USBTD_CRC   BIT2
 
#define USBTD_BITSTUFF   BIT1
 

Functions

UINT16 UhciReadReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset)
 
VOID UhciWriteReg (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT16 Data)
 
VOID UhciSetRegBit (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT16 Bit)
 
VOID UhciClearRegBit (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT32 Offset, IN UINT16 Bit)
 
VOID UhciAckAllInterrupt (IN USB_HC_DEV *Uhc)
 
EFI_STATUS UhciStopHc (IN USB_HC_DEV *Uhc, IN UINTN Timeout)
 
BOOLEAN UhciIsHcWorking (IN EFI_PCI_IO_PROTOCOL *PciIo)
 
VOID UhciSetFrameListBaseAddr (IN EFI_PCI_IO_PROTOCOL *PciIo, IN VOID *Addr)
 
VOID UhciTurnOffUsbEmulation (IN EFI_PCI_IO_PROTOCOL *PciIo)
 

Detailed Description

The definition for UHCI register operation routines.

Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UhciReg.h.

Macro Definition Documentation

◆ ERROR_PACKET_ID

#define ERROR_PACKET_ID   0x55

Definition at line 38 of file UhciReg.h.

◆ INPUT_PACKET_ID

#define INPUT_PACKET_ID   0x69

Definition at line 36 of file UhciReg.h.

◆ OUTPUT_PACKET_ID

#define OUTPUT_PACKET_ID   0xE1

Definition at line 37 of file UhciReg.h.

◆ SETUP_PACKET_ID

#define SETUP_PACKET_ID   0x2D

Definition at line 35 of file UhciReg.h.

◆ UHCI_FRAME_NUM

#define UHCI_FRAME_NUM   1024

Definition at line 17 of file UhciReg.h.

◆ USB_BAR_INDEX

#define USB_BAR_INDEX   4

Definition at line 22 of file UhciReg.h.

◆ USB_EMULATION_OFFSET

#define USB_EMULATION_OFFSET   0xC0

Definition at line 30 of file UhciReg.h.

◆ USB_FRAME_BASE_OFFSET

#define USB_FRAME_BASE_OFFSET   8

Definition at line 29 of file UhciReg.h.

◆ USB_FRAME_NO_OFFSET

#define USB_FRAME_NO_OFFSET   6

Definition at line 28 of file UhciReg.h.

◆ USB_MAX_ROOTHUB_PORT

#define USB_MAX_ROOTHUB_PORT   0x0F

Definition at line 59 of file UhciReg.h.

◆ USBCMD_CF

#define USBCMD_CF   BIT6

Definition at line 70 of file UhciReg.h.

◆ USBCMD_EGSM

#define USBCMD_EGSM   BIT3

Definition at line 67 of file UhciReg.h.

◆ USBCMD_FGR

#define USBCMD_FGR   BIT4

Definition at line 68 of file UhciReg.h.

◆ USBCMD_GRESET

#define USBCMD_GRESET   BIT2

Definition at line 66 of file UhciReg.h.

◆ USBCMD_HCRESET

#define USBCMD_HCRESET   BIT1

Definition at line 65 of file UhciReg.h.

◆ USBCMD_MAXP

#define USBCMD_MAXP   BIT7

Definition at line 71 of file UhciReg.h.

◆ USBCMD_OFFSET

#define USBCMD_OFFSET   0

Definition at line 24 of file UhciReg.h.

◆ USBCMD_RS

#define USBCMD_RS   BIT0

Definition at line 64 of file UhciReg.h.

◆ USBCMD_SWDBG

#define USBCMD_SWDBG   BIT5

Definition at line 69 of file UhciReg.h.

◆ USBINTR_OFFSET

#define USBINTR_OFFSET   4

Definition at line 26 of file UhciReg.h.

◆ USBPORTSC_CCS

#define USBPORTSC_CCS   BIT0

Definition at line 43 of file UhciReg.h.

◆ USBPORTSC_CSC

#define USBPORTSC_CSC   BIT1

Definition at line 44 of file UhciReg.h.

◆ USBPORTSC_LSDA

#define USBPORTSC_LSDA   BIT8

Definition at line 50 of file UhciReg.h.

◆ USBPORTSC_LSH

#define USBPORTSC_LSH   BIT5

Definition at line 48 of file UhciReg.h.

◆ USBPORTSC_LSL

#define USBPORTSC_LSL   BIT4

Definition at line 47 of file UhciReg.h.

◆ USBPORTSC_OFFSET

#define USBPORTSC_OFFSET   0x10

Definition at line 27 of file UhciReg.h.

◆ USBPORTSC_PED

#define USBPORTSC_PED   BIT2

Definition at line 45 of file UhciReg.h.

◆ USBPORTSC_PEDC

#define USBPORTSC_PEDC   BIT3

Definition at line 46 of file UhciReg.h.

◆ USBPORTSC_PR

#define USBPORTSC_PR   BIT9

Definition at line 51 of file UhciReg.h.

◆ USBPORTSC_RD

#define USBPORTSC_RD   BIT6

Definition at line 49 of file UhciReg.h.

◆ USBPORTSC_SUSP

#define USBPORTSC_SUSP   BIT12

Definition at line 52 of file UhciReg.h.

◆ USBSTS_ERROR

#define USBSTS_ERROR   BIT1

Definition at line 77 of file UhciReg.h.

◆ USBSTS_HCH

#define USBSTS_HCH   BIT5

Definition at line 81 of file UhciReg.h.

◆ USBSTS_HCPE

#define USBSTS_HCPE   BIT4

Definition at line 80 of file UhciReg.h.

◆ USBSTS_HSE

#define USBSTS_HSE   BIT3

Definition at line 79 of file UhciReg.h.

◆ USBSTS_OFFSET

#define USBSTS_OFFSET   2

Definition at line 25 of file UhciReg.h.

◆ USBSTS_RD

#define USBSTS_RD   BIT2

Definition at line 78 of file UhciReg.h.

◆ USBSTS_USBINT

#define USBSTS_USBINT   BIT0

Definition at line 76 of file UhciReg.h.

◆ USBTD_ACTIVE

#define USBTD_ACTIVE   BIT7

Definition at line 83 of file UhciReg.h.

◆ USBTD_BABBLE

#define USBTD_BABBLE   BIT4

Definition at line 86 of file UhciReg.h.

◆ USBTD_BITSTUFF

#define USBTD_BITSTUFF   BIT1

Definition at line 89 of file UhciReg.h.

◆ USBTD_BUFFERR

#define USBTD_BUFFERR   BIT5

Definition at line 85 of file UhciReg.h.

◆ USBTD_CRC

#define USBTD_CRC   BIT2

Definition at line 88 of file UhciReg.h.

◆ USBTD_NAK

#define USBTD_NAK   BIT3

Definition at line 87 of file UhciReg.h.

◆ USBTD_STALLED

#define USBTD_STALLED   BIT6

Definition at line 84 of file UhciReg.h.

Function Documentation

◆ UhciAckAllInterrupt()

VOID UhciAckAllInterrupt ( IN USB_HC_DEV Uhc)

Clear all the interrutp status bits, these bits are Write-Clean.

Parameters
UhcThe UHCI device.
Returns
None.

Clear all the interrutp status bits, these bits are Write-Clean.

Parameters
UhcThe UHCI device.

Definition at line 131 of file UhciReg.c.

◆ UhciClearRegBit()

VOID UhciClearRegBit ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT16  Bit 
)

Clear a bit of the UHCI Register.

Parameters
PciIoThe PCI_IO protocol to access the PCI.
OffsetRegister offset to USB_BAR_INDEX.
BitThe bit to clear.
Returns
None.

Clear a bit of the UHCI Register.

Parameters
PciIoThe PCI_IO protocol to access the PCI.
OffsetRegister offset to USB_BAR_INDEX.
BitThe bit to clear.

Definition at line 110 of file UhciReg.c.

◆ UhciIsHcWorking()

BOOLEAN UhciIsHcWorking ( IN EFI_PCI_IO_PROTOCOL PciIo)

Check whether the host controller operates well.

Parameters
PciIoThe PCI_IO protocol to use.
Return values
TRUEHost controller is working.
FALSEHost controller is halted or system error.

Definition at line 195 of file UhciReg.c.

◆ UhciReadReg()

UINT16 UhciReadReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset 
)

Read a UHCI register.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
OffsetRegister offset to USB_BAR_INDEX.
Returns
Content of register.

Definition at line 22 of file UhciReg.c.

◆ UhciSetFrameListBaseAddr()

VOID UhciSetFrameListBaseAddr ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN VOID *  Addr 
)

Set the UHCI frame list base address. It can't use UhciWriteReg which access memory in UINT16.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
AddrAddress to set.
Returns
None.

Set the UHCI frame list base address. It can't use UhciWriteReg which access memory in UINT16.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
AddrAddress to set.

Definition at line 220 of file UhciReg.c.

◆ UhciSetRegBit()

VOID UhciSetRegBit ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT16  Bit 
)

Set a bit of the UHCI Register.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
OffsetRegister offset to USB_BAR_INDEX.
BitThe bit to set.
Returns
None.

Set a bit of the UHCI Register.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
OffsetRegister offset to USB_BAR_INDEX.
BitThe bit to set.

Definition at line 88 of file UhciReg.c.

◆ UhciStopHc()

EFI_STATUS UhciStopHc ( IN USB_HC_DEV Uhc,
IN UINTN  Timeout 
)

Stop the host controller.

Parameters
UhcThe UHCI device.
TimeoutMax time allowed.
Return values
EFI_SUCCESSThe host controller is stopped.
EFI_TIMEOUTFailed to stop the host controller.

Definition at line 158 of file UhciReg.c.

◆ UhciTurnOffUsbEmulation()

VOID UhciTurnOffUsbEmulation ( IN EFI_PCI_IO_PROTOCOL PciIo)

Disable USB Emulation.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL protocol to use.
Returns
None.

Disable USB Emulation.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL protocol to use.

Definition at line 251 of file UhciReg.c.

◆ UhciWriteReg()

VOID UhciWriteReg ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN UINT32  Offset,
IN UINT16  Data 
)

Write data to UHCI register.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
OffsetRegister offset to USB_BAR_INDEX.
DataData to write.
Returns
None.

Write data to UHCI register.

Parameters
PciIoThe EFI_PCI_IO_PROTOCOL to use.
OffsetRegister offset to USB_BAR_INDEX.
DataData to write.

Definition at line 57 of file UhciReg.c.