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.web09.3547.1660121517226291905 for ; Wed, 10 Aug 2022 01:51:57 -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 EEDF51FB; Wed, 10 Aug 2022 01:51:56 -0700 (PDT) Received: from [192.168.28.158] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ECCF43F70D; Wed, 10 Aug 2022 01:51:54 -0700 (PDT) Message-ID: <8e9707a8-b200-5727-46bb-58f99c74f501@arm.com> Date: Wed, 10 Aug 2022 10:51:49 +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: [edk2-devel] [PATCH v3 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space To: Sami Mujawar , devel@edk2.groups.io, kuqin12@gmail.com Cc: Joe Lopez , "nd@arm.com" References: <20220731053727.536-1-kuqin12@gmail.com> <20220731053727.536-6-kuqin12@gmail.com> <7b2fb1d3-6acf-9cc8-025d-2ef598976df4@arm.com> From: "PierreGondois" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 8/8/22 17:39, Sami Mujawar wrote: > Hi Kun, >=20 > I have just tried testing your patch with Kvmtool guest firmware and th= ink this patch may need some modifications. >=20 > Also, the patch 4/6 may need some adjustment, which I will reply back o= n that patch separately. >=20 > Regards, >=20 > Sami Mujawar >=20 > On 08/08/2022 02:22 pm, Sami Mujawar wrote: >> Hi Kun, >> >> Thank you for this patch. >> >> These changes look good to me. >> >> Reviewed-by: Sami Mujawar >> >> Regards, >> >> Sami Mujawar >> >> On 31/07/2022 06:37 am, Kun Qin via groups.io wrote: >>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3998 >>> >>> Certain OSes will complain if the ECAM config space is not reserved i= n >>> the ACPI namespace. >>> >>> This change adds a function to reserve PNP motherboard resources for = a >>> given PCI node. >>> >>> Co-authored-by: Joe Lopez >>> Signed-off-by: Kun Qin >>> Reviewed-by: Pierre Gondois >>> --- >>> >>> Notes: >>> =C2=A0=C2=A0=C2=A0=C2=A0 v2: >>> =C2=A0=C2=A0=C2=A0=C2=A0 - Only create RES0 after config space checki= ng [Pierre] >>> =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 v3: >>> =C2=A0=C2=A0=C2=A0=C2=A0 - Updated function names and descriptions [P= ierre] >>> =C2=A0=C2=A0=C2=A0=C2=A0 - Moved translation calculation to CONFIG ca= se [Pierre] >>> >>> DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerato= r.c | 171 ++++++++++++++++++++ >>> =C2=A0 1 file changed, 171 insertions(+) >>> >>> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/Ssd= tPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/S= sdtPcieGenerator.c >>> index ceffe2838c03..658a089c8f1f 100644 >>> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGe= nerator.c >>> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGe= nerator.c >>> @@ -616,6 +616,169 @@ GeneratePciCrs ( >>> =C2=A0=C2=A0=C2=A0 return Status; >>> >>> =C2=A0 } >>> >>> >>> +/** Generate a RES0 device node to reserve PNP motherboard resources >>> >>> +=C2=A0 for a given PCI node. >>> >>> + >>> >>> +=C2=A0 @param [in]=C2=A0=C2=A0 PciNode=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Parent PCI node handle of the generated >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 resource object. >>> >>> +=C2=A0 @param [out]=C2=A0 CrsNode=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= CRS node of the AML tree to populate. >>> >>> + >>> >>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The function completed successfully. >>> >>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0 Invalid input param= eter. >>> >>> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0=C2=A0=C2=A0 Could not allo= cate memory. >>> >>> +**/ >>> >>> +STATIC >>> >>> +EFI_STATUS >>> >>> +EFIAPI >>> >>> +GenerateMotherboardDevice ( >>> >>> +=C2=A0 IN=C2=A0 AML_OBJECT_NODE_HANDLE=C2=A0 PciNode, >>> >>> +=C2=A0 OUT AML_OBJECT_NODE_HANDLE=C2=A0 *CrsNode >>> >>> +=C2=A0 ) >>> >>> +{ >>> >>> +=C2=A0 EFI_STATUS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 Status; >>> >>> +=C2=A0 UINT32=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 EisaId; >>> >>> +=C2=A0 AML_OBJECT_NODE_HANDLE=C2=A0 ResNode; >>> >>> + >>> >>> +=C2=A0 if (CrsNode =3D=3D NULL) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return EFI_INVALID_PARAMETER; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 // ASL: Device (RES0) {} >>> >>> +=C2=A0 Status =3D AmlCodeGenDevice ("RES0", PciNode, &ResNode); >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 // ASL: Name (_HID, EISAID ("PNP0C02")) >>> >>> +=C2=A0 Status =3D AmlGetEisaIdFromString ("PNP0C02", &EisaId); /* PN= P Motherboard Resources */ >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 Status =3D AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NU= LL); >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 // ASL: Name (_CRS, ResourceTemplate () {}) >>> >>> +=C2=A0 Status =3D AmlCodeGenNameResourceTemplate ("_CRS", ResNode, C= rsNode); >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 return Status; >>> >>> +} >>> >>> + >>> >>> +/** Reserves ECAM space for PCI config space >>> >>> + >>> >>> +=C2=A0 @param [in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Generator=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The SSDT Pci generator. >>> >>> +=C2=A0 @param [in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CfgMgrProtoco= l=C2=A0 Pointer to the Configuration Manager >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Protoc= ol interface. >>> >>> +=C2=A0 @param [in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PciInfo=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Pci device information. >>> >>> +=C2=A0 @param [in, out]=C2=A0 PciNode=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 RootNode of the AML tree to populate. >>> >>> + >>> >>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The function completed successfully. >>> >>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0=C2=A0 Invalid parameter. >>> >>> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0=C2=A0=C2=A0 Could not allo= cate memory. >>> >>> +**/ >>> >>> +STATIC >>> >>> +EFI_STATUS >>> >>> +EFIAPI >>> >>> +ReserveEcamSpace ( >>> >>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ACPI_PCI_GENERATOR *Generator, >>> >>> +=C2=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0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= RefCount; >>> >>> +=C2=A0 CM_ARM_PCI_ADDRESS_MAP_INFO=C2=A0 *AddrMapInfo; >>> >>> +=C2=A0 BOOLEAN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = IsPosDecode; >>> >>> + >>> >>> +=C2=A0 // Get the array of CM_ARM_OBJ_REF referencing the >>> >>> +=C2=A0 // CM_ARM_PCI_ADDRESS_MAP_INFO objects. >>> >>> +=C2=A0 Status =3D GetEArmObjCmRef ( >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 CfgMgrProtocol, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 PciInfo->AddressMapToken, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 &RefInfo, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 &RefCount >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 ); >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 for (Index =3D 0; Index < RefCount; Index++) { >>> >>> +=C2=A0=C2=A0=C2=A0 // Get CM_ARM_PCI_ADDRESS_MAP_INFO structures one= by one. >>> >>> +=C2=A0=C2=A0=C2=A0 Status =3D GetEArmObjPciAddressMapInfo ( >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 CfgMgrProtocol, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 RefInfo[Index].ReferenceToken, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 &AddrMapInfo, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 NULL >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 ); >>> >>> +=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0=C2=A0=C2=A0 } >>> > [SAMI] Sorry for missing this earlier in the review. However, the ECAM = memory space is described byCM_ARM_PCI_CONFIG_SPACE_INFO. So, I think tha= t needs to be used here. >=20 > The CM_ARM_PCI_CONFIG_SPACE_INFO structure does not include the length = of the configuration space and would probably need to be updated. >=20 > Which platform are you testing these changes on? I would like to unders= tand more about your use case. Is it possible to share some more details,= please? >=20 > [/SAMI] [Pierre] Yes indeed, CM_ARM_PCI_CONFIG_SPACE_INFO should contain the configuration address space, it should not be described in CM_ARM_PCI_ADDRESS_MAP_INFO. So there should be no need to search through the CM_ARM_PCI_ADDRESS_MAP_I= NFO objects. Sorry for missing this earlier. The length of the address space could be computed as: length =3D (end_bus - start_bus + 1) =C3=97 32 devices =C3=97 8 functions= =C3=97 4 KB [/Pierre] >=20 >>> + >>> >>> +=C2=A0=C2=A0=C2=A0 switch (AddrMapInfo->SpaceCode) { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case PCI_SS_CONFIG: >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Translation =3D (AddrMapI= nfo->CpuAddress !=3D AddrMapInfo->PciAddress); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (AddrMapInfo->CpuAddre= ss >=3D AddrMapInfo->PciAddress) { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 IsPosDecode =3D= TRUE; >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 IsPosDecode =3D= FALSE; >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> >>> + >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D GenerateMother= boardDevice (PciNode, &CrsNode); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> >>> + >>> >>> +=C2=A0=C2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=C2=A0=C2=A0 AddrMapInfo->PciAddress, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AddrMapInfo->PciAddress + AddrMap= Info->AddressSize - 1, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Translation ? AddrMapInfo->CpuAdd= ress - AddrMapInfo->PciAddress : 0, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AddrMapInfo->AddressSize, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 TRUE, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CrsNode, >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 default: >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break; >>> >>> +=C2=A0=C2=A0=C2=A0 } // switch >>> >>> + >>> >>> +=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0=C2=A0=C2=A0 } >>> >>> +=C2=A0 } >>> >>> + >>> >>> +=C2=A0 return Status; >>> >>> +} >>> >>> + >>> >>> =C2=A0 /** Generate a Pci device. >>> >>> >>> =C2=A0=C2=A0=C2=A0 @param [in]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Ge= nerator=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 The SSDT Pci generator. >>> >>> @@ -702,9 +865,17 @@ GeneratePciDevice ( >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return Status; >>> >>> =C2=A0=C2=A0=C2=A0 } >>> >>> >>> +=C2=A0 // Add the PNP Motherboard Resources Device to reserve ECAM s= pace >>> >>> +=C2=A0 Status =3D ReserveEcamSpace (Generator, CfgMgrProtocol, PciIn= fo, PciNode); >>> >>> +=C2=A0 if (EFI_ERROR (Status)) { >>> >>> +=C2=A0=C2=A0=C2=A0 ASSERT (0); >>> >>> +=C2=A0=C2=A0=C2=A0 return Status; >>> >>> +=C2=A0 } >>> >>> + >>> >>> =C2=A0=C2=A0=C2=A0 // Add the template _OSC method. >>> >>> =C2=A0=C2=A0=C2=A0 Status =3D AddOscMethod (PciInfo, PciNode); >>> >>> =C2=A0=C2=A0=C2=A0 ASSERT_EFI_ERROR (Status); >>> >>> + >>> >>> =C2=A0=C2=A0=C2=A0 return Status; >>> >>> =C2=A0 } >>> >>>