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.web08.16552.1661375545244486042 for ; Wed, 24 Aug 2022 14:12:25 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@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 519FFD6E; Wed, 24 Aug 2022 14:12:28 -0700 (PDT) Received: from [192.168.1.11] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBB193F67D; Wed, 24 Aug 2022 14:12:22 -0700 (PDT) Message-ID: <532bb58f-8354-9cb6-7080-f63f13121a93@arm.com> Date: Wed, 24 Aug 2022 23:12:15 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2] DynamicTablesPkg: AcpiSsdtPcieLibArm : Add UID to slot creation To: Jeff Brasen , devel@edk2.groups.io Cc: sami.mujawar@arm.com, Alexei.Fedorov@arm.com, nd@arm.com References: <42a40dcf43d62ff985fd89bbcde47558344384bc.1661315727.git.jbrasen@nvidia.com> From: "PierreGondois" In-Reply-To: <42a40dcf43d62ff985fd89bbcde47558344384bc.1661315727.git.jbrasen@nvidia.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Reviewed-by: Pierre Gondois On 8/24/22 06:35, Jeff Brasen wrote: > Expose the UID value to GeneratePciSlots(). > This is needed for some cases for example: > https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#identifying-externally-exposed-pcie-root-ports > > Name (_DSD, Package () { > ToUUID("EFCC06CC-73AC-4BC3-BFF0-76143807C389"), > Package () { > Package (2) {"ExternalFacingPort", 1}, > Package (2) {"UID", 0}, > } > }) > > Signed-off-by: Jeff Brasen > --- > DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h | 8 +++++--- > .../Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 5 ++++- > .../Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c | 8 +++++--- > 3 files changed, 14 insertions(+), 7 deletions(-) > > diff --git a/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h b/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h > index 85e283a994..4171dabc33 100644 > --- a/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h > +++ b/DynamicTablesPkg/Include/Library/SsdtPcieSupportLib.h > @@ -54,9 +54,10 @@ AddOscMethod ( > used. It should be possible to enumerate them, but this is additional > information. > > - @param [in] PciInfo Pci device information. > - @param [in] MappingTable The mapping table structure. > - @param [in, out] PciNode Pci node to amend. > + @param [in] PciInfo Pci device information. > + @param [in] MappingTable The mapping table structure. > + @param [in] Uid Unique Id of the Pci device. > + @param [in, out] PciNode Pci node to amend. > > @retval EFI_SUCCESS Success. > @retval EFI_INVALID_PARAMETER Invalid parameter. > @@ -67,6 +68,7 @@ EFIAPI > GeneratePciSlots ( > IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, > IN CONST MAPPING_TABLE *MappingTable, > + IN UINT32 Uid, > IN OUT AML_OBJECT_NODE_HANDLE PciNode > ); > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > index ceffe2838c..24e074ea90 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > @@ -295,6 +295,7 @@ GeneratePciDeviceInfo ( > @param [in] CfgMgrProtocol Pointer to the Configuration Manager > Protocol interface. > @param [in] PciInfo Pci device information. > + @param [in] Uid Unique Id of the Pci device. > @param [in, out] PciNode Pci node to amend. > > @retval EFI_SUCCESS The function completed successfully. > @@ -308,6 +309,7 @@ GeneratePrt ( > IN ACPI_PCI_GENERATOR *Generator, > IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, > IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, > + IN UINT32 Uid, > IN OUT AML_OBJECT_NODE_HANDLE PciNode > ) > { > @@ -416,7 +418,7 @@ GeneratePrt ( > PrtNode = NULL; > > // Generate the Pci slots once all the device have been added. > - Status = GeneratePciSlots (PciInfo, &Generator->DeviceTable, PciNode); > + Status = GeneratePciSlots (PciInfo, &Generator->DeviceTable, Uid, PciNode); > if (EFI_ERROR (Status)) { > ASSERT (0); > goto exit_handler; > @@ -687,6 +689,7 @@ GeneratePciDevice ( > Generator, > CfgMgrProtocol, > PciInfo, > + Uid, > PciNode > ); > if (EFI_ERROR (Status)) { > diff --git a/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c b/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c > index e5ab3a3ca8..b35fb6a7dd 100644 > --- a/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c > +++ b/DynamicTablesPkg/Library/Common/SsdtPcieSupportLib/SsdtPcieSupportLib.c > @@ -41,9 +41,10 @@ > used. It should be possible to enumerate them, but this is additional > information. > > - @param [in] PciInfo Pci device information. > - @param [in] MappingTable The mapping table structure. > - @param [in, out] PciNode Pci node to amend. > + @param [in] PciInfo Pci device information. > + @param [in] MappingTable The mapping table structure. > + @param [in] Uid Unique Id of the Pci device. > + @param [in, out] PciNode Pci node to amend. > > @retval EFI_SUCCESS Success. > @retval EFI_INVALID_PARAMETER Invalid parameter. > @@ -54,6 +55,7 @@ EFIAPI > GeneratePciSlots ( > IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, > IN CONST MAPPING_TABLE *MappingTable, > + IN UINT32 Uid, > IN OUT AML_OBJECT_NODE_HANDLE PciNode > ) > {