EmbeddedPkg[all]  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MmcHost.h File Reference

Data Structures

struct  _EFI_MMC_HOST_PROTOCOL
 

Macros

#define EMBEDDED_MMC_HOST_PROTOCOL_GUID   { 0x3e591c00, 0x9e4a, 0x11df, {0x92, 0x44, 0x00, 0x02, 0xA5, 0xD5, 0xC5, 0x1B } }
 
#define MMC_RESPONSE_TYPE_R1   0
 
#define MMC_RESPONSE_TYPE_R1b   0
 
#define MMC_RESPONSE_TYPE_R2   1
 
#define MMC_RESPONSE_TYPE_R3   0
 
#define MMC_RESPONSE_TYPE_R6   0
 
#define MMC_RESPONSE_TYPE_R7   0
 
#define MMC_RESPONSE_TYPE_OCR   0
 
#define MMC_RESPONSE_TYPE_CID   1
 
#define MMC_RESPONSE_TYPE_CSD   1
 
#define MMC_RESPONSE_TYPE_RCA   0
 
#define MMC_CMD_WAIT_RESPONSE   (1 << 16)
 
#define MMC_CMD_LONG_RESPONSE   (1 << 17)
 
#define MMC_CMD_NO_CRC_RESPONSE   (1 << 18)
 
#define MMC_INDX(Index)   ((Index) & 0xFFFF)
 
#define MMC_GET_INDX(MmcCmd)   ((MmcCmd) & 0xFFFF)
 
#define MMC_CMD0   (MMC_INDX(0) | MMC_CMD_NO_CRC_RESPONSE)
 
#define MMC_CMD1   (MMC_INDX(1) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
 
#define MMC_CMD2   (MMC_INDX(2) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE)
 
#define MMC_CMD3   (MMC_INDX(3) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD5   (MMC_INDX(5) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
 
#define MMC_CMD6   (MMC_INDX(6) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD7   (MMC_INDX(7) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD8   (MMC_INDX(8) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD9   (MMC_INDX(9) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE)
 
#define MMC_CMD11   (MMC_INDX(11) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD12   (MMC_INDX(12) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD13   (MMC_INDX(13) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD16   (MMC_INDX(16) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD17   (MMC_INDX(17) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD18   (MMC_INDX(18) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD20   (MMC_INDX(20) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD23   (MMC_INDX(23) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD24   (MMC_INDX(24) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD25   (MMC_INDX(25) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_CMD55   (MMC_INDX(55) | MMC_CMD_WAIT_RESPONSE)
 
#define MMC_ACMD41   (MMC_INDX(41) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
 
#define MMC_ACMD51   (MMC_INDX(51) | MMC_CMD_WAIT_RESPONSE)
 
#define EMMC_CMD1_CAPACITY_LESS_THAN_2GB   0x00FF8080
 
#define EMMC_CMD1_CAPACITY_GREATER_THAN_2GB   0x40FF8080
 
#define MMC_STATUS_APP_CMD   (1 << 5)
 
#define EMMCBACKWARD   (0)
 
#define EMMCHS26   (1 << 0)
 
#define EMMCHS52   (1 << 1)
 
#define EMMCHS52DDR1V8   (1 << 2)
 
#define EMMCHS52DDR1V2   (1 << 3)
 
#define EMMCHS200SDR1V8   (1 << 4)
 
#define EMMCHS200SDR1V2   (1 << 5)
 
#define EMMCHS400DDR1V8   (1 << 6)
 
#define EMMCHS400DDR1V2   (1 << 7)
 
#define MMC_HOST_PROTOCOL_REVISION   0x00010002
 
#define MMC_HOST_HAS_SETIOS(Host)
 
#define MMC_HOST_HAS_ISMULTIBLOCK(Host)
 

Typedefs

typedef UINT32 MMC_RESPONSE_TYPE
 
typedef UINT32 MMC_CMD
 
typedef enum _MMC_STATE MMC_STATE
 
typedef struct
_EFI_MMC_HOST_PROTOCOL 
EFI_MMC_HOST_PROTOCOL
 
typedef OUT
EFI_DEVICE_PATH_PROTOCOL ** 
DevicePath
 
typedef IN MMC_STATE State
 
typedef IN MMC_CMD Cmd
 
typedef IN MMC_CMD IN UINT32 Argument
 
typedef IN MMC_RESPONSE_TYPE Type
 
typedef IN MMC_RESPONSE_TYPE
IN UINT32 * 
Buffer
 
typedef IN EFI_LBA Lba
 
typedef IN EFI_LBA IN UINTN Length
 
typedef IN UINT32 BusClockFreq
 
typedef IN UINT32 IN UINT32 BusWidth
 
typedef IN UINT32 IN UINT32 IN
UINT32 
TimingMode
 

Enumerations

enum  _MMC_STATE {
  MmcInvalidState = 0, MmcHwInitializationState, MmcIdleState, MmcReadyState,
  MmcIdentificationState, MmcStandByState, MmcTransferState, MmcSendingDataState,
  MmcReceiveDataState, MmcProgrammingState, MmcDisconnectState
}
 

Functions

typedef BOOLEAN (EFIAPI *MMC_ISCARDPRESENT)(IN EFI_MMC_HOST_PROTOCOL *This)
 
typedef EFI_STATUS (EFIAPI *MMC_BUILDDEVICEPATH)(IN EFI_MMC_HOST_PROTOCOL *This
 

Variables

EFI_GUID gEmbeddedMmcHostProtocolGuid
 

Detailed Description

Definition of the MMC Host Protocol

Copyright (c) 2011-2014, ARM Limited. All rights reserved.

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

Macro Definition Documentation

#define EMBEDDED_MMC_HOST_PROTOCOL_GUID   { 0x3e591c00, 0x9e4a, 0x11df, {0x92, 0x44, 0x00, 0x02, 0xA5, 0xD5, 0xC5, 0x1B } }

Global ID for the MMC Host Protocol

#define EMMC_CMD1_CAPACITY_GREATER_THAN_2GB   0x40FF8080
#define EMMC_CMD1_CAPACITY_LESS_THAN_2GB   0x00FF8080
#define EMMCBACKWARD   (0)
#define EMMCHS200SDR1V2   (1 << 5)
#define EMMCHS200SDR1V8   (1 << 4)
#define EMMCHS26   (1 << 0)
#define EMMCHS400DDR1V2   (1 << 7)
#define EMMCHS400DDR1V8   (1 << 6)
#define EMMCHS52   (1 << 1)
#define EMMCHS52DDR1V2   (1 << 3)
#define EMMCHS52DDR1V8   (1 << 2)
#define MMC_ACMD41   (MMC_INDX(41) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
#define MMC_ACMD51   (MMC_INDX(51) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD0   (MMC_INDX(0) | MMC_CMD_NO_CRC_RESPONSE)
#define MMC_CMD1   (MMC_INDX(1) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
#define MMC_CMD11   (MMC_INDX(11) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD12   (MMC_INDX(12) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD13   (MMC_INDX(13) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD16   (MMC_INDX(16) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD17   (MMC_INDX(17) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD18   (MMC_INDX(18) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD2   (MMC_INDX(2) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE)
#define MMC_CMD20   (MMC_INDX(20) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD23   (MMC_INDX(23) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD24   (MMC_INDX(24) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD25   (MMC_INDX(25) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD3   (MMC_INDX(3) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD5   (MMC_INDX(5) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
#define MMC_CMD55   (MMC_INDX(55) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD6   (MMC_INDX(6) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD7   (MMC_INDX(7) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD8   (MMC_INDX(8) | MMC_CMD_WAIT_RESPONSE)
#define MMC_CMD9   (MMC_INDX(9) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_LONG_RESPONSE)
#define MMC_CMD_LONG_RESPONSE   (1 << 17)
#define MMC_CMD_NO_CRC_RESPONSE   (1 << 18)
#define MMC_CMD_WAIT_RESPONSE   (1 << 16)
#define MMC_GET_INDX (   MmcCmd)    ((MmcCmd) & 0xFFFF)
#define MMC_HOST_HAS_ISMULTIBLOCK (   Host)
Value:
(Host->Revision >= MMC_HOST_PROTOCOL_REVISION && \
Host->IsMultiBlock != NULL)
#define MMC_HOST_PROTOCOL_REVISION
Definition: MmcHost.h:174
#define MMC_HOST_HAS_SETIOS (   Host)
Value:
(Host->Revision >= MMC_HOST_PROTOCOL_REVISION && \
Host->SetIos != NULL)
#define MMC_HOST_PROTOCOL_REVISION
Definition: MmcHost.h:174
#define MMC_HOST_PROTOCOL_REVISION   0x00010002
#define MMC_INDX (   Index)    ((Index) & 0xFFFF)
#define MMC_RESPONSE_TYPE_CID   1
#define MMC_RESPONSE_TYPE_CSD   1
#define MMC_RESPONSE_TYPE_OCR   0
#define MMC_RESPONSE_TYPE_R1   0
#define MMC_RESPONSE_TYPE_R1b   0
#define MMC_RESPONSE_TYPE_R2   1
#define MMC_RESPONSE_TYPE_R3   0
#define MMC_RESPONSE_TYPE_R6   0
#define MMC_RESPONSE_TYPE_R7   0
#define MMC_RESPONSE_TYPE_RCA   0
#define MMC_STATUS_APP_CMD   (1 << 5)

Typedef Documentation

typedef IN MMC_CMD IN UINT32 Argument
typedef IN UINTN IN UINTN IN VOID * Buffer
typedef IN UINT32 BusClockFreq
typedef IN UINT32 IN UINT32 BusWidth
typedef IN MMC_CMD Cmd
typedef OUT EFI_DEVICE_PATH_PROTOCOL** DevicePath

Forward declaration for EFI_MMC_HOST_PROTOCOL

typedef IN EFI_LBA Lba
typedef IN UINTN IN UINTN Length
typedef UINT32 MMC_CMD
typedef UINT32 MMC_RESPONSE_TYPE
typedef enum _MMC_STATE MMC_STATE
typedef IN MMC_STATE State
typedef IN UINT32 IN UINT32 IN UINT32 TimingMode
typedef IN MMC_RESPONSE_TYPE Type

Enumeration Type Documentation

enum _MMC_STATE
Enumerator
MmcInvalidState 
MmcHwInitializationState 
MmcIdleState 
MmcReadyState 
MmcIdentificationState 
MmcStandByState 
MmcTransferState 
MmcSendingDataState 
MmcReceiveDataState 
MmcProgrammingState 
MmcDisconnectState 

Function Documentation

typedef BOOLEAN ( EFIAPI *  MMC_ISCARDPRESENT)
typedef EFI_STATUS ( EFIAPI *  MMC_BUILDDEVICEPATH)

Gets the state of a GPIO pin

Parameters
ThisPointer to protocol
GpioWhich pin to read
ValueState of the pin
Return values
EFI_SUCCESSGPIO state returned in Value
EFI_INVALID_PARAMETERValue is NULL
EFI_NOT_FOUNDPin does not exit

Sets the state of a GPIO pin

Parameters
ThisPointer to protocol
GpioWhich pin to modify
ModeMode to set
Return values
EFI_SUCCESSGPIO set as requested
EFI_INVALID_PARAMETERInvalid mode
EFI_NOT_FOUNDPin does not exit

Gets the mode (function) of a GPIO pin

Parameters
ThisPointer to protocol
GpioWhich pin
ModePointer to output mode value
Return values
EFI_SUCCESSMode value retrieved
EFI_INVALID_PARAMETERMode is NULL
EFI_NOT_FOUNDPin does not exit

Sets the pull-up / pull-down resistor of a GPIO pin

Parameters
ThisPointer to PPI
GpioPort/pin index
PullThe pullup/pulldown mode to set
Return values
EFI_SUCCESSMode was set
EFI_NOT_FOUNDPin does not exist
EFI_UNSUPPORTEDAction not supported

Enable interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt enabled.
EFI_DEVICE_ERRORHardware could not be programmed.

Disable interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt disabled.
EFI_DEVICE_ERRORHardware could not be programmed.

Return current state of interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
InterruptStateTRUE: source enabled, FALSE: source disabled.
Return values
EFI_SUCCESSInterruptState is valid
EFI_DEVICE_ERRORInterruptState is not valid

Signal to the hardware that the End Of Interrupt state has been reached.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt EOI'ed.
EFI_DEVICE_ERRORHardware could not be programmed.

Return the configured trigger type for an interrupt source

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
TriggerTypeThe configured trigger type
Return values
EFI_SUCCESSOperation successful
EFI_DEVICE_ERRORInformation could not be returned

Configure the trigger type for an interrupt source

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
TriggerTypeThe trigger type to configure
Return values
EFI_SUCCESSOperation successful
EFI_DEVICE_ERRORHardware could not be programmed.

Register Handler for the specified interrupt source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
HandlerCallback for interrupt. NULL to unregister
Return values
EFI_SUCCESSSource was updated to support Handler.
EFI_DEVICE_ERRORHardware could not be programmed.

Enable interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt enabled.
EFI_DEVICE_ERRORHardware could not be programmed.

Disable interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt disabled.
EFI_DEVICE_ERRORHardware could not be programmed.

Return current state of interrupt source Source.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
InterruptStateTRUE: source enabled, FALSE: source disabled.
Return values
EFI_SUCCESSInterruptState is valid
EFI_DEVICE_ERRORInterruptState is not valid

Signal to the hardware that the End Of Interrupt state has been reached.

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
Return values
EFI_SUCCESSSource interrupt EOI'ed.
EFI_DEVICE_ERRORHardware could not be programmed.

Return the configured trigger type for an interrupt source

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
TriggerTypeThe configured trigger type
Return values
EFI_SUCCESSOperation successful
EFI_DEVICE_ERRORInformation could not be returned

Configure the trigger type for an interrupt source

Parameters
ThisInstance pointer for this protocol
SourceHardware source of the interrupt
TriggerTypeThe trigger type to configure
Return values
EFI_SUCCESSOperation successful
EFI_DEVICE_ERRORHardware could not be programmed.

Variable Documentation

EFI_GUID gEmbeddedMmcHostProtocolGuid