From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.14.59; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=sami.mujawar@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140059.outbound.protection.outlook.com [40.107.14.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9899E21B02822 for ; Tue, 19 Mar 2019 06:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IBv03hhZ0l6dMlMSCLE+4kovAl1BjB+p6pgdy2lo5no=; b=aB8fs9qpJ/OUjSUpRe4Pewy7UP463AcA+499PeD8uePp5I40Q81nsySdSNgf+8ZT2S210d9se47eSfe33ssZcm7y0+zvOdWmBK7VISx8p5FmAXbilnZyL4WeANY/KMSacsPCpfpL2KqC1hZ0CQ8iC+69wmNHXHGe41F0mWPa5pY= Received: from HE1PR08CA0052.eurprd08.prod.outlook.com (2603:10a6:7:2a::23) by VI1PR0801MB1487.eurprd08.prod.outlook.com (2603:10a6:800:18::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.14; Tue, 19 Mar 2019 13:47:58 +0000 Received: from VE1EUR03FT057.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::208) by HE1PR08CA0052.outlook.office365.com (2603:10a6:7:2a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1709.13 via Frontend Transport; Tue, 19 Mar 2019 13:47:58 +0000 Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT057.mail.protection.outlook.com (10.152.19.123) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.1730.9 via Frontend Transport; Tue, 19 Mar 2019 13:47:57 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Tue, 19 Mar 2019 13:47:36 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Tue, 19 Mar 2019 13:47:36 +0000 Received: from E107187.Arm.com (10.1.195.55) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Tue, 19 Mar 2019 13:47:36 +0000 From: Sami Mujawar To: CC: , , , , , Date: Tue, 19 Mar 2019 13:47:23 +0000 Message-ID: <20190319134726.95524-4-sami.mujawar@arm.com> X-Mailer: git-send-email 2.11.0.windows.3 In-Reply-To: <20190319134726.95524-1-sami.mujawar@arm.com> References: <20190319134726.95524-1-sami.mujawar@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:40.67.248.234; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(376002)(346002)(396003)(136003)(2980300002)(189003)(199004)(478600001)(126002)(97736004)(316002)(4326008)(81166006)(30864003)(2351001)(106466001)(53416004)(76176011)(305945005)(2906002)(81156014)(16586007)(54906003)(1076003)(86362001)(6916009)(72206003)(47776003)(356004)(5660300002)(36756003)(336012)(6666004)(8936002)(486006)(50226002)(106002)(8676002)(50466002)(77096007)(48376002)(26005)(44832011)(68736007)(51416003)(7696005)(476003)(446003)(2616005)(11346002)(426003)(53936002)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB1487; H:nebula.arm.com; FPR:; SPF:Pass; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4be225f-ddb2-454d-1c09-08d6ac717ece X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060); SRVR:VI1PR0801MB1487; X-MS-TrafficTypeDiagnostic: VI1PR0801MB1487: NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0981815F2F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: h5Xx7rx2Rxi7BbjqjTOB6hZi/yov+5bcNZipqawln/hfQ6EuEzsKs5DIWbzc1ZYjwOHIo4HDH9xat8/AmeYphriWBgFAJfS1BNSP4mmEmmvxmaQAPTu8MbzjAAza4dtQ0M8EsZ8jP3R10BDi4xYYa2MOEw9+T/kRBAEHo9bPrhTTxuYQ1qrXcPLhibYb6Dca+XfsqdgityPUccav6XdvnAbB2J994ETA4yee3Pq4gcvzGkK9U2hCfePPgh2a3nlNr1pQg/ymQt+lug45Mg8hnh/GwxMDu5YcTFWaCmqGdo/1NSqU1GG7mtGzocolPVBGeDeLKiIUEbU5s0IPd8pmOQXmas1m1d5ZbIZp43PvZCmxxqS8BorcCGpH1LWPH1cA5g5rq7jDHUWBbEWTmDRHQv+OJ9k8Qh/NbtLn7ZFUkeY= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2019 13:47:57.6671 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4be225f-ddb2-454d-1c09-08d6ac717ece X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[40.67.248.234]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1487 Subject: [PATCH v2 3/6] DynamicTablesPkg: Add OEM Info X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 X-List-Received-Date: Tue, 19 Mar 2019 13:48:02 -0000 Content-Type: text/plain This patch originally merged in edk2 master at c788bdaba47536447ae37518a96d92e0da54aad7. However, this was later reverted at bdbbedea949eb4b10d24110c0e559b03c7a6bce4 as it was merged during the Soft Feature Freeze for edk2-stable201903. Resubmitting this patch as the edk2 merge window is now open. Added option for OEMs to provide OEM Table ID and OEM Revision for ACPI tables. Cc: Laszlo Ersek Cc: Alexei Fedorov Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Sami Mujawar Reviewed-by: Alexei Fedorov --- DynamicTablesPkg/Include/Library/TableHelperLib.h | 4 +-- DynamicTablesPkg/Include/StandardNameSpaceObjects.h | 18 ++++++++++++++ DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c | 2 +- DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c | 2 +- DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c | 26 ++++++++++++++------ 10 files changed, 46 insertions(+), 16 deletions(-) diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h b/DynamicTablesPkg/Include/Library/TableHelperLib.h index 3c4e1d23d2e6955388ab0b51fb57779f2225beb2..0f872bc3d08bf78e33bd8dab866e7bf57e00cb8c 100644 --- a/DynamicTablesPkg/Include/Library/TableHelperLib.h +++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h @@ -45,7 +45,7 @@ GetCgfMgrInfo ( @param [in] Generator Pointer to the ACPI table Generator. @param [in,out] AcpiHeader Pointer to the ACPI table header to be updated. - @param [in] Revision Revision of the ACPI table. + @param [in] AcpiTableInfo Pointer to the ACPI table info structure. @param [in] Length Length of the ACPI table. @retval EFI_SUCCESS The ACPI table is updated successfully. @@ -61,7 +61,7 @@ AddAcpiHeader ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR * CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader, - IN CONST UINT32 Revision, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo, IN CONST UINT32 Length ); diff --git a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h index 4377ee8f785399b02fec824f3a34d2f4ed3b1c01..58503858b27141cf7647a410c4b0b3fa574033de 100644 --- a/DynamicTablesPkg/Include/StandardNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/StandardNameSpaceObjects.h @@ -93,6 +93,24 @@ typedef struct CmAStdObjAcpiTableInfo { /// Optional pointer to the ACPI table data EFI_ACPI_DESCRIPTION_HEADER * AcpiTableData; + /// An OEM-supplied string that the OEM uses to identify the particular + /// data table. This field is particularly useful when defining a definition + /// block to distinguish definition block functions. The OEM assigns each + /// dissimilar table a new OEM Table ID. + /// This field could be constructed using the SIGNATURE_64() macro. + /// e.g. SIGNATURE_64 ('A','R','M','H','G','T','D','T') + /// Note: If this field is not populated (has value of Zero), then the + /// Generators shall populate this information using part of the + /// CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.OemId field and the + /// ACPI table signature. + UINT64 OemTableId; + + /// An OEM-supplied revision number. Larger numbers are assumed to be + /// newer revisions. + /// Note: If this field is not populated (has value of Zero), then the + /// Generators shall populate this information using the revision of the + /// Configuration Manager (CM_STD_OBJ_CONFIGURATION_MANAGER_INFO.Revision). + UINT32 OemRevision; } CM_STD_OBJ_ACPI_TABLE_INFO; /** A structure used to describe the SMBIOS table generators to be invoked. diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c index e21e2b660634b1aedce8167b74573694d6df2a3b..697cfc46abaedf34d30abf26e7ebb2b4d271822a 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c @@ -342,7 +342,7 @@ BuildDbg2Table ( CfgMgrProtocol, This, (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, sizeof (DBG2_TABLE) ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index 62927b51d6d7c1585da1cb0d59785e2382639002..6699901b42a63a152027de59887ed097748ece91 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -537,7 +537,7 @@ BuildFadtTable ( CfgMgrProtocol, This, (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, sizeof (EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE) ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c index 70f52507bc7f12a776f76271b3f378bc62e717ba..d58794ee3ef5b72a8b2e3eb930ad5ab5bbb57c38 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c @@ -518,7 +518,7 @@ BuildGtdtTable ( CfgMgrProtocol, This, &Gtdt->Header, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, TableSize ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index b53c4bb47798d4ad441db1fe1b1e5b180e313403..2bac7a59ea40d6a3cae675b39d5df26ab7783a29 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -1798,7 +1798,7 @@ BuildIortTable ( CfgMgrProtocol, This, &Iort->Header, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, TableSize ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c index 06794758308e028b7d8da06670b1793cbdb3ae81..1ee0b9e006bfa00ea5bbf6aa64209dac244c90a0 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c @@ -569,7 +569,7 @@ BuildMadtTable ( CfgMgrProtocol, This, &Madt->Header, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, TableSize ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c index 29eb72bd917227e87b8f126aa098a6e0ff3918cc..2131683a35158f40304892da9ab12e547483a4bc 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c @@ -220,7 +220,7 @@ BuildMcfgTable ( CfgMgrProtocol, This, &Mcfg->Header, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, TableSize ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c index a4654acb39812af022a1e678b78e31415d94ef30..6778d7673e71e6347f21935b5f709b690f64dab4 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c @@ -211,7 +211,7 @@ BuildSpcrTable ( CfgMgrProtocol, This, (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr, - AcpiTableInfo->AcpiTableRevision, + AcpiTableInfo, sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE) ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c index 02860ddf233b4a44c30450c8c090b416f1e07d81..203207bac2b202f568072b68e8cb25c5c258045f 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/TableHelper.c @@ -100,7 +100,7 @@ GetCgfMgrInfo ( @param [in] Generator Pointer to the ACPI table Generator. @param [in,out] AcpiHeader Pointer to the ACPI table header to be updated. - @param [in] Revision Revision of the ACPI table. + @param [in] AcpiTableInfo Pointer to the ACPI table info structure. @param [in] Length Length of the ACPI table. @retval EFI_SUCCESS The ACPI table is updated successfully. @@ -116,7 +116,7 @@ AddAcpiHeader ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol, IN CONST ACPI_TABLE_GENERATOR * CONST Generator, IN OUT EFI_ACPI_DESCRIPTION_HEADER * CONST AcpiHeader, - IN CONST UINT32 Revision, + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo, IN CONST UINT32 Length ) { @@ -151,7 +151,7 @@ AddAcpiHeader ( // UINT32 Length AcpiHeader->Length = Length; // UINT8 Revision - AcpiHeader->Revision = Revision; + AcpiHeader->Revision = AcpiTableInfo->AcpiTableRevision; // UINT8 Checksum AcpiHeader->Checksum = 0; @@ -159,12 +159,24 @@ AddAcpiHeader ( CopyMem (AcpiHeader->OemId, CfgMfrInfo->OemId, sizeof (AcpiHeader->OemId)); // UINT64 OemTableId - AcpiHeader->OemTableId = Generator->CreatorId; - AcpiHeader->OemTableId <<= 32; - AcpiHeader->OemTableId |= Generator->AcpiTableSignature; + if (AcpiTableInfo->OemTableId != 0) { + AcpiHeader->OemTableId = AcpiTableInfo->OemTableId; + } else { + AcpiHeader->OemTableId = SIGNATURE_32 ( + CfgMfrInfo->OemId[0], + CfgMfrInfo->OemId[1], + CfgMfrInfo->OemId[2], + CfgMfrInfo->OemId[3] + ) | + ((UINT64)Generator->AcpiTableSignature << 32); + } // UINT32 OemRevision - AcpiHeader->OemRevision = CfgMfrInfo->Revision; + if (AcpiTableInfo->OemRevision != 0) { + AcpiHeader->OemRevision = AcpiTableInfo->OemRevision; + } else { + AcpiHeader->OemRevision = CfgMfrInfo->Revision; + } // UINT32 CreatorId AcpiHeader->CreatorId = Generator->CreatorId; -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'