<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">Could we rework some of these magic constants? Esp the SetPowerState ones.</div>
<div style="margin:0px;font-size:12pt"><br>
</div>
<div style="margin:0px;font-size:12pt">Do we need both EMMC and EMMC2 clocks enabled all the time?</div>
<div style="margin:0px;font-size:12pt"><br>
</div>
<div style="margin:0px;font-size:12pt">A</div>
</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 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">It seems we should be powering up the sd cards, and possibly<br>
the clocks as well to assure they are setup properly before<br>
we attempt to access the controller.<br>
<br>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com><br>
---<br>
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 9 +++++++++<br>
 1 file changed, 9 insertions(+)<br>
<br>
diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c<br>
index 28f57438c5..8829740938 100644<br>
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c<br>
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c<br>
@@ -552,6 +552,15 @@ ApplyVariables (<br>
       GpioPinFuncSet (37, GPIO_FSEL_ALT3);<br>
<br>
       GpioPinFuncSet (38, GPIO_FSEL_ALT3);<br>
<br>
       GpioPinFuncSet (39, GPIO_FSEL_ALT3);<br>
<br>
+<br>
<br>
+      /*<br>
<br>
+       * power and clock everything by default<br>
<br>
+       */<br>
<br>
+      Status = mFwProtocol->SetPowerState (0, 1, 1); //SD on<br>
<br>
+      Status = mFwProtocol->SetGpioConfig (RPI_EXP_GPIO_SD_VOLT, <br>
<br>
+                                           RPI_EXP_GPIO_DIR_OUT, 1); //3.3v<br>
<br>
+      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC2, 1);<br>
<br>
+      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC, 1);<br>
<br>
     }<br>
<br>
   } else {<br>
<br>
     DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamily));<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 (#68818): <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68818&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MYuBr4R6LYw8l3pWORpmGzLTyvljJCffHUODVQk%2BjxQ%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68818&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MYuBr4R6LYw8l3pWORpmGzLTyvljJCffHUODVQk%2BjxQ%3D&amp;reserved=0</a><br>
Mute This Topic: <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964895%2F4387333&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MRu43d1ZNnFvGE3K9JJCXIUXvE2bZ6xWUzWtVxkNf7E%3D&amp;reserved=0">
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964895%2F4387333&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=MRu43d1ZNnFvGE3K9JJCXIUXvE2bZ6xWUzWtVxkNf7E%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%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5g23ev8pYF4L%2B2rNNABCccLjr1VMPZ1nfbV%2BfUlwqmU%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%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=5g23ev8pYF4L%2B2rNNABCccLjr1VMPZ1nfbV%2BfUlwqmU%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/68876">View/Reply Online (#68876)</a> |    |  <a target="_blank" href="https://groups.io/mt/78964895/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>