From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75042+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75042+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1620772916; cv=none; d=zohomail.com; s=zohoarc; b=VJQHXmY4DSf6gSQObs9IH326tkSquTgbwKDyXY7N49NdOl26e+Ch2sKdlojiIZrP7c68vu8TEz1oEfluIy0E/c30Rezkd6avAbS3beG3AEK2rHw2DKzhxon6dDapgD+iVHIrNbnebszSIKKVfgDhfDGTSwy9WqprviChGGnJSgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620772916; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ammcqqw7GEUtnbV002qgMbro0UM6+1zr57jQBcoUHdg=; b=Qludg4kLq+IhUl8A2/nSf18j4ON8guVnjtAOULvUDjz0lHoHCfOBhK1fGZIuBfRUt6UE7tYnvyLemtW6DzZ5koeB40QCrfFf1zmfafG2clLu2HToTOg02Ot2kx4yVYjB64Js6E1QgzWJG3bJNidoBgqhTO1Mh+dheBwzHDyQ33s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75042+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1620772916252381.7302615262721; Tue, 11 May 2021 15:41:56 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UQY6YY1788612xzzETOcL3OD; Tue, 11 May 2021 15:41:55 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.4281.1620772915177083806 for ; Tue, 11 May 2021 15:41:55 -0700 X-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 BF940D6E; Tue, 11 May 2021 15:41:54 -0700 (PDT) X-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 ACE703F718; Tue, 11 May 2021 15:41:54 -0700 (PDT) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com, Jeremy Linton Subject: [edk2-devel] [PATCH 1/2] Platform/Raspberrypi: Update DMA constants based on SOC revision Date: Tue, 11 May 2021 17:41:48 -0500 Message-Id: <20210511224149.864718-2-jeremy.linton@arm.com> In-Reply-To: <20210511224149.864718-1-jeremy.linton@arm.com> References: <20210511224149.864718-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com X-Gm-Message-State: weGz2zzwwF6A1gsoaJh1ootax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1620772915; bh=kHbO2AlnW5oHHcWmRn/JA/3tHS0Q7K2YlaFp0hPdK/w=; h=Cc:Date:From:Reply-To:Subject:To; b=D7UpFZXusAgjeGEzIpw8JbyNmpvqtPhJzZswQ2L0T2HLoDNDc7MzwfViJiRqLeVr714 5QYGft31V7rVYQVVuLT8RqnuFck/qc4ie28EKw67aZPjOQ9MXef8Qb8toHxxUOeH0uFY8 xVOWmXq4y4HBLz835c7YdB5+3G+InO90yVU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The newer BCM2711 SoC's don't have a DMA constraint on the emmc2 controller. So we don't need to do the 1G translation. Lets allow the AML to detect the SoC revision and return a different _DMA resource. Signed-off-by: Jeremy Linton Reviewed-by: Pete Batard --- Platform/RaspberryPi/AcpiTables/Emmc.asl | 39 ++++++++++++++++++= +++- .../Bcm27xx/Include/IndustryStandard/Bcm2711.h | 2 ++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Platform/RaspberryPi/AcpiTables/Emmc.asl b/Platform/RaspberryP= i/AcpiTables/Emmc.asl index 23febe37b4..c6691e81dc 100644 --- a/Platform/RaspberryPi/AcpiTables/Emmc.asl +++ b/Platform/RaspberryPi/AcpiTables/Emmc.asl @@ -8,6 +8,7 @@ =20 #include #include +#include =20 #include "AcpiTables.h" =20 @@ -31,7 +32,8 @@ DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPI4EMMC= ", 2) Return (^RBUF) } =20 - Name (_DMA, ResourceTemplate() { + // Translated DMA region for < C0 + Name (DMTR, ResourceTemplate() { QWordMemory (ResourceProducer, , MinFixed, @@ -48,6 +50,41 @@ DefinitionBlock (__FILE__, "SSDT", 2, "RPIFDN", "RPI4EMM= C", 2) ) }) =20 + // Non translated DMA region for >=3D C0 + Name (DMNT, ResourceTemplate() { + QWordMemory (ResourceProducer, + , + MinFixed, + MaxFixed, + NonCacheable, + ReadWrite, + 0x0, + 0x0000000000000000, // MIN + 0x000000FFFFFFFFFF, // MAX + 0x0000000000000000, // TRA + 0x0000010000000000, // LEN + , + , + ) + }) + + Method (_DMA, 0x0, Serialized) + { + OperationRegion (CHPR, SystemMemory, ID_CHIPREV, 0x4) + Field (CHPR, DWordAcc, NoLock, Preserve) { + SOCI, 32 + } + + if ((SOCI & 0xFF) >=3D 0x20) + { + return (^DMNT); + } + else + { + return (^DMTR); + } + } + // emmc2 Host Controller. (brcm,bcm2711-emmc2) Device (SDC3) { diff --git a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h b/= Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h index 86906b2438..8a69128d11 100644 --- a/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h +++ b/Silicon/Broadcom/Bcm27xx/Include/IndustryStandard/Bcm2711.h @@ -88,4 +88,6 @@ =20 #define THERM_SENSOR 0xfd5d2200 =20 +#define ID_CHIPREV 0xfc404000 + #endif /* BCM2711_H__ */ --=20 2.13.7 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75042): https://edk2.groups.io/g/devel/message/75042 Mute This Topic: https://groups.io/mt/82759461/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 03:54:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+75043+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75043+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1620772917; cv=none; d=zohomail.com; s=zohoarc; b=F+pviMvJKF5UnLvJD4jj9rzPz/TvjCJjVRzOZF8VZbXTfaGai3SOOnZC17+eEP9ulVflaO/MABs7QE4W/BhdudQXRPAZZKUY3S+5Mbo5d7bV1taU7ygRAfsTXDTPL2Qv2cGCyDWHLYj5+wnhuArba7/hnzyqa9cmUXck0qwXdts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620772917; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=PULLJDmYb4UhIlN5n/Y+AV50yvLp43FBKuY44fluNBs=; b=Y8rqQ3TknA8+jv/8QSuBwemLlUeoIvMgffElFgCT1tf+O2wJeq/mbW5ebLPf5DlcwGF+KwU4jf3BkRcrAtTO1uPceoo7psBAmFllT/4vK36/GdvGbJsFvtp2nOtGp4xSkkuXrREjkIEWPUhjz7jlxlkqb4CYTNhUZv7QNlGe6mI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+75043+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1620772917832499.4047828260125; Tue, 11 May 2021 15:41:57 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cy7YYY1788612xzjp6gw59AD; Tue, 11 May 2021 15:41:57 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.4393.1620772916552080538 for ; Tue, 11 May 2021 15:41:56 -0700 X-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 E51EEED1; Tue, 11 May 2021 15:41:55 -0700 (PDT) X-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 D6A153F718; Tue, 11 May 2021 15:41:55 -0700 (PDT) From: "Jeremy Linton" To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org, pete@akeo.ie, samer.el-haj-mahmoud@arm.com, awarkentin@vmware.com, Jeremy Linton Subject: [edk2-devel] [PATCH 2/2] Platform/RaspberryPi: Invert emmc PIO/DMA selection Date: Tue, 11 May 2021 17:41:49 -0500 Message-Id: <20210511224149.864718-3-jeremy.linton@arm.com> In-Reply-To: <20210511224149.864718-1-jeremy.linton@arm.com> References: <20210511224149.864718-1-jeremy.linton@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jeremy.linton@arm.com X-Gm-Message-State: fTx98i9zkQijNT9K4mFCDnRxx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1620772917; bh=nKaq9aQvUSdpIxJU5WjAsKmT1XSFlLLeUgEaUWmW9Es=; h=Cc:Date:From:Reply-To:Subject:To; b=EOVT1nK8AEyqr4BJeYf5AixEjwKyyyOo/PA9W8C+b6R2Y/Lpdg+jUojzn5zDObRrOto DEO3L9ltaalXLfF12U1PL41m0+zxZwvqy4oqRTsRuiiM1/VFjPRbl8uF4G3HPWuwyv0fa o2Q0NRRsHOGUWKI0j1HGtb3j4d3t/7vX3ek= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Now that we are doing SoC detection and adjusting the DMA window it should be safe to turn DMA on by default. Signed-off-by: Jeremy Linton Reviewed-by: Pete Batard --- Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr | 4 ++-- Platform/RaspberryPi/RPi4/RPi4.dsc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr b/Plat= form/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr index aa124e4e31..759db6212f 100644 --- a/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr +++ b/Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr @@ -300,8 +300,8 @@ formset prompt =3D STRING_TOKEN(STR_MMC_EMMC_PROMPT), help =3D STRING_TOKEN(STR_MMC_EMMC_HELP), flags =3D NUMERIC_SIZE_4 | INTERACTIVE | RESET_REQUIRED, - option text =3D STRING_TOKEN(STR_MMC_EMMC_PIO), value =3D 0, f= lags =3D DEFAULT; - option text =3D STRING_TOKEN(STR_MMC_EMMC_DMA), value =3D 1, f= lags =3D 0; + option text =3D STRING_TOKEN(STR_MMC_EMMC_PIO), value =3D 0, f= lags =3D 0; + option text =3D STRING_TOKEN(STR_MMC_EMMC_DMA), value =3D 1, f= lags =3D DEFAULT; endoneof; endif; #endif diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4= /RPi4.dsc index cf796acf6a..b3acc04e07 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -486,7 +486,7 @@ gRaspberryPiTokenSpaceGuid.PcdMmcSdDefaultSpeedMHz|L"MmcSdDefaultSpeedMH= z"|gConfigDxeFormSetGuid|0x0|25 gRaspberryPiTokenSpaceGuid.PcdMmcSdHighSpeedMHz|L"MmcSdHighSpeedMHz"|gCo= nfigDxeFormSetGuid|0x0|50 gRaspberryPiTokenSpaceGuid.PcdMmcDisableMulti|L"MmcDisableMulti"|gConfig= DxeFormSetGuid|0x0|0 - gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma|L"MmcEnableDma"|gConfigDxeFor= mSetGuid|0x0|0 + gRaspberryPiTokenSpaceGuid.PcdMmcEnableDma|L"MmcEnableDma"|gConfigDxeFor= mSetGuid|0x0|1 =20 # # Debug-related. --=20 2.13.7 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75043): https://edk2.groups.io/g/devel/message/75043 Mute This Topic: https://groups.io/mt/82759463/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-