/* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */
EFI_STATUS SdPeimSelect(IN SD_PEIM_HC_SLOT *Slot, IN UINT16 Rca)
/* Refer to SD Physical Layer Simplified Spec 4.1 Section 4.7 for details. */
EFI_STATUS SdPeimSelect(IN SD_PEIM_HC_SLOT *Slot, IN UINT16 Rca)
{
  SD_COMMAND_BLOCK   SdCmdBlk;
  SD_STATUS_BLOCK    SdStatusBlk;
  SD_COMMAND_PACKET  Packet;
  EFI_STATUS         Status;
  ZeroMem (&SdCmdBlk, sizeof (SdCmdBlk));
  ZeroMem (&SdStatusBlk, sizeof (SdStatusBlk));
  ZeroMem (&Packet, sizeof (Packet));
  Packet.SdCmdBlk    = &SdCmdBlk;
  Packet.SdStatusBlk = &SdStatusBlk;
  Packet.Timeout     = SD_TIMEOUT;
  SdCmdBlk.CommandIndex    = SD_SELECT_DESELECT_CARD;
  SdCmdBlk.CommandType     = SdCommandTypeAc;
  SdCmdBlk.ResponseType    = SdResponseTypeR1b;
  SdCmdBlk.CommandArgument = (UINT32)Rca << 16;
  Status = SdPeimExecCmd (Slot, &Packet);
  return Status;
}