/* Refer to SD Host Controller Simplified spec 3.0 Section 3.2.2 for details. */
EFI_STATUS EmmcPeimHcStopClock(IN UINTN Bar)
/* Refer to SD Host Controller Simplified spec 3.0 Section 3.2.2 for details. */
EFI_STATUS EmmcPeimHcStopClock(IN UINTN Bar)
{
  EFI_STATUS  Status;
  UINT32      PresentState;
  UINT16      ClockCtrl;
  Status = EmmcPeimHcWaitMmioSet (
             Bar + EMMC_HC_PRESENT_STATE,
             sizeof (PresentState),
             BIT0 | BIT1,
             0,
             EMMC_TIMEOUT
             );
  if (EFI_ERROR (Status)) {
    return Status;
  }
  ClockCtrl = (UINT16) ~BIT2;
  Status    = EmmcPeimHcAndMmio (Bar + EMMC_HC_CLOCK_CTRL, sizeof (ClockCtrl), &ClockCtrl);
  return Status;
}