Lines Matching refs:Status
78 EFI_STATUS Status; in EmmcGetDeviceState() local
87 Status = Host->SendCommand (Host, MMC_CMD13, RCA); in EmmcGetDeviceState()
88 if (EFI_ERROR (Status)) { in EmmcGetDeviceState()
89 DEBUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to get card status, Status=%r.\n", Status)); in EmmcGetDeviceState()
90 return Status; in EmmcGetDeviceState()
92 Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R1, &Data); in EmmcGetDeviceState()
93 if (EFI_ERROR (Status)) { in EmmcGetDeviceState()
94 …BUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to get response of CMD13, Status=%r.\n", Status)); in EmmcGetDeviceState()
95 return Status; in EmmcGetDeviceState()
98 …EBUG ((EFI_D_ERROR, "EmmcGetDeviceState(): Failed to switch expected mode, Status=%r.\n", Status)); in EmmcGetDeviceState()
116 EFI_STATUS Status; in EmmcSetEXTCSD() local
122 Status = Host->SendCommand (Host, MMC_CMD6, Argument); in EmmcSetEXTCSD()
123 if (EFI_ERROR (Status)) { in EmmcSetEXTCSD()
124 DEBUG ((EFI_D_ERROR, "EmmcSetEXTCSD(): Failed to send CMD6, Status=%r.\n", Status)); in EmmcSetEXTCSD()
125 return Status; in EmmcSetEXTCSD()
129 Status = EmmcGetDeviceState (MmcHostInstance, &State); in EmmcSetEXTCSD()
130 if (EFI_ERROR (Status)) { in EmmcSetEXTCSD()
131 DEBUG ((EFI_D_ERROR, "EmmcSetEXTCSD(): Failed to get device state, Status=%r.\n", Status)); in EmmcSetEXTCSD()
132 return Status; in EmmcSetEXTCSD()
148 EFI_STATUS Status; in EmmcIdentificationMode() local
156 Status = Host->SendCommand (Host, MMC_CMD2, 0); in EmmcIdentificationMode()
157 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
158 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD2, Status=%r.\n", Status)); in EmmcIdentificationMode()
159 return Status; in EmmcIdentificationMode()
162 …Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.… in EmmcIdentificationMode()
163 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
164 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CID retrieval error, Status=%r.\n", Status)); in EmmcIdentificationMode()
165 return Status; in EmmcIdentificationMode()
171 Status = Host->SendCommand (Host, MMC_CMD3, RCA); in EmmcIdentificationMode()
172 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
173 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): RCA set error, Status=%r.\n", Status)); in EmmcIdentificationMode()
174 return Status; in EmmcIdentificationMode()
178 Status = Host->SendCommand (Host, MMC_CMD9, RCA); in EmmcIdentificationMode()
179 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
180 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD9, Status=%r.\n", Status)); in EmmcIdentificationMode()
181 return Status; in EmmcIdentificationMode()
184 …Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.… in EmmcIdentificationMode()
185 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
186 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CSD retrieval error, Status=%r.\n", Status)); in EmmcIdentificationMode()
187 return Status; in EmmcIdentificationMode()
191 Status = Host->SendCommand (Host, MMC_CMD7, RCA); in EmmcIdentificationMode()
192 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
193 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Card selection error, Status=%r.\n", Status)); in EmmcIdentificationMode()
198 Status = Host->SetIos (Host, 0, 1, EMMCBACKWARD); in EmmcIdentificationMode()
199 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
200 …DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Set 1-bit bus width error, Status=%r.\n", Status)); in EmmcIdentificationMode()
201 return Status; in EmmcIdentificationMode()
205 Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_1BIT); in EmmcIdentificationMode()
206 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
207 …EBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Set extcsd bus width error, Status=%r.\n", Status)); in EmmcIdentificationMode()
208 return Status; in EmmcIdentificationMode()
213 Status = Host->SendCommand (Host, MMC_CMD8, RCA); in EmmcIdentificationMode()
214 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
215 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status)); in EmmcIdentificationMode()
218 Status = Host->ReadBlockData (Host, 0, 512, (UINT32 *)&(MmcHostInstance->CardInfo.ECSDData)); in EmmcIdentificationMode()
219 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
220 DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status)); in EmmcIdentificationMode()
221 return Status; in EmmcIdentificationMode()
226 Status = EmmcGetDeviceState (MmcHostInstance, &State); in EmmcIdentificationMode()
227 if (EFI_ERROR (Status)) { in EmmcIdentificationMode()
228 …EBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to get device state, Status=%r.\n", Status)); in EmmcIdentificationMode()
229 return Status; in EmmcIdentificationMode()
255 EFI_STATUS Status = EFI_SUCCESS; in InitializeEmmcDevice() local
268 Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_HS_TIMING, EMMC_TIMING_HS); in InitializeEmmcDevice()
269 if (EFI_ERROR (Status)) { in InitializeEmmcDevice()
270 … ((DEBUG_ERROR, "InitializeEmmcDevice(): Failed to switch high speed mode, Status:%r.\n", Status)); in InitializeEmmcDevice()
271 return Status; in InitializeEmmcDevice()
287 Status = Host->SetIos (Host, BusClockFreq, 8, TimingMode[Idx]); in InitializeEmmcDevice()
288 if (!EFI_ERROR (Status)) { in InitializeEmmcDevice()
289 Status = EmmcSetEXTCSD (MmcHostInstance, EXTCSD_BUS_WIDTH, EMMC_BUS_WIDTH_DDR_8BIT); in InitializeEmmcDevice()
290 if (EFI_ERROR (Status)) { in InitializeEmmcDevice()
291 …BUG ((DEBUG_ERROR, "InitializeEmmcDevice(): Failed to set EXTCSD bus width, Status:%r\n", Status)); in InitializeEmmcDevice()
293 return Status; in InitializeEmmcDevice()
296 return Status; in InitializeEmmcDevice()
313 EFI_STATUS Status; in InitializeSdMmcDevice() local
320 Status = MmcHost->SendCommand (MmcHost, MMC_CMD9, CmdArg); in InitializeSdMmcDevice()
321 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
322 DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD9): Error, Status=%r\n", Status)); in InitializeSdMmcDevice()
323 return Status; in InitializeSdMmcDevice()
327 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CSD, Response); in InitializeSdMmcDevice()
328 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
329 DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(): Failed to receive CSD, Status=%r\n", Status)); in InitializeSdMmcDevice()
330 return Status; in InitializeSdMmcDevice()
362 Status = MmcHost->SendCommand (MmcHost, MMC_CMD7, CmdArg); in InitializeSdMmcDevice()
363 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
364 DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD7): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
365 return Status; in InitializeSdMmcDevice()
368 Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg); in InitializeSdMmcDevice()
369 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
370 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD55): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
371 return Status; in InitializeSdMmcDevice()
373 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1, Response); in InitializeSdMmcDevice()
374 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
375 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD55): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
376 return Status; in InitializeSdMmcDevice()
383 Status = MmcHost->SendCommand (MmcHost, MMC_ACMD51, 0); in InitializeSdMmcDevice()
384 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
385 DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): Error and Status = %r\n", __func__, Status)); in InitializeSdMmcDevice()
386 return Status; in InitializeSdMmcDevice()
388 Status = MmcHost->ReadBlockData (MmcHost, 0, 8, Buffer); in InitializeSdMmcDevice()
389 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
390 … DEBUG ((EFI_D_ERROR, "%a(MMC_ACMD51): ReadBlockData Error and Status = %r\n", __func__, Status)); in InitializeSdMmcDevice()
391 return Status; in InitializeSdMmcDevice()
425 Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, CmdArg); in InitializeSdMmcDevice()
426 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
427 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD6): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
428 return Status; in InitializeSdMmcDevice()
430 Status = MmcHost->ReadBlockData (MmcHost, 0, 64, Buffer); in InitializeSdMmcDevice()
431 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
432 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD6): ReadBlockData Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
433 return Status; in InitializeSdMmcDevice()
439 Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, CmdArg); in InitializeSdMmcDevice()
440 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
441 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD55): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
442 return Status; in InitializeSdMmcDevice()
445 Status = MmcHost->SendCommand (MmcHost, MMC_CMD6, 2); in InitializeSdMmcDevice()
446 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
447 DEBUG ((EFI_D_ERROR, "%a(MMC_CMD6): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
448 return Status; in InitializeSdMmcDevice()
452 Status = MmcHost->SetIos (MmcHost, 26 * 1000 * 1000, 4, EMMCBACKWARD); in InitializeSdMmcDevice()
453 if (EFI_ERROR (Status)) { in InitializeSdMmcDevice()
454 DEBUG ((EFI_D_ERROR, "%a(SetIos): Error and Status = %r\n", Status)); in InitializeSdMmcDevice()
455 return Status; in InitializeSdMmcDevice()
468 EFI_STATUS Status; in MmcIdentificationMode() local
487 Status = MmcNotifyState (MmcHostInstance, MmcHwInitializationState); in MmcIdentificationMode()
488 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
489 … ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcHwInitializationState, Status=%r.\n", Status)); in MmcIdentificationMode()
490 return Status; in MmcIdentificationMode()
494 Status = MmcHost->SendCommand (MmcHost, MMC_CMD0, 0); in MmcIdentificationMode()
495 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
496 DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD0): Error, Status=%r.\n", Status)); in MmcIdentificationMode()
497 return Status; in MmcIdentificationMode()
499 Status = MmcNotifyState (MmcHostInstance, MmcIdleState); in MmcIdentificationMode()
500 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
501 DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdleState, Status=%r.\n", Status)); in MmcIdentificationMode()
502 return Status; in MmcIdentificationMode()
509 Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, EMMC_CMD1_CAPACITY_GREATER_THAN_2GB); in MmcIdentificationMode()
510 if (EFI_ERROR (Status)) in MmcIdentificationMode()
512 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse); in MmcIdentificationMode()
513 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
514 … DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status)); in MmcIdentificationMode()
515 return Status; in MmcIdentificationMode()
519 if (Status == EFI_SUCCESS) { in MmcIdentificationMode()
521 …FI_D_ERROR, "MmcIdentificationMode(MMC_CMD1): Card initialisation failure, Status=%r.\n", Status)); in MmcIdentificationMode()
539 Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0); in MmcIdentificationMode()
540 if (Status == EFI_SUCCESS) { in MmcIdentificationMode()
541 …EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD5): Error - SDIO not supported, Status=%r.\n", Status)); in MmcIdentificationMode()
547 Status = MmcHost->SendCommand (MmcHost, MMC_CMD8, CmdArg); in MmcIdentificationMode()
548 if (Status == EFI_SUCCESS) { in MmcIdentificationMode()
551 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R7, Response); in MmcIdentificationMode()
552 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
553 …FI_D_ERROR, "MmcIdentificationMode() : Failed to receive response to CMD8, Status=%r.\n", Status)); in MmcIdentificationMode()
554 return Status; in MmcIdentificationMode()
570 Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, 0); in MmcIdentificationMode()
571 if (Status == EFI_SUCCESS) { in MmcIdentificationMode()
584 Status = MmcHost->SendCommand (MmcHost, MMC_ACMD41, CmdArg); in MmcIdentificationMode()
585 if (!EFI_ERROR (Status)) { in MmcIdentificationMode()
586 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response); in MmcIdentificationMode()
587 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
588 … DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status)); in MmcIdentificationMode()
589 return Status; in MmcIdentificationMode()
597 Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, 0x800000); in MmcIdentificationMode()
598 if (!EFI_ERROR (Status)) { in MmcIdentificationMode()
599 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response); in MmcIdentificationMode()
600 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
601 … DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status)); in MmcIdentificationMode()
602 return Status; in MmcIdentificationMode()
608 if (!EFI_ERROR (Status)) { in MmcIdentificationMode()
632 Status = MmcNotifyState (MmcHostInstance, MmcReadyState); in MmcIdentificationMode()
633 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
635 return Status; in MmcIdentificationMode()
638 Status = MmcHost->SendCommand (MmcHost, MMC_CMD2, 0); in MmcIdentificationMode()
639 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
641 return Status; in MmcIdentificationMode()
643 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CID, Response); in MmcIdentificationMode()
644 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
645 DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive CID, Status=%r.\n", Status)); in MmcIdentificationMode()
646 return Status; in MmcIdentificationMode()
651 Status = MmcHost->NotifyState (MmcHost, MmcIdentificationState); in MmcIdentificationMode()
652 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
654 return Status; in MmcIdentificationMode()
663 Status = MmcHost->SendCommand (MmcHost, MMC_CMD3, CmdArg); in MmcIdentificationMode()
664 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
666 return Status; in MmcIdentificationMode()
669 Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_RCA, Response); in MmcIdentificationMode()
670 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
671 DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive RCA, Status=%r.\n", Status)); in MmcIdentificationMode()
672 return Status; in MmcIdentificationMode()
682 Status = MmcNotifyState (MmcHostInstance, MmcStandByState); in MmcIdentificationMode()
683 if (EFI_ERROR (Status)) { in MmcIdentificationMode()
685 return Status; in MmcIdentificationMode()
696 EFI_STATUS Status; in InitializeMmcDevice() local
703 Status = MmcIdentificationMode (MmcHostInstance); in InitializeMmcDevice()
704 if (EFI_ERROR (Status)) { in InitializeMmcDevice()
705 … DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error in Identification Mode, Status=%r\n", Status)); in InitializeMmcDevice()
706 return Status; in InitializeMmcDevice()
709 Status = MmcNotifyState (MmcHostInstance, MmcTransferState); in InitializeMmcDevice()
710 if (EFI_ERROR (Status)) { in InitializeMmcDevice()
711 DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error MmcTransferState, Status=%r\n", Status)); in InitializeMmcDevice()
712 return Status; in InitializeMmcDevice()
716 Status = InitializeSdMmcDevice (MmcHostInstance); in InitializeMmcDevice()
718 Status = InitializeEmmcDevice (MmcHostInstance); in InitializeMmcDevice()
720 if (EFI_ERROR (Status)) { in InitializeMmcDevice()
721 return Status; in InitializeMmcDevice()
725 Status = MmcHost->SendCommand (MmcHost, MMC_CMD16, MmcHostInstance->BlockIo.Media->BlockSize); in InitializeMmcDevice()
726 if (EFI_ERROR (Status)) { in InitializeMmcDevice()
728 MmcHostInstance->BlockIo.Media->BlockSize, Status)); in InitializeMmcDevice()
729 return Status; in InitializeMmcDevice()
734 Status = MmcHost->SendCommand (MmcHost, MMC_CMD23, BlockCount); in InitializeMmcDevice()
735 if (EFI_ERROR (Status)) { in InitializeMmcDevice()
736 DEBUG((EFI_D_ERROR, "InitializeMmcDevice(MMC_CMD23): Error, Status=%r\n", Status)); in InitializeMmcDevice()
737 return Status; in InitializeMmcDevice()