summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg/Drivers
diff options
context:
space:
mode:
authorJun Nie <jun.nie@linaro.org>2017-07-05 16:27:07 +0800
committerLeif Lindholm <leif.lindholm@linaro.org>2017-07-17 17:54:06 +0100
commitd4102f68dceb36fa8f07af9fa3d24b0da9f173bf (patch)
treef4b56f8f536c6cd03173e7800309f345304a7761 /EmbeddedPkg/Drivers
parentd4f6c35c84b8503bc2acde89a7adb7ee05c56516 (diff)
downloadedk2-d4102f68dceb36fa8f07af9fa3d24b0da9f173bf.tar.gz
edk2-d4102f68dceb36fa8f07af9fa3d24b0da9f173bf.tar.bz2
edk2-d4102f68dceb36fa8f07af9fa3d24b0da9f173bf.zip
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>
Diffstat (limited to 'EmbeddedPkg/Drivers')
-rw-r--r--EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c4
-rw-r--r--EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf1
2 files changed, 5 insertions, 0 deletions
diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
index fe23d113ee..bb26b69fd1 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.c
@@ -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) {
diff --git a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf
index e3c8313bc5..99b4f990f6 100644
--- a/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf
+++ b/EmbeddedPkg/Drivers/DwEmmcDxe/DwEmmcDxe.inf
@@ -48,6 +48,7 @@
[Pcd]
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeBaseAddress
gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeClockFrequencyInHz
+ gEmbeddedTokenSpaceGuid.PcdDwEmmcDxeMaxClockFreqInHz
[Depex]
TRUE