Browse Source

KabylakeOpenBoardPkg: Add board ID to Global NVS

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2207

Adds the board ID as a field in global NVS (BDID) to allow ACPI code
to take conditional actions based on the active board.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
Michael Kubacki 4 years ago
parent
commit
3a853a38a7

+ 2 - 0
Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Library/BoardAcpiLib/DxeGalagoPro3AcpiTableLib.c

@@ -56,6 +56,8 @@ GalagoPro3UpdateGlobalNvs (
 
   mGlobalNvsArea.Area->Ps2MouseEnable     = PcdGet8 (PcdPs2KbMsEnable);
   mGlobalNvsArea.Area->Ps2KbMsEnable      = PcdGet8 (PcdPs2KbMsEnable);
+
+  mGlobalNvsArea.Area->BoardId = (UINT8) LibPcdGetSku ();
 }
 
 EFI_STATUS

+ 2 - 1
Platform/Intel/KabylakeOpenBoardPkg/Include/Acpi/GlobalNvs.asl

@@ -1,7 +1,7 @@
 /** @file
   ACPI DSDT table
 
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -111,4 +111,5 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
   Offset(81),     TNAT, 8,  // Offset(81),    TbtNativeOsHotPlug
   Offset(82),     TBSE, 8,  // Offset(82),    Thunderbolt(TM) Root port selector
   Offset(83),     TBS1, 8,  // Offset(83),    Thunderbolt(TM) Root port selector
+  Offset(84),     BDID, 8,  // Offset(84),    Board ID
   }

+ 2 - 1
Platform/Intel/KabylakeOpenBoardPkg/Include/Acpi/GlobalNvsAreaDef.h

@@ -1,7 +1,7 @@
 /** @file
   ACPI DSDT table
 
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -111,6 +111,7 @@ typedef struct {
   UINT8    TbtNativeOsHotPlug;                      ///< Offset 81      TbtNativeOsHotPlug
   UINT8    TbtSelector;                             ///< Offset 82      Thunderbolt(TM) Root port selector
   UINT8    TbtSelector1;                            ///< Offset 83      Thunderbolt(TM) Root port selector
+  UINT8    BoardId;                                 ///< Offset 84      Board ID
 } EFI_GLOBAL_NVS_AREA;
 
 #pragma pack(pop)

+ 2 - 0
Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Library/BoardAcpiLib/DxeKabylakeRvp3AcpiTableLib.c

@@ -56,6 +56,8 @@ KabylakeRvp3UpdateGlobalNvs (
 
   mGlobalNvsArea.Area->Ps2MouseEnable     = FALSE;
   mGlobalNvsArea.Area->Ps2KbMsEnable      = PcdGet8 (PcdPs2KbMsEnable);
+
+  mGlobalNvsArea.Area->BoardId = (UINT8) LibPcdGetSku ();
 }
 
 EFI_STATUS