[edk2-devel] [PATCH 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency

Andrei Warkentin awarkentin at vmware.com
Tue Dec 15 18:18:44 UTC 2020


LGTM

Reviewed-by: Andrei Warkentin <awarkentin at vmware.com>

________________________________
From: devel at edk2.groups.io <devel at edk2.groups.io> on behalf of Jeremy Linton via groups.io <jeremy.linton=arm.com at groups.io>
Sent: Monday, December 14, 2020 5:23 PM
To: devel at edk2.groups.io <devel at edk2.groups.io>
Cc: ard.biesheuvel at arm.com <ard.biesheuvel at arm.com>; leif at nuviainc.com <leif at nuviainc.com>; pete at akeo.ie <pete at akeo.ie>; andrey.warkentin at gmail.com <andrey.warkentin at gmail.com>; samer.el-haj-mahmoud at arm.com <samer.el-haj-mahmoud at arm.com>; Jeremy Linton <jeremy.linton at arm.com>
Subject: [edk2-devel] [PATCH 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency

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://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68817&data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YxlrM8qbYHtMl1ULi3pTnHnJyyepSmSxsSc3hPnqdY8%3D&reserved=0
Mute This Topic: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964894%2F4387333&data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MFG8KdTLIf%2FzzP5taWbyHf94q%2FMd3CR%2B9l76FhBLlqg%3D&reserved=0
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=18%2F5sdBQAPKGtwJDGPqwqWmLpLQeWDVGm1PQmZp%2B%2BUM%3D&reserved=0 [awarkentin at vmware.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68874): https://edk2.groups.io/g/devel/message/68874
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]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20201215/b8d0fcf6/attachment.htm>


More information about the edk2-devel-archive mailing list