TianoCore EDK2 master
Loading...
Searching...
No Matches
MmcIdentification.c File Reference

Go to the source code of this file.

Data Structures

union  OCR_RESPONSE
 

Macros

#define MAX_RETRY_COUNT   1000
 
#define CMD_RETRY_COUNT   20
 
#define RCA_SHIFT_OFFSET   16
 
#define EMMC_CARD_SIZE   512
 
#define EMMC_ECSD_SIZE_OFFSET   53
 
#define EXTCSD_BUS_WIDTH   183
 
#define EXTCSD_HS_TIMING   185
 
#define EMMC_TIMING_BACKWARD   0
 
#define EMMC_TIMING_HS   1
 
#define EMMC_TIMING_HS200   2
 
#define EMMC_TIMING_HS400   3
 
#define EMMC_BUS_WIDTH_1BIT   0
 
#define EMMC_BUS_WIDTH_4BIT   1
 
#define EMMC_BUS_WIDTH_8BIT   2
 
#define EMMC_BUS_WIDTH_DDR_4BIT   5
 
#define EMMC_BUS_WIDTH_DDR_8BIT   6
 
#define EMMC_SWITCH_ERROR   (1 << 7)
 
#define SD_BUS_WIDTH_1BIT   (1 << 0)
 
#define SD_BUS_WIDTH_4BIT   (1 << 2)
 
#define SD_CCC_SWITCH   (1 << 10)
 
#define DEVICE_STATE(x)   (((x) >> 9) & 0xf)
 

Typedefs

typedef enum _EMMC_DEVICE_STATE EMMC_DEVICE_STATE
 

Enumerations

enum  _EMMC_DEVICE_STATE {
  EMMC_IDLE_STATE = 0 , EMMC_READY_STATE , EMMC_IDENT_STATE , EMMC_STBY_STATE ,
  EMMC_TRAN_STATE , EMMC_DATA_STATE , EMMC_RCV_STATE , EMMC_PRG_STATE ,
  EMMC_DIS_STATE , EMMC_BTST_STATE , EMMC_SLP_STATE
}
 

Functions

STATIC EFI_STATUS EFIAPI EmmcGetDeviceState (IN MMC_HOST_INSTANCE *MmcHostInstance, OUT EMMC_DEVICE_STATE *State)
 
STATIC EFI_STATUS EFIAPI EmmcSetEXTCSD (IN MMC_HOST_INSTANCE *MmcHostInstance, UINT32 ExtCmdIndex, UINT32 Value)
 
STATIC EFI_STATUS EFIAPI EmmcIdentificationMode (IN MMC_HOST_INSTANCE *MmcHostInstance, IN OCR_RESPONSE Response)
 
STATIC EFI_STATUS InitializeEmmcDevice (IN MMC_HOST_INSTANCE *MmcHostInstance)
 
STATIC UINT32 CreateSwitchCmdArgument (IN UINT32 Mode, IN UINT8 Group, IN UINT8 Value)
 
STATIC EFI_STATUS InitializeSdMmcDevice (IN MMC_HOST_INSTANCE *MmcHostInstance)
 
STATIC EFI_STATUS EFIAPI MmcIdentificationMode (IN MMC_HOST_INSTANCE *MmcHostInstance)
 
EFI_STATUS InitializeMmcDevice (IN MMC_HOST_INSTANCE *MmcHostInstance)
 

Variables

UINT32 mEmmcRcaCount = 0
 

Detailed Description

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

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

Definition in file MmcIdentification.c.

Macro Definition Documentation

◆ CMD_RETRY_COUNT

#define CMD_RETRY_COUNT   20

Definition at line 21 of file MmcIdentification.c.

◆ DEVICE_STATE

#define DEVICE_STATE (   x)    (((x) >> 9) & 0xf)

Definition at line 47 of file MmcIdentification.c.

◆ EMMC_BUS_WIDTH_1BIT

#define EMMC_BUS_WIDTH_1BIT   0

Definition at line 34 of file MmcIdentification.c.

◆ EMMC_BUS_WIDTH_4BIT

#define EMMC_BUS_WIDTH_4BIT   1

Definition at line 35 of file MmcIdentification.c.

◆ EMMC_BUS_WIDTH_8BIT

#define EMMC_BUS_WIDTH_8BIT   2

Definition at line 36 of file MmcIdentification.c.

◆ EMMC_BUS_WIDTH_DDR_4BIT

#define EMMC_BUS_WIDTH_DDR_4BIT   5

Definition at line 37 of file MmcIdentification.c.

◆ EMMC_BUS_WIDTH_DDR_8BIT

#define EMMC_BUS_WIDTH_DDR_8BIT   6

Definition at line 38 of file MmcIdentification.c.

◆ EMMC_CARD_SIZE

#define EMMC_CARD_SIZE   512

Definition at line 23 of file MmcIdentification.c.

◆ EMMC_ECSD_SIZE_OFFSET

#define EMMC_ECSD_SIZE_OFFSET   53

Definition at line 24 of file MmcIdentification.c.

◆ EMMC_SWITCH_ERROR

#define EMMC_SWITCH_ERROR   (1 << 7)

Definition at line 40 of file MmcIdentification.c.

◆ EMMC_TIMING_BACKWARD

#define EMMC_TIMING_BACKWARD   0

Definition at line 29 of file MmcIdentification.c.

◆ EMMC_TIMING_HS

#define EMMC_TIMING_HS   1

Definition at line 30 of file MmcIdentification.c.

◆ EMMC_TIMING_HS200

#define EMMC_TIMING_HS200   2

Definition at line 31 of file MmcIdentification.c.

◆ EMMC_TIMING_HS400

#define EMMC_TIMING_HS400   3

Definition at line 32 of file MmcIdentification.c.

◆ EXTCSD_BUS_WIDTH

#define EXTCSD_BUS_WIDTH   183

Definition at line 26 of file MmcIdentification.c.

◆ EXTCSD_HS_TIMING

#define EXTCSD_HS_TIMING   185

Definition at line 27 of file MmcIdentification.c.

◆ MAX_RETRY_COUNT

#define MAX_RETRY_COUNT   1000

Definition at line 20 of file MmcIdentification.c.

◆ RCA_SHIFT_OFFSET

#define RCA_SHIFT_OFFSET   16

Definition at line 22 of file MmcIdentification.c.

◆ SD_BUS_WIDTH_1BIT

#define SD_BUS_WIDTH_1BIT   (1 << 0)

Definition at line 42 of file MmcIdentification.c.

◆ SD_BUS_WIDTH_4BIT

#define SD_BUS_WIDTH_4BIT   (1 << 2)

Definition at line 43 of file MmcIdentification.c.

◆ SD_CCC_SWITCH

#define SD_CCC_SWITCH   (1 << 10)

Definition at line 45 of file MmcIdentification.c.

Enumeration Type Documentation

◆ _EMMC_DEVICE_STATE

enum _EMMC_DEVICE_STATE

Definition at line 48 of file MmcIdentification.c.

Function Documentation

◆ CreateSwitchCmdArgument()

STATIC UINT32 CreateSwitchCmdArgument ( IN UINT32  Mode,
IN UINT8  Group,
IN UINT8  Value 
)

Definition at line 328 of file MmcIdentification.c.

◆ EmmcGetDeviceState()

STATIC EFI_STATUS EFIAPI EmmcGetDeviceState ( IN MMC_HOST_INSTANCE MmcHostInstance,
OUT EMMC_DEVICE_STATE *  State 
)

Definition at line 67 of file MmcIdentification.c.

◆ EmmcIdentificationMode()

STATIC EFI_STATUS EFIAPI EmmcIdentificationMode ( IN MMC_HOST_INSTANCE MmcHostInstance,
IN OCR_RESPONSE  Response 
)

Definition at line 141 of file MmcIdentification.c.

◆ EmmcSetEXTCSD()

STATIC EFI_STATUS EFIAPI EmmcSetEXTCSD ( IN MMC_HOST_INSTANCE MmcHostInstance,
UINT32  ExtCmdIndex,
UINT32  Value 
)

Definition at line 106 of file MmcIdentification.c.

◆ InitializeEmmcDevice()

STATIC EFI_STATUS InitializeEmmcDevice ( IN MMC_HOST_INSTANCE MmcHostInstance)

Definition at line 259 of file MmcIdentification.c.

◆ InitializeMmcDevice()

EFI_STATUS InitializeMmcDevice ( IN MMC_HOST_INSTANCE MmcHostInstance)

Definition at line 785 of file MmcIdentification.c.

◆ InitializeSdMmcDevice()

STATIC EFI_STATUS InitializeSdMmcDevice ( IN MMC_HOST_INSTANCE MmcHostInstance)

Definition at line 345 of file MmcIdentification.c.

◆ MmcIdentificationMode()

STATIC EFI_STATUS EFIAPI MmcIdentificationMode ( IN MMC_HOST_INSTANCE MmcHostInstance)

Definition at line 542 of file MmcIdentification.c.

Variable Documentation

◆ mEmmcRcaCount

UINT32 mEmmcRcaCount = 0

Definition at line 62 of file MmcIdentification.c.