mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/SdMmcPciHcDxe: Use BaseClk if the target clock is larger
The original code has a bug to calculate which clock freq should be used when the target clock freq is larger than the BaseClock Freq provided by the system. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
parent
c25ddd0134
commit
cb9cb9e2aa
|
@ -706,9 +706,14 @@ SdMmcHcClockSupply (
|
|||
ASSERT (Capability.BaseClkFreq != 0);
|
||||
|
||||
BaseClkFreq = Capability.BaseClkFreq;
|
||||
if ((ClockFreq > (BaseClkFreq * 1000)) || (ClockFreq == 0)) {
|
||||
if (ClockFreq == 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (ClockFreq > (BaseClkFreq * 1000)) {
|
||||
ClockFreq = BaseClkFreq * 1000;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate the divisor of base frequency.
|
||||
//
|
||||
|
|
|
@ -535,9 +535,15 @@ EmmcPeimHcClockSupply (
|
|||
ASSERT (Capability.BaseClkFreq != 0);
|
||||
|
||||
BaseClkFreq = Capability.BaseClkFreq;
|
||||
if ((ClockFreq > (BaseClkFreq * 1000)) || (ClockFreq == 0)) {
|
||||
|
||||
if (ClockFreq == 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (ClockFreq > (BaseClkFreq * 1000)) {
|
||||
ClockFreq = BaseClkFreq * 1000;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate the divisor of base frequency.
|
||||
//
|
||||
|
|
|
@ -535,9 +535,15 @@ SdPeimHcClockSupply (
|
|||
ASSERT (Capability.BaseClkFreq != 0);
|
||||
|
||||
BaseClkFreq = Capability.BaseClkFreq;
|
||||
if ((ClockFreq > (BaseClkFreq * 1000)) || (ClockFreq == 0)) {
|
||||
|
||||
if (ClockFreq == 0) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
if (ClockFreq > (BaseClkFreq * 1000)) {
|
||||
ClockFreq = BaseClkFreq * 1000;
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate the divisor of base frequency.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue