diff options
author | Marcin Wojtas <mw@semihalf.com> | 2017-09-27 19:05:35 +0200 |
---|---|---|
committer | Leif Lindholm <leif@developerbox> | 2017-10-29 16:47:41 +0000 |
commit | 20f6f144d3a8ece26f2970220b6a2b09c9fa2613 (patch) | |
tree | 9de46c25e2c075b846c4d278d07f44726d9ffe8c /Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c | |
parent | ed226a5d4ee8fb93f9e2a054e6905e99c70bf50c (diff) | |
download | edk2-platforms-20f6f144d3a8ece26f2970220b6a2b09c9fa2613.tar.xz |
Marvell/Drivers: XenonDxe: Allow overriding base clock frequency
Some SdMmc host controllers are run by clocks with different
frequency than it is reflected in Capabilities Register 1.
Because the bitfield is only 8 bits wide, a maximum value
that could be obtained from hardware is 255(MHz).
In case the actual frequency exceeds 255MHz, the 8-bit BaseClkFreq
member of SD_MMC_HC_SLOT_CAP structure occurs to be not sufficient
to be used for setting the clock speed in SdMmcHcClockSupply
function.
This patch adds new UINT32 array ('BaseClkFreq[]') to
SD_MMC_HC_PRIVATE_DATA structure for specifying
the input clock speed for each slot of the host controller.
All routines that are used for clock configuration are
updated accordingly.
Thanks to above the Xenon host controller driver
could be modified to configure clock speed relatively
to actual 400MHz input.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c')
-rwxr-xr-x | Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c b/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c index 4d4833fb58..530a01ccdc 100755 --- a/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c +++ b/Platform/Marvell/Drivers/SdMmc/XenonDxe/EmmcDevice.c @@ -705,7 +705,7 @@ EmmcSwitchClockFreq ( //
// Convert the clock freq unit from MHz to KHz.
//
- Status = SdMmcHcClockSupply (PciIo, Slot, ClockFreq * 1000, Private->Capability[Slot]);
+ Status = SdMmcHcClockSupply (PciIo, Slot, ClockFreq * 1000, Private->BaseClkFreq[Slot]);
return Status;
}
@@ -1007,7 +1007,7 @@ EmmcSetBusMode ( return Status;
}
- ASSERT (Private->Capability[Slot].BaseClkFreq != 0);
+ ASSERT (Private->BaseClkFreq[Slot] != 0);
//
// Check if the Host Controller support 8bits bus width.
//
|