[edk2-devel] [PATCH 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs

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


Could we rework some of these magic constants? Esp the SetPowerState ones.

Do we need both EMMC and EMMC2 clocks enabled all the time?

A
________________________________
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 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs

It seems we should be powering up the sd cards, and possibly
the clocks as well to assure they are setup properly before
we attempt to access the controller.

Signed-off-by: Jeremy Linton <jeremy.linton at arm.com>
---
 Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
index 28f57438c5..8829740938 100644
--- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
+++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
@@ -552,6 +552,15 @@ ApplyVariables (
       GpioPinFuncSet (37, GPIO_FSEL_ALT3);

       GpioPinFuncSet (38, GPIO_FSEL_ALT3);

       GpioPinFuncSet (39, GPIO_FSEL_ALT3);

+

+      /*

+       * power and clock everything by default

+       */

+      Status = mFwProtocol->SetPowerState (0, 1, 1); //SD on

+      Status = mFwProtocol->SetGpioConfig (RPI_EXP_GPIO_SD_VOLT,

+                                           RPI_EXP_GPIO_DIR_OUT, 1); //3.3v

+      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC2, 1);

+      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC, 1);

     }

   } else {

     DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamily));

--
2.13.7



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68818): https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F68818&data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MYuBr4R6LYw8l3pWORpmGzLTyvljJCffHUODVQk%2BjxQ%3D&reserved=0
Mute This Topic: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964895%2F4387333&data=04%7C01%7Cawarkentin%40vmware.com%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=MRu43d1ZNnFvGE3K9JJCXIUXvE2bZ6xWUzWtVxkNf7E%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%7C09a7a2483d704affef4e08d8a0875810%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637435850454110853%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5g23ev8pYF4L%2B2rNNABCccLjr1VMPZ1nfbV%2BfUlwqmU%3D&reserved=0 [awarkentin at vmware.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#68876): https://edk2.groups.io/g/devel/message/68876
Mute This Topic: https://groups.io/mt/78964895/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/86e265dd/attachment.htm>


More information about the edk2-devel-archive mailing list