public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeremy Linton" <jeremy.linton@arm.com>
To: Andrei Warkentin <awarkentin@vmware.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "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>
Subject: Re: [edk2-devel] [PATCH 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs
Date: Tue, 15 Dec 2020 14:15:34 -0600	[thread overview]
Message-ID: <d8665ae8-7565-05f6-6abc-b87b499c7fb3@arm.com> (raw)
In-Reply-To: <SJ0PR05MB7580AC02117660DC0FE1C1CEB9C60@SJ0PR05MB7580.namprd05.prod.outlook.com>

On 12/15/20 1:36 PM, Andrei Warkentin wrote:
> Reviewed-by: Andrey Warkentin <awarkentin@vmware.com>

Thanks,

To be clear i'm going to repost this one.


> ________________________________
> From: Jeremy Linton <jeremy.linton@arm.com>
> Sent: Tuesday, December 15, 2020 12:55 PM
> To: Andrei Warkentin <awarkentin@vmware.com>; devel@edk2.groups.io <devel@edk2.groups.io>
> Cc: 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>
> Subject: Re: [edk2-devel] [PATCH 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs
> 
> Hi,
> 
> On 12/15/20 12:21 PM, Andrei Warkentin wrote:
>> Could we rework some of these magic constants? Esp the SetPowerState ones.
> 
> Yes, I know from the mailbox description what the 1,1 do (on with
> wait?). But its clear as mud what the channel "0" really means. It seems
> to have varying definitions, from "power everything" to "power sd". So
> it may depend on model, but again, ugh, uboot is doing it.
> 
> 
>>
>> Do we need both EMMC and EMMC2 clocks enabled all the time?
> 
> I think so, not so much for edk2, but for the resulting OS. At least
> until we get AML to power on/enable them.
> 
> Which is sorta a todo at this point for the platform, we really should
> be supporting the ACPI power states and forwarding that info via mailbox
> commands.
> 
>>   > A
>> ________________________________
>> From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Jeremy Linton via groups.io <jeremy.linton=arm.com@groups.io>
>> Sent: Monday, December 14, 2020 5:23 PM
>> To: devel@edk2.groups.io <devel@edk2.groups.io>
>> Cc: 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>
>> 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@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&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C72669f70d63c494ac71408d8a12b1035%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637436553643223033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nSIj0mEg742NAcojf0oTDhWds2ZBoIJuQuvdo09sJzM%3D&amp;reserved=0
>> Mute This Topic: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F78964895%2F4387333&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C72669f70d63c494ac71408d8a12b1035%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637436553643223033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=ginptEm%2FCGAaCPtqLlmKqNMGEPWog3RhWBHuTh%2FIWG8%3D&amp;reserved=0
>> Group Owner: devel+owner@edk2.groups.io
>> Unsubscribe: https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&amp;data=04%7C01%7Cawarkentin%40vmware.com%7C72669f70d63c494ac71408d8a12b1035%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C637436553643223033%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=NzTgITb5uDBkEggkjmjXgfdp0XpHEhJ8o9g1cPbVDNE%3D&amp;reserved=0 [awarkentin@vmware.com]
>> -=-=-=-=-=-=
>>
>>
>>
> 
> 


  reply	other threads:[~2020-12-15 20:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 23:23 [PATCH 0/7] Enable emmc2 controller rpi4 Jeremy Linton
2020-12-14 23:23 ` [PATCH 1/7] Platform/RaspberryPi: Update VPU mailbox constants Jeremy Linton
2020-12-15 18:15   ` [edk2-devel] " Andrei Warkentin
2020-12-14 23:23 ` [PATCH 2/7] Platform/RaspberryPi: Add further mailbox helpers Jeremy Linton
2020-12-15 18:18   ` [edk2-devel] " Andrei Warkentin
2020-12-14 23:23 ` [PATCH 3/7] Platform/RaspberryPi: Split MMC register defintions Jeremy Linton
2020-12-15 18:17   ` [edk2-devel] " Andrei Warkentin
2020-12-14 23:23 ` [PATCH 4/7] Platform/RaspberryPi/Arasan: Add write delay and voltage/clock config Jeremy Linton
2020-12-15 18:26   ` [edk2-devel] " Andrei Warkentin
2020-12-15 18:46     ` Jeremy Linton
2020-12-15 18:52       ` Andrei Warkentin
2020-12-14 23:23 ` [PATCH 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency Jeremy Linton
2020-12-15 18:18   ` [edk2-devel] " Andrei Warkentin
2020-12-14 23:23 ` [PATCH 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs Jeremy Linton
2020-12-15 18:21   ` [edk2-devel] " Andrei Warkentin
2020-12-15 18:55     ` Jeremy Linton
2020-12-15 19:36       ` Andrei Warkentin
2020-12-15 20:15         ` Jeremy Linton [this message]
2020-12-14 23:23 ` [PATCH 7/7] Platform/RaspberryPi: Correct device path removal Jeremy Linton
2020-12-15 18:19   ` [edk2-devel] " Andrei Warkentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8665ae8-7565-05f6-6abc-b87b499c7fb3@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox