<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Consolas, Courier, monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<div style="margin:0px;font-size:12pt"><span style="margin:0px">LGTM</span><br>
</div>
<div style="margin:0px;font-size:12pt"><br>
</div>
<div style="margin:0px;font-size:12pt">Reviewed-by: Andrei Warkentin <awarkentin@vmware.com></div>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Jeremy Linton via groups.io <jeremy.linton=arm.com@groups.io><br>
<b>Sent:</b> Monday, December 14, 2020 5:23 PM<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> ard.biesheuvel@arm.com <ard.biesheuvel@arm.com>; leif@nuviainc.com <leif@nuviainc.com>; pete@akeo.ie <pete@akeo.ie>; andrey.warkentin@gmail.com <andrey.warkentin@gmail.com>; samer.el-haj-mahmoud@arm.com <samer.el-haj-mahmoud@arm.com>; Jeremy Linton
 <jeremy.linton@arm.com><br>
<b>Subject:</b> [edk2-devel] [PATCH 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The firmware reports the emmc2 frequency with a slightly<br>
different mailbox command, lets select the correct one<br>
based on which controller we are binding to.<br>
<br>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com><br>
---<br>
 .../RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c    | 10 +++++++---<br>
 1 file changed, 7 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c<br>
index a7b538a91a..b0f03cefc9 100644<br>
--- a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c<br>
+++ b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c<br>
@@ -250,7 +250,11 @@ CalculateClockFrequencyDivisor (<br>
   UINT32 Divisor;<br>
<br>
   UINT32 BaseFrequency = 0;<br>
<br>
 <br>
<br>
-  Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseFrequency);<br>
<br>
+  if (PcdGet32 (PcdSdIsArasan)) {<br>
<br>
+    Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseFrequency);<br>
<br>
+  } else {<br>
<br>
+    Status = mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC2, &BaseFrequency);<br>
<br>
+  }<br>
<br>
   if (EFI_ERROR (Status)) {<br>
<br>
     DEBUG ((DEBUG_ERROR, "Couldn't get RPI_MBOX_CLOCK_RATE_EMMC\n"));<br>
<br>
     return Status;<br>
<br>
@@ -472,8 +476,8 @@ MMCNotifyState (<br>
   switch (State) {<br>
<br>
   case MmcHwInitializationState:<br>
<br>
     {<br>
<br>
-      EFI_STATUS Status;<br>
<br>
-      UINT32 Divisor;<br>
<br>
+<br>
<br>
+      DEBUG ((DEBUG_MMCHOST_SD, "ArasanMMCHost: current divisor %x\n", MmioRead32(MMCHS_SYSCTL)));<br>
<br>
 <br>
<br>
       Status = SoftReset (SRA);<br>
<br>
       if (EFI_ERROR (Status)) {<br>
<br>
-- <br>
2.13.7<br>
<br>
<br>
<br>
-=-=-=-=-=-=<br>
Groups.io Links: You receive all messages sent to this group.<br>
View/Reply Online (#68817): <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68817&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=YxlrM8qbYHtMl1ULi3pTnHnJyyepSmSxsSc3hPnqdY8%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68817&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=YxlrM8qbYHtMl1ULi3pTnHnJyyepSmSxsSc3hPnqdY8%3D&amp;reserved=0</a><br>
Mute This Topic: <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964894%2F4387333&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MFG8KdTLIf%2FzzP5taWbyHf94q%2FMd3CR%2B9l76FhBLlqg%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964894%2F4387333&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MFG8KdTLIf%2FzzP5taWbyHf94q%2FMd3CR%2B9l76FhBLlqg%3D&amp;reserved=0</a><br>
Group Owner: devel+owner@edk2.groups.io<br>
Unsubscribe: <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=18%2F5sdBQAPKGtwJDGPqwqWmLpLQeWDVGm1PQmZp%2B%2BUM%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C3e52cf5f8620415a603f08d8a0875747%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850451597004%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=18%2F5sdBQAPKGtwJDGPqwqWmLpLQeWDVGm1PQmZp%2B%2BUM%3D&amp;reserved=0</a>
 [awarkentin@vmware.com]<br>
-=-=-=-=-=-=<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/68874">View/Reply Online (#68874)</a> |    |  <a target="_blank" href="https://groups.io/mt/78964894/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>