TianoCore EDK2 master
Loading...
Searching...
No Matches
EmmcDevice.c File Reference
#include "SdMmcPciHcDxe.h"

Go to the source code of this file.

Functions

EFI_STATUS EmmcReset (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot)
 
EFI_STATUS EmmcGetOcr (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN OUT UINT32 *Argument)
 
EFI_STATUS EmmcGetAllCid (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot)
 
EFI_STATUS EmmcSetRca (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca)
 
EFI_STATUS EmmcGetCsd (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, OUT EMMC_CSD *Csd)
 
EFI_STATUS EmmcSelect (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca)
 
EFI_STATUS EmmcGetExtCsd (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, OUT EMMC_EXT_CSD *ExtCsd)
 
EFI_STATUS EmmcSwitch (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT8 Access, IN UINT8 Index, IN UINT8 Value, IN UINT8 CmdSet)
 
EFI_STATUS EmmcSendStatus (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, OUT UINT32 *DevStatus)
 
EFI_STATUS EmmcSendTuningBlk (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT8 BusWidth)
 
EFI_STATUS EmmcTuningClkForHs200 (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT8 BusWidth)
 
EFI_STATUS EmmcCheckSwitchStatus (IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca)
 
EFI_STATUS EmmcSwitchBusWidth (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN BOOLEAN IsDdr, IN UINT8 BusWidth)
 
EFI_STATUS EmmcSwitchBusTiming (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN EDKII_SD_MMC_DRIVER_STRENGTH DriverStrength, IN SD_MMC_BUS_MODE BusTiming, IN UINT32 ClockFreq)
 
EFI_STATUS EmmcSwitchToHighSpeed (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN SD_MMC_BUS_SETTINGS *BusMode)
 
EFI_STATUS EmmcSwitchToHS200 (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN SD_MMC_BUS_SETTINGS *BusMode)
 
EFI_STATUS EmmcSwitchToHS400 (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca, IN SD_MMC_BUS_SETTINGS *BusMode)
 
BOOLEAN EmmcIsBusTimingSupported (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
 
SD_MMC_BUS_MODE EmmcGetTargetBusTiming (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd)
 
BOOLEAN EmmcIsBusWidthSupported (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN SD_MMC_BUS_MODE BusTiming, IN UINT16 BusWidth)
 
UINT8 EmmcGetTargetBusWidth (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
 
UINT32 EmmcGetTargetClockFreq (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
 
EDKII_SD_MMC_DRIVER_STRENGTH EmmcGetTargetDriverStrength (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
 
VOID EmmcGetTargetBusMode (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, OUT SD_MMC_BUS_SETTINGS *BusMode)
 
EFI_STATUS EmmcSetBusMode (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_SD_MMC_PASS_THRU_PROTOCOL *PassThru, IN UINT8 Slot, IN UINT16 Rca)
 
EFI_STATUS EmmcIdentification (IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 Slot)
 

Detailed Description

This file provides some helper functions which are specific for EMMC device.

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

Definition in file EmmcDevice.c.

Function Documentation

◆ EmmcCheckSwitchStatus()

EFI_STATUS EmmcCheckSwitchStatus ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca 
)

Check the SWITCH operation status.

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number on which command should be sent.
[in]RcaThe relative device address.
Return values
EFI_SUCCESSThe SWITCH finished siccessfully.
othersThe SWITCH failed.

Definition at line 574 of file EmmcDevice.c.

◆ EmmcGetAllCid()

EFI_STATUS EmmcGetAllCid ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot 
)

Broadcast command ALL_SEND_CID to the bus to ask all the EMMC devices to send the data of their CID registers.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 120 of file EmmcDevice.c.

◆ EmmcGetCsd()

EFI_STATUS EmmcGetCsd ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
OUT EMMC_CSD Csd 
)

Send command SEND_CSD to the EMMC device to get the data of the CSD register.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address of selected device.
[out]CsdThe buffer to store the content of the CSD register. Note the caller should ignore the lowest byte of this buffer as the content of this byte is meaningless even if the operation succeeds.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 210 of file EmmcDevice.c.

◆ EmmcGetExtCsd()

EFI_STATUS EmmcGetExtCsd ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
OUT EMMC_EXT_CSD ExtCsd 
)

Send command SEND_EXT_CSD to the EMMC device to get the data of the EXT_CSD register.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[out]ExtCsdThe buffer to store the content of the EXT_CSD register.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 303 of file EmmcDevice.c.

◆ EmmcGetOcr()

EFI_STATUS EmmcGetOcr ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN OUT UINT32 *  Argument 
)

Send command SEND_OP_COND to the EMMC device to get the data of the OCR register.

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

Parameters
[in]PassThruA 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]ArgumentOn input, the argument of SEND_OP_COND is to send to the device. On output, the argument is the value of OCR register.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 71 of file EmmcDevice.c.

◆ EmmcGetTargetBusMode()

VOID EmmcGetTargetBusMode ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd,
OUT SD_MMC_BUS_SETTINGS BusMode 
)

Get the target settings for the bus mode.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to card's extended CSD
[out]BusModeTarget configuration of the bus

Definition at line 1208 of file EmmcDevice.c.

◆ EmmcGetTargetBusTiming()

SD_MMC_BUS_MODE EmmcGetTargetBusTiming ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd 
)

Get the target bus timing to set on the link. This function will try to select highest bus timing supported by card, controller and the driver.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to the card's extended CSD
Returns
Bus timing value that should be set on link

Definition at line 1030 of file EmmcDevice.c.

◆ EmmcGetTargetBusWidth()

UINT8 EmmcGetTargetBusWidth ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd,
IN SD_MMC_BUS_MODE  BusTiming 
)

Get the target bus width to be set on the bus.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to card's extended CSD
[in]BusTimingBus timing set on the bus
Returns
Bus width to be set on the bus

Definition at line 1095 of file EmmcDevice.c.

◆ EmmcGetTargetClockFreq()

UINT32 EmmcGetTargetClockFreq ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd,
IN SD_MMC_BUS_MODE  BusTiming 
)

Get the target clock frequency to be set on the bus.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to card's extended CSD
[in]BusTimingBus timing to be set on the bus
Returns
Value of the clock frequency to be set on bus in MHz

Definition at line 1133 of file EmmcDevice.c.

◆ EmmcGetTargetDriverStrength()

EDKII_SD_MMC_DRIVER_STRENGTH EmmcGetTargetDriverStrength ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd,
IN SD_MMC_BUS_MODE  BusTiming 
)

Get the driver strength to be set on bus.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to card's extended CSD
[in]BusTimingBus timing set on the bus
Returns
Value of the driver strength to be set on the bus

Definition at line 1177 of file EmmcDevice.c.

◆ 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.

◆ EmmcIsBusTimingSupported()

BOOLEAN EmmcIsBusTimingSupported ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN EMMC_EXT_CSD ExtCsd,
IN SD_MMC_BUS_MODE  BusTiming 
)

Check if passed BusTiming is supported in both controller and card.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]ExtCsdPointer to the card's extended CSD
[in]BusTimingBus timing to check
Return values
TRUEBoth card and controller support given BusTiming
FALSECard or controller doesn't support given BusTiming

Definition at line 967 of file EmmcDevice.c.

◆ EmmcIsBusWidthSupported()

BOOLEAN EmmcIsBusWidthSupported ( IN SD_MMC_HC_PRIVATE_DATA Private,
IN UINT8  SlotIndex,
IN SD_MMC_BUS_MODE  BusTiming,
IN UINT16  BusWidth 
)

Check if the passed bus width is supported by controller and card.

Parameters
[in]PrivatePointer to controller private data
[in]SlotIndexIndex of the slot in the controller
[in]BusTimingBus timing set on the link
[in]BusWidthBus width to check
Return values
TRUEPassed bus width is supported in current bus configuration
FALSEPassed bus width is not supported in current bus configuration

Definition at line 1066 of file EmmcDevice.c.

◆ EmmcReset()

EFI_STATUS EmmcReset ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot 
)

Send command GO_IDLE_STATE (CMD0 with argument of 0x00000000) to the device to make it go to Idle State.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
Return values
EFI_SUCCESSThe EMMC device is reset correctly.
OthersThe device reset fails.

Definition at line 26 of file EmmcDevice.c.

◆ EmmcSelect()

EFI_STATUS EmmcSelect ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca 
)

Send command SELECT_DESELECT_CARD to the EMMC device to select/deselect it.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address of selected device.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 260 of file EmmcDevice.c.

◆ EmmcSendStatus()

EFI_STATUS EmmcSendStatus ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
OUT UINT32 *  DevStatus 
)

Send command SEND_STATUS to the addressed EMMC device to get its status register.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address of addressed device.
[out]DevStatusThe returned device status.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 399 of file EmmcDevice.c.

◆ EmmcSendTuningBlk()

EFI_STATUS EmmcSendTuningBlk ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT8  BusWidth 
)

Send command SEND_TUNING_BLOCK to the EMMC device for HS200 optimal sampling point detection.

It may be sent up to 40 times until the host finishes the tuning procedure.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]BusWidthThe bus width to work.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 449 of file EmmcDevice.c.

◆ EmmcSetBusMode()

EFI_STATUS EmmcSetBusMode ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca 
)

Switch the high speed timing according to request.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 1237 of file EmmcDevice.c.

◆ EmmcSetRca()

EFI_STATUS EmmcSetRca ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca 
)

Send command SET_RELATIVE_ADDR to the EMMC device to assign a Relative device Address (RCA).

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 163 of file EmmcDevice.c.

◆ EmmcSwitch()

EFI_STATUS EmmcSwitch ( IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT8  Access,
IN UINT8  Index,
IN UINT8  Value,
IN UINT8  CmdSet 
)

Send command SWITCH to the EMMC device to switch the mode of operation of the selected Device or modifies the EXT_CSD registers.

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

Parameters
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]AccessThe access mode of SWTICH command.
[in]IndexThe offset of the field to be access.
[in]ValueThe value to be set to the specified field of EXT_CSD register.
[in]CmdSetThe value of CmdSet field of EXT_CSD register.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 352 of file EmmcDevice.c.

◆ EmmcSwitchBusTiming()

EFI_STATUS EmmcSwitchBusTiming ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
IN EDKII_SD_MMC_DRIVER_STRENGTH  DriverStrength,
IN SD_MMC_BUS_MODE  BusTiming,
IN UINT32  ClockFreq 
)

Switch the bus timing and clock frequency.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6 and SD Host Controller Simplified Spec 3.0 Figure 3-3 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
[in]DriverStrengthDriver strength to set for speed modes that support it.
[in]BusTimingThe bus mode timing indicator.
[in]ClockFreqThe max clock frequency to be set, the unit is MHz.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 687 of file EmmcDevice.c.

◆ EmmcSwitchBusWidth()

EFI_STATUS EmmcSwitchBusWidth ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
IN BOOLEAN  IsDdr,
IN UINT8  BusWidth 
)

Switch the bus width to specified width.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.9 and SD Host Controller Simplified Spec 3.0 Figure 3-7 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
[in]IsDdrIf TRUE, use dual data rate data simpling method. Otherwise use single data rate data simpling method.
[in]BusWidthThe bus width to be set, it could be 4 or 8.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 619 of file EmmcDevice.c.

◆ EmmcSwitchToHighSpeed()

EFI_STATUS EmmcSwitchToHighSpeed ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
IN SD_MMC_BUS_SETTINGS BusMode 
)

Switch to the High Speed timing according to request.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
[in]BusModePointer to SD_MMC_BUS_SETTINGS structure containing bus settings.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 813 of file EmmcDevice.c.

◆ EmmcSwitchToHS200()

EFI_STATUS EmmcSwitchToHS200 ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
IN SD_MMC_BUS_SETTINGS BusMode 
)

Switch to the HS200 timing. This function assumes that eMMC bus is still in legacy mode.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
[in]BusModePointer to SD_MMC_BUS_SETTINGS structure containing bus settings.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 861 of file EmmcDevice.c.

◆ EmmcSwitchToHS400()

EFI_STATUS EmmcSwitchToHS400 ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT16  Rca,
IN SD_MMC_BUS_SETTINGS BusMode 
)

Switch to the HS400 timing. This function assumes that eMMC bus is still in legacy mode.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]RcaThe relative device address to be assigned.
[in]BusModePointer to SD_MMC_BUS_SETTINGS structure containing bus settings.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 909 of file EmmcDevice.c.

◆ EmmcTuningClkForHs200()

EFI_STATUS EmmcTuningClkForHs200 ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_SD_MMC_PASS_THRU_PROTOCOL PassThru,
IN UINT8  Slot,
IN UINT8  BusWidth 
)

Tunning the clock to get HS200 optimal sampling point.

Command SEND_TUNING_BLOCK may be sent up to 40 times until the host finishes the tuning procedure.

Refer to EMMC Electrical Standard Spec 5.1 Section 6.6.8 and SD Host Controller Simplified Spec 3.0 Figure 2-29 for details.

Parameters
[in]PciIoA pointer to the EFI_PCI_IO_PROTOCOL instance.
[in]PassThruA pointer to the EFI_SD_MMC_PASS_THRU_PROTOCOL instance.
[in]SlotThe slot number of the SD card to send the command to.
[in]BusWidthThe bus width to work.
Return values
EFI_SUCCESSThe operation is done correctly.
OthersThe operation fails.

Definition at line 505 of file EmmcDevice.c.