From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C19B9780663 for ; Tue, 3 Oct 2023 07:04:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6Fzio5QPMjfjoIazUZn1WorvihNPu7CdnH1OMvNizFU=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1696316628; v=1; b=HDWRYX8jQ6+ldEpg1PvwbM2gX3zmS2MhqpuM78Ie9MURQXqdAvPIIC9C9xiEhebh2RqmxDXA zrdHIdRVX6XN7lw2K8aHi08uxBaBINMaV/7H2kie1EzPjmkGySL8z+4+aGkCrXwRF1yqR5/FgUy 2LBKY2dhTrnWyfz6gCHAvBJU= X-Received: by 127.0.0.2 with SMTP id 261SYY7687511xLTZn4wD5U7; Tue, 03 Oct 2023 00:03:48 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.103209.1696316627558095921 for ; Tue, 03 Oct 2023 00:03:47 -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 608A8C15; Tue, 3 Oct 2023 00:04:25 -0700 (PDT) X-Received: from [192.168.1.13] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9AE93F59C; Tue, 3 Oct 2023 00:03:45 -0700 (PDT) Message-ID: <5a8510b3-91cf-385c-9706-0d32b8b49dcc@arm.com> Date: Tue, 3 Oct 2023 09:03:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [edk2-devel] [PATCH] DynamicTablesPkg/AmlLib: Enumerate memory cacheability and type To: Jeshua Smith , devel@edk2.groups.io Cc: Sami.Mujawar@arm.com, quic_llindhol@quicinc.com, ardb+tianocore@kernel.org References: <4e29533888e7dbc72d0815aa4318230636a43588.1696283429.git.jeshuas@nvidia.com> From: "PierreGondois" In-Reply-To: <4e29533888e7dbc72d0815aa4318230636a43588.1696283429.git.jeshuas@nvidia.com> Precedence: Bulk 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,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JNepSqS1Z7rAnHrQN1FWd2Hux7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=HDWRYX8j; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Hello Jeshua, just a few NITs: On 10/2/23 23:52, Jeshua Smith wrote: > AmlCodeGenRdQWordMemory's and AmlCodeGenRdDWordMemory's Cacheable > and MemoryRangeType parameters treat specific values as having > specific meanings. This change adds enums to map those meanings to their > corresponding values. >=20 > Signed-off-by: Jeshua Smith > --- > .../Include/Library/AmlLib/AmlLib.h | 33 +++++++++++++++++++ > .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 12 +++---- > 2 files changed, 39 insertions(+), 6 deletions(-) >=20 > diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTa= blesPkg/Include/Library/AmlLib/AmlLib.h > index 510c79a399..6a273059fb 100644 > --- a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > +++ b/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h > @@ -59,6 +59,39 @@ typedef void *AML_DATA_NODE_HANDLE; > =20 > #endif // AML_HANDLE > =20 > +/** Cacheable parameter values > + > + Possible values are: > + 0-The memory is non-cacheable > + 1-The memory is cacheable > + 2-The memory is cacheable and supports > + write combining > + 3-The memory is cacheable and prefetchable Is it possible add a reference to ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags" for future reference ? Same comment for the other enum. > + > +**/ > +typedef enum { > + AML_MEMORY_NONCACHEABLE =3D 0, > + AML_MEMORY_CACHEABLE =3D 1, > + AML_MEMORY_CACHEABLE_WC =3D 2, > + AML_MEMORY_CACHEABLE_PF =3D 3 Just for a matter of unification in the package, is is possible to use camelcase enum names, like AmlMemoryNonCacheable ? Also would it be possible to add a AmlMemoryMax enum at the end ? Same comment for the other enum. > +} AML_MEMORY_CACHEABILITY; > + > +/** MemoryRangeType parameter values > + > + Possible values are: > + 0-AddressRangeMemory > + 1-AddressRangeReserved > + 2-AddressRangeACPI > + 3-AddressRangeNVS > + > +**/ > +typedef enum { > + AML_MEMORY_RANGE_TYPE_MEMORY =3D 0, > + AML_MEMORY_RANGE_TYPE_RESERVED =3D 1, > + AML_MEMORY_RANGE_TYPE_ACPI =3D 2, > + AML_MEMORY_RANGE_TYPE_NVS =3D 3 > +} AML_MEMORY_RANGE_TYPE; > + > /** Parse the definition block. > =20 > The function parses the whole AML blob. It starts with the ACPI DSDT/= SSDT > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPci= eGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPci= eGenerator.c > index 9ddaddc198..7df7117352 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenera= tor.c Is is possible to modify the definition/declaration of the modified functio= ns to use the newly created type ? > @@ -566,7 +566,7 @@ GeneratePciCrs ( > IsPosDecode, > TRUE, > TRUE, > - TRUE, > + AML_MEMORY_CACHEABLE, > TRUE, > 0, > AddrMapInfo->PciAddress, > @@ -575,7 +575,7 @@ GeneratePciCrs ( > AddrMapInfo->AddressSize, > 0, > NULL, > - 0, > + AML_MEMORY_RANGE_TYPE_MEMORY, > TRUE, > CrsNode, > NULL > @@ -588,7 +588,7 @@ GeneratePciCrs ( > IsPosDecode, > TRUE, > TRUE, > - TRUE, > + AML_MEMORY_CACHEABLE, > TRUE, > 0, > AddrMapInfo->PciAddress, > @@ -597,7 +597,7 @@ GeneratePciCrs ( > AddrMapInfo->AddressSize, > 0, > NULL, > - 0, > + AML_MEMORY_RANGE_TYPE_MEMORY, > TRUE, > CrsNode, > NULL > @@ -718,7 +718,7 @@ ReserveEcamSpace ( > TRUE, > TRUE, > TRUE, > - FALSE, // non-cacheable > + AML_MEMORY_NONCACHEABLE, > TRUE, > 0, > AddressMinimum, > @@ -727,7 +727,7 @@ ReserveEcamSpace ( > AddressMaximum - AddressMinimum + 1, > 0, > NULL, > - 0, > + AML_MEMORY_RANGE_TYPE_MEMORY, > TRUE, > CrsNode, > NULL Regards, Pierre -=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 (#109275): https://edk2.groups.io/g/devel/message/109275 Mute This Topic: https://groups.io/mt/101722936/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-