public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue
@ 2017-04-05  6:57 Guo, Mang
  2017-04-06  1:30 ` Wei, David
  0 siblings, 1 reply; 2+ messages in thread
From: Guo, Mang @ 2017-04-05  6:57 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: Wei, David, Lu, ShifeiX A

Fix "AcpiGlobalVariable" couldn't be get issue. S3 memory info was saved in this variable.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Guo Mang <mang.guo@intel.com>
---
 .../PlatformPreMemPei/PlatformInitPreMem.c                | 15 ++++++++-------
 .../CseVariableStorageSelectorLib.c                       |  9 ++++++++-
 .../SmmCseVariableStorageSelectorLib.inf                  |  4 +++-
 .../PeiCseVariableStorageSelectorLib.c                    |  8 +++++++-
 .../PeiCseVariableStorageSelectorLib.inf                  |  4 +++-
 5 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
index a002bef..854d737 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
@@ -907,6 +907,7 @@ PlatformInitPreMemEntryPoint (
   #endif
   PEI_BOARD_PRE_MEM_INIT_PPI       *BoardPreMemInitPpi;
   UINTN                            Instance;
+  UINT64                           AcpiVariableSetCompatibility;
 
   Status = (*PeiServices)->RegisterForShadow (FileHandle);
 
@@ -1070,25 +1071,25 @@ PlatformInitPreMemEntryPoint (
       ASSERT_EFI_ERROR (Status);
       return Status;
     }
-
-    VariableSize = sizeof (SystemConfiguration);
+ 
+    VariableSize = sizeof (AcpiVariableSetCompatibility);
     Status = VariableServices->GetVariable (
                                  VariableServices,
-                                 PLATFORM_SETUP_VARIABLE_NAME,
-                                 &gEfiSetupVariableGuid,
+                                 ACPI_GLOBAL_VARIABLE,
+                                 &gEfiAcpiVariableCompatiblityGuid,
                                  NULL,
                                  &VariableSize,
-                                 &SystemConfiguration
+                                 &AcpiVariableSetCompatibility
                                  );
 
     AcpiVarHobSize = sizeof (UINT64);
     BuildGuidDataHob (
       &gEfiAcpiVariableCompatiblityGuid,
-      &SystemConfiguration.AcpiVariableSetCompatibility,
+      &AcpiVariableSetCompatibility,
       sizeof (AcpiVarHobSize)
       );
 
-    DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", SystemConfiguration.AcpiVariableSetCompatibility));
+    DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", AcpiVariableSetCompatibility)); 
 
     PERF_START_EX (NULL, "RstVctr", "IBBL", 1, 0x1000);
     Tick = CarMap->IbblPerfRecord0;
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
index 09e6d68..1087196 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
@@ -1,7 +1,7 @@
 /** @file
   DXE SMM CSE Variable Storage Selector Library.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -75,6 +75,13 @@ GetCseVariableStoreFileType (
                                                                    CseVariableFileTypePreMemoryFile :
                                                                    CseVariableFileTypePrimaryIndexFile
                                                                    );
+  } else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+    CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+    DEBUG ((EFI_D_INFO, "CseVariableStorageSelectorLib - Variable is AcpiGlobalVariable\n"));
+    return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+                                                                   CseVariableFileTypePreMemoryFile :
+                                                                   CseVariableFileTypePrimaryIndexFile
+                                                                   );
   } else {
     //
     // All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
index 5956383..bbbde90 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
@@ -4,7 +4,7 @@
 #  Determines which CSE resources to consume in SMM.
 #  Example: HECI1 or HECI2.
 #
-#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -37,6 +37,7 @@
   MdePkg/MdePkg.dec
   BroxtonSiPkg/BroxtonSiPkg.dec
   BroxtonSiPkg/BroxtonSiPrivate.dec
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
 
 [Protocols]
   gEfiHeciSmmProtocolGuid
@@ -52,3 +53,4 @@
 [Guids]
   gEfiMemoryConfigVariableGuid
   gEfiSetupVariableGuid
+  gEfiAcpiVariableCompatiblityGuid
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
index cee10ea..a9d93fe 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
@@ -1,7 +1,7 @@
 /** @file
   PEI CSE Variable Storage Selector Library.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -73,6 +73,12 @@ GetCseVariableStoreFileType (
                                                                    CseVariableFileTypePreMemoryFile :
                                                                    CseVariableFileTypePrimaryIndexFile
                                                                    );
+} else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+    CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+    return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+                                                                   CseVariableFileTypePreMemoryFile :
+                                                                   CseVariableFileTypePrimaryIndexFile
+                                                                   );
   } else {
     //
     // All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
index bd6cce0..474a9b7 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
@@ -4,7 +4,7 @@
 #  Determines which CSE resources to consume in PEI.
 #  Example: HECI1 or HECI2.
 #
-#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -35,6 +35,7 @@
   MdePkg/MdePkg.dec
   BroxtonSiPkg/BroxtonSiPkg.dec
   BroxtonSiPkg/BroxtonSiPrivate.dec
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
 
 [LibraryClasses]
   BaseLib
@@ -45,3 +46,4 @@
 [Guids]
   gEfiMemoryConfigVariableGuid
   gEfiSetupVariableGuid
+  gEfiAcpiVariableCompatiblityGuid
-- 
2.10.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue
  2017-04-05  6:57 [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue Guo, Mang
@ 2017-04-06  1:30 ` Wei, David
  0 siblings, 0 replies; 2+ messages in thread
From: Wei, David @ 2017-04-06  1:30 UTC (permalink / raw)
  To: Guo, Mang, edk2-devel@lists.01.org; +Cc: Lu, ShifeiX A

Reviewed-by: zwei4 <david.wei@intel.com>


Thanks,
David  Wei                                 

-----Original Message-----
From: Guo, Mang 
Sent: Wednesday, April 05, 2017 2:57 PM
To: edk2-devel@lists.01.org
Cc: Wei, David <david.wei@intel.com>; Lu, ShifeiX A <shifeix.a.lu@intel.com>
Subject: [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue

Fix "AcpiGlobalVariable" couldn't be get issue. S3 memory info was saved in this variable.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Guo Mang <mang.guo@intel.com>
---
 .../PlatformPreMemPei/PlatformInitPreMem.c                | 15 ++++++++-------
 .../CseVariableStorageSelectorLib.c                       |  9 ++++++++-
 .../SmmCseVariableStorageSelectorLib.inf                  |  4 +++-
 .../PeiCseVariableStorageSelectorLib.c                    |  8 +++++++-
 .../PeiCseVariableStorageSelectorLib.inf                  |  4 +++-
 5 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
index a002bef..854d737 100644
--- a/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
+++ b/Platform/BroxtonPlatformPkg/Common/PlatformSettings/PlatformPreMemPei/PlatformInitPreMem.c
@@ -907,6 +907,7 @@ PlatformInitPreMemEntryPoint (
   #endif
   PEI_BOARD_PRE_MEM_INIT_PPI       *BoardPreMemInitPpi;
   UINTN                            Instance;
+  UINT64                           AcpiVariableSetCompatibility;
 
   Status = (*PeiServices)->RegisterForShadow (FileHandle);
 
@@ -1070,25 +1071,25 @@ PlatformInitPreMemEntryPoint (
       ASSERT_EFI_ERROR (Status);
       return Status;
     }
-
-    VariableSize = sizeof (SystemConfiguration);
+ 
+    VariableSize = sizeof (AcpiVariableSetCompatibility);
     Status = VariableServices->GetVariable (
                                  VariableServices,
-                                 PLATFORM_SETUP_VARIABLE_NAME,
-                                 &gEfiSetupVariableGuid,
+                                 ACPI_GLOBAL_VARIABLE,
+                                 &gEfiAcpiVariableCompatiblityGuid,
                                  NULL,
                                  &VariableSize,
-                                 &SystemConfiguration
+                                 &AcpiVariableSetCompatibility
                                  );
 
     AcpiVarHobSize = sizeof (UINT64);
     BuildGuidDataHob (
       &gEfiAcpiVariableCompatiblityGuid,
-      &SystemConfiguration.AcpiVariableSetCompatibility,
+      &AcpiVariableSetCompatibility,
       sizeof (AcpiVarHobSize)
       );
 
-    DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", SystemConfiguration.AcpiVariableSetCompatibility));
+    DEBUG ((DEBUG_INFO, "AcpiVariableAddr : 0x%08x\n", AcpiVariableSetCompatibility)); 
 
     PERF_START_EX (NULL, "RstVctr", "IBBL", 1, 0x1000);
     Tick = CarMap->IbblPerfRecord0;
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
index 09e6d68..1087196 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/CseVariableStorageSelectorLib.c
@@ -1,7 +1,7 @@
 /** @file
   DXE SMM CSE Variable Storage Selector Library.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -75,6 +75,13 @@ GetCseVariableStoreFileType (
                                                                    CseVariableFileTypePreMemoryFile :
                                                                    CseVariableFileTypePrimaryIndexFile
                                                                    );
+  } else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+    CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+    DEBUG ((EFI_D_INFO, "CseVariableStorageSelectorLib - Variable is AcpiGlobalVariable\n"));
+    return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+                                                                   CseVariableFileTypePreMemoryFile :
+                                                                   CseVariableFileTypePrimaryIndexFile
+                                                                   );
   } else {
     //
     // All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
index 5956383..bbbde90 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/DxeSmmCseVariableStorageSelectorLib/SmmCseVariableStorageSelectorLib.inf
@@ -4,7 +4,7 @@
 #  Determines which CSE resources to consume in SMM.
 #  Example: HECI1 or HECI2.
 #
-#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -37,6 +37,7 @@
   MdePkg/MdePkg.dec
   BroxtonSiPkg/BroxtonSiPkg.dec
   BroxtonSiPkg/BroxtonSiPrivate.dec
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
 
 [Protocols]
   gEfiHeciSmmProtocolGuid
@@ -52,3 +53,4 @@
 [Guids]
   gEfiMemoryConfigVariableGuid
   gEfiSetupVariableGuid
+  gEfiAcpiVariableCompatiblityGuid
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
index cee10ea..a9d93fe 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.c
@@ -1,7 +1,7 @@
 /** @file
   PEI CSE Variable Storage Selector Library.
 
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -73,6 +73,12 @@ GetCseVariableStoreFileType (
                                                                    CseVariableFileTypePreMemoryFile :
                                                                    CseVariableFileTypePrimaryIndexFile
                                                                    );
+} else if ((StrCmp (VariableName, L"AcpiGlobalVariable") == 0) &&
+    CompareGuid (VendorGuid, &gEfiAcpiVariableCompatiblityGuid)) {
+    return (CseVariableFileInfo[CseVariableFileTypePreMemoryFile]->FileEnabled ?
+                                                                   CseVariableFileTypePreMemoryFile :
+                                                                   CseVariableFileTypePrimaryIndexFile
+                                                                   );
   } else {
     //
     // All other variables are stored in individual CSE files
diff --git a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
index bd6cce0..474a9b7 100644
--- a/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
+++ b/Silicon/BroxtonSoC/BroxtonSiPkg/Library/Private/PeiCseVariableStorageSelectorLib/PeiCseVariableStorageSelectorLib.inf
@@ -4,7 +4,7 @@
 #  Determines which CSE resources to consume in PEI.
 #  Example: HECI1 or HECI2.
 #
-#  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -35,6 +35,7 @@
   MdePkg/MdePkg.dec
   BroxtonSiPkg/BroxtonSiPkg.dec
   BroxtonSiPkg/BroxtonSiPrivate.dec
+  IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
 
 [LibraryClasses]
   BaseLib
@@ -45,3 +46,4 @@
 [Guids]
   gEfiMemoryConfigVariableGuid
   gEfiSetupVariableGuid
+  gEfiAcpiVariableCompatiblityGuid
-- 
2.10.1.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-06  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-05  6:57 [Patch][edk2-platforms/devel-MinnowBoard3 1/3] Fix get variable issue Guo, Mang
2017-04-06  1:30 ` Wei, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox