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.17118.1609781876126923985 for ; Mon, 04 Jan 2021 09:37:56 -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 CBE43113E; Mon, 4 Jan 2021 09:37:55 -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 C5C183F66E; Mon, 4 Jan 2021 09:37:55 -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, Jeremy Linton , Andrei Warkentin Subject: [PATCH v3 5/7] Platform/RaspberryPi/Arasan: Select the correct base frequency Date: Mon, 4 Jan 2021 11:37:29 -0600 Message-Id: <20210104173731.1413044-6-jeremy.linton@arm.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210104173731.1413044-1-jeremy.linton@arm.com> References: <20210104173731.1413044-1-jeremy.linton@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The firmware reports the emmc2 frequency with a slightly different mailbox command, lets select the correct one based on which controller we are binding to. Signed-off-by: Jeremy Linton Reviewed-by: Andrei Warkentin --- .../RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c | 10 ++++++= +--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe= .c b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c index a7b538a91a..b0f03cefc9 100644 --- a/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c +++ b/Platform/RaspberryPi/Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c @@ -250,7 +250,11 @@ CalculateClockFrequencyDivisor ( UINT32 Divisor;=0D UINT32 BaseFrequency =3D 0;=0D =0D - Status =3D mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseFre= quency);=0D + if (PcdGet32 (PcdSdIsArasan)) {=0D + Status =3D mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC, &BaseF= requency);=0D + } else {=0D + Status =3D mFwProtocol->GetClockRate (RPI_MBOX_CLOCK_RATE_EMMC2, &Base= Frequency);=0D + }=0D if (EFI_ERROR (Status)) {=0D DEBUG ((DEBUG_ERROR, "Couldn't get RPI_MBOX_CLOCK_RATE_EMMC\n"));=0D return Status;=0D @@ -472,8 +476,8 @@ MMCNotifyState ( switch (State) {=0D case MmcHwInitializationState:=0D {=0D - EFI_STATUS Status;=0D - UINT32 Divisor;=0D +=0D + DEBUG ((DEBUG_MMCHOST_SD, "ArasanMMCHost: current divisor %x\n", Mmi= oRead32(MMCHS_SYSCTL)));=0D =0D Status =3D SoftReset (SRA);=0D if (EFI_ERROR (Status)) {=0D --=20 2.13.7