/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details. */
EFI_STATUS EmmcPeimGetOcr(IN EMMC_PEIM_HC_SLOT *Slot, IN OUT UINT32 *Argument)
/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.4 for details. */
EFI_STATUS EmmcPeimGetOcr(IN EMMC_PEIM_HC_SLOT *Slot, IN OUT UINT32 *Argument)
{
  EMMC_COMMAND_BLOCK   EmmcCmdBlk;
  EMMC_STATUS_BLOCK    EmmcStatusBlk;
  EMMC_COMMAND_PACKET  Packet;
  EFI_STATUS           Status;
  ZeroMem (&EmmcCmdBlk, sizeof (EmmcCmdBlk));
  ZeroMem (&EmmcStatusBlk, sizeof (EmmcStatusBlk));
  ZeroMem (&Packet, sizeof (Packet));
  Packet.EmmcCmdBlk    = &EmmcCmdBlk;
  Packet.EmmcStatusBlk = &EmmcStatusBlk;
  Packet.Timeout       = EMMC_TIMEOUT;
  EmmcCmdBlk.CommandIndex    = EMMC_SEND_OP_COND;
  EmmcCmdBlk.CommandType     = EmmcCommandTypeBcr;
  EmmcCmdBlk.ResponseType    = EmmcResponceTypeR3;
  EmmcCmdBlk.CommandArgument = *Argument;
  Status = EmmcPeimExecCmd (Slot, &Packet);
  if (!EFI_ERROR (Status)) {
    *Argument = EmmcStatusBlk.Resp0;
  }
  return Status;
}