From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.116]) by mx.groups.io with SMTP id smtpd.web09.4092.1607505888632196578 for ; Wed, 09 Dec 2020 01:24:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=Byx0Jbov; spf=pass (domain: os.amperecomputing.com, ip: 40.107.220.116, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jafr5864yXZFRjM6eFZedW291S3nLInz7oJx0jCCfkAEcNa0nsr3jC5fn06Ax0j6W6Wqdz0mrjI4iZrUe/bO3GeX2wyd6t+Z3nNgikov4C7tepw0wdDs6Fu+FWZvMEF2HlVxdg0j2prU6rrVIRBAZH2KJQ5tbJgnb+ySXZAbLofQ7WgXvTzqMckRg9W1Z9oihB6rueU7dCAvuz/8wSLz8F2Bsjoygeo4R/HvWv9oJA7JRJ8k3TRXZjYf2zTn3eiMX+W9NQltFsZeq1Gk6M3fFLufHtT8jMYdBtpexxHVTuQbOYF2JZE03Q0FKdI0x+9IxJm2jcyJtMkRgyyCASRyTw== 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-SenderADCheck; bh=m5J+Q/qcgI+SAfuGB3gRj019InCwWqLrXJu8nar3agk=; b=eCdWuBqnSiRUas7oI0++cqGhUry4OL1a6S7qxMfMhlTH8YwF8I5erxoJXvpfDWGwp+DDT1pUY+3Az4b6WDifFw2nJ9eIioYioLbdxkR45vb3f6kmc/hdm7UT59uyFDmGx4mNIkvqXTYhZY4YY5n+lbEYY7+icCkHcE/96HUhBnDwNefxpQNMoua5EIiY3LymKSEd2CwdZBdgrWKThVHydYMjsj4AKrZzDKGs6oVRgmhvZrAJQLR9a1ImSzERQwRAk1SJK2L8MLoyXyMlgB4K8AmatlWMIZgc0GRsSZt6J7ZQOibk78q8pEDWfmzgJsgHVlkwfTSQN7LVYsRR7ciUMg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m5J+Q/qcgI+SAfuGB3gRj019InCwWqLrXJu8nar3agk=; b=Byx0Jbov0v9UpEl6H/F9ZxJgalkO2pPW+PE2X9LCczeTc5O8sNW+UTF/4u+E9EpPjFa/7u+1b1/Fqi+fx5MWvjdfBbI5JMPzUJBDtRWreTc+5O6CPbhPHkJIF0FSQONdNSf+YXJkK8Dp4qMqqt3EvAqEnUNx7Vv9wlA69QRefrQ= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=os.amperecomputing.com; Received: from DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) by DM6PR01MB5609.prod.exchangelabs.com (2603:10b6:5:157::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.21; Wed, 9 Dec 2020 09:24:47 +0000 Received: from DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076]) by DM6PR01MB5849.prod.exchangelabs.com ([fe80::c814:9a08:5c2e:4076%5]) with mapi id 15.20.3632.023; Wed, 9 Dec 2020 09:24:47 +0000 From: "Nhi Pham" To: devel@edk2.groups.io Cc: Nhi Pham Subject: [edk2-platforms][PATCH 24/34] AmpereAltraPkg: Add ACPI configuration screen Date: Wed, 9 Dec 2020 16:25:21 +0700 Message-Id: <20201209092531.30867-25-nhi@os.amperecomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201209092531.30867-1-nhi@os.amperecomputing.com> References: <20201209092531.30867-1-nhi@os.amperecomputing.com> X-Originating-IP: [118.69.219.201] X-ClientProxiedBy: HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) To DM6PR01MB5849.prod.exchangelabs.com (2603:10b6:5:205::20) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sw004.amperecomputing.com (118.69.219.201) by HK0PR01CA0054.apcprd01.prod.exchangelabs.com (2603:1096:203:a6::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Wed, 9 Dec 2020 09:24:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e11a52bf-8b63-4f58-a5e7-08d89c244592 X-MS-TrafficTypeDiagnostic: DM6PR01MB5609: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:207; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VEulPkmw43LlEK/Xdpqnyvdw+ZLvauxuVpO5KeszAw3ZT1K8s2Be/9yi7bOwgc79g1eQMGzKXkSHi0zR0X4wMvOS0jHee2Dr9Nuas9MFNoTCqsez8JgdNe2hSj48JsNWN7A5VJkorHNpQCh+AhuTobIj1qEcc+cdifeWqLNUtqVvHxJBR/51E0ZJIbVmngI57OYh11qcLfzU93mMrFP26FjHw4qCSrZqJ6VPqtwXRD6deH3kSDo8ykw7hfyKjoFhL/u4I98du41sf37Sa1LdEvsyzjSAYnDwCr4KA9V7PFDg2K/KlO4HqMnBI+Q2QytHcfJrwFk7CrtvUJukDPjtLKMJO1IyuS1HH4AyTKJB8mhf24NJ8kKWLsjjClI/k7OeMj51bulZYtM2mum9b29hdIl8s+T/7J9198ChqGKKqT0kZsAQRxG8dgbg+rDKjtuX X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR01MB5849.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(346002)(366004)(5660300002)(956004)(508600001)(52116002)(30864003)(66946007)(6916009)(2616005)(1076003)(19627235002)(86362001)(6512007)(66476007)(26005)(8936002)(16526019)(107886003)(6666004)(186003)(6486002)(8676002)(66574015)(6506007)(83380400001)(2906002)(34490700003)(66556008)(4326008)(290074003)(44824005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?8BmxnZJGim7sHp9zjD7wejqnGZesFAqcSgSCCIBP3ThPK2mL6xPlI3BDT/Lq?= =?us-ascii?Q?jKSPSTomy2W+ol8XNsvcwmrjQDpz/FijmvXBIGlz9fmXlDPDopYlw8b6pSwk?= =?us-ascii?Q?KxfAtNg0pNPdNqM2E8iO0n4mGzXg4uNavWpq838F+f2Np0+IFkDw6VT9tAMe?= =?us-ascii?Q?S6YpoPesqcWylBVSPAVcQ/7khWIPMDyfhbH9y6TrHics4PyiMJ+GNidxixPz?= =?us-ascii?Q?ynVgdtiHLagK9sZG3SsO8wfRIRHEl5dEfyARrvJI+NST5N0x1ijykdFw9cn2?= =?us-ascii?Q?qn054AgEnrC+gnxKQmBo2iHtmh7vjjEJc3gbMJgi59Q1zg9P0NJ2A7hTZs/i?= =?us-ascii?Q?kCdh944BZdn/L2870d+xQ5EC1IMkP6rvoahkVOUtczEIZY9Z/NgNTUJcsXbC?= =?us-ascii?Q?P7vvF8M1xrPAqAeBDfpbzsxuib2V6//9TqGnGUIxL4S7imgbhzNc758AM/eU?= =?us-ascii?Q?ot4BsqF13FuAtWwDTGMAkTyW9uMhNfq9j0n2JWkmKFWhl4g/yvj4HaoNeLbJ?= =?us-ascii?Q?8BC3/bLzPKx8Sc3ckMyhO6Bq1b3lq6eThda7eGtU/zCTx9fZImgWwM6M1fEa?= =?us-ascii?Q?PzcUcE/tX+cOh37BP1gyKWY4tsDEvE44yHPxQyuiwjoFZB3GlJps8eeqKtWp?= =?us-ascii?Q?ZuHtAt6sEB7NVnDYarS6Icnid4UwlkdrQyMNbHZhzLP9FM7sUQqg25gQWV+D?= =?us-ascii?Q?4VR13/P1e+p5jnhsXj2dtp6XpeWP/MM6p2UgKksFlNv9btk91tj8ZBL9XnXY?= =?us-ascii?Q?6AKUWHm6DR6NVaLWm+9ox24C1HoCZOw2+Jns7BcT+kt4obwmHdGrCj7tmmI6?= =?us-ascii?Q?eOqgfA4MqfP7hSjYrtMGiqLxk9S1W4bKfw3LhaA5bXf5mon96VfS7niX+QqI?= =?us-ascii?Q?3WwSAhMbxj7sOm9uQHhzOPPXIS+5f9eIxlQZHakwVkp/a6LetXcrsZk9+7WR?= =?us-ascii?Q?+60LZW1ojB0el0/RhrEuSqbPU80QznrgHq61QSc3wlgVjT0C+23/Q0AtWrDW?= =?us-ascii?Q?TkCV?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR01MB5849.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2020 09:24:47.1660 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-Network-Message-Id: e11a52bf-8b63-4f58-a5e7-08d89c244592 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lP3RZ/0GaeDxIqdSVTP4Ou3h5byNlofuWoBO4c9SFA8i023VW59KC/6ieZKxKklTkUC/8719G9dcU7OeUprUX/Ws7YjEX2fOuvVeu5G7uK4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR01MB5609 Content-Type: text/plain This supports: * Enable/Disable CPPC Support * Enable/Disable LPI support * Enable/Disable Max Performance Mode Signed-off-by: Nhi Pham --- Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec | 3 + Platform/Ampere/JadePkg/Jade.dsc | 1 + Platform/Ampere/JadePkg/Jade.fdf | 1 + Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf | 55 ++ Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.h | 84 +++ Silicon/Ampere/AmpereAltraPkg/Include/AcpiNVDataStruc.h | 27 + Silicon/Ampere/AmpereAltraPkg/Include/Guid/AcpiConfigFormSet.h | 19 + Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/Vfr.vfr | 61 ++ Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c | 729 ++++++++++++++++++++ Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/VfrStrings.uni | 24 + 10 files changed, 1004 insertions(+) diff --git a/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec b/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec index 9f5c4817e225..2ddf5f8fbf57 100644 --- a/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec +++ b/Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec @@ -47,6 +47,9 @@ [Guids] # GUID for the CPU HII configuration form gCpuConfigFormSetGuid = { 0x43FAA144, 0xA2DF, 0x4050, { 0xA7, 0xFD, 0xEE, 0x17, 0xC9, 0xB8, 0x88, 0x8E } } + # GUID for the ACPI HII configuration form + gAcpiConfigFormSetGuid = { 0x0ceb6764, 0xd415, 0x4b01, { 0xa8, 0x43, 0xd1, 0x01, 0xbc, 0xb0, 0xd8, 0x29 } } + ## SPI NOR Proxy MM GUID gSpiNorMmGuid = { 0xC8D76438, 0x4D3C, 0x4BEA, { 0xBF, 0x86, 0x92, 0x6B, 0x83, 0x07, 0xA2, 0x39 } } diff --git a/Platform/Ampere/JadePkg/Jade.dsc b/Platform/Ampere/JadePkg/Jade.dsc index 7b293350d40d..6d2079117377 100755 --- a/Platform/Ampere/JadePkg/Jade.dsc +++ b/Platform/Ampere/JadePkg/Jade.dsc @@ -160,3 +160,4 @@ [Components.common] Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf Silicon/Ampere/AmpereAltraPkg/Drivers/MemInfo/MemInfoDxe.inf Silicon/Ampere/AmpereAltraPkg/Drivers/CpuConfigDxe/CpuConfigDxe.inf + Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jade.fdf index fb87bba69a0a..2cf2678e1d76 100755 --- a/Platform/Ampere/JadePkg/Jade.fdf +++ b/Platform/Ampere/JadePkg/Jade.fdf @@ -376,5 +376,6 @@ [FV.FvMain] INF Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf INF Silicon/Ampere/AmpereAltraPkg/Drivers/MemInfo/MemInfoDxe.inf INF Silicon/Ampere/AmpereAltraPkg/Drivers/CpuConfigDxe/CpuConfigDxe.inf + INF Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf !include Platform/Ampere/FvRules.fdf.inc diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf new file mode 100644 index 000000000000..af32819e11f0 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.inf @@ -0,0 +1,55 @@ +## @file +# +# Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = AcpiConfigDxe + FILE_GUID = F36685AE-2623-4231-ABC0-2C151451E6B7 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + ENTRY_POINT = AcpiConfigEntryPoint + +[Sources.common] + AcpiConfigDxe.c + AcpiConfigDxe.h + Vfr.vfr + VfrStrings.uni + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Silicon/Ampere/AmperePkg.dec + Silicon/Ampere/AmpereAltraPkg/Ac01Pkg.dec + +[LibraryClasses] + UefiDriverEntryPoint + UefiBootServicesTableLib + MemoryAllocationLib + BaseMemoryLib + BaseLib + UefiLib + DevicePathLib + DebugLib + HiiLib + HobLib + PMProLib + AcpiHelperLib + +[Guids] + gPlatformManagerFormsetGuid + gAcpiConfigFormSetGuid + gEfiEventReadyToBootGuid + +[Protocols] + gEfiDevicePathProtocolGuid ## CONSUMES + gEfiHiiConfigRoutingProtocolGuid ## CONSUMES + gEfiHiiConfigAccessProtocolGuid ## PRODUCES + +[Depex] + gEfiVariableArchProtocolGuid AND + gEfiVariableWriteArchProtocolGuid diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.h new file mode 100644 index 000000000000..44fc508f2c38 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.h @@ -0,0 +1,84 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _DRIVER_SAMPLE_H_ +#define _DRIVER_SAMPLE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +// +// This is the generated IFR binary data for each formset defined in VFR. +// +extern UINT8 VfrBin[]; + +// +// This is the generated String package data for all .UNI files. +// +extern UINT8 AcpiConfigDxeStrings[]; + +#define ACPI_CONFIG_PRIVATE_SIGNATURE SIGNATURE_32 ('A', 'C', 'P', 'I') + +typedef struct { + UINTN Signature; + + EFI_HANDLE DriverHandle; + EFI_HII_HANDLE HiiHandle; + ACPI_CONFIG_VARSTORE_DATA Configuration; + PlatformInfoHob_V2 *PlatformHob; + EFI_ACPI_SDT_PROTOCOL *AcpiTableProtocol; + EFI_ACPI_HANDLE AcpiTableHandle; + + // + // Consumed protocol + // + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + + // + // Produced protocol + // + EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess; +} ACPI_CONFIG_PRIVATE_DATA; + +#define ACPI_CONFIG_PRIVATE_FROM_THIS(a) CR (a, ACPI_CONFIG_PRIVATE_DATA, ConfigAccess, ACPI_CONFIG_PRIVATE_SIGNATURE) + +#pragma pack(1) + +/// +/// HII specific Vendor Device Path definition. +/// +typedef struct { + VENDOR_DEVICE_PATH VendorDevicePath; + EFI_DEVICE_PATH_PROTOCOL End; +} HII_VENDOR_DEVICE_PATH; + +#pragma pack() + +#endif diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/AcpiNVDataStruc.h b/Silicon/Ampere/AmpereAltraPkg/Include/AcpiNVDataStruc.h new file mode 100644 index 000000000000..79610c1a3fad --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Include/AcpiNVDataStruc.h @@ -0,0 +1,27 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _ACPI_NV_DATA_STRUC_H_ +#define _ACPI_NV_DATA_STRUC_H_ + +#pragma pack(1) + +// +// ACPI Configuration NV data structure definition +// +typedef struct { + UINT32 AcpiCppcEnable; + UINT32 AcpiLpiEnable; + UINT32 AcpiTurboSupport; + UINT32 AcpiTurboMode; + UINT32 Reserved[4]; +} ACPI_CONFIG_VARSTORE_DATA; + +#pragma pack() + +#endif /* _ACPI_NV_DATA_STRUC_H_ */ diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/Guid/AcpiConfigFormSet.h b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/AcpiConfigFormSet.h new file mode 100644 index 000000000000..ad614a944ab4 --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Include/Guid/AcpiConfigFormSet.h @@ -0,0 +1,19 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _ACPI_CONFIG_FORMSET_GUID_H_ +#define _ACPI_CONFIG_FORMSET_GUID_H_ + +#define ACPI_CONFIGURATION_FORMSET_GUID \ + { \ + 0x0ceb6764, 0xd415, 0x4b01, { 0xa8, 0x43, 0xd1, 0x01, 0xbc, 0xb0, 0xd8, 0x29 } \ + } + +extern EFI_GUID gAcpiConfigFormSetGuid; + +#endif /* _ACPI_CONFIG_FORMSET_GUID_H_ */ diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/Vfr.vfr b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/Vfr.vfr new file mode 100644 index 000000000000..6971b445818d --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/Vfr.vfr @@ -0,0 +1,61 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + + +#include +#include + +#define ACPI_CONFIG_FORM_ID 1 + +formset + guid = ACPI_CONFIGURATION_FORMSET_GUID, + title = STRING_TOKEN(STR_ACPI_FORM), + help = STRING_TOKEN(STR_ACPI_FORM_HELP), + classguid = gPlatformManagerFormsetGuid, + + varstore ACPI_CONFIG_VARSTORE_DATA, + name = AcpiConfigNVData, + guid = ACPI_CONFIGURATION_FORMSET_GUID; + + form + formid = ACPI_CONFIG_FORM_ID, + title = STRING_TOKEN(STR_ACPI_FORM); + subtitle text = STRING_TOKEN(STR_ACPI_FORM_HELP); + + oneof + varid = AcpiConfigNVData.AcpiCppcEnable, + prompt = STRING_TOKEN(STR_ACPI_CPPC_PROMPT), + help = STRING_TOKEN(STR_ACPI_CPPC_HELP), + option text = STRING_TOKEN(STR_ACPI_COMMON_DISABLE), value = 0, flags = 0; + option text = STRING_TOKEN(STR_ACPI_COMMON_ENABLE), value = 1, flags = DEFAULT; + endoneof; + + oneof + varid = AcpiConfigNVData.AcpiLpiEnable, + prompt = STRING_TOKEN(STR_ACPI_LPI_PROMPT), + help = STRING_TOKEN(STR_ACPI_LPI_HELP), + option text = STRING_TOKEN(STR_ACPI_COMMON_DISABLE), value = 0, flags = 0; + option text = STRING_TOKEN(STR_ACPI_COMMON_ENABLE), value = 1, flags = DEFAULT; + endoneof; + + grayoutif ideqval AcpiConfigNVData.AcpiTurboSupport == 0; + oneof + varid = AcpiConfigNVData.AcpiTurboMode, + prompt = STRING_TOKEN(STR_ACPI_TURBO_PROMPT), + help = STRING_TOKEN(STR_ACPI_TURBO_HELP), + option text = STRING_TOKEN(STR_ACPI_COMMON_ENABLE), value = 1, flags = DEFAULT; + option text = STRING_TOKEN(STR_ACPI_COMMON_DISABLE), value = 0, flags = 0; + suppressif ideqval AcpiConfigNVData.AcpiTurboSupport > 0; + option text = STRING_TOKEN(STR_ACPI_UNSUPPORTED), value = 2, flags = 0; + endif; + endoneof; + endif; + + endform; + +endformset; diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c new file mode 100644 index 000000000000..3bf61337140f --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c @@ -0,0 +1,729 @@ +/** @file + + Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "AcpiConfigDxe.h" + +#define ACPI_VARSTORE_ATTRIBUTES EFI_VARIABLE_BOOTSERVICE_ACCESS | \ + EFI_VARIABLE_RUNTIME_ACCESS | \ + EFI_VARIABLE_NON_VOLATILE + +CHAR16 AcpiVarstoreDataName[] = L"AcpiConfigNVData"; + +EFI_HANDLE mDriverHandle = NULL; +ACPI_CONFIG_PRIVATE_DATA *mPrivateData = NULL; + +HII_VENDOR_DEVICE_PATH mAcpiConfigHiiVendorDevicePath = { + { + { + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP, + { + (UINT8) (sizeof (VENDOR_DEVICE_PATH)), + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) + } + }, + ACPI_CONFIGURATION_FORMSET_GUID + }, + { + END_DEVICE_PATH_TYPE, + END_ENTIRE_DEVICE_PATH_SUBTYPE, + { + (UINT8) (END_DEVICE_PATH_LENGTH), + (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8) + } + } +}; + +/** + This function allows a caller to extract the current configuration for one + or more named elements from the target driver. + + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + @param Request A null-terminated Unicode string in + format. + @param Progress On return, points to a character in the Request + string. Points to the string's null terminator if + request was successful. Points to the most recent + '&' before the first failing name/value pair (or + the beginning of the string if the failure is in + the first name/value pair) if the request was not + successful. + @param Results A null-terminated Unicode string in + format which has all values filled + in for the names in the Request string. String to + be allocated by the called function. + + @retval EFI_SUCCESS The Results is filled with the requested values. + @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results. + @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name. + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this + driver. + +**/ +EFI_STATUS +EFIAPI +ExtractConfig ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Request, + OUT EFI_STRING *Progress, + OUT EFI_STRING *Results + ) +{ + EFI_STATUS Status; + UINTN BufferSize; + ACPI_CONFIG_PRIVATE_DATA *PrivateData; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + EFI_STRING ConfigRequest; + EFI_STRING ConfigRequestHdr; + UINTN Size; + BOOLEAN AllocatedRequest; + + if (Progress == NULL || Results == NULL) { + return EFI_INVALID_PARAMETER; + } + // + // Initialize the local variables. + // + ConfigRequestHdr = NULL; + ConfigRequest = NULL; + Size = 0; + *Progress = Request; + AllocatedRequest = FALSE; + + if ((Request != NULL) && !HiiIsConfigHdrMatch (Request, &gAcpiConfigFormSetGuid, AcpiVarstoreDataName)) { + return EFI_NOT_FOUND; + } + + PrivateData = ACPI_CONFIG_PRIVATE_FROM_THIS (This); + HiiConfigRouting = PrivateData->HiiConfigRouting; + + // + // Get Buffer Storage data from EFI variable. + // Try to get the current setting from variable. + // + BufferSize = sizeof (ACPI_CONFIG_VARSTORE_DATA); + Status = gRT->GetVariable ( + AcpiVarstoreDataName, + &gAcpiConfigFormSetGuid, + NULL, + &BufferSize, + &PrivateData->Configuration + ); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + // + // Convert buffer data to by helper function BlockToConfig() + // + BufferSize = sizeof (ACPI_CONFIG_VARSTORE_DATA); + ConfigRequest = Request; + if ((Request == NULL) || (StrStr (Request, L"OFFSET") == NULL)) { + // + // Request has no request element, construct full request string. + // Allocate and fill a buffer large enough to hold the template + // followed by "&OFFSET=0&WIDTH=WWWWWWWWWWWWWWWW" followed by a Null-terminator + // + ConfigRequestHdr = HiiConstructConfigHdr ( + &gAcpiConfigFormSetGuid, + AcpiVarstoreDataName, + PrivateData->DriverHandle + ); + Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16); + ConfigRequest = AllocateZeroPool (Size); + ASSERT (ConfigRequest != NULL); + if (ConfigRequest == NULL) { + return EFI_OUT_OF_RESOURCES; + } + AllocatedRequest = TRUE; + UnicodeSPrint (ConfigRequest, Size, L"%s&OFFSET=0&WIDTH=%016LX", ConfigRequestHdr, (UINT64)BufferSize); + FreePool (ConfigRequestHdr); + } + + // + // Convert buffer data to by helper function BlockToConfig() + // + Status = HiiConfigRouting->BlockToConfig ( + HiiConfigRouting, + ConfigRequest, + (UINT8 *) &PrivateData->Configuration, + BufferSize, + Results, + Progress + ); + + // + // Free the allocated config request string. + // + if (AllocatedRequest) { + FreePool (ConfigRequest); + ConfigRequest = NULL; + } + + // + // Set Progress string to the original request string. + // + if (Request == NULL) { + *Progress = NULL; + } else if (StrStr (Request, L"OFFSET") == NULL) { + *Progress = Request + StrLen (Request); + } + + return Status; +} + +/** + This function processes the results of changes in configuration. + + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + @param Configuration A null-terminated Unicode string in + format. + @param Progress A pointer to a string filled in with the offset of + the most recent '&' before the first failing + name/value pair (or the beginning of the string if + the failure is in the first name/value pair) or + the terminating NULL if all was successful. + + @retval EFI_SUCCESS The Results is processed successfully. + @retval EFI_INVALID_PARAMETER Configuration is NULL. + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this + driver. + +**/ +EFI_STATUS +EFIAPI +RouteConfig ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN CONST EFI_STRING Configuration, + OUT EFI_STRING *Progress + ) +{ + EFI_STATUS Status; + UINTN BufferSize; + ACPI_CONFIG_PRIVATE_DATA *PrivateData; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + + if (Configuration == NULL || Progress == NULL) { + return EFI_INVALID_PARAMETER; + } + + PrivateData = ACPI_CONFIG_PRIVATE_FROM_THIS (This); + HiiConfigRouting = PrivateData->HiiConfigRouting; + *Progress = Configuration; + + // + // Check routing data in . + // Note: if only one Storage is used, then this checking could be skipped. + // + if (!HiiIsConfigHdrMatch (Configuration, &gAcpiConfigFormSetGuid, AcpiVarstoreDataName)) { + return EFI_NOT_FOUND; + } + + // + // Get Buffer Storage data from EFI variable + // + BufferSize = sizeof (ACPI_CONFIG_VARSTORE_DATA); + Status = gRT->GetVariable ( + AcpiVarstoreDataName, + &gAcpiConfigFormSetGuid, + NULL, + &BufferSize, + &PrivateData->Configuration + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Convert to buffer data by helper function ConfigToBlock() + // + BufferSize = sizeof (ACPI_CONFIG_VARSTORE_DATA); + Status = HiiConfigRouting->ConfigToBlock ( + HiiConfigRouting, + Configuration, + (UINT8 *) &PrivateData->Configuration, + &BufferSize, + Progress + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Store Buffer Storage back to EFI variable + // + Status = gRT->SetVariable( + AcpiVarstoreDataName, + &gAcpiConfigFormSetGuid, + ACPI_VARSTORE_ATTRIBUTES, + sizeof (ACPI_CONFIG_VARSTORE_DATA), + &PrivateData->Configuration + ); + + return Status; +} + +/** + This function processes the results of changes in configuration. + + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. + @param Action Specifies the type of action taken by the browser. + @param QuestionId A unique value which is sent to the original + exporting driver so that it can identify the type + of data to expect. + @param Type The type of value for the question. + @param Value A pointer to the data being sent to the original + exporting driver. + @param ActionRequest On return, points to the action requested by the + callback function. + + @retval EFI_SUCCESS The callback successfully handled the action. + @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters. + +**/ +EFI_STATUS +EFIAPI +DriverCallback ( + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, + IN EFI_BROWSER_ACTION Action, + IN EFI_QUESTION_ID QuestionId, + IN UINT8 Type, + IN EFI_IFR_TYPE_VALUE *Value, + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest + ) +{ + if (Action != EFI_BROWSER_ACTION_CHANGING) { + // + // Do nothing for other UEFI Action. Only do call back when data is changed. + // + return EFI_UNSUPPORTED; + } + if (((Value == NULL) + && (Action != EFI_BROWSER_ACTION_FORM_OPEN) + && (Action != EFI_BROWSER_ACTION_FORM_CLOSE)) + || (ActionRequest == NULL)) { + return EFI_INVALID_PARAMETER; + } + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +AcpiNVDataUpdate ( + IN ACPI_CONFIG_PRIVATE_DATA *PrivateData + ) +{ + EFI_STATUS Status; + PlatformInfoHob_V2 *PlatformHob; + UINT32 TurboSupport; + + ASSERT (PrivateData != NULL); + + PlatformHob = PrivateData->PlatformHob; + TurboSupport = PlatformHob->TurboCapability[0] + PlatformHob->TurboCapability[1]; + + if (TurboSupport == 0) { + PrivateData->Configuration.AcpiTurboMode = 2; // Unsupported mode + PrivateData->Configuration.AcpiTurboSupport = 0; + } else { + PrivateData->Configuration.AcpiTurboSupport = 1; + } + + Status = gRT->SetVariable ( + AcpiVarstoreDataName, + &gAcpiConfigFormSetGuid, + ACPI_VARSTORE_ATTRIBUTES, + sizeof (ACPI_CONFIG_VARSTORE_DATA), + &PrivateData->Configuration + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a %d gRT->SetVariable() failed \n", __FUNCTION__, __LINE__)); + return Status; + } + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +UpdateTurboModeConfig ( + IN ACPI_CONFIG_PRIVATE_DATA *PrivateData + ) +{ + EFI_STATUS Status; + PlatformInfoHob_V2 *PlatformHob; + + ASSERT (PrivateData != NULL); + + if (PrivateData->Configuration.AcpiTurboSupport != 0) { + PlatformHob = PrivateData->PlatformHob; + + if (PlatformHob->TurboCapability[0] != 0) { + Status = PMProTurboEnable (0, PrivateData->Configuration.AcpiTurboMode); + if (EFI_ERROR (Status)) { + return Status; + } + } + + if (PlatformHob->TurboCapability[1] != 0) { + Status = PMProTurboEnable (1, PrivateData->Configuration.AcpiTurboMode); + if (EFI_ERROR (Status)) { + return Status; + } + } + } else { + DEBUG ((DEBUG_INFO, "%a: Turbo mode is unsupported! \n", __FUNCTION__)); + } + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +UpdateCPPCConfig ( + IN ACPI_CONFIG_PRIVATE_DATA *PrivateData + ) +{ + EFI_STATUS Status; + EFI_ACPI_HANDLE ChildHandle; + CHAR8 Buffer[64]; + EFI_ACPI_DATA_TYPE DataType; + UINTN DataSize; + UINT8 *Data; + EFI_ACPI_SDT_PROTOCOL *AcpiTableProtocol; + + ASSERT (PrivateData != NULL); + + AcpiTableProtocol = PrivateData->AcpiTableProtocol; + + AsciiSPrint (Buffer, sizeof (Buffer), "\\_SB.CPCE"); + Status = AcpiTableProtocol->FindPath ( + PrivateData->AcpiTableHandle, + (VOID *) Buffer, + &ChildHandle + ); + if (EFI_ERROR (Status)) { + DEBUG((DEBUG_ERROR, "Failed to find path CPCE\n")); + AcpiTableProtocol->Close (PrivateData->AcpiTableHandle); + return Status; + } + + Status = AcpiTableProtocol->GetOption ( + ChildHandle, 2, + &DataType, + (VOID *) &Data, + &DataSize + ); + if (EFI_ERROR (Status)) { + return Status; + } + Data[0] = PrivateData->Configuration.AcpiCppcEnable; + + return EFI_SUCCESS; +} + +STATIC +EFI_STATUS +UpdateLPIConfig ( + IN ACPI_CONFIG_PRIVATE_DATA *PrivateData + ) +{ + EFI_STATUS Status; + EFI_ACPI_HANDLE ChildHandle; + CHAR8 Buffer[64]; + EFI_ACPI_DATA_TYPE DataType; + UINTN DataSize; + UINT8 *Data; + EFI_ACPI_SDT_PROTOCOL *AcpiTableProtocol; + + ASSERT (PrivateData != NULL); + + AcpiTableProtocol = PrivateData->AcpiTableProtocol; + + AsciiSPrint (Buffer, sizeof (Buffer), "\\_SB.LPIE"); + Status = AcpiTableProtocol->FindPath ( + PrivateData->AcpiTableHandle, + (VOID *) Buffer, + &ChildHandle + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Fail to find path LPIE\n")); + AcpiTableProtocol->Close (PrivateData->AcpiTableHandle); + return Status; + } + + Status = AcpiTableProtocol->GetOption ( + ChildHandle, 2, + &DataType, + (VOID *) &Data, + &DataSize + ); + if (EFI_ERROR (Status)) { + return Status; + } + Data[0] = PrivateData->Configuration.AcpiLpiEnable; + + return EFI_SUCCESS; +} + +STATIC +VOID +UpdateAcpiOnReadyToBoot ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + EFI_ACPI_SDT_PROTOCOL *AcpiTableProtocol; + EFI_ACPI_HANDLE TableHandle; + + ASSERT (mPrivateData != NULL); + + // + // Find the AcpiTable protocol + // + Status = gBS->LocateProtocol ( + &gEfiAcpiSdtProtocolGuid, + NULL, + (VOID **) &AcpiTableProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Unable to locate ACPI table protocol\n")); + return; + } + + mPrivateData->AcpiTableProtocol = AcpiTableProtocol; + + Status = AcpiOpenDSDT (AcpiTableProtocol, &TableHandle); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Unable to locate DSDT table protocol\n")); + return; + } + + mPrivateData->AcpiTableHandle = TableHandle; + + Status = UpdateCPPCConfig (mPrivateData); + if (EFI_ERROR (Status)) { + return; + } + + Status = UpdateLPIConfig (mPrivateData); + if (EFI_ERROR (Status)) { + return; + } + + Status = UpdateTurboModeConfig (mPrivateData); + if (EFI_ERROR (Status)) { + return; + } + + // + // Close DSDT Table + // + AcpiTableProtocol->Close (TableHandle); + + AcpiDSDTUpdateChecksum (AcpiTableProtocol); +} + +STATIC +EFI_STATUS +AcpiConfigUnload ( + VOID + ) +{ + ASSERT (mPrivateData != NULL); + + if (mDriverHandle != NULL) { + gBS->UninstallMultipleProtocolInterfaces ( + mDriverHandle, + &gEfiDevicePathProtocolGuid, + &mAcpiConfigHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &mPrivateData->ConfigAccess, + NULL + ); + mDriverHandle = NULL; + } + + if (mPrivateData->HiiHandle != NULL) { + HiiRemovePackages (mPrivateData->HiiHandle); + } + + FreePool (mPrivateData); + mPrivateData = NULL; + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +AcpiConfigEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HII_HANDLE HiiHandle; + EFI_HII_CONFIG_ROUTING_PROTOCOL *HiiConfigRouting; + UINTN BufferSize; + ACPI_CONFIG_VARSTORE_DATA *Configuration; + BOOLEAN ActionFlag; + EFI_STRING ConfigRequestHdr; + EFI_EVENT ReadyToBootEvent; + CONST EFI_GUID PlatformHobGuid= PLATFORM_INFO_HOB_GUID_V2; + PlatformInfoHob_V2 *PlatformHob; + VOID *Hob; + + // + // Initialize the local variables. + // + ConfigRequestHdr = NULL; + + // + // Initialize driver private data + // + mPrivateData = AllocateZeroPool (sizeof (ACPI_CONFIG_PRIVATE_DATA)); + if (mPrivateData == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + mPrivateData->Signature = ACPI_CONFIG_PRIVATE_SIGNATURE; + + mPrivateData->ConfigAccess.ExtractConfig = ExtractConfig; + mPrivateData->ConfigAccess.RouteConfig = RouteConfig; + mPrivateData->ConfigAccess.Callback = DriverCallback; + + // + // Get the Platform HOB + // + Hob = GetFirstGuidHob (&PlatformHobGuid); + ASSERT (Hob != NULL); + if (Hob == NULL) { + AcpiConfigUnload (); + return EFI_DEVICE_ERROR; + } + PlatformHob = (PlatformInfoHob_V2 *) GET_GUID_HOB_DATA (Hob); + + mPrivateData->PlatformHob = PlatformHob; + + // + // Locate ConfigRouting protocol + // + Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &HiiConfigRouting); + if (EFI_ERROR (Status)) { + return Status; + } + mPrivateData->HiiConfigRouting = HiiConfigRouting; + + Status = gBS->InstallMultipleProtocolInterfaces ( + &mDriverHandle, + &gEfiDevicePathProtocolGuid, + &mAcpiConfigHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &mPrivateData->ConfigAccess, + NULL + ); + ASSERT_EFI_ERROR (Status); + + mPrivateData->DriverHandle = mDriverHandle; + + // + // Publish our HII data + // + HiiHandle = HiiAddPackages ( + &gAcpiConfigFormSetGuid, + mDriverHandle, + AcpiConfigDxeStrings, + VfrBin, + NULL + ); + if (HiiHandle == NULL) { + gBS->UninstallMultipleProtocolInterfaces ( + mDriverHandle, + &gEfiDevicePathProtocolGuid, + &mAcpiConfigHiiVendorDevicePath, + &gEfiHiiConfigAccessProtocolGuid, + &mPrivateData->ConfigAccess, + NULL + ); + return EFI_OUT_OF_RESOURCES; + } + + mPrivateData->HiiHandle = HiiHandle; + + // + // Initialize configuration data + // + Configuration = &mPrivateData->Configuration; + ZeroMem (Configuration, sizeof (ACPI_CONFIG_VARSTORE_DATA)); + + // + // Try to read NV config EFI variable first + // + ConfigRequestHdr = HiiConstructConfigHdr (&gAcpiConfigFormSetGuid, AcpiVarstoreDataName, mDriverHandle); + ASSERT (ConfigRequestHdr != NULL); + + BufferSize = sizeof (ACPI_CONFIG_VARSTORE_DATA); + Status = gRT->GetVariable (AcpiVarstoreDataName, &gAcpiConfigFormSetGuid, NULL, &BufferSize, Configuration); + if (EFI_ERROR (Status)) { + // + // Store zero data Buffer Storage to EFI variable + // + Status = gRT->SetVariable( + AcpiVarstoreDataName, + &gAcpiConfigFormSetGuid, + ACPI_VARSTORE_ATTRIBUTES, + sizeof (ACPI_CONFIG_VARSTORE_DATA), + Configuration + ); + if (EFI_ERROR (Status)) { + AcpiConfigUnload (); + return Status; + } + // + // EFI variable for NV config doesn't exit, we should build this variable + // based on default values stored in IFR + // + ActionFlag = HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD); + if (!ActionFlag) { + AcpiConfigUnload (); + return EFI_INVALID_PARAMETER; + } + } else { + // + // EFI variable does exist and Validate Current Setting + // + ActionFlag = HiiValidateSettings (ConfigRequestHdr); + if (!ActionFlag) { + AcpiConfigUnload (); + return EFI_INVALID_PARAMETER; + } + } + FreePool (ConfigRequestHdr); + + Status = gBS->CreateEventEx ( + EVT_NOTIFY_SIGNAL, + TPL_NOTIFY, + UpdateAcpiOnReadyToBoot, + NULL, + &gEfiEventReadyToBootGuid, + &ReadyToBootEvent + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Fail to create ready to boot event %r!\n", Status)); + return Status; + } + + Status = AcpiNVDataUpdate (mPrivateData); + if (EFI_ERROR (Status)) { + return Status; + } + + return EFI_SUCCESS; +} diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/VfrStrings.uni b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/VfrStrings.uni new file mode 100644 index 000000000000..f15a8ba433fa --- /dev/null +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/VfrStrings.uni @@ -0,0 +1,24 @@ +// +// Copyright (c) 2020, Ampere Computing LLC. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// + +#langdef en-US "English" + +#string STR_ACPI_FORM #language en-US "ACPI Configuration" +#string STR_ACPI_FORM_HELP #language en-US "ACPI Configuration" + +#string STR_ACPI_FORM_SEPERATE_LINE #language en-US "" +#string STR_ACPI_COMMON_ENABLE #language en-US "Enabled" +#string STR_ACPI_COMMON_DISABLE #language en-US "Disabled" +#string STR_ACPI_UNSUPPORTED #language en-US "Unsupported" + +#string STR_ACPI_CPPC_PROMPT #language en-US "CPPC Support" +#string STR_ACPI_CPPC_HELP #language en-US "Enables or Disables System ability to CPPC (Collaborative Processor Performance Control)" + +#string STR_ACPI_LPI_PROMPT #language en-US "LPI Support" +#string STR_ACPI_LPI_HELP #language en-US "Enables or Disables System ability to LPI (Lower Power Idle)" + +#string STR_ACPI_TURBO_PROMPT #language en-US "Max Performance" +#string STR_ACPI_TURBO_HELP #language en-US "Enables or Disables System ability to Max Performance" -- 2.17.1