public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jeremy Linton" <jeremy.linton@arm.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>, devel@edk2.groups.io
Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie,
	samer.el-haj-mahmoud@arm.com,
	Andrei Warkentin <awarkentin@vmware.com>
Subject: Re: [edk2-devel] [PATCH v3 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs
Date: Mon, 4 Jan 2021 22:35:44 -0600	[thread overview]
Message-ID: <513633f8-9ecb-ac55-28c9-2d53630d9244@arm.com> (raw)
In-Reply-To: <97584144-c3ac-8e91-83bd-2d63921bdc9d@redhat.com>

Hi,

On 1/4/21 12:44 PM, Philippe Mathieu-Daudé wrote:
> On 1/4/21 6:37 PM, Jeremy Linton wrote:
>> 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>
>> Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
>> ---
>>   Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
>> index 28f57438c5..e55ed63efa 100644
>> --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
>> +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c
>> @@ -552,6 +552,16 @@ ApplyVariables (
>>         GpioPinFuncSet (37, GPIO_FSEL_ALT3);
>>         GpioPinFuncSet (38, GPIO_FSEL_ALT3);
>>         GpioPinFuncSet (39, GPIO_FSEL_ALT3);
>> +
>> +      /*
>> +       * power and clock everything by default
> 
> Isn't this comment a bit exaggerated? You only power the minimum
> required to use the SD controller to access the card.

Maybe. Since I will be re-posting, maybe just dropping the comment is 
reasonable since the code is fairly self explanatory now.


> 
>> +       */
>> +      Status = mFwProtocol->SetPowerState (RPI_MBOX_POWER_STATE_SDHCI,
>> +                                           TRUE, TRUE); //SD on with wait
>> +      Status = mFwProtocol->SetGpioConfig (RPI_EXP_GPIO_SD_VOLT,
>> +                                           RPI_EXP_GPIO_DIR_OUT, TRUE); //3.3v
>> +      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC2, TRUE);
>> +      Status = mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC, TRUE);
>>       }
>>     } else {
>>       DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamily));
>>
> 


  reply	other threads:[~2021-01-05  4:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 17:37 [PATCH v3 0/7] Enable emmc2 controller rpi4 Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 1/7] Platform/RaspberryPi: Update VPU mailbox constants Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 2/7] Platform/RaspberryPi: Add further mailbox helpers Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 3/7] Platform/RaspberryPi: Split MMC register defintions Jeremy Linton
2021-01-04 18:41   ` [edk2-devel] " Philippe Mathieu-Daudé
2021-01-05  4:31     ` Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 4/7] Platform/RaspberryPi/Arasan: Add write delay and voltage/clock config Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency Jeremy Linton
2021-01-04 17:37 ` [PATCH v3 6/7] Platform/RaspberryPi: Power up sd, and tweak GPIOs Jeremy Linton
2021-01-04 18:44   ` [edk2-devel] " Philippe Mathieu-Daudé
2021-01-05  4:35     ` Jeremy Linton [this message]
2021-01-04 17:37 ` [PATCH v3 7/7] Platform/RaspberryPi: Correct device path removal Jeremy Linton

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=513633f8-9ecb-ac55-28c9-2d53630d9244@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