/* Get the target bus timing to set on the link. This function will try to select highest bus timing supported by card, controller and the driver. */
SD_MMC_BUS_MODE EmmcGetTargetBusTiming(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd)
/* Get the target bus timing to set on the link. This function will try to select highest bus timing supported by card, controller and the driver. */
SD_MMC_BUS_MODE EmmcGetTargetBusTiming(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd)
{
  SD_MMC_BUS_MODE  BusTiming;
  BusTiming = SdMmcMmcHs400;
  while (BusTiming > SdMmcMmcLegacy) {
    if (EmmcIsBusTimingSupported (Private, SlotIndex, ExtCsd, BusTiming)) {
      break;
    }
    BusTiming--;
  }
  return BusTiming;
}