return Status;\r
}\r
\r
- CmdArg = 0;\r
- CmdRetryCnt = CMD_RETRY_COUNT;\r
- //Keep sending CMD 3 until card enters to Standby mode and Card status is ready\r
- while((MMC_R0_CURRENTSTATE(Response) != MMC_R0_STATE_STDBY) && CmdRetryCnt--) {\r
- Status = MmcHost->SendCommand(MMC_CMD3, CmdArg);\r
- if (EFI_ERROR(Status)) {\r
- DEBUG((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));\r
- return Status;\r
- }\r
- MmcHost->ReceiveResponse(MMC_RESPONSE_TYPE_RCA,Response);\r
- PrintRCA(Response[0]);\r
+ //\r
+ // Note, SD specifications say that "if the command execution causes a state change, it\r
+ // will be visible to the host in the response to the next command"\r
+ // The status returned for this CMD3 will be 2 - identification\r
+ //\r
+ CmdArg = 1;\r
+ Status = MmcHost->SendCommand(MMC_CMD3, CmdArg);\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));\r
+ return Status;\r
}\r
\r
+ MmcHost->ReceiveResponse(MMC_RESPONSE_TYPE_RCA,Response);\r
+ PrintRCA(Response[0]);\r
+\r
// For MMC card, RCA is assigned by CMD3 while CMD3 dumps the RCA for SD card\r
if (MmcHostInstance->CardInfo.CardType != MMC_CARD) {\r
MmcHostInstance->CardInfo.RCA = Response[0] >> 16;\r