/* Get the target bus width to be set on the bus. */
UINT8 EmmcGetTargetBusWidth(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
/* Get the target bus width to be set on the bus. */
UINT8 EmmcGetTargetBusWidth(IN SD_MMC_HC_PRIVATE_DATA *Private, IN UINT8 SlotIndex, IN EMMC_EXT_CSD *ExtCsd, IN SD_MMC_BUS_MODE BusTiming)
{
  UINT8  BusWidth;
  UINT8  PreferredBusWidth;
  PreferredBusWidth = Private->Slot[SlotIndex].OperatingParameters.BusWidth;
  if ((PreferredBusWidth != EDKII_SD_MMC_BUS_WIDTH_IGNORE) &&
      EmmcIsBusWidthSupported (Private, SlotIndex, BusTiming, PreferredBusWidth))
  {
    BusWidth = PreferredBusWidth;
  } else if (EmmcIsBusWidthSupported (Private, SlotIndex, BusTiming, 8)) {
    BusWidth = 8;
  } else if (EmmcIsBusWidthSupported (Private, SlotIndex, BusTiming, 4)) {
    BusWidth = 4;
  } else {
    BusWidth = 1;
  }
  return BusWidth;
}