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 8506A941B09 for ; Tue, 3 Oct 2023 15:22:49 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=bBqdLv9w1EZY1qJio2mWOHntykQTdA0Phq9eMe4IHrw=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Disposition; s=20140610; t=1696346568; v=1; b=wbrWDBGBAh7T9cviuSoRgxGodvEqGFywrxJoK5f3ETFkcy4bD6hpW5qkdahAx5qnozuzRCYM 1d9TApafJeGjKC+62naUliH1Zems+uiDtWHTV6IHFs3SUm9eWc7tI0cUTCdAawz8ssC1PheE0sb xfR4DqzVm9AgfdwlBcNbaCzk= X-Received: by 127.0.0.2 with SMTP id sIc6YY7687511xs0eFWrLrcS; Tue, 03 Oct 2023 08:22:48 -0700 X-Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.111507.1696346567605626847 for ; Tue, 03 Oct 2023 08:22:47 -0700 X-Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 393Eelci026344; Tue, 3 Oct 2023 15:22:43 GMT X-Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tgbjj9bx7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 15:22:43 +0000 X-Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 393FMgI4009123 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Oct 2023 15:22:42 GMT X-Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Tue, 3 Oct 2023 08:22:40 -0700 Date: Tue, 3 Oct 2023 16:22:34 +0100 From: "Leif Lindholm" To: Jeshua Smith CC: , , , Subject: Re: [edk2-devel] [PATCH] DynamicTablesPkg/AmlLib: Enumerate memory cacheability and type Message-ID: References: <4e29533888e7dbc72d0815aa4318230636a43588.1696283429.git.jeshuas@nvidia.com> MIME-Version: 1.0 In-Reply-To: <4e29533888e7dbc72d0815aa4318230636a43588.1696283429.git.jeshuas@nvidia.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-GUID: Rw6aFwGBqRHGH9Zc7lddkGjWZrtrd855 X-Proofpoint-ORIG-GUID: Rw6aFwGBqRHGH9Zc7lddkGjWZrtrd855 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,quic_llindhol@quicinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vC0fYs5dnMu2KDn3Ohalrwu3x7686176AA= Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=wbrWDBGB; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=quicinc.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 On Mon, Oct 02, 2023 at 21:52:52 +0000, 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. > > Signed-off-by: Jeshua Smith Looks like a nice bit of cleanup. Acked-by: Leif Lindholm / Leif > --- > .../Include/Library/AmlLib/AmlLib.h | 33 +++++++++++++++++++ > .../AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 12 +++---- > 2 files changed, 39 insertions(+), 6 deletions(-) > > diff --git a/DynamicTablesPkg/Include/Library/AmlLib/AmlLib.h b/DynamicTablesPkg/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; > > #endif // AML_HANDLE > > +/** 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 > + > +**/ > +typedef enum { > + AML_MEMORY_NONCACHEABLE = 0, > + AML_MEMORY_CACHEABLE = 1, > + AML_MEMORY_CACHEABLE_WC = 2, > + AML_MEMORY_CACHEABLE_PF = 3 > +} AML_MEMORY_CACHEABILITY; > + > +/** MemoryRangeType parameter values > + > + Possible values are: > + 0-AddressRangeMemory > + 1-AddressRangeReserved > + 2-AddressRangeACPI > + 3-AddressRangeNVS > + > +**/ > +typedef enum { > + AML_MEMORY_RANGE_TYPE_MEMORY = 0, > + AML_MEMORY_RANGE_TYPE_RESERVED = 1, > + AML_MEMORY_RANGE_TYPE_ACPI = 2, > + AML_MEMORY_RANGE_TYPE_NVS = 3 > +} AML_MEMORY_RANGE_TYPE; > + > /** Parse the definition block. > > The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > index 9ddaddc198..7df7117352 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > @@ -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 > -- > 2.25.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109285): https://edk2.groups.io/g/devel/message/109285 Mute This Topic: https://groups.io/mt/101722936/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-