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

Go to the source code of this file.

Data Structures

struct  SD_MMC_HC_SLOT
 
struct  SD_MMC_HC_PRIVATE_DATA
 
struct  SD_MMC_BUS_SETTINGS
 
struct  SD_MMC_HC_TRB
 
struct  SD_MMC_HC_QUEUE
 

Macros

#define SD_MMC_HC_PRIVATE_SIGNATURE   SIGNATURE_32 ('s', 'd', 't', 'f')
 
#define SD_MMC_HC_PRIVATE_FROM_THIS(a)    CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)
 
#define SD_MMC_HC_GENERIC_TIMEOUT   (PcdGet32 (PcdSdMmcGenericTimeoutValue))
 
#define SD_MMC_HC_ASYNC_TIMER   EFI_TIMER_PERIOD_MILLISECONDS(1)
 
#define SD_MMC_HC_ENUM_TIMER   EFI_TIMER_PERIOD_MILLISECONDS(100)
 
#define SD_MMC_HC_TRB_SIG   SIGNATURE_32 ('T', 'R', 'B', 'T')
 
#define SD_MMC_TRB_RETRIES   5
 
#define SD_MMC_HC_TRB_FROM_THIS(a)    CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)
 

Typedefs

typedef EFI_STATUS(* CARD_TYPE_DETECT_ROUTINE) (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 

Enumerations

enum  SD_MMC_CARD_TYPE {
  UnknownCardType , SdCardType , SdioCardType , MmcCardType ,
  EmmcCardType
}
 
enum  EFI_SD_MMC_SLOT_TYPE { RemovableSlot , EmbeddedSlot , SharedBusSlot , UnknownSlot }
 

Functions

EFI_STATUS EFIAPI SdMmcPassThruPassThru (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot, IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event OPTIONAL)
 
EFI_STATUS EFIAPI SdMmcPassThruGetNextSlot (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN OUT UINT8 *Slot)
 
EFI_STATUS EFIAPI SdMmcPassThruBuildDevicePath (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot, IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePath)
 
EFI_STATUS EFIAPI SdMmcPassThruGetSlotNumber (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, OUT UINT8 *Slot)
 
EFI_STATUS EFIAPI SdMmcPassThruResetDevice (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *This, IN UINT8 Slot)
 
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 
EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetDriverName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN CHAR8 *Language, OUT CHAR16 **DriverName)
 
EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetControllerName (IN EFI_COMPONENT_NAME_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_HANDLE ChildHandle OPTIONAL, IN CHAR8 *Language, OUT CHAR16 **ControllerName)
 
SD_MMC_HC_TRBSdMmcCreateTrb (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot, IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET *Packet, IN EFI_EVENT Event)
 
VOID SdMmcFreeTrb (IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS SdMmcCheckTrbEnv (IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS SdMmcWaitTrbEnv (IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS SdMmcExecTrb (IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS SdMmcCheckTrbResult (IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS SdMmcWaitTrbResult (IN SD_MMC_HC_PRIVATE_DATA *Private, IN SD_MMC_HC_TRB *Trb)
 
EFI_STATUS EmmcIdentification (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 
EFI_STATUS SdCardIdentification (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 
EFI_STATUS SdMmcHcClockSupply (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot, IN SD_MMC_BUS_MODE BusTiming, IN BOOLEAN FirstTimeSetup, IN UINT64 ClockFreq)
 
EFI_STATUS SdMmcHcReset (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 
EFI_STATUS SdMmcHcInitHost (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 

Variables

EFI_COMPONENT_NAME_PROTOCOL gSdMmcPciHcComponentName
 
EFI_COMPONENT_NAME2_PROTOCOL gSdMmcPciHcComponentName2
 
EFI_DRIVER_BINDING_PROTOCOL gSdMmcPciHcDriverBinding
 
EDKII_SD_MMC_OVERRIDEmOverride
 

Detailed Description

Provides some data structure definitions used by the SD/MMC host controller driver.

Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file SdMmcPciHcDxe.h.

Macro Definition Documentation

◆ SD_MMC_HC_ASYNC_TIMER

#define SD_MMC_HC_ASYNC_TIMER   EFI_TIMER_PERIOD_MILLISECONDS(1)

Definition at line 59 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_ENUM_TIMER

#define SD_MMC_HC_ENUM_TIMER   EFI_TIMER_PERIOD_MILLISECONDS(100)

Definition at line 64 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_GENERIC_TIMEOUT

#define SD_MMC_HC_GENERIC_TIMEOUT   (PcdGet32 (PcdSdMmcGenericTimeoutValue))

Definition at line 53 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_PRIVATE_FROM_THIS

#define SD_MMC_HC_PRIVATE_FROM_THIS (   a)     CR(a, SD_MMC_HC_PRIVATE_DATA, PassThru, SD_MMC_HC_PRIVATE_SIGNATURE)

Definition at line 47 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_PRIVATE_SIGNATURE

#define SD_MMC_HC_PRIVATE_SIGNATURE   SIGNATURE_32 ('s', 'd', 't', 'f')

Definition at line 45 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_TRB_FROM_THIS

#define SD_MMC_HC_TRB_FROM_THIS (   a)     CR(a, SD_MMC_HC_TRB, TrbList, SD_MMC_HC_TRB_SIG)

Definition at line 175 of file SdMmcPciHcDxe.h.

◆ SD_MMC_HC_TRB_SIG

#define SD_MMC_HC_TRB_SIG   SIGNATURE_32 ('T', 'R', 'B', 'T')

Definition at line 133 of file SdMmcPciHcDxe.h.

◆ SD_MMC_TRB_RETRIES

#define SD_MMC_TRB_RETRIES   5

Definition at line 135 of file SdMmcPciHcDxe.h.

Typedef Documentation

◆ CARD_TYPE_DETECT_ROUTINE

typedef EFI_STATUS(* CARD_TYPE_DETECT_ROUTINE) (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)

Execute card identification procedure.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe card is identified correctly.
OthersThe card can't be identified.

Definition at line 210 of file SdMmcPciHcDxe.h.

Enumeration Type Documentation

◆ EFI_SD_MMC_SLOT_TYPE

enum EFI_SD_MMC_SLOT_TYPE

Definition at line 74 of file SdMmcPciHcDxe.h.

◆ SD_MMC_CARD_TYPE

enum SD_MMC_CARD_TYPE

Definition at line 66 of file SdMmcPciHcDxe.h.

Function Documentation

◆ EmmcIdentification()

EFI_STATUS EmmcIdentification ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot 
)

Execute EMMC device identification procedure.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThere is a EMMC card.
OthersThere is not a EMMC card.

Definition at line 1318 of file EmmcDevice.c.

◆ SdCardIdentification()

EFI_STATUS SdCardIdentification ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot 
)

Execute EMMC device identification procedure.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThere is a EMMC card.
OthersThere is not a EMMC card.

Execute SD device identification procedure.

Refer to SD Physical Layer Simplified Spec 4.1 Section 3.6 for details.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThere is a SD card.
OthersThere is not a SD card.

Definition at line 1210 of file SdDevice.c.

◆ SdMmcCheckTrbEnv()

EFI_STATUS SdMmcCheckTrbEnv ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN SD_MMC_HC_TRB Trb 
)

Check if the env is ready for execute specified TRB.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.
Return values
EFI_SUCCESSThe env is ready for TRB execution.
EFI_NOT_READYThe env is not ready for TRB execution.
OthersSome erros happen.

Definition at line 2021 of file SdMmcPciHci.c.

◆ SdMmcCheckTrbResult()

EFI_STATUS SdMmcCheckTrbResult ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN SD_MMC_HC_TRB Trb 
)

Check the TRB execution result.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.
Return values
EFI_SUCCESSThe TRB is executed successfully.
EFI_NOT_READYThe TRB is not completed for execution.
OthersSome erros happen when executing this request.

Definition at line 2798 of file SdMmcPciHci.c.

◆ SdMmcCreateTrb()

SD_MMC_HC_TRB * SdMmcCreateTrb ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot,
IN EFI_SD_MMC_PASS_THRU_COMMAND_PACKET Packet,
IN EFI_EVENT  Event 
)

Create a new TRB for the SD/MMC cmd request.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]PacketA pointer to the SD command data structure.
[in]EventIf Event is NULL, blocking I/O is performed. If Event is not NULL, then nonblocking I/O is performed, and Event will be signaled when the Packet completes.
Returns
Created Trb or NULL.

Definition at line 1848 of file SdMmcPciHci.c.

◆ SdMmcExecTrb()

EFI_STATUS SdMmcExecTrb ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN SD_MMC_HC_TRB Trb 
)

Execute the specified TRB.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.
Return values
EFI_SUCCESSThe TRB is sent to host controller successfully.
OthersSome erros happen when sending this request to the host controller.

Definition at line 2127 of file SdMmcPciHci.c.

◆ SdMmcFreeTrb()

VOID SdMmcFreeTrb ( IN SD_MMC_HC_TRB Trb)

Free the resource used by the TRB.

Parameters
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.

Definition at line 1959 of file SdMmcPciHci.c.

◆ SdMmcHcClockSupply()

EFI_STATUS SdMmcHcClockSupply ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot,
IN SD_MMC_BUS_MODE  BusTiming,
IN BOOLEAN  FirstTimeSetup,
IN UINT64  ClockFreq 
)

SD/MMC card clock supply.

Refer to SD Host Controller Simplified spec 3.0 Section 3.2.1 for details.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]BusTimingBusTiming at which the frequency change is done.
[in]FirstTimeSetupFlag to indicate whether the clock is being setup for the first time.
[in]ClockFreqThe max clock frequency to be set. The unit is KHz.
Return values
EFI_SUCCESSThe clock is supplied successfully.
OthersThe clock isn't supplied successfully.

Definition at line 815 of file SdMmcPciHci.c.

◆ SdMmcHcInitHost()

EFI_STATUS SdMmcHcInitHost ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot 
)

Initial SD/MMC host controller with lowest clock frequency, max power and max timeout value at initialization.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe host controller is initialized successfully.
OthersThe host controller isn't initialized successfully.

Definition at line 1213 of file SdMmcPciHci.c.

◆ SdMmcHcReset()

EFI_STATUS SdMmcHcReset ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  Slot 
)

Software reset the specified SD/MMC host controller.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe software reset executes successfully.
OthersThe software reset fails.

Software reset the specified SD/MMC host controller and enable all interrupts.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe software reset executes successfully.
OthersThe software reset fails.

Definition at line 477 of file SdMmcPciHci.c.

◆ SdMmcPassThruBuildDevicePath()

EFI_STATUS EFIAPI SdMmcPassThruBuildDevicePath ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL This,
IN UINT8  Slot,
IN OUT EFI_DEVICE_PATH_PROTOCOL **  DevicePath 
)

Used to allocate and build a device path node for an SD card on the SD controller.

The BuildDevicePath() function allocates and builds a single device node for the SD card specified by Slot.

If the SD card specified by Slot is not present on the SD controller, then EFI_NOT_FOUND is returned.

If DevicePath is NULL, then EFI_INVALID_PARAMETER is returned.

If there are not enough resources to allocate the device path node, then EFI_OUT_OF_RESOURCES is returned.

Otherwise, DevicePath is allocated with the boot service AllocatePool(), the contents of DevicePath are initialized to describe the SD card specified by Slot, and EFI_SUCCESS is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
[in]SlotSpecifies the slot number of the SD card for which a device path node is to be allocated and built.
[in,out]DevicePathA pointer to a single device path node that describes the SD card specified by Slot. This function is responsible for allocating the buffer DevicePath with the boot service AllocatePool(). It is the caller's responsibility to free DevicePath when the caller is finished with DevicePath.
Return values
EFI_SUCCESSThe device path node that describes the SD card specified by Slot was allocated and returned in DevicePath.
EFI_NOT_FOUNDThe SD card specified by Slot does not exist on the SD controller.
EFI_INVALID_PARAMETERDevicePath is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources to allocate DevicePath.

Definition at line 1266 of file SdMmcPciHcDxe.c.

◆ SdMmcPassThruGetNextSlot()

EFI_STATUS EFIAPI SdMmcPassThruGetNextSlot ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL This,
IN OUT UINT8 *  Slot 
)

Used to retrieve next slot numbers supported by the SD controller. The function returns information about all available slots (populated or not-populated).

The GetNextSlot() function retrieves the next slot number on an SD controller. If on input Slot is 0xFF, then the slot number of the first slot on the SD controller is returned.

If Slot is a slot number that was returned on a previous call to GetNextSlot(), then the slot number of the next slot on the SD controller is returned.

If Slot is not 0xFF and Slot was not returned on a previous call to GetNextSlot(), EFI_INVALID_PARAMETER is returned.

If Slot is the slot number of the last slot on the SD controller, then EFI_NOT_FOUND is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMMC_PASS_THRU_PROTOCOL instance.
[in,out]SlotOn input, a pointer to a slot number on the SD controller. On output, a pointer to the next slot number on the SD controller. An input value of 0xFF retrieves the first slot number on the SD controller.
Return values
EFI_SUCCESSThe next slot number on the SD controller was returned in Slot.
EFI_NOT_FOUNDThere are no more slots on this SD controller.
EFI_INVALID_PARAMETERSlot is not 0xFF and Slot was not returned on a previous call to GetNextSlot().

Definition at line 1191 of file SdMmcPciHcDxe.c.

◆ SdMmcPassThruGetSlotNumber()

EFI_STATUS EFIAPI SdMmcPassThruGetSlotNumber ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL This,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
OUT UINT8 *  Slot 
)

This function retrieves an SD card slot number based on the input device path.

The GetSlotNumber() function retrieves slot number for the SD card specified by the DevicePath node. If DevicePath is NULL, EFI_INVALID_PARAMETER is returned.

If DevicePath is not a device path node type that the SD Pass Thru driver supports, EFI_UNSUPPORTED is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]DevicePathA pointer to the device path node that describes a SD card on the SD controller.
[out]SlotOn return, points to the slot number of an SD card on the SD controller.
Return values
EFI_SUCCESSSD card slot number is returned in Slot.
EFI_INVALID_PARAMETERSlot or DevicePath is NULL.
EFI_UNSUPPORTEDDevicePath is not a device path node type that the SD Pass Thru driver supports.

Definition at line 1337 of file SdMmcPciHcDxe.c.

◆ SdMmcPassThruPassThru()

EFI_STATUS EFIAPI SdMmcPassThruPassThru ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL This,
IN UINT8  Slot,
IN OUT EFI_SD_MMC_PASS_THRU_COMMAND_PACKET Packet,
IN EFI_EVENT Event  OPTIONAL 
)

Sends SD command to an SD card that is attached to the SD controller.

The PassThru() function sends the SD command specified by Packet to the SD card specified by Slot.

If Packet is successfully sent to the SD card, then EFI_SUCCESS is returned.

If a device error occurs while sending the Packet, then EFI_DEVICE_ERROR is returned.

If Slot is not in a valid range for the SD controller, then EFI_INVALID_PARAMETER is returned.

If Packet defines a data command but both InDataBuffer and OutDataBuffer are NULL, EFI_INVALID_PARAMETER is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in,out]PacketA pointer to the SD command data structure.
[in]EventIf Event is NULL, blocking I/O is performed. If Event is not NULL, then nonblocking I/O is performed, and Event will be signaled when the Packet completes.
Return values
EFI_SUCCESSThe SD Command Packet was sent by the host.
EFI_DEVICE_ERRORA device error occurred while attempting to send the SD command Packet.
EFI_INVALID_PARAMETERPacket, Slot, or the contents of the Packet is invalid.
EFI_INVALID_PARAMETERPacket defines a data command but both InDataBuffer and OutDataBuffer are NULL.
EFI_NO_MEDIASD Device not present in the Slot.
EFI_UNSUPPORTEDThe command described by the SD Command Packet is not supported by the host controller.
EFI_BAD_BUFFER_SIZEThe InTransferLength or OutTransferLength exceeds the limit supported by SD card ( i.e. if the number of bytes exceed the Last LBA).

Definition at line 1100 of file SdMmcPciHcDxe.c.

◆ SdMmcPassThruResetDevice()

EFI_STATUS EFIAPI SdMmcPassThruResetDevice ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL This,
IN UINT8  Slot 
)

Resets an SD card that is connected to the SD controller.

The ResetDevice() function resets the SD card specified by Slot.

If this SD controller does not support a device reset operation, EFI_UNSUPPORTED is returned.

If Slot is not in a valid slot number for this SD controller, EFI_INVALID_PARAMETER is returned.

If the device reset operation is completed, EFI_SUCCESS is returned.

Parameters
[in]ThisA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotSpecifies the slot number of the SD card to be reset.
Return values
EFI_SUCCESSThe SD card specified by Slot was reset.
EFI_UNSUPPORTEDThe SD controller does not support a device reset operation.
EFI_INVALID_PARAMETERSlot number is invalid.
EFI_NO_MEDIASD Device not present in the Slot.
EFI_DEVICE_ERRORThe reset command failed due to a device error

Definition at line 1411 of file SdMmcPciHcDxe.c.

◆ SdMmcPciHcComponentNameGetControllerName()

EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetControllerName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN EFI_HANDLE  ControllerHandle,
IN EFI_HANDLE ChildHandle  OPTIONAL,
IN CHAR8 *  Language,
OUT CHAR16 **  ControllerName 
)

Retrieves a Unicode string that is the user readable name of the controller that is being managed by a driver.

This function retrieves the user readable name of the controller specified by ControllerHandle and ChildHandle in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the controller name is returned in ControllerName, and EFI_SUCCESS is returned. If the driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle, then EFI_UNSUPPORTED is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
This[in]A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
ControllerHandle[in]The handle of a controller that the driver specified by This is managing. This handle specifies the controller whose name is to be returned.
ChildHandle[in]The handle of the child controller to retrieve the name of. This is an optional parameter that may be NULL. It will be NULL for device drivers. It will also be NULL for a bus drivers that wish to retrieve the name of the bus controller. It will not be NULL for a bus driver that wishes to retrieve the name of a child controller.
Language[in]A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
ControllerName[out]A pointer to the Unicode string to return. This Unicode string is the name of the controller specified by ControllerHandle and ChildHandle in the language specified by Language from the point of view of the driver specified by This.
Return values
EFI_SUCCESSThe Unicode string for the user readable name in the language specified by Language for the driver specified by This was returned in DriverName.
EFI_INVALID_PARAMETERControllerHandle is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERChildHandle is not NULL and it is not a valid EFI_HANDLE.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERControllerName is NULL.
EFI_UNSUPPORTEDThe driver specified by This is not currently managing the controller specified by ControllerHandle and ChildHandle.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 165 of file ComponentName.c.

◆ SdMmcPciHcComponentNameGetDriverName()

EFI_STATUS EFIAPI SdMmcPciHcComponentNameGetDriverName ( IN EFI_COMPONENT_NAME_PROTOCOL This,
IN CHAR8 *  Language,
OUT CHAR16 **  DriverName 
)

Retrieves a Unicode string that is the user readable name of the driver.

This function retrieves the user readable name of a driver in the form of a Unicode string. If the driver specified by This has a user readable name in the language specified by Language, then a pointer to the driver name is returned in DriverName, and EFI_SUCCESS is returned. If the driver specified by This does not support the language specified by Language, then EFI_UNSUPPORTED is returned.

Parameters
This[in]A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or EFI_COMPONENT_NAME_PROTOCOL instance.
Language[in]A pointer to a Null-terminated ASCII string array indicating the language. This is the language of the driver name that the caller is requesting, and it must match one of the languages specified in SupportedLanguages. The number of languages supported by a driver is up to the driver writer. Language is specified in RFC 4646 or ISO 639-2 language code format.
DriverName[out]A pointer to the Unicode string to return. This Unicode string is the name of the driver specified by This in the language specified by Language.
Return values
EFI_SUCCESSThe Unicode string for the Driver specified by This and the language specified by Language was returned in DriverName.
EFI_INVALID_PARAMETERLanguage is NULL.
EFI_INVALID_PARAMETERDriverName is NULL.
EFI_UNSUPPORTEDThe driver specified by This does not support the language specified by Language.

Definition at line 80 of file ComponentName.c.

◆ SdMmcPciHcDriverBindingStart()

EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Starts a device controller or a bus controller.

The Start() function is designed to be invoked from the EFI boot service ConnectController(). As a result, much of the error checking on the parameters to Start() has been moved into this common boot service. It is legal to call Start() from other locations, but the following calling restrictions must be followed or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE.
  2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned EFI_DEVICE_PATH_PROTOCOL.
  3. Prior to calling Start(), the Supported() function for the driver specified by This must have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to start. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers. For a bus driver, if this parameter is NULL, then handles for all the children of Controller are created by this driver. If this parameter is not NULL and the first Device Path Node is not the End of Device Path Node, then only the handle for the child device specified by the first Device Path Node of RemainingDevicePath is created by this driver. If the first Device Path Node of RemainingDevicePath is the End of Device Path Node, no child handle is created by this driver.
Return values
EFI_SUCCESSThe device was started.
EFI_DEVICE_ERRORThe device could not be started due to a device error.Currently not implemented.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
OthersThe driver failded to start the device.

Definition at line 537 of file SdMmcPciHcDxe.c.

◆ SdMmcPciHcDriverBindingStop()

EFI_STATUS EFIAPI SdMmcPciHcDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stops a device controller or a bus controller.

The Stop() function is designed to be invoked from the EFI boot service DisconnectController(). As a result, much of the error checking on the parameters to Stop() has been moved into this common boot service. It is legal to call Stop() from other locations, but the following calling restrictions must be followed or the system behavior will not be deterministic.

  1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this same driver's Start() function.
  2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid EFI_HANDLE. In addition, all of these handles must have been created in this driver's Start() function, and the Start() function must have called OpenProtocol() on ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleA handle to the device being stopped. The handle must support a bus specific I/O protocol for the driver to use to stop the device.
[in]NumberOfChildrenThe number of child device handles in ChildHandleBuffer.
[in]ChildHandleBufferAn array of child handles to be freed. May be NULL if NumberOfChildren is 0.
Return values
EFI_SUCCESSThe device was stopped.
EFI_DEVICE_ERRORThe device could not be stopped due to a device error.

Definition at line 911 of file SdMmcPciHcDxe.c.

◆ SdMmcPciHcDriverBindingSupported()

EFI_STATUS EFIAPI SdMmcPciHcDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Tests to see if this driver supports a given controller. If a child device is provided, it further tests to see if this driver supports creating a handle for the specified child device.

This function checks to see if the driver specified by This supports the device specified by ControllerHandle. Drivers will typically use the device path attached to ControllerHandle and/or the services from the bus I/O abstraction attached to ControllerHandle to determine if the driver supports ControllerHandle. This function may be called many times during platform initialization. In order to reduce boot times, the tests performed by this function must be very small, and take as little time as possible to execute. This function must not change the state of any hardware devices, and this function must be aware that the device specified by ControllerHandle may already be managed by the same driver or a different driver. This function must match its calls to AllocatePages() with FreePages(), AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol(). Since ControllerHandle may have been previously started by the same driver, if a protocol is already in the opened state, then it must not be closed with CloseProtocol(). This is required to guarantee the state of ControllerHandle is not modified by this function.

Parameters
[in]ThisA pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
[in]ControllerHandleThe handle of the controller to test. This handle must support a protocol interface that supplies an I/O abstraction to the driver.
[in]RemainingDevicePathA pointer to the remaining portion of a device path. This parameter is ignored by device drivers, and is optional for bus drivers. For bus drivers, if this parameter is not NULL, then the bus driver must determine if the bus controller specified by ControllerHandle and the child controller specified by RemainingDevicePath are both supported by this bus driver.
Return values
EFI_SUCCESSThe device specified by ControllerHandle and RemainingDevicePath is supported by the driver specified by This.
EFI_ALREADY_STARTEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by the driver specified by This.
EFI_ACCESS_DENIEDThe device specified by ControllerHandle and RemainingDevicePath is already being managed by a different driver or an application that requires exclusive access. Currently not implemented.
EFI_UNSUPPORTEDThe device specified by ControllerHandle and RemainingDevicePath is not supported by the driver specified by This.

Definition at line 396 of file SdMmcPciHcDxe.c.

◆ SdMmcWaitTrbEnv()

EFI_STATUS SdMmcWaitTrbEnv ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN SD_MMC_HC_TRB Trb 
)

Wait for the env to be ready for execute specified TRB.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.
Return values
EFI_SUCCESSThe env is ready for TRB execution.
EFI_TIMEOUTThe env is not ready for TRB execution in time.
OthersSome erros happen.

Definition at line 2075 of file SdMmcPciHci.c.

◆ SdMmcWaitTrbResult()

EFI_STATUS SdMmcWaitTrbResult ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN SD_MMC_HC_TRB Trb 
)

Wait for the TRB execution result.

Parameters
[in]PrivateA pointer to the SD_MMC_HC_PRIVATE_DATA instance.
[in]TrbThe pointer to the SD_MMC_HC_TRB instance.
Return values
EFI_SUCCESSThe TRB is executed successfully.
OthersSome erros happen when executing this request.

Definition at line 2888 of file SdMmcPciHci.c.

Variable Documentation

◆ gSdMmcPciHcComponentName

EFI_COMPONENT_NAME_PROTOCOL gSdMmcPciHcComponentName
extern

Definition at line 14 of file ComponentName.c.

◆ gSdMmcPciHcComponentName2

EFI_COMPONENT_NAME2_PROTOCOL gSdMmcPciHcComponentName2
extern

Definition at line 23 of file ComponentName.c.

◆ gSdMmcPciHcDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gSdMmcPciHcDriverBinding
extern

Definition at line 22 of file SdMmcPciHcDxe.c.

◆ mOverride

EDKII_SD_MMC_OVERRIDE* mOverride
extern

Definition at line 17 of file SdMmcPciHcDxe.c.