public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nhi Pham via groups.io" <nhi=os.amperecomputing.com@groups.io>
To: devel@edk2.groups.io
Cc: quic_llindhol@quicinc.com, chuong@os.amperecomputing.com,
	rebecca@os.amperecomputing.com, nhi@os.amperecomputing.com
Subject: [edk2-devel] [edk2-platforms][PATCH 1/3] AmpereAltraPkg/AcpiConfigDxe: Remove Max Frequency config option
Date: Thu, 15 Aug 2024 14:12:32 +0700	[thread overview]
Message-ID: <20240815071234.3807473-2-nhi@os.amperecomputing.com> (raw)
In-Reply-To: <20240815071234.3807473-1-nhi@os.amperecomputing.com>

Beginning with SCP version 1.08, the CPU nominal frequency is
equivalient to the maximum (turbo) frequency. Hence, the max frequency
config option can be eliminated from the ACPI Configuration screen.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
 Silicon/Ampere/AmpereAltraPkg/Include/AcpiConfigNVDataStruct.h            |  4 +-
 Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigVfr.vfr     | 13 ---
 Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c       | 83 --------------------
 Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigStrings.uni |  3 -
 4 files changed, 1 insertion(+), 102 deletions(-)

diff --git a/Silicon/Ampere/AmpereAltraPkg/Include/AcpiConfigNVDataStruct.h b/Silicon/Ampere/AmpereAltraPkg/Include/AcpiConfigNVDataStruct.h
index a56bfa9aa694..58574015c642 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Include/AcpiConfigNVDataStruct.h
+++ b/Silicon/Ampere/AmpereAltraPkg/Include/AcpiConfigNVDataStruct.h
@@ -18,9 +18,7 @@ typedef struct {
   UINT32 EnableApeiSupport;
   UINT32 AcpiCppcEnable;
   UINT32 AcpiLpiEnable;
-  UINT32 AcpiTurboSupport;
-  UINT32 AcpiTurboMode;
-  UINT32 Reserved[4];
+  UINT32 Reserved[6];
 } ACPI_CONFIG_VARSTORE_DATA;
 
 #pragma pack()
diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigVfr.vfr b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigVfr.vfr
index 3962aa227037..0d775172ce81 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigVfr.vfr
+++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigVfr.vfr
@@ -51,19 +51,6 @@ formset
       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
index 6ba39ad4409b..4536010a6f0d 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c
+++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigDxe.c
@@ -338,79 +338,6 @@ DriverCallback (
   return EFI_SUCCESS;
 }
 
-STATIC
-EFI_STATUS
-AcpiNVDataUpdate (
-  IN ACPI_CONFIG_PRIVATE_DATA *PrivateData
-  )
-{
-  EFI_STATUS         Status;
-  PLATFORM_INFO_HOB  *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;
-  PLATFORM_INFO_HOB  *PlatformHob;
-  BOOLEAN            EnableTurbo;
-
-  ASSERT (PrivateData != NULL);
-
-  if (PrivateData->Configuration.AcpiTurboSupport != 0) {
-    PlatformHob = PrivateData->PlatformHob;
-    EnableTurbo = (PrivateData->Configuration.AcpiTurboMode != 0) ? TRUE : FALSE;
-
-    if (PlatformHob->TurboCapability[0] != 0) {
-      Status = MailboxMsgTurboConfig (0, EnableTurbo);
-      if (EFI_ERROR (Status)) {
-        return Status;
-      }
-    }
-
-    if (PlatformHob->TurboCapability[1] != 0) {
-      Status = MailboxMsgTurboConfig (1, EnableTurbo);
-      if (EFI_ERROR (Status)) {
-        return Status;
-      }
-    }
-  } else {
-    DEBUG ((DEBUG_INFO, "%a: Turbo mode is unsupported! \n", __FUNCTION__));
-  }
-
-  return EFI_SUCCESS;
-}
-
 STATIC
 EFI_STATUS
 UpdateCPPCConfig (
@@ -519,11 +446,6 @@ UpdateAcpiOnReadyToBoot (
     return;
   }
 
-  Status = UpdateTurboModeConfig (mPrivateData);
-  if (EFI_ERROR (Status)) {
-    return;
-  }
-
   //
   // Close DSDT Table
   //
@@ -719,10 +641,5 @@ AcpiConfigEntryPoint (
     return Status;
   }
 
-  Status = AcpiNVDataUpdate (mPrivateData);
-  if (EFI_ERROR (Status)) {
-    return Status;
-  }
-
   return EFI_SUCCESS;
 }
diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigStrings.uni b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigStrings.uni
index 21a6188518fd..143672262744 100644
--- a/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigStrings.uni
+++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/AcpiConfigDxe/AcpiConfigStrings.uni
@@ -22,6 +22,3 @@
 
 #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.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#120348): https://edk2.groups.io/g/devel/message/120348
Mute This Topic: https://groups.io/mt/107909935/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-08-15  7:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15  7:12 [edk2-devel] [edk2-platforms][PATCH 0/3] AmpereAltraPkg: Remove Max Frequency config Nhi Pham via groups.io
2024-08-15  7:12 ` Nhi Pham via groups.io [this message]
2024-08-15  7:12 ` [edk2-devel] [edk2-platforms][PATCH 2/3] AmpereAltraPkg/PlatformInfoDxe: Correct CPU frequency info Nhi Pham via groups.io
2024-08-15  7:12 ` [edk2-devel] [edk2-platforms][PATCH 3/3] AmpereAltraPkg/SystemFirmwareInterfaceLib: Remove unused MailboxMsgTurboConfig() Nhi Pham via groups.io
2024-08-22  6:58 ` [edk2-devel] [edk2-platforms][PATCH 0/3] AmpereAltraPkg: Remove Max Frequency config Chuong Tran
2024-08-23  2:50   ` Nhi Pham via groups.io

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240815071234.3807473-2-nhi@os.amperecomputing.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox