[edk2-devel] [PATCH 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency
Jeremy Linton
jeremy.linton at arm.com
Mon Dec 14 23:23:48 UTC 2020
The firmware reports the emmc2 frequency with a slightly
different mailbox command, lets select the correct one
based on which controller we are binding to.
Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
.../RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c
index a7b538a91a..b0f03cefc9 100644
--- a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c
+++ b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c
@@ -250,7 +250,11 @@ CalculateClockFrequencyDivisor (
UINT32 Divisor;
UINT32 BaseFrequency = 0;
- Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseFrequency);
+ if (PcdGet32 (PcdSdIsArasan)) {
+ Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseFrequency);
+ } else {
+ Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC2, &BaseFrequency);
+ }
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Couldn't get RPI_MBOX_CLOCK_RATE_EMMC\n"));
return Status;
@@ -472,8 +476,8 @@ MMCNotifyState (
switch (State) {
case MmcHwInitializationState:
{
- EFI_STATUS Status;
- UINT32 Divisor;
+
+ DEBUG ((DEBUG_MMCHOST_SD, "ArasanMMCHost: current divisor %x\n", MmioRead32(MMCHS_SYSCTL)));
Status = SoftReset (SRA);
if (EFI_ERROR (Status)) {
--
2.13.7
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68817): https://edk2.groups.io/g/devel/message/68817
Mute This Topic: https://groups.io/mt/78964894/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list