From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.66]) by mx.groups.io with SMTP id smtpd.web12.27817.1660737744244553421 for ; Wed, 17 Aug 2022 05:02:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=i8hgJeLg; spf=pass (domain: arm.com, ip: 40.107.22.66, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ASLrN+Pr5WWzjaYAsZwkrwMxQF/6mxqa26MVMewboMffSh68P19HYPF6uka0qO1L/rvy2EPoySqqV/ehmMZ7PyFUKU+Do03GzQslh/9l31pvPTunav3uPXxUikIggPHGfXD0lZCzooHteCPLGsxSynFGA2nbSjK3ma0LsfxgdaMXjGXwe9jX3jja//jy09oDiISmOS+4dQfJ2MOrxPnZt+FL5h/iL/92YcwRG85Boyfkr8HZFL8F0y3+BnqN19AlyGtRWNjfx1oKbEkk/fcpz7n4KrABm7rilPy8MvRq5bn9T6LD+xnV2iN8SUnJsXvGB0VshS+28OxDzW316ulKZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fR21cmfxi1TfFN4vJ/UBOVQWhTLm/Ady2nIG5Scv2R4=; b=aO3ftgfQb14ZbPlYByW4bslU0klN2qkyu+IiONWZMI6V58XjlZxp9MDFGbj2jybQwOciXYpjlmKyciHNjhnIgbuSrLuhyOTK6HsGaiaJQKfvD/qCG/FwxeUkGxpJDm3M2AF2X6r6bAgpWru9SVUu8OOS8A9pptAAOu3p0oqQaIIh7oJO5EJYA3A/LeYNc9BNFtIUzwEhiJfNX7hQ4t3OAFrOOSWVOtPAZenKAayBcw+H3eQJi70wka736JfF1EPh+ragfBsLeBli6hC1h9IzG2JXBmjmtxrx2xetcVro+1Qel2jvEyg3aO4ihCak6Y5atF2BfpyYhZsOl5fS3nEw4g== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fR21cmfxi1TfFN4vJ/UBOVQWhTLm/Ady2nIG5Scv2R4=; b=i8hgJeLgEoeca6JqjGa83SyTzdoinJOwPZyHYQI1D6IStr4xwGdpWyoTa+/1QOmHCCr7xJakG3DFomPmrWUJ1GUVKN1B26VCUyZAcrPPMVZZtW5LlDvAmGLPzjeknrNP1yRvOFEd6INcEwCrIJPDt/JIzf3ZDUA+Qx2Ks9jdAzg= Received: from DB8PR09CA0029.eurprd09.prod.outlook.com (2603:10a6:10:a0::42) by AS8PR08MB5911.eurprd08.prod.outlook.com (2603:10a6:20b:292::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Wed, 17 Aug 2022 12:02:20 +0000 Received: from DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:a0:cafe::f7) by DB8PR09CA0029.outlook.office365.com (2603:10a6:10:a0::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.12 via Frontend Transport; Wed, 17 Aug 2022 12:02:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT032.mail.protection.outlook.com (100.127.142.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.15 via Frontend Transport; Wed, 17 Aug 2022 12:02:20 +0000 Received: ("Tessian outbound 6a3290ff1310:v123"); Wed, 17 Aug 2022 12:02:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 43d77f0691bc382d X-CR-MTA-TID: 64aa7808 Received: from e37fdcdd4782.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1779712D-9506-4252-A000-287C40A1267A.1; Wed, 17 Aug 2022 12:02:13 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e37fdcdd4782.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 17 Aug 2022 12:02:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Acvhz97lQ9a6oRIWL7tYoW/fjxUQVvZRY3Hu6Wx91Bl2Qt5lcW4fProPLMGipTiZOqjhitU5334+wBfUbkU9kU7agj4X3J+CKozhdTkmjPwF+S/1gVpHWzV7iAY+YZw2z5YYOy/pNCotucpP3j2vmAdVd4pS5Z4gG6FqzDhctIaA4/+rqveN0XEoYyyano64NtrsPYLDaRzyT4eJWIDAiFKnioHMT8JPt9HOyCMAnq+V45r9/zPaYI4DHL64ZuoMucyTVqdCaSgkVD7dKXovTh3OoA/AsZTKllbV65oM3z80KgW42F2LhWzKCqrdRL3Cj9zHEYwi/8V6dRHeBjiqpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fR21cmfxi1TfFN4vJ/UBOVQWhTLm/Ady2nIG5Scv2R4=; b=EBxZAJwC4q1pXO0gOm3TXa7Wnl4QsAmzeV7aptjIp3Qxk7cuxG6eE2hx91vNNDae/HLtGJ6Xp43HbJZNxCLbwiMXtXvga9/LPF1zHve2Sfx+fp46VZC/6lj5sqNqcyTz0c663+1yRzotZc5PJDYf8a/H/ci3075IJG1uMjNYcn86NMVk8phder71bl+OutsykaqsztJESw6+4Bo0tI6vNwVc8v0hmt/4jLYOsSXtR8Ec9NT1ehkg5iABYypO59XzZlgHNLHumCmz6DCECcIuRlnDGt1JvSaik8zlmigxRigHf3L8YrfmWvQLVVN6kMZToXXRxcDNh9w2RtrOxsB0ew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fR21cmfxi1TfFN4vJ/UBOVQWhTLm/Ady2nIG5Scv2R4=; b=i8hgJeLgEoeca6JqjGa83SyTzdoinJOwPZyHYQI1D6IStr4xwGdpWyoTa+/1QOmHCCr7xJakG3DFomPmrWUJ1GUVKN1B26VCUyZAcrPPMVZZtW5LlDvAmGLPzjeknrNP1yRvOFEd6INcEwCrIJPDt/JIzf3ZDUA+Qx2Ks9jdAzg= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM0PR08MB4932.eurprd08.prod.outlook.com (2603:10a6:208:162::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Wed, 17 Aug 2022 12:02:11 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9%6]) with mapi id 15.20.5504.027; Wed, 17 Aug 2022 12:02:11 +0000 Message-ID: <71c2d7fb-8363-fe58-cdd4-ffe31bb5b70d@arm.com> Date: Wed, 17 Aug 2022 13:02:10 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] [PATCH v4 5/6] DynamicTablesPkg: AcpiSsdtPcieLibArm: Added function to reserve ECAM space To: devel@edk2.groups.io, kuqin12@gmail.com Cc: Joe Lopez , "nd@arm.com" References: <20220810222853.1916-1-kuqin12@gmail.com> <20220810222853.1916-6-kuqin12@gmail.com> From: "Sami Mujawar" In-Reply-To: <20220810222853.1916-6-kuqin12@gmail.com> X-ClientProxiedBy: LO2P265CA0058.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::22) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: fba2c03d-0600-41a8-1cac-08da80485651 X-MS-TrafficTypeDiagnostic: AM0PR08MB4932:EE_|DBAEUR03FT032:EE_|AS8PR08MB5911:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: zCsgvScqmtT/QAxhPWQlZnDDzXLkEpt9V9xL/Mvr33sGz7dcdcwn8H9vXkOWPiRKjoI32FzAKfmyHcJiOwfZXtE+DdE1ahFUrx0zfkfcJJCKFA/PwWalPKUUWBwQCToLOaxWw1Y2dL7gNmYJQk0rBgvRYZb2fCApzh74fy8AxTQgnr5XJ0W11tB4tWGow7SpR4h5qpv4Ic2FkX6nuVB4SkB1ptzaPrtFn9xYRfsjxigZ7h46cHVtEVBtBPqtZUtjHA1BqbvxbgEQrI/FsiDuOpqWnUrdRBECbtLat9AGG3gB9JiWQT1ba3AtGgdNu8WDYrcVuLJPrpT1yeRUcczbkCwMh1CAgm2SalY1Iq+0OC2swhOtQab5mxkcKTeb1p3h9rUyvjOhjONAUx2YEgWU3GNFvpxuQLKvJWvnDeiGsUcMv6gI5PuMQzg4sgG4sMlOknoRBnQ3vd741SHFEMBB8HeuNfaWh+lypHQqH+UcoZMgNvhB7KOOiJ1KrOj8hfDuq4Hznyt1wfIbDzgSur7d/pD6LcO6+q+h4fVii0673c8Sm5Ko+rVQtsZguZLy+H4ZqpZnqf/j4yeB4yJePlS5Sss2Qh8lHfO3G3WKt3fj5/2z8GTrwxeJ9Ei6S2wkzQEFj66XA8NO4snfAl1UTCoU01zcPpLniQrIKetM0KKdKnRu7CgSciaKzd+522uu998mW1exJsrpXUPsh4WkGpc35hbj7wrtlEzczh5F7b0Yvlo45Vu+lnBzUpCaOAxkoHDsCywGQgziWSOxmOveNE+mUdBig4i9V33vuqRNP9zG+pF6+VWZtTp3bWeL5zcEpPchSqGmQ8Lc4wliwfMrCq7Syr7J1AavAbznO7qBkwiQEpG0icZ/rVJKFm5IRGEVTFbIX797P1q0AselstBGRswelg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(376002)(396003)(136003)(39860400002)(346002)(6506007)(41300700001)(478600001)(38100700002)(6486002)(966005)(36756003)(53546011)(2906002)(31686004)(44832011)(86362001)(4326008)(45080400002)(8676002)(66946007)(66556008)(66476007)(316002)(5660300002)(54906003)(31696002)(26005)(6512007)(83380400001)(186003)(2616005)(8936002)(213903007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4932 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ed5b2365-68ec-4b2f-d172-08da8048511f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pCl8zPUkWMhgiJHm8Qz2Bz3nYWm7sf5nCUqRdjomYBqjrr4WFKznbJjsmz8z2zf4aHUvo6UK1XyjzRFzhVx4veEw91IjwPbjDrFEe7CZLsDKQg1zq/XVD5q8r4ZGGx2h4mClUlaGf3SaR4yT6MYfin+883Bo4sLZZoZIwR5NuDRD8v5g7CRWwnwDMWPNlavHHPmeEWYdsu3nFix8CeVM00eNghOjsu9+ghH0VCT6L80TFeO3V5J31Md71W3KO1dtYVl27WrF0UwWr099P9uD1xm0luOlk4TM2KGpdM+VZlGoWK6SEd6jKBfXvBX61VFLqQ4hblz2kvftbbA9wk3jqM5GbrIx3oWRebP7fHNAjs20QqTFDTSdHuPnICvxuQ02/MNL+p5Zgfs5oGpUj0Mwjhim0JTnE6T+Z9EHSfKY4H6vLaBnbe2t4flXhLoIpWIQlOMVq+UOs18s3HObQyUaQiZWyIHpGRNK2dqxbqc4rWBbzEcgGTon8Z+ussZv7zm0zsbd1tTtBL/u0uPZXzsnkVaBnXRWOs8q6SFiH2IXUywivaq5oOnRWmPVuUOOn/JY2kqFAkDGtmNjGfQEBElQaQ+vDw70kRB4svr+hASWN54tvBXz7Zcqviot/ZEA7cibqmVtiN312YSTS/Tw4kbT94HqSrVoBa7TvIl+X1LOImkDMHTIKq+eUeLK8kl/+qzFXixzKJnBHpd4WE5xYCL4lnDsGC4fJsh7RM8OcYqCAqGl4/ysU8gHT0gyEuo16RdGnxavSXEvcnA5lRiOpS2tMJECylvQTNNY7DSQUGZDtoQKUpkFKXYdRV6muLRPZWjDBvR5qrIWdEfcWRFd00zq950OeyZJEloSdrxvKs6CFMzgsZCuk2A7XqX6ebcVCV1rmTdIFZCsELjILG6FZIzGVQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(376002)(346002)(39860400002)(136003)(396003)(46966006)(36840700001)(40470700004)(31686004)(186003)(53546011)(86362001)(2906002)(36756003)(6506007)(31696002)(478600001)(26005)(45080400002)(6512007)(336012)(47076005)(6486002)(2616005)(41300700001)(966005)(83380400001)(82310400005)(40480700001)(316002)(5660300002)(70586007)(54906003)(40460700003)(4326008)(8676002)(81166007)(356005)(36860700001)(44832011)(70206006)(82740400003)(8936002)(213903007)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2022 12:02:20.0503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fba2c03d-0600-41a8-1cac-08da80485651 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5911 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Kun, Thank you for the updated patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 10/08/2022 11:28 pm, Kun Qin via groups.io wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3998 > > Certain OSes will complain if the ECAM config space is not reserved in > 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 > --- > > Notes: > v2: > - Only create RES0 after config space checking [Pierre] > > v3: > - Updated function names and descriptions [Pierre] > - Moved translation calculation to CONFIG case [Pierre] > > v4: > - Used CM_ARM_PCI_CONFIG_SPACE_INFO for ECAM region calculation [Sami, Pierre] > > DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c | 135 ++++++++++++++++++++ > 1 file changed, 135 insertions(+) > > diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > index ceffe2838c03..dd75fc27e60e 100644 > --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtPcieLibArm/SsdtPcieGenerator.c > @@ -34,6 +34,9 @@ > > > #include "SsdtPcieGenerator.h" > > > > +#define PCI_MAX_DEVICE_COUNT_PER_BUS 32 > > +#define PCI_MAX_FUNCTION_COUNT_PER_DEVICE 8 > > + > > /** ARM standard SSDT Pcie Table Generator. > > > > Requirements: > > @@ -616,6 +619,130 @@ GeneratePciCrs ( > return Status; > > } > > > > +/** Generate a RES0 device node to reserve PNP motherboard resources > > + for a given PCI node. > > + > > + @param [in] PciNode Parent PCI node handle of the generated > > + resource object. > > + @param [out] CrsNode CRS node of the AML tree to populate. > > + > > + @retval EFI_SUCCESS The function completed successfully. > > + @retval EFI_INVALID_PARAMETER Invalid input parameter. > > + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. > > +**/ > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +GenerateMotherboardDevice ( > > + IN AML_OBJECT_NODE_HANDLE PciNode, > > + OUT AML_OBJECT_NODE_HANDLE *CrsNode > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT32 EisaId; > > + AML_OBJECT_NODE_HANDLE ResNode; > > + > > + if (CrsNode == NULL) { > > + ASSERT (0); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + // ASL: Device (RES0) {} > > + Status = AmlCodeGenDevice ("RES0", PciNode, &ResNode); > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + // ASL: Name (_HID, EISAID ("PNP0C02")) > > + Status = AmlGetEisaIdFromString ("PNP0C02", &EisaId); /* PNP Motherboard Resources */ > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + Status = AmlCodeGenNameInteger ("_HID", EisaId, ResNode, NULL); > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + // ASL: Name (_CRS, ResourceTemplate () {}) > > + Status = AmlCodeGenNameResourceTemplate ("_CRS", ResNode, CrsNode); > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + return Status; > > +} > > + > > +/** Reserves ECAM space for PCI config space > > + > > + @param [in] Generator The SSDT Pci generator. > > + @param [in] CfgMgrProtocol Pointer to the Configuration Manager > > + Protocol interface. > > + @param [in] PciInfo Pci device information. > > + @param [in, out] PciNode RootNode of the AML tree to populate. > > + > > + @retval EFI_SUCCESS The function completed successfully. > > + @retval EFI_INVALID_PARAMETER Invalid parameter. > > + @retval EFI_OUT_OF_RESOURCES Could not allocate memory. > > +**/ > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +ReserveEcamSpace ( > > + IN ACPI_PCI_GENERATOR *Generator, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, > > + IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciInfo, > > + IN OUT AML_OBJECT_NODE_HANDLE PciNode > > + ) > > +{ > > + EFI_STATUS Status; > > + AML_OBJECT_NODE_HANDLE CrsNode; > > + UINT64 AddressMinimum; > > + UINT64 AddressMaximum; > > + > > + Status = GenerateMotherboardDevice (PciNode, &CrsNode); > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + AddressMinimum = PciInfo->BaseAddress + (PciInfo->StartBusNumber * > > + PCI_MAX_DEVICE_COUNT_PER_BUS * PCI_MAX_FUNCTION_COUNT_PER_DEVICE * SIZE_4KB); > > + AddressMaximum = PciInfo->BaseAddress + ((PciInfo->EndBusNumber + 1) * > > + PCI_MAX_DEVICE_COUNT_PER_BUS * PCI_MAX_FUNCTION_COUNT_PER_DEVICE * SIZE_4KB) - 1; > > + > > + Status = AmlCodeGenRdQWordMemory ( > > + FALSE, > > + TRUE, > > + TRUE, > > + TRUE, > > + FALSE, // non-cacheable > > + TRUE, > > + 0, > > + AddressMinimum, > > + AddressMaximum, > > + 0, // no translation > > + AddressMaximum - AddressMinimum + 1, > > + 0, > > + NULL, > > + 0, > > + TRUE, > > + CrsNode, > > + NULL > > + ); > > + > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > + return Status; > > +} > > + > > /** Generate a Pci device. > > > > @param [in] Generator The SSDT Pci generator. > > @@ -702,9 +829,17 @@ GeneratePciDevice ( > return Status; > > } > > > > + // Add the PNP Motherboard Resources Device to reserve ECAM space > > + Status = ReserveEcamSpace (Generator, CfgMgrProtocol, PciInfo, PciNode); > > + if (EFI_ERROR (Status)) { > > + ASSERT (0); > > + return Status; > > + } > > + > > // Add the template _OSC method. > > Status = AddOscMethod (PciInfo, PciNode); > > ASSERT_EFI_ERROR (Status); > > + > > return Status; > > } > > >