TianoCore EDK2 master
Loading...
Searching...
No Matches
AhciPei.c File Reference
#include "AhciPei.h"
#include <Ppi/PciDevice.h>
#include <Library/DevicePathLib.h>
#include <IndustryStandard/Pci.h>

Go to the source code of this file.

Functions

VOID AhciFreeDmaResource (IN PEI_AHCI_CONTROLLER_PRIVATE_DATA *Private)
 
EFI_STATUS EFIAPI AhciPeimEndOfPei (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS AtaAhciInitPrivateData (IN UINTN MmioBase, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINTN DevicePathLength)
 
EFI_STATUS AtaAhciInitPrivateDataFromHostControllerPpi (IN EDKII_ATA_AHCI_HOST_CONTROLLER_PPI *AhciHcPpi)
 
EFI_STATUS EFIAPI AtaAhciHostControllerPpiInstallationCallback (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS AtaAhciInitPrivateDataFromPciDevice (EDKII_PCI_DEVICE_PPI *PciDevice)
 
EFI_STATUS EFIAPI AtaAhciPciDevicePpiInstallationCallback (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
 
EFI_STATUS EFIAPI AtaAhciPeimEntry (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 

Variables

EFI_PEI_PPI_DESCRIPTOR mAhciAtaPassThruPpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mAhciBlkIoPpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mAhciBlkIo2PpiListTemplate
 
EFI_PEI_PPI_DESCRIPTOR mAhciStorageSecurityPpiListTemplate
 
EFI_PEI_NOTIFY_DESCRIPTOR mAhciEndOfPeiNotifyListTemplate
 
EFI_PEI_NOTIFY_DESCRIPTOR mAtaAhciHostControllerNotify
 
EFI_PEI_NOTIFY_DESCRIPTOR mPciDevicePpiNotify
 

Detailed Description

The AhciPei driver is used to manage ATA hard disk device working under AHCI mode at PEI phase.

Copyright (c) 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AhciPei.c.

Function Documentation

◆ AhciFreeDmaResource()

VOID AhciFreeDmaResource ( IN PEI_AHCI_CONTROLLER_PRIVATE_DATA Private)

Free the DMA resources allocated by an ATA AHCI controller.

Parameters
[in]PrivateA pointer to the PEI_AHCI_CONTROLLER_PRIVATE_DATA data structure.

Definition at line 66 of file AhciPei.c.

◆ AhciPeimEndOfPei()

EFI_STATUS EFIAPI AhciPeimEndOfPei ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

One notified function to cleanup the allocated DMA buffers at EndOfPei.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully

Definition at line 114 of file AhciPei.c.

◆ AtaAhciHostControllerPpiInstallationCallback()

EFI_STATUS EFIAPI AtaAhciHostControllerPpiInstallationCallback ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

Callback for EDKII_ATA_AHCI_HOST_CONTROLLER_PPI installation.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize AHCI controller from given EDKII_ATA_AHCI_HOST_CONTROLLER_PPI

Definition at line 376 of file AhciPei.c.

◆ AtaAhciInitPrivateData()

EFI_STATUS AtaAhciInitPrivateData ( IN UINTN  MmioBase,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN UINTN  DevicePathLength 
)

Initialize and install PrivateData PPIs.

Parameters
[in]MmioBaseMMIO base address of specific AHCI controller
[in]DevicePathA pointer to the EFI_DEVICE_PATH_PROTOCOL structure.
[in]DevicePathLengthLength of the device path.
Return values
EFI_SUCCESSAHCI controller initialized and PPIs installed
othersFailed to initialize AHCI controller

Definition at line 140 of file AhciPei.c.

◆ AtaAhciInitPrivateDataFromHostControllerPpi()

EFI_STATUS AtaAhciInitPrivateDataFromHostControllerPpi ( IN EDKII_ATA_AHCI_HOST_CONTROLLER_PPI AhciHcPpi)

Initialize AHCI controller from EDKII_ATA_AHCI_HOST_CONTROLLER_PPI instance.

Parameters
[in]AhciHcPpiPointer to the AHCI Host Controller PPI instance.
Return values
EFI_SUCCESSPPI successfully installed.

Definition at line 297 of file AhciPei.c.

◆ AtaAhciInitPrivateDataFromPciDevice()

EFI_STATUS AtaAhciInitPrivateDataFromPciDevice ( EDKII_PCI_DEVICE_PPI PciDevice)

Initialize AHCI controller from fiven PCI_DEVICE_PPI.

Parameters
[in]PciDevicePointer to the PCI Device PPI instance.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize AHCI controller for given device

Definition at line 402 of file AhciPei.c.

◆ AtaAhciPciDevicePpiInstallationCallback()

EFI_STATUS EFIAPI AtaAhciPciDevicePpiInstallationCallback ( IN EFI_PEI_SERVICES **  PeiServices,
IN EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor,
IN VOID *  Ppi 
)

Callback for EDKII_PCI_DEVICE_PPI installation.

Parameters
[in]PeiServicesPointer to PEI Services Table.
[in]NotifyDescriptorPointer to the descriptor for the Notification event that caused this function to execute.
[in]PpiPointer to the PPI data associated with this function.
Return values
EFI_SUCCESSThe function completes successfully
OthersCannot initialize AHCI controller from given PCI_DEVICE_PPI

Definition at line 496 of file AhciPei.c.

◆ AtaAhciPeimEntry()

EFI_STATUS EFIAPI AtaAhciPeimEntry ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

Entry point of the PEIM.

Parameters
[in]FileHandleHandle of the file being invoked.
[in]PeiServicesDescribes the list of possible PEI Services.
Return values
EFI_SUCCESSPPI successfully installed.

Definition at line 520 of file AhciPei.c.

Variable Documentation

◆ mAhciAtaPassThruPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mAhciAtaPassThruPpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiAtaPassThruPpiGuid,
}
#define NULL
Definition: Base.h:319

Definition at line 16 of file AhciPei.c.

◆ mAhciBlkIo2PpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mAhciBlkIo2PpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiVirtualBlockIo2PpiGuid,
}

Definition at line 28 of file AhciPei.c.

◆ mAhciBlkIoPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mAhciBlkIoPpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiPeiVirtualBlockIoPpiGuid,
}

Definition at line 22 of file AhciPei.c.

◆ mAhciEndOfPeiNotifyListTemplate

EFI_PEI_NOTIFY_DESCRIPTOR mAhciEndOfPeiNotifyListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEfiEndOfPeiSignalPpiGuid,
}
EFI_STATUS EFIAPI AhciPeimEndOfPei(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition: AhciPei.c:114

Definition at line 40 of file AhciPei.c.

◆ mAhciStorageSecurityPpiListTemplate

EFI_PEI_PPI_DESCRIPTOR mAhciStorageSecurityPpiListTemplate
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiStorageSecurityCommandPpiGuid,
}

Definition at line 34 of file AhciPei.c.

◆ mAtaAhciHostControllerNotify

EFI_PEI_NOTIFY_DESCRIPTOR mAtaAhciHostControllerNotify
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiAtaAhciHostControllerPpiGuid,
}
EFI_STATUS EFIAPI AtaAhciHostControllerPpiInstallationCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition: AhciPei.c:376

Definition at line 46 of file AhciPei.c.

◆ mPciDevicePpiNotify

EFI_PEI_NOTIFY_DESCRIPTOR mPciDevicePpiNotify
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gEdkiiPeiPciDevicePpiGuid,
}
EFI_STATUS EFIAPI AtaAhciPciDevicePpiInstallationCallback(IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
Definition: AhciPei.c:496

Definition at line 52 of file AhciPei.c.