EmbeddedPkg/DwEmmcDxe: limit max clock for platform

Some boards may have max clock limitation. Add a Pcd to notify
driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jun Nie <jun.nie@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Jun Nie 2017-07-05 16:27:07 +08:00 committed by Leif Lindholm
parent d4f6c35c84
commit d4102f68dc
3 changed files with 6 additions and 0 deletions

View File

@ -560,6 +560,10 @@ DwEmmcSetIos (
EFI_STATUS Status = EFI_SUCCESS;
UINT32 Data;
if ((PcdGet32 (PcdDwEmmcDxeMaxClockFreqInHz) != 0) &&
(BusClockFreq > PcdGet32 (PcdDwEmmcDxeMaxClockFreqInHz))) {
return EFI_UNSUPPORTED;
}
if (TimingMode != EMMCBACKWARD) {
Data = MmioRead32 (DWEMMC_UHSREG);
switch (TimingMode) {

View File

@ -48,6 +48,7 @@
[Pcd]
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz
[Depex]
TRUE

View File

@ -167,6 +167,7 @@
# DwEmmc Driver PCDs
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress|0x0|UINT32|0x00000035
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz|0x0|UINT32|0x00000036
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz|0x0|UINT32|0x00000037
#
# Android FastBoot