/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.10.4 for details. */
EFI_STATUS EmmcPeimSwitch(IN EMMC_PEIM_HC_SLOT *Slot, IN UINT8 Access, IN UINT8 Index, IN UINT8 Value, IN UINT8 CmdSet)
/* Refer to EMMC Electrical Standard Spec 5.1 Section 6.10.4 for details. */
EFI_STATUS EmmcPeimSwitch(IN EMMC_PEIM_HC_SLOT *Slot, IN UINT8 Access, IN UINT8 Index, IN UINT8 Value, IN UINT8 CmdSet)
{
  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_SWITCH;
  EmmcCmdBlk.CommandType     = EmmcCommandTypeAc;
  EmmcCmdBlk.ResponseType    = EmmcResponceTypeR1b;
  EmmcCmdBlk.CommandArgument = (Access << 24) | (Index << 16) | (Value << 8) | CmdSet;
  Status = EmmcPeimExecCmd (Slot, &Packet);
  return Status;
}