|
OpenCore
1.0.5
OpenCore Bootloader
|
#include "AudioDxe.h"#include <IndustryStandard/HdaRegisters.h>#include <Library/BaseOverflowLib.h>#include <Protocol/PciIo.h>#include <IndustryStandard/Pci.h>Go to the source code of this file.
Data Structures | |
| struct | HDA_BDL_ENTRY |
| struct | HDA_DMA_POS_ENTRY |
| struct | HDA_STREAM |
| struct | HDA_RING_BUFFER |
| struct | HDA_IO_CHILD |
| struct | _HDA_CONTROLLER_DEV |
| struct | _HDA_IO_PRIVATE_DATA |
| struct | _HDA_CONTROLLER_INFO_PRIVATE_DATA |
Typedefs | |
| typedef struct _HDA_CONTROLLER_DEV | HDA_CONTROLLER_DEV |
| typedef struct _HDA_IO_PRIVATE_DATA | HDA_IO_PRIVATE_DATA |
| typedef struct _HDA_CONTROLLER_INFO_PRIVATE_DATA | HDA_CONTROLLER_INFO_PRIVATE_DATA |
Enumerations | |
| enum | HDA_RING_BUFFER_TYPE { HDA_RING_BUFFER_TYPE_CORB , HDA_RING_BUFFER_TYPE_RIRB } |
Functions | |
| EFI_STATUS EFIAPI | HdaControllerHdaIoGetAddress (IN EFI_HDA_IO_PROTOCOL *This, OUT UINT8 *CodecAddress) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoSendCommand (IN EFI_HDA_IO_PROTOCOL *This, IN UINT8 Node, IN UINT32 Verb, OUT UINT32 *Response) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoSendCommands (IN EFI_HDA_IO_PROTOCOL *This, IN UINT8 Node, IN EFI_HDA_IO_VERB_LIST *Verbs) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoSetupStream (IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN UINT16 Format, OUT UINT8 *StreamId) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoCloseStream (IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoGetStream (IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, OUT BOOLEAN *State) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoStartStream (IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN BufferPosition OPTIONAL, IN EFI_HDA_IO_STREAM_CALLBACK Callback OPTIONAL, IN VOID *Context1 OPTIONAL, IN VOID *Context2 OPTIONAL, IN VOID *Context3 OPTIONAL) |
| EFI_STATUS EFIAPI | HdaControllerHdaIoStopStream (IN EFI_HDA_IO_PROTOCOL *This, IN EFI_HDA_IO_PROTOCOL_TYPE Type) |
| EFI_STATUS EFIAPI | HdaControllerInfoGetName (IN EFI_HDA_CONTROLLER_INFO_PROTOCOL *This, OUT CONST CHAR16 **Name) |
| EFI_STATUS EFIAPI | HdaControllerInfoGetVendorId (IN EFI_HDA_CONTROLLER_INFO_PROTOCOL *This, OUT UINT32 *VendorId) |
| VOID EFIAPI | HdaControllerStreamOutputPollTimerHandler (IN EFI_EVENT Event, IN VOID *Context) |
| EFI_STATUS EFIAPI | HdaControllerReset (IN HDA_CONTROLLER_DEV *HdaControllerDev, IN BOOLEAN Restart) |
| EFI_STATUS EFIAPI | HdaControllerSendCommands (IN HDA_CONTROLLER_DEV *HdaDev, IN UINT8 CodecAddress, IN UINT8 Node, IN EFI_HDA_IO_VERB_LIST *Verbs) |
| EFI_STATUS EFIAPI | HdaControllerDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL) |
| EFI_STATUS EFIAPI | HdaControllerDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL) |
| EFI_STATUS EFIAPI | HdaControllerDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer OPTIONAL) |
| EFI_STATUS | HdaControllerInitRingBuffer (IN HDA_RING_BUFFER *HdaRingBuffer, IN HDA_CONTROLLER_DEV *HdaDev, IN HDA_RING_BUFFER_TYPE Type) |
| VOID | HdaControllerCleanupRingBuffer (IN HDA_RING_BUFFER *HdaRingBuffer, IN HDA_RING_BUFFER_TYPE Type) |
| EFI_STATUS | HdaControllerSetRingBufferState (IN HDA_RING_BUFFER *HdaRingBuffer, IN BOOLEAN Enable, IN HDA_RING_BUFFER_TYPE Type) |
| EFI_STATUS | HdaControllerResetRingBuffer (IN HDA_RING_BUFFER *HdaRingBuffer) |
| EFI_STATUS | HdaControllerInitStreams (IN HDA_CONTROLLER_DEV *HdaDev) |
| BOOLEAN | HdaControllerResetStream (IN HDA_STREAM *HdaStream) |
| VOID | HdaControllerCleanupStreams (IN HDA_CONTROLLER_DEV *HdaDev) |
| BOOLEAN | HdaControllerGetStreamState (IN HDA_STREAM *HdaStream, OUT BOOLEAN *Run) |
| BOOLEAN | HdaControllerSetStreamState (IN HDA_STREAM *HdaStream, IN BOOLEAN Run) |
| BOOLEAN | HdaControllerGetStreamLinkPos (IN HDA_STREAM *HdaStream, OUT UINT32 *Position) |
| BOOLEAN | HdaControllerGetStreamId (IN HDA_STREAM *HdaStream, OUT UINT8 *Index) |
| BOOLEAN | HdaControllerSetStreamId (IN HDA_STREAM *HdaStream, IN UINT8 Index) |
| VOID | HdaControllerStreamIdle (IN HDA_STREAM *HdaStream) |
| VOID | HdaControllerStreamAbort (IN HDA_STREAM *HdaStream) |
Variables | |
| BOOLEAN | gRestoreNoSnoop |
| EFI_DEVICE_PATH_PROTOCOL * | gForcedControllerDevicePath |
| #define HDA_BDL_BLOCKSIZE (HDA_STREAM_BUF_SIZE / HDA_BDL_ENTRY_COUNT) |
Definition at line 102 of file HdaController.h.
| #define HDA_BDL_ENTRY_COUNT 2 |
Definition at line 94 of file HdaController.h.
| #define HDA_BDL_ENTRY_HALF ((HDA_BDL_ENTRY_COUNT / 2) - 1) |
Definition at line 96 of file HdaController.h.
| #define HDA_BDL_ENTRY_IOC BIT0 |
Definition at line 93 of file HdaController.h.
| #define HDA_BDL_ENTRY_LAST (HDA_BDL_ENTRY_COUNT - 1) |
Definition at line 97 of file HdaController.h.
| #define HDA_BDL_SIZE (sizeof(HDA_BDL_ENTRY) * HDA_BDL_ENTRY_COUNT) |
Definition at line 95 of file HdaController.h.
| #define HDA_CONTROLLER_INFO_PRIVATE_DATA_FROM_THIS | ( | This | ) |
Definition at line 395 of file HdaController.h.
| #define HDA_CONTROLLER_PRIVATE_DATA_SIGNATURE SIGNATURE_32('H','d','a','C') |
Definition at line 47 of file HdaController.h.
| #define HDA_CONTROLLER_QUIRK_CORB_NO_POLL_RESET BIT2 |
Definition at line 304 of file HdaController.h.
| #define HDA_CONTROLLER_QUIRK_INITIAL |
Definition at line 306 of file HdaController.h.
| #define HDA_CONTROLLER_QUIRK_QEMU_1 BIT0 |
Definition at line 289 of file HdaController.h.
| #define HDA_CONTROLLER_QUIRK_QEMU_2 BIT1 |
Definition at line 295 of file HdaController.h.
| #define HDA_CORB_ENTRY_SIZE sizeof(UINT32) |
Definition at line 70 of file HdaController.h.
| #define HDA_CORB_VERB | ( | Cad, | |
| Nid, | |||
| Verb ) |
Definition at line 74 of file HdaController.h.
| #define HDA_IO_PRIVATE_DATA_FROM_THIS | ( | This | ) |
Definition at line 380 of file HdaController.h.
| #define HDA_MAX_CODECS 15 |
Definition at line 59 of file HdaController.h.
| #define HDA_RIRB_CAD | ( | Response | ) |
Definition at line 76 of file HdaController.h.
| #define HDA_RIRB_ENTRY_SIZE sizeof(UINT64) |
Definition at line 71 of file HdaController.h.
| #define HDA_RIRB_RESP | ( | Response | ) |
Definition at line 75 of file HdaController.h.
| #define HDA_RIRB_UNSOL | ( | Response | ) |
Definition at line 77 of file HdaController.h.
| #define HDA_STREAM_BUF_SIZE BASE_512KB |
Definition at line 100 of file HdaController.h.
| #define HDA_STREAM_BUF_SIZE_HALF (HDA_STREAM_BUF_SIZE / 2) |
Definition at line 101 of file HdaController.h.
| #define HDA_STREAM_BUFFER_PADDING 0x200 |
Definition at line 104 of file HdaController.h.
| #define HDA_STREAM_DMA_CHECK_THRESH 5 |
Definition at line 106 of file HdaController.h.
| #define HDA_STREAM_ID_MAX 15 |
Definition at line 125 of file HdaController.h.
| #define HDA_STREAM_ID_MIN 1 |
Definition at line 124 of file HdaController.h.
| #define HDA_STREAM_POLL_TIME (EFI_TIMER_PERIOD_MILLISECONDS(1)) |
Definition at line 103 of file HdaController.h.
| #define HDA_VERSION_MIN_MAJOR 0x1 |
Definition at line 57 of file HdaController.h.
| #define HDA_VERSION_MIN_MINOR 0x0 |
Definition at line 58 of file HdaController.h.
| #define PCI_HDA_BAR 0 |
Definition at line 54 of file HdaController.h.
| #define PCI_HDA_DEVC_NOSNOOPEN BIT11 |
Definition at line 64 of file HdaController.h.
| #define PCI_HDA_DEVC_OFFSET 0x78 |
Definition at line 63 of file HdaController.h.
| #define PCI_HDA_TCSEL_OFFSET 0x44 |
Definition at line 61 of file HdaController.h.
| #define PCI_HDA_TCSEL_TC0_MASK ~(BIT0 | BIT1 | BIT2) |
Definition at line 62 of file HdaController.h.
| typedef struct _HDA_CONTROLLER_DEV HDA_CONTROLLER_DEV |
Definition at line 42 of file HdaController.h.
Definition at line 44 of file HdaController.h.
| typedef struct _HDA_IO_PRIVATE_DATA HDA_IO_PRIVATE_DATA |
Definition at line 43 of file HdaController.h.
| enum HDA_RING_BUFFER_TYPE |
| Enumerator | |
|---|---|
| HDA_RING_BUFFER_TYPE_CORB | |
| HDA_RING_BUFFER_TYPE_RIRB | |
Definition at line 222 of file HdaController.h.
| VOID HdaControllerCleanupRingBuffer | ( | IN HDA_RING_BUFFER * | HdaRingBuffer, |
| IN HDA_RING_BUFFER_TYPE | Type ) |
Definition at line 197 of file HdaControllerMem.c.
| VOID HdaControllerCleanupStreams | ( | IN HDA_CONTROLLER_DEV * | HdaDev | ) |
Definition at line 739 of file HdaControllerMem.c.
| EFI_STATUS EFIAPI HdaControllerDriverBindingStart | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
| IN EFI_HANDLE | ControllerHandle, | ||
| IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL ) |
Definition at line 1065 of file HdaController.c.
| EFI_STATUS EFIAPI HdaControllerDriverBindingStop | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
| IN EFI_HANDLE | ControllerHandle, | ||
| IN UINTN | NumberOfChildren, | ||
| IN EFI_HANDLE *ChildHandleBuffer | OPTIONAL ) |
Definition at line 1288 of file HdaController.c.
| EFI_STATUS EFIAPI HdaControllerDriverBindingSupported | ( | IN EFI_DRIVER_BINDING_PROTOCOL * | This, |
| IN EFI_HANDLE | ControllerHandle, | ||
| IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath | OPTIONAL ) |
Definition at line 995 of file HdaController.c.
| BOOLEAN HdaControllerGetStreamId | ( | IN HDA_STREAM * | HdaStream, |
| OUT UINT8 * | Index ) |
Definition at line 930 of file HdaControllerMem.c.
| BOOLEAN HdaControllerGetStreamLinkPos | ( | IN HDA_STREAM * | HdaStream, |
| OUT UINT32 * | Position ) |
Definition at line 909 of file HdaControllerMem.c.
| BOOLEAN HdaControllerGetStreamState | ( | IN HDA_STREAM * | HdaStream, |
| OUT BOOLEAN * | Run ) |
Definition at line 832 of file HdaControllerMem.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoCloseStream | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN EFI_HDA_IO_PROTOCOL_TYPE | Type ) |
Definition at line 253 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoGetAddress | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| OUT UINT8 * | CodecAddress ) |
Retrieves this codec's address.
| [in] | This | A pointer to the HDA_IO_PROTOCOL instance. |
| [out] | CodecAddress | The codec's address. |
| EFI_SUCCESS | The codec's address was returned. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 42 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoGetStream | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN EFI_HDA_IO_PROTOCOL_TYPE | Type, | ||
| OUT BOOLEAN * | State ) |
Definition at line 330 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoSendCommand | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN UINT8 | Node, | ||
| IN UINT32 | Verb, | ||
| OUT UINT32 * | Response ) |
Sends a single command to the codec.
| [in] | This | A pointer to the HDA_IO_PROTOCOL instance. |
| [in] | Node | The destination node. |
| [in] | Verb | The verb to send. |
| [out] | Response | The response received. |
| EFI_SUCCESS | The verb was sent successfully and a response received. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 73 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoSendCommands | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN UINT8 | Node, | ||
| IN EFI_HDA_IO_VERB_LIST * | Verbs ) |
Sends a set of commands to the codec.
| [in] | This | A pointer to the HDA_IO_PROTOCOL instance. |
| [in] | Node | The destination node. |
| [in] | Verbs | The verbs to send. Responses will be delievered in the same list. |
| EFI_SUCCESS | The verbs were sent successfully and all responses received. |
| EFI_INVALID_PARAMETER | One or more parameters are invalid. |
Definition at line 103 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoSetupStream | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN EFI_HDA_IO_PROTOCOL_TYPE | Type, | ||
| IN UINT16 | Format, | ||
| OUT UINT8 * | StreamId ) |
Definition at line 124 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoStartStream | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN EFI_HDA_IO_PROTOCOL_TYPE | Type, | ||
| IN VOID * | Buffer, | ||
| IN UINTN | BufferLength, | ||
| IN UINTN BufferPosition | OPTIONAL, | ||
| IN EFI_HDA_IO_STREAM_CALLBACK Callback | OPTIONAL, | ||
| IN VOID *Context1 | OPTIONAL, | ||
| IN VOID *Context2 | OPTIONAL, | ||
| IN VOID *Context3 | OPTIONAL ) |
Definition at line 367 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerHdaIoStopStream | ( | IN EFI_HDA_IO_PROTOCOL * | This, |
| IN EFI_HDA_IO_PROTOCOL_TYPE | Type ) |
Definition at line 529 of file HdaControllerHdaIo.c.
| EFI_STATUS EFIAPI HdaControllerInfoGetName | ( | IN EFI_HDA_CONTROLLER_INFO_PROTOCOL * | This, |
| OUT CONST CHAR16 ** | Name ) |
Definition at line 29 of file HdaControllerInfo.c.
| EFI_STATUS EFIAPI HdaControllerInfoGetVendorId | ( | IN EFI_HDA_CONTROLLER_INFO_PROTOCOL * | This, |
| OUT UINT32 * | VendorId ) |
Definition at line 48 of file HdaControllerInfo.c.
| EFI_STATUS HdaControllerInitRingBuffer | ( | IN HDA_RING_BUFFER * | HdaRingBuffer, |
| IN HDA_CONTROLLER_DEV * | HdaDev, | ||
| IN HDA_RING_BUFFER_TYPE | Type ) |
Definition at line 31 of file HdaControllerMem.c.
| EFI_STATUS HdaControllerInitStreams | ( | IN HDA_CONTROLLER_DEV * | HdaDev | ) |
Definition at line 380 of file HdaControllerMem.c.
| EFI_STATUS EFIAPI HdaControllerReset | ( | IN HDA_CONTROLLER_DEV * | HdaControllerDev, |
| IN BOOLEAN | Restart ) |
Definition at line 411 of file HdaController.c.
| EFI_STATUS HdaControllerResetRingBuffer | ( | IN HDA_RING_BUFFER * | HdaRingBuffer | ) |
Definition at line 305 of file HdaControllerMem.c.
| BOOLEAN HdaControllerResetStream | ( | IN HDA_STREAM * | HdaStream | ) |
Definition at line 590 of file HdaControllerMem.c.
| EFI_STATUS EFIAPI HdaControllerSendCommands | ( | IN HDA_CONTROLLER_DEV * | HdaDev, |
| IN UINT8 | CodecAddress, | ||
| IN UINT8 | Node, | ||
| IN EFI_HDA_IO_VERB_LIST * | Verbs ) |
Definition at line 683 of file HdaController.c.
| EFI_STATUS HdaControllerSetRingBufferState | ( | IN HDA_RING_BUFFER * | HdaRingBuffer, |
| IN BOOLEAN | Enable, | ||
| IN HDA_RING_BUFFER_TYPE | Type ) |
Definition at line 237 of file HdaControllerMem.c.
| BOOLEAN HdaControllerSetStreamId | ( | IN HDA_STREAM * | HdaStream, |
| IN UINT8 | Index ) |
Definition at line 957 of file HdaControllerMem.c.
| BOOLEAN HdaControllerSetStreamState | ( | IN HDA_STREAM * | HdaStream, |
| IN BOOLEAN | Run ) |
Definition at line 859 of file HdaControllerMem.c.
| VOID HdaControllerStreamAbort | ( | IN HDA_STREAM * | HdaStream | ) |
Definition at line 1013 of file HdaControllerMem.c.
| VOID HdaControllerStreamIdle | ( | IN HDA_STREAM * | HdaStream | ) |
Definition at line 994 of file HdaControllerMem.c.
| VOID EFIAPI HdaControllerStreamOutputPollTimerHandler | ( | IN EFI_EVENT | Event, |
| IN VOID * | Context ) |
Definition at line 45 of file HdaController.c.
|
extern |
Definition at line 41 of file HdaController.c.
|
extern |
Definition at line 38 of file HdaController.c.