]> git.proxmox.com Git - mirror_edk2.git/blobdiff - QuarkPlatformPkg/Platform/Dxe/MemorySubClass/MemorySubClass.c
edk2: Remove packages moved to edk2-platforms
[mirror_edk2.git] / QuarkPlatformPkg / Platform / Dxe / MemorySubClass / MemorySubClass.c
diff --git a/QuarkPlatformPkg/Platform/Dxe/MemorySubClass/MemorySubClass.c b/QuarkPlatformPkg/Platform/Dxe/MemorySubClass/MemorySubClass.c
deleted file mode 100644 (file)
index fb11f5f..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-/** @file\r
-This is the driver that locates the MemoryConfigurationData Variable, if it\r
-exists, and reports the data to the DataHub.\r
-\r
-Copyright (c) 2013-2015 Intel Corporation.\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-\r
-#include "MemorySubClass.h"\r
-\r
-extern UINT8 MemorySubClassStrings[];\r
-\r
-EFI_GUID  gEfiMemorySubClassDriverGuid = EFI_MEMORY_SUBCLASS_DRIVER_GUID;\r
-\r
-EFI_STATUS\r
-MemorySubClassEntryPoint (\r
-  IN EFI_HANDLE       ImageHandle,\r
-  IN EFI_SYSTEM_TABLE *SystemTable\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    This is the standard EFI driver point that detects whether there is a\r
-    MemoryConfigurationData Variable and, if so, reports memory configuration info\r
-    to the DataHub.\r
-\r
-  Arguments:\r
-    ImageHandle   - Handle for the image of this driver\r
-    SystemTable   - Pointer to the EFI System Table\r
-\r
-  Returns:\r
-    EFI_SUCCESS if the data is successfully reported\r
-    EFI_NOT_FOUND if the HOB list could not be located.\r
-\r
---*/\r
-{\r
-//  UINT8                           Index;\r
-  UINTN                           DataSize;\r
-  UINT8                           Dimm;\r
-  UINTN                           StringBufferSize;\r
-  UINT8                           NumSlots;\r
-  UINTN                           DevLocStrLen;\r
-  UINTN                           BankLocStrLen;\r
-  UINTN                           ManuStrLen;\r
-  UINTN                           SerialNumStrLen;\r
-  UINTN                           AssertTagStrLen;\r
-  UINTN                           PartNumStrLen;\r
-  UINTN                           MemoryDeviceSize;\r
-  CHAR8*                          OptionalStrStart;\r
-  UINT16                          ArrayInstance;\r
-  UINT64                          DimmMemorySize;\r
-  UINT64                          TotalMemorySize;\r
-  UINT32                          Data;\r
-  UINT32                          MemoryCapacity;\r
-  BOOLEAN                         MemoryDeviceSizeUnitMega;\r
-  EFI_STATUS                      Status;\r
-  EFI_STRING                      StringBuffer;\r
-  EFI_STRING                      DevLocStr;\r
-  EFI_STRING                      BankLocStr;\r
-  EFI_STRING                      ManuStr;\r
-  EFI_STRING                      SerialNumStr;\r
-  EFI_STRING                      AssertTagStr;\r
-  EFI_STRING                      PartNumStr;\r
-  EFI_HII_HANDLE                  HiiHandle;\r
-  EFI_SMBIOS_HANDLE               MemArraySmbiosHandle;\r
-  EFI_SMBIOS_HANDLE               MemArrayMappedAddrSmbiosHandle;\r
-  EFI_SMBIOS_HANDLE               MemDevSmbiosHandle;\r
-  EFI_SMBIOS_HANDLE               MemDevMappedAddrSmbiosHandle;\r
-  EFI_SMBIOS_HANDLE               MemModuleInfoSmbiosHandle;\r
-  SMBIOS_TABLE_TYPE6              *Type6Record;\r
-  SMBIOS_TABLE_TYPE16             *Type16Record;\r
-  SMBIOS_TABLE_TYPE17             *Type17Record;\r
-  SMBIOS_TABLE_TYPE19              *Type19Record;\r
-  SMBIOS_TABLE_TYPE20             *Type20Record;\r
-  EFI_SMBIOS_PROTOCOL             *Smbios;\r
-  EFI_MEMORY_ARRAY_LINK_DATA      ArrayLink;\r
-  EFI_MEMORY_ARRAY_LOCATION_DATA  ArrayLocationData;\r
-  EFI_MEMORY_DEVICE_START_ADDRESS_DATA  DeviceStartAddress;\r
-\r
-\r
-  DataSize = 0;\r
-  Dimm = 0;\r
-\r
-\r
-  //\r
-  // Allocate Buffers\r
-  //\r
-  StringBufferSize = (sizeof (CHAR16)) * 100;\r
-  StringBuffer = AllocateZeroPool (StringBufferSize);\r
-  ASSERT (StringBuffer != NULL);\r
-\r
-  //\r
-  // Locate dependent protocols\r
-  //\r
-  Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID**)&Smbios);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  //\r
-  // Add our default strings to the HII database. They will be modified later.\r
-  //\r
-  HiiHandle = HiiAddPackages (\r
-                &gEfiMemorySubClassDriverGuid,\r
-                NULL,\r
-                MemorySubClassStrings,\r
-                NULL\r
-                );\r
-  ASSERT (HiiHandle != NULL);\r
-\r
-  //\r
-  // Create physical array and associated data for all mainboard memory\r
-  // This will translate into a Type 16 SMBIOS Record\r
-  //\r
-  ArrayInstance = 1;\r
-\r
-  McD0PciCfg32 (QNC_ACCESS_PORT_MCR) = MESSAGE_READ_DW (0x3, 0x8);\r
-  TotalMemorySize =     McD0PciCfg32 (QNC_ACCESS_PORT_MDR);\r
-\r
-  ArrayLocationData.MemoryArrayLocation = EfiMemoryArrayLocationSystemBoard;\r
-  ArrayLocationData.MemoryArrayUse = EfiMemoryArrayUseSystemMemory;\r
-\r
-  ArrayLocationData.MemoryErrorCorrection = EfiMemoryErrorCorrectionNone;\r
-\r
-  Data = 0x40000000;//(UINT32) RShiftU64(MemConfigData->RowInfo.MaxMemory, 10);\r
-\r
-  ArrayLocationData.MaximumMemoryCapacity.Exponent = (UINT16) LowBitSet32 (Data);\r
-  ArrayLocationData.MaximumMemoryCapacity.Value    = (UINT16) (Data >> ArrayLocationData.MaximumMemoryCapacity.Exponent);\r
-\r
-  NumSlots = 2;// (UINT8)(MemConfigData->RowInfo.MaxRows >> 1);\r
-  ArrayLocationData.NumberMemoryDevices = (UINT16)(NumSlots);\r
-\r
-  //\r
-  // Report top level physical array to Type 16 SMBIOS Record\r
-  //\r
-  Type16Record = AllocatePool(sizeof(SMBIOS_TABLE_TYPE16) + 1 + 1);\r
-  ZeroMem(Type16Record, sizeof(SMBIOS_TABLE_TYPE16) + 1 + 1);\r
-\r
-  Type16Record->Hdr.Type = EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY;\r
-  Type16Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE16);\r
-  Type16Record->Hdr.Handle = 0;\r
-\r
-  Type16Record->Location = (UINT8)ArrayLocationData.MemoryArrayLocation;\r
-\r
-  Type16Record->Use = (UINT8)ArrayLocationData.MemoryArrayUse;\r
-\r
-  Type16Record->MemoryErrorCorrection = (UINT8)ArrayLocationData.MemoryErrorCorrection;\r
-\r
-  MemoryCapacity = (UINT32) ArrayLocationData.MaximumMemoryCapacity.Value * (1 << ((UINT32) ArrayLocationData.MaximumMemoryCapacity.Exponent - 10));\r
-  Type16Record->MaximumCapacity = MemoryCapacity;\r
-\r
-  Type16Record->MemoryErrorInformationHandle = 0xfffe;\r
-\r
-  Type16Record->NumberOfMemoryDevices = ArrayLocationData.NumberMemoryDevices;\r
-  //\r
-  // Don't change it. This handle will be referenced by type 17 records\r
-  //\r
-  MemArraySmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (Smbios, NULL, &MemArraySmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type16Record);\r
-  FreePool(Type16Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  // Do  associated data for each DIMM\r
-  //RowConfArray = &MemConfigData->RowConfArray;\r
-\r
-  //\r
-  // Get total memory size for the construction of smbios record type 19\r
-  //\r
-  //TotalMemorySize = 0;// MSG_BUS_READ(0x0208);\r
-\r
-  //\r
-  // Generate Memory Array Mapped Address info\r
-  //\r
-  Type19Record = AllocatePool(sizeof (SMBIOS_TABLE_TYPE19));\r
-  ZeroMem(Type19Record, sizeof(SMBIOS_TABLE_TYPE19));\r
-  Type19Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS;\r
-  Type19Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE19);\r
-  Type19Record->Hdr.Handle = 0;\r
-  Type19Record->StartingAddress = 0;\r
-  Type19Record->EndingAddress = (UINT32)RShiftU64(TotalMemorySize, 10) - 1;\r
-  Type19Record->MemoryArrayHandle = MemArraySmbiosHandle;\r
-  Type19Record->PartitionWidth = (UINT8)(NumSlots);\r
-\r
-  //\r
-  // Generate Memory Array Mapped Address info (TYPE 19)\r
-  //\r
-  MemArrayMappedAddrSmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (Smbios, NULL, &MemArrayMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type19Record);\r
-  FreePool(Type19Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-\r
-  // Use SPD data to generate Device Type info\r
-  ZeroMem (&ArrayLink, sizeof (EFI_MEMORY_ARRAY_LINK_DATA));\r
-  ArrayLink.MemoryDeviceLocator = STRING_TOKEN(STR_MEMORY_SUBCLASS_DEVICE_LOCATOR_0);\r
-  ArrayLink.MemoryBankLocator = STRING_TOKEN(STR_MEMORY_SUBCLASS_DEVICE_LOCATOR_0);\r
-  ArrayLink.MemoryAssetTag = STRING_TOKEN(STR_MEMORY_SUBCLASS_UNKNOWN);\r
-  ArrayLink.MemoryArrayLink.ProducerName = gEfiMemorySubClassDriverGuid;\r
-  ArrayLink.MemoryArrayLink.Instance = ArrayInstance;\r
-  ArrayLink.MemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;\r
-  ArrayLink.MemorySubArrayLink.ProducerName = gEfiMemorySubClassDriverGuid;\r
-  ArrayLink.MemorySubArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;\r
-  ArrayLink.MemoryFormFactor = EfiMemoryFormFactorChip;\r
-  ArrayLink.MemoryType = EfiMemoryTypeDdr2;\r
-\r
-\r
-  StrCpy (StringBuffer, L"NO DIMM,MEMROY DOWN");\r
-  ArrayLink.MemoryManufacturer = HiiSetString (\r
-                                   HiiHandle,\r
-                                   0,\r
-                                   StringBuffer,\r
-                                   NULL\r
-                                   );\r
-  ArrayLink.MemorySerialNumber = HiiSetString (\r
-                                   HiiHandle,\r
-                                   0,\r
-                                   StringBuffer,\r
-                                   NULL\r
-                                   );\r
-\r
-  ArrayLink.MemoryPartNumber = HiiSetString (\r
-                                 HiiHandle,\r
-                                 0,\r
-                                 StringBuffer,\r
-                                 NULL\r
-                                 );\r
-\r
-  //\r
-  // Hardcode value. Need to revise for different configuration.\r
-  //\r
-  ArrayLink.MemoryTotalWidth = 64;\r
-  ArrayLink.MemoryDataWidth = 64;\r
-\r
-  DimmMemorySize = TotalMemorySize;// MSG_BUS_READ(0x0208);\r
-\r
-  ArrayLink.MemoryDeviceSize.Exponent = (UINT16) LowBitSet64 (DimmMemorySize);\r
-  ArrayLink.MemoryDeviceSize.Value    = (UINT16) RShiftU64(DimmMemorySize, ArrayLink.MemoryDeviceSize.Exponent);\r
-  ArrayLink.MemoryTypeDetail.Synchronous  = 1;\r
-  Data = 800;\r
-  ArrayLink.MemorySpeed = *((EFI_EXP_BASE10_DATA *) &Data);\r
-\r
-\r
-\r
-  DevLocStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemoryDeviceLocator, NULL);\r
-  DevLocStrLen = StrLen(DevLocStr);\r
-  ASSERT(DevLocStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  BankLocStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemoryBankLocator, NULL);\r
-  BankLocStrLen = StrLen(BankLocStr);\r
-  ASSERT(BankLocStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  ManuStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemoryManufacturer, NULL);\r
-  ManuStrLen = StrLen(ManuStr);\r
-  ASSERT(ManuStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  SerialNumStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemorySerialNumber, NULL);\r
-  SerialNumStrLen = StrLen(SerialNumStr);\r
-  ASSERT(SerialNumStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  AssertTagStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemoryAssetTag, NULL);\r
-  AssertTagStrLen = StrLen(AssertTagStr);\r
-  ASSERT(AssertTagStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  PartNumStr = HiiGetPackageString(&gEfiMemorySubClassDriverGuid, ArrayLink.MemoryPartNumber, NULL);\r
-  PartNumStrLen = StrLen(PartNumStr);\r
-  ASSERT(PartNumStrLen <= SMBIOS_STRING_MAX_LENGTH);\r
-\r
-  //\r
-  // Report DIMM level memory module information to smbios (Type 6)\r
-  //\r
-  DataSize = sizeof(SMBIOS_TABLE_TYPE6) + DevLocStrLen + 1 + 1;\r
-  Type6Record = AllocatePool(DataSize);\r
-  ZeroMem(Type6Record, DataSize);\r
-  Type6Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON;\r
-  Type6Record->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE6);\r
-  Type6Record->Hdr.Handle = 0;\r
-  Type6Record->SocketDesignation = 1;\r
-  if (ArrayLink.MemorySpeed.Value == 0) {\r
-    Type6Record->CurrentSpeed = 0;\r
-  } else {\r
-    //\r
-    // Memory speed is in ns unit\r
-    //\r
-    Type6Record->CurrentSpeed = (UINT8)(1000 / (ArrayLink.MemorySpeed.Value));\r
-  }\r
-  //\r
-  // Device Size\r
-  //\r
-  MemoryDeviceSize = (UINTN)(ArrayLink.MemoryDeviceSize.Value) * (UINTN)(1 << ArrayLink.MemoryDeviceSize.Exponent);\r
-  if (MemoryDeviceSize == 0) {\r
-    *(UINT8*)&(Type6Record->InstalledSize) = 0x7F;\r
-    *(UINT8*)&(Type6Record->EnabledSize)   = 0x7F;\r
-  } else {\r
-    MemoryDeviceSize = (UINTN) RShiftU64 ((UINT64) MemoryDeviceSize, 21);\r
-    while (MemoryDeviceSize != 0) {\r
-      (*(UINT8*)&(Type6Record->InstalledSize))++;\r
-      (*(UINT8*)&(Type6Record->EnabledSize))++;\r
-      MemoryDeviceSize = (UINTN) RShiftU64 ((UINT64) MemoryDeviceSize,1);\r
-    }\r
-  }\r
-\r
-  if (ArrayLink.MemoryFormFactor == EfiMemoryFormFactorDimm ||\r
-    ArrayLink.MemoryFormFactor == EfiMemoryFormFactorFbDimm) {\r
-    *(UINT16*)&Type6Record->CurrentMemoryType |= 1<<8;\r
-  }\r
-  if (ArrayLink.MemoryFormFactor == EfiMemoryFormFactorSimm) {\r
-    *(UINT16*)&Type6Record->CurrentMemoryType |= 1<<7;\r
-  }\r
-  if (ArrayLink.MemoryType == EfiMemoryTypeSdram) {\r
-    *(UINT16*)&Type6Record->CurrentMemoryType |= 1<<10;\r
-  }\r
-  if (ArrayLink.MemoryTypeDetail.Edo == 1) {\r
-    *(UINT16*)&Type6Record->CurrentMemoryType |= 1<<4;\r
-  }\r
-  if (ArrayLink.MemoryTypeDetail.FastPaged == 1) {\r
-    *(UINT16*)&Type6Record->CurrentMemoryType |= 1<<3;\r
-  }\r
-  OptionalStrStart = (CHAR8 *)(Type6Record + 1);\r
-  UnicodeStrToAsciiStr(DevLocStr, OptionalStrStart);\r
-  MemModuleInfoSmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (Smbios, NULL, &MemModuleInfoSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type6Record);\r
-  FreePool(Type6Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-  //\r
-  // Report DIMM level Device Type to smbios (Type 17)\r
-  //\r
-  DataSize = sizeof (SMBIOS_TABLE_TYPE17) + DevLocStrLen + 1 + BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + PartNumStrLen + 1 + 1;\r
-  Type17Record = AllocatePool(DataSize);\r
-  ZeroMem(Type17Record, DataSize);\r
-  Type17Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_DEVICE;\r
-  Type17Record->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE17);\r
-  Type17Record->Hdr.Handle = 0;\r
-\r
-  Type17Record->MemoryArrayHandle = MemArraySmbiosHandle;\r
-  Type17Record->MemoryErrorInformationHandle = 0xfffe;\r
-  Type17Record->TotalWidth = ArrayLink.MemoryTotalWidth;\r
-  Type17Record->DataWidth = ArrayLink.MemoryDataWidth;\r
-  //\r
-  // Device Size\r
-  //\r
-  MemoryDeviceSize          = ((UINTN) ArrayLink.MemoryDeviceSize.Value) << (ArrayLink.MemoryDeviceSize.Exponent - 10);\r
-  MemoryDeviceSizeUnitMega  = FALSE;\r
-  //\r
-  // kilo as unit\r
-  //\r
-  if (MemoryDeviceSize > 0xffff) {\r
-    MemoryDeviceSize = MemoryDeviceSize >> 10;\r
-    //\r
-    // Mega as unit\r
-    //\r
-    MemoryDeviceSizeUnitMega = TRUE;\r
-  }\r
-\r
-  MemoryDeviceSize = MemoryDeviceSize & 0x7fff;\r
-  if (MemoryDeviceSize != 0 && MemoryDeviceSizeUnitMega == FALSE) {\r
-    MemoryDeviceSize |= 0x8000;\r
-  }\r
-  Type17Record->Size = (UINT16)MemoryDeviceSize;\r
-\r
-  Type17Record->FormFactor = (UINT8)ArrayLink.MemoryFormFactor;\r
-  Type17Record->DeviceLocator = 1;\r
-  Type17Record->BankLocator = 2;\r
-  Type17Record->MemoryType = (UINT8)ArrayLink.MemoryType;\r
-  CopyMem (\r
-    (UINT8 *) &Type17Record->TypeDetail,\r
-    &ArrayLink.MemoryTypeDetail,\r
-    2\r
-  );\r
-\r
-  Type17Record->Speed = ArrayLink.MemorySpeed.Value;\r
-  Type17Record->Manufacturer = 3;\r
-  Type17Record->SerialNumber = 4;\r
-  Type17Record->AssetTag = 5;\r
-  Type17Record->PartNumber = 6;\r
-  //\r
-  // temporary solution for save device label information.\r
-  //\r
-  Type17Record->Attributes = (UINT8)(Dimm + 1);\r
-\r
-  OptionalStrStart = (CHAR8 *)(Type17Record + 1);\r
-  UnicodeStrToAsciiStr(DevLocStr, OptionalStrStart);\r
-  UnicodeStrToAsciiStr(BankLocStr, OptionalStrStart + DevLocStrLen + 1);\r
-  UnicodeStrToAsciiStr(ManuStr, OptionalStrStart + DevLocStrLen + 1 + BankLocStrLen + 1);\r
-  UnicodeStrToAsciiStr(SerialNumStr, OptionalStrStart + DevLocStrLen + 1 + BankLocStrLen + 1 + ManuStrLen + 1);\r
-  UnicodeStrToAsciiStr(AssertTagStr, OptionalStrStart + DevLocStrLen + 1 + BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1);\r
-  UnicodeStrToAsciiStr(PartNumStr, OptionalStrStart + DevLocStrLen + 1 + BankLocStrLen + 1 + ManuStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1);\r
-  MemDevSmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (Smbios, NULL, &MemDevSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type17Record);\r
-  FreePool(Type17Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  //\r
-  // Generate Memory Device Mapped Address info\r
-  //\r
-  ZeroMem(&DeviceStartAddress, sizeof(EFI_MEMORY_DEVICE_START_ADDRESS_DATA));\r
-  DeviceStartAddress.MemoryDeviceStartAddress = 0;\r
-  DeviceStartAddress.MemoryDeviceEndAddress = DeviceStartAddress.MemoryDeviceStartAddress + DimmMemorySize-1;\r
-  DeviceStartAddress.PhysicalMemoryDeviceLink.ProducerName = gEfiMemorySubClassDriverGuid;\r
-  DeviceStartAddress.PhysicalMemoryDeviceLink.Instance = ArrayInstance;\r
-  DeviceStartAddress.PhysicalMemoryDeviceLink.SubInstance = (UINT16)(Dimm + 1);\r
-  DeviceStartAddress.PhysicalMemoryArrayLink.ProducerName = gEfiMemorySubClassDriverGuid;\r
-  DeviceStartAddress.PhysicalMemoryArrayLink.Instance = ArrayInstance;\r
-  DeviceStartAddress.PhysicalMemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;\r
-\r
-  //\r
-  // Single channel mode\r
-  //\r
-  DeviceStartAddress.MemoryDevicePartitionRowPosition = 0x01;\r
-  DeviceStartAddress.MemoryDeviceInterleavePosition = 0x00;\r
-  DeviceStartAddress.MemoryDeviceInterleaveDataDepth = 0x00;\r
-\r
-  //\r
-  // Generate Memory Device Mapped Address info (TYPE 20)\r
-  //\r
-  Type20Record = AllocatePool(sizeof (SMBIOS_TABLE_TYPE20));\r
-  ZeroMem(Type20Record, sizeof (SMBIOS_TABLE_TYPE20));\r
-  Type20Record->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS;\r
-  Type20Record->Hdr.Length = sizeof(SMBIOS_TABLE_TYPE20);\r
-  Type20Record->Hdr.Handle = 0;\r
-\r
-  Type20Record->StartingAddress = (UINT32)RShiftU64 (DeviceStartAddress.MemoryDeviceStartAddress, 10);\r
-  Type20Record->EndingAddress = (UINT32)RShiftU64 (DeviceStartAddress.MemoryDeviceEndAddress, 10);\r
-  Type20Record->MemoryDeviceHandle = MemDevSmbiosHandle;\r
-  Type20Record->MemoryArrayMappedAddressHandle = MemArrayMappedAddrSmbiosHandle;\r
-  Type20Record->PartitionRowPosition = DeviceStartAddress.MemoryDevicePartitionRowPosition;\r
-  Type20Record->InterleavePosition = DeviceStartAddress.MemoryDeviceInterleavePosition;\r
-  Type20Record->InterleavedDataDepth = DeviceStartAddress.MemoryDeviceInterleaveDataDepth;\r
-  MemDevMappedAddrSmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;\r
-  Status = Smbios->Add (Smbios, NULL, &MemDevMappedAddrSmbiosHandle, (EFI_SMBIOS_TABLE_HEADER*) Type20Record);\r
-  FreePool(Type20Record);\r
-  ASSERT_EFI_ERROR (Status);\r
-\r
-  return Status;\r
-}\r