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.web10.380.1610086463715040161 for ; Thu, 07 Jan 2021 22:14:23 -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 5F0B3113E; Thu, 7 Jan 2021 22:14:23 -0800 (PST) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.28.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 586E53F66E; Thu, 7 Jan 2021 22:14:23 -0800 (PST) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ard.biesheuvel@arm.com, leif@nuviainc.com, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com, Jeremy Linton , Philippe Mathieu-Daude Subject: [PATCH v5 6/7] Platform/RaspberryPi: Power up SD, and tweak GPIOs Date: Fri, 8 Jan 2021 00:14:10 -0600 Message-Id: <20210108061411.1721734-7-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210108061411.1721734-1-jeremy.linton@arm.com> References: <20210108061411.1721734-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Andrei Warkentin Reviewed-by: Philippe Mathieu-Daude --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c b/Platform/= RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c index 28f57438c5..aa9ba7d76f 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c @@ -552,6 +552,13 @@ ApplyVariables ( GpioPinFuncSet (37, GPIO_FSEL_ALT3);=0D GpioPinFuncSet (38, GPIO_FSEL_ALT3);=0D GpioPinFuncSet (39, GPIO_FSEL_ALT3);=0D +=0D + Status =3D mFwProtocol->SetPowerState (RPI_MBOX_POWER_STATE_SDHCI,=0D + TRUE, TRUE); //SD on with wait= =0D + Status =3D mFwProtocol->SetGpioConfig (RPI_EXP_GPIO_SD_VOLT, =0D + RPI_EXP_GPIO_DIR_OUT, TRUE); //= 3.3v=0D + Status =3D mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC2, TR= UE);=0D + Status =3D mFwProtocol->SetClockState (RPI_MBOX_CLOCK_RATE_EMMC, TRU= E);=0D }=0D } else {=0D DEBUG ((DEBUG_ERROR, "Model Family %d not supported...\n", mModelFamil= y));=0D --=20 2.13.7