]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Vlv2TbltDevicePkg/PlatformDxe/BoardId.c
edk2: Remove packages moved to edk2-platforms
[mirror_edk2.git] / Vlv2TbltDevicePkg / PlatformDxe / BoardId.c
diff --git a/Vlv2TbltDevicePkg/PlatformDxe/BoardId.c b/Vlv2TbltDevicePkg/PlatformDxe/BoardId.c
deleted file mode 100644 (file)
index 7d77456..0000000
+++ /dev/null
@@ -1,223 +0,0 @@
-/** @file\r
-\r
-  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>\r
-                                                                                   \r\r
-  SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-                                                                                   \r\r
-\r
-Module Name:\r
-\r
-\r
-  BoardId.c\r
-\r
-Abstract:\r
-\r
-  Initialization for the board ID.\r
-\r
-  This code should be common across a chipset family of products.\r
-\r
-\r
-\r
---*/\r
-\r
-#include "PchRegs.h"\r
-#include "PlatformDxe.h"\r
-#include <Guid/IdccData.h>\r
-#include <Guid/EfiVpdData.h>\r
-#include <Protocol/DataHub.h>\r
-\r
-\r
-extern EFI_GUID mPlatformDriverGuid;\r
-\r
-//\r
-// Global module data\r
-//\r
-UINT32 mBoardId;\r
-UINT8  mBoardIdIndex;\r
-EFI_BOARD_FEATURES mBoardFeatures;\r
-UINT16 mSubsystemDeviceId;\r
-UINT16 mSubsystemAudioDeviceId;\r
-CHAR8  BoardAaNumber[7];\r
-BOOLEAN mFoundAANum;\r
-\r
-/**\r
-\r
-  Write the boardid variable if it does not already exist.\r
-\r
-**/\r
-VOID\r
-InitializeBoardId (\r
-  )\r
-{\r
-\r
-  UINT32                        BoardIdBufferSize;\r
-  EFI_IDCC_BOARD_FORM_FACTOR    IdccBoardFormFactor;\r
-  EFI_DATA_HUB_PROTOCOL         *DataHub;\r
-  EFI_STATUS                    Status;\r
-  DMI_DATA                      DmiDataVariable;\r
-  UINTN                         Size;\r
-#if defined(DUPLICATE_AA_NO_BASE_ADDR)\r
-  CHAR8                         DuplicateAaNoAscii[sizeof(DmiDataVariable.BaseBoardVersion)];\r
-  UINTN                         iter;\r
-#endif\r
-#if defined(GPIO_BOARD_ID_SUPPORT) && GPIO_BOARD_ID_SUPPORT != 0\r
-  UINT8                         Data8;\r
-#endif\r
-\r
-  //\r
-  // Update data from the updatable DMI data area\r
-  //\r
-  Size = sizeof (DMI_DATA);\r
-  SetMem(&DmiDataVariable, Size, 0xFF);\r
-  Status = gRT->GetVariable (\r
-                  DMI_DATA_NAME,\r
-                  &gDmiDataGuid,\r
-                  NULL,\r
-                  &Size,\r
-                  &DmiDataVariable\r
-                  );\r
-\r
-#if defined(DUPLICATE_AA_NO_BASE_ADDR)\r
-  //\r
-  // Get AA# from flash descriptor region\r
-  //\r
-  EfiSetMem(DuplicateAaNoAscii, sizeof(DuplicateAaNoAscii), 0xFF);\r
-  FlashRead((UINT8 *)(UINTN)DUPLICATE_AA_NO_BASE_ADDR,\r
-            (UINT8 *)DuplicateAaNoAscii,\r
-            sizeof(DuplicateAaNoAscii));\r
-\r
-  //\r
-  // Validate AA# read from VPD\r
-  //\r
-  for (iter = 0; iter < sizeof(DuplicateAaNoAscii); iter++) {\r
-     if ((DuplicateAaNoAscii[iter] != 0xFF) &&\r
-         (DuplicateAaNoAscii[iter] != DmiDataVariable.BaseBoardVersion[iter])) {\r
-       DmiDataVariable.BaseBoardVersion[iter] = DuplicateAaNoAscii[iter];\r
-     }\r
-  }\r
-\r
-  Status = EFI_SUCCESS;\r
-#endif\r
-\r
-  mFoundAANum = FALSE;\r
-\r
-  //\r
-  // No variable...no copy\r
-  //\r
-  if (EFI_ERROR (Status)) {\r
-    mBoardIdIndex = 0; // If we can't find the BoardId in the table, use the first entry\r
-  } else {\r
-       //\r
-    // This is the correct method of checking for AA#.\r
-    //\r
-    CopyMem(&BoardAaNumber, ((((UINT8*)&DmiDataVariable.BaseBoardVersion)+2)), 6);\r
-    BoardAaNumber[6] = 0;\r
-    for (mBoardIdIndex = 0; mBoardIdIndex < mBoardIdDecodeTableSize; mBoardIdIndex++) {\r
-      if (AsciiStrnCmp(mBoardIdDecodeTable[mBoardIdIndex].AaNumber, BoardAaNumber, 6) == 0) {\r
-        mFoundAANum = TRUE;\r
-        break;\r
-      }\r
-    }\r
-\r
-    if(!mFoundAANum) {\r
-       //\r
-      // Add check for AA#'s that is programmed without the AA as leading chars.\r
-      //\r
-      CopyMem(&BoardAaNumber, (((UINT8*)&DmiDataVariable.BaseBoardVersion)), 6);\r
-      BoardAaNumber[6] = 0;\r
-      for (mBoardIdIndex = 0; mBoardIdIndex < mBoardIdDecodeTableSize; mBoardIdIndex++) {\r
-        if (AsciiStrnCmp(mBoardIdDecodeTable[mBoardIdIndex].AaNumber, BoardAaNumber, 6) == 0) {\r
-          mFoundAANum = TRUE;\r
-          break;\r
-        }\r
-      }\r
-    }\r
-  }\r
-\r
-#if defined(GPIO_BOARD_ID_SUPPORT) && GPIO_BOARD_ID_SUPPORT != 0\r
-  //\r
-  // If we can't find the BoardAA# in the table, find BoardId\r
-  //\r
-  if (mFoundAANum != TRUE) {\r
-    //\r
-    // BoardID BIT    Location\r
-    //  0             GPIO33  (ICH)\r
-    //  1             GPIO34  (ICH)\r
-    //\r
-    Data8 = IoRead8(GPIO_BASE_ADDRESS + R_PCH_GPIO_SC_LVL2);\r
-\r
-    //\r
-    // BoardId[0]\r
-    //\r
-    mBoardId = (UINT32)((Data8 >> 1) & BIT0);\r
-    //\r
-    // BoardId[1]\r
-    //\r
-    mBoardId |= (UINT32)((Data8 >> 1) & BIT1);\r
-\r
-    for (mBoardIdIndex = 0; mBoardIdIndex < mBoardIdDecodeTableSize; mBoardIdIndex++) {\r
-      if (mBoardIdDecodeTable[mBoardIdIndex].BoardId == mBoardId) {\r
-        break;\r
-      }\r
-    }\r
-#endif\r
-    if (mBoardIdIndex == mBoardIdDecodeTableSize) {\r
-      mBoardIdIndex = 0; // If we can't find the BoardId in the table, use the first entry\r
-    }\r
-#if defined(GPIO_BOARD_ID_SUPPORT) && GPIO_BOARD_ID_SUPPORT != 0\r
-  }\r
-#endif\r
-\r
-  mBoardFeatures = mBoardIdDecodeTable[mBoardIdIndex].Features;\r
-  mSubsystemDeviceId = mBoardIdDecodeTable[mBoardIdIndex].SubsystemDeviceId;\r
-  mSubsystemAudioDeviceId = mBoardIdDecodeTable[mBoardIdIndex].AudioSubsystemDeviceId;\r
-\r
-  //\r
-  // Set the BoardFeatures variable\r
-  //\r
-  BoardIdBufferSize = sizeof (mBoardFeatures);\r
-  gRT->SetVariable (\r
-         BOARD_FEATURES_NAME,\r
-         &gEfiBoardFeaturesGuid,\r
-         EFI_VARIABLE_NON_VOLATILE |\r
-         EFI_VARIABLE_BOOTSERVICE_ACCESS |\r
-         EFI_VARIABLE_RUNTIME_ACCESS,\r
-         BoardIdBufferSize,\r
-         &mBoardFeatures\r
-         );\r
-\r
-  //\r
-  // Get the Data Hub protocol\r
-  //\r
-  Status = gBS->LocateProtocol (\r
-                  &gEfiDataHubProtocolGuid,\r
-                  NULL,\r
-                  (VOID **) &DataHub\r
-                  );\r
-  if (!(EFI_ERROR(Status))) {\r
-    //\r
-    // Fill out data\r
-    //\r
-    IdccBoardFormFactor.IdccHeader.Type = EFI_IDCC_BOARD_FORM_FACTOR_TYPE;\r
-    IdccBoardFormFactor.IdccHeader.RecordLength = sizeof(EFI_IDCC_BOARD_FORM_FACTOR);\r
-    if ((mBoardFeatures & B_BOARD_FEATURES_FORM_FACTOR_ATX) || (mBoardFeatures & B_BOARD_FEATURES_FORM_FACTOR_MICRO_ATX)) {\r
-        IdccBoardFormFactor.BoardFormFactor = ATX_FORM_FACTOR; // ATX\r
-    } else {\r
-        IdccBoardFormFactor.BoardFormFactor = BTX_FORM_FACTOR; // BTX\r
-    }\r
-\r
-    //\r
-    // Publish the Board Form Factor value for IDCC\r
-    //\r
-    Status = DataHub->LogData (\r
-                        DataHub,\r
-                        &gIdccDataHubGuid,\r
-                        &mPlatformDriverGuid,\r
-                        EFI_DATA_RECORD_CLASS_DATA,\r
-                        &IdccBoardFormFactor,\r
-                        sizeof(EFI_IDCC_BOARD_FORM_FACTOR)\r
-                        );\r
-  }\r
-}\r
-\r