From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web12.15790.1609776507082782646 for ; Mon, 04 Jan 2021 08:08:27 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: jeremy.linton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EA861101E; Mon, 4 Jan 2021 08:08:25 -0800 (PST) Received: from [192.168.122.166] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE36D3F719; Mon, 4 Jan 2021 08:08:25 -0800 (PST) Subject: Re: [PATCH v2 6/9] Platform/RaspberryPi: Power up sd, and tweak GPIOs To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, andrey.warkentin@gmail.com, samer.el-haj-mahmoud@arm.com References: <20201215210045.1195658-1-jeremy.linton@arm.com> From: "Jeremy Linton" Message-ID: Date: Mon, 4 Jan 2021 10:08:17 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: <20201215210045.1195658-1-jeremy.linton@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Hi, On 12/15/20 3:00 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. Looks like this hasn't been merged yet. I sent this patch as a replacement for 6/9 in the original set, rather than resend the entire set. Would it help if I resent the entire series? Thanks, > > Signed-off-by: Jeremy Linton > --- > 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 > + */ > + 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)); >