summaryrefslogtreecommitdiff
path: root/DuetPkg/DataHubGenDxe
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-21 08:48:38 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-21 08:48:38 +0000
commitca162103dae16dd48474f8dfc7a8951c997c89bc (patch)
tree4bf0dbf4127b7cf9bde9f59b4d760cf29f6ac446 /DuetPkg/DataHubGenDxe
parenta09aa7e27a6206bb91ebf5035753472ff6bcb280 (diff)
downloadedk2-platforms-ca162103dae16dd48474f8dfc7a8951c997c89bc.tar.xz
Initialize DuetPkg ...
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4416 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg/DataHubGenDxe')
-rw-r--r--DuetPkg/DataHubGenDxe/DataHubGen.c468
-rw-r--r--DuetPkg/DataHubGenDxe/DataHubGen.dxs39
-rw-r--r--DuetPkg/DataHubGenDxe/DataHubGen.h74
-rw-r--r--DuetPkg/DataHubGenDxe/DataHubGen.inf63
-rw-r--r--DuetPkg/DataHubGenDxe/DataHubGenStrings.unibin0 -> 2102 bytes
5 files changed, 644 insertions, 0 deletions
diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.c b/DuetPkg/DataHubGenDxe/DataHubGen.c
new file mode 100644
index 0000000000..24b2c636be
--- /dev/null
+++ b/DuetPkg/DataHubGenDxe/DataHubGen.c
@@ -0,0 +1,468 @@
+/*++
+
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ DataHubGen.c
+
+Abstract:
+
+--*/
+
+#include "DataHubGen.h"
+
+EFI_HII_PROTOCOL *gHii;
+extern UINT8 DataHubGenDxeStrings[];
+
+EFI_DATA_HUB_PROTOCOL *gDataHub;
+EFI_HII_HANDLE gStringHandle;
+
+VOID *
+GetSmbiosTablesFromHob (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ EFI_HOB_HANDOFF_INFO_TABLE *HobList;
+ EFI_PHYSICAL_ADDRESS *Table;
+
+ //
+ // Get Hob List
+ //
+
+ Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, (VOID *) &HobList);
+ if (EFI_ERROR (Status)) {
+ return NULL;
+ }
+
+ //
+ // If there is a SMBIOS table in the HOB add it to the EFI System table
+ //
+ Table = GetNextGuidHob (&gEfiSmbiosTableGuid, &HobList);
+
+ if (!EFI_ERROR (Status)) {
+ return (VOID *)(UINTN)*Table;
+ }
+
+ return NULL;
+}
+
+EFI_STATUS
+PrepareHiiPackage (
+ VOID
+ )
+{
+ EFI_HII_PACKAGES *PackageList;
+ EFI_STATUS Status;
+
+ PackageList = PreparePackages (1, &gEfiMiscProducerGuid, DataHubGenDxeStrings);
+ Status = gHii->NewPack (gHii, PackageList, &gStringHandle);
+
+ return Status;
+}
+
+EFI_SUBCLASS_TYPE1_HEADER mCpuDataRecordHeader = {
+ EFI_PROCESSOR_SUBCLASS_VERSION, // Version
+ sizeof (EFI_SUBCLASS_TYPE1_HEADER), // Header Size
+ 0, // Instance, Initialize later
+ EFI_SUBCLASS_INSTANCE_NON_APPLICABLE, // SubInstance
+ 0 // RecordType, Initialize later
+};
+
+VOID
+InstallProcessorDataHub (
+ IN VOID *Smbios
+ )
+{
+ EFI_STATUS Status;
+ SMBIOS_STRUCTURE_POINTER SmbiosTable;
+ EFI_CPU_DATA_RECORD DataRecord;
+ CHAR8 *AString;
+ CHAR16 *UString;
+ STRING_REF Token;
+
+ //
+ // Processor info (TYPE 4)
+ //
+ SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 4, 0);
+ if (SmbiosTable.Raw == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 4 (Processor Info) not found!\n"));
+ return ;
+ }
+
+ //
+ // Record Header
+ //
+ CopyMem (&DataRecord, &mCpuDataRecordHeader, sizeof (DataRecord.DataRecordHeader));
+
+ //
+ // Record Type 1
+ //
+ DataRecord.DataRecordHeader.RecordType = ProcessorCoreFrequencyRecordType;
+ DataRecord.VariableRecord.ProcessorCoreFrequency.Value = SmbiosTable.Type4->CurrentSpeed;
+ DataRecord.VariableRecord.ProcessorCoreFrequency.Exponent = 6;
+
+ Status = gDataHub->LogData (
+ gDataHub,
+ &gEfiProcessorSubClassGuid,
+ &gEfiMiscProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &DataRecord,
+ sizeof (DataRecord.DataRecordHeader) + sizeof (DataRecord.VariableRecord.ProcessorCoreFrequency)
+ );
+ //
+ // Record Type 3
+ //
+ AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type4->ProcessorVersion);
+ UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16));
+ ASSERT (UString != NULL);
+ AsciiStrToUnicodeStr (AString, UString);
+
+ Token = 0;
+ Status = gHii->NewString (gHii, NULL, gStringHandle, &Token, UString);
+
+ if (EFI_ERROR (Status)) {
+ gBS->FreePool (UString);
+ return ;
+ }
+ gBS->FreePool (UString);
+
+ DataRecord.DataRecordHeader.RecordType = ProcessorVersionRecordType;
+ DataRecord.VariableRecord.ProcessorVersion = Token;
+
+ Status = gDataHub->LogData (
+ gDataHub,
+ &gEfiProcessorSubClassGuid,
+ &gEfiMiscProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &DataRecord,
+ sizeof (DataRecord.DataRecordHeader) + sizeof (DataRecord.VariableRecord.ProcessorVersion)
+ );
+
+ return ;
+}
+
+VOID
+InstallCacheDataHub (
+ IN VOID *Smbios
+ )
+{
+ return ;
+}
+
+EFI_SUBCLASS_TYPE1_HEADER mMemorySubclassDriverDataHeader = {
+ EFI_MEMORY_SUBCLASS_VERSION, // Version
+ sizeof (EFI_SUBCLASS_TYPE1_HEADER), // Header Size
+ 0, // Instance, Initialize later
+ EFI_SUBCLASS_INSTANCE_NON_APPLICABLE, // SubInstance
+ 0 // RecordType, Initialize later
+};
+
+VOID
+InstallMemoryDataHub (
+ IN VOID *Smbios
+ )
+{
+ EFI_STATUS Status;
+ SMBIOS_STRUCTURE_POINTER SmbiosTable;
+ EFI_MEMORY_SUBCLASS_DRIVER_DATA DataRecord;
+
+ //
+ // Generate Memory Array Mapped Address info (TYPE 19)
+ //
+ SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 19, 0);
+ if (SmbiosTable.Raw == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 19 (Memory Array Mapped Address Info) not found!\n"));
+ return ;
+ }
+
+ //
+ // Record Header
+ //
+ CopyMem (&DataRecord, &mMemorySubclassDriverDataHeader, sizeof (DataRecord.Header));
+
+ //
+ // Record Type 4
+ //
+ DataRecord.Header.RecordType = EFI_MEMORY_ARRAY_START_ADDRESS_RECORD_NUMBER;
+ DataRecord.Record.ArrayStartAddress.MemoryArrayStartAddress = LShiftU64(SmbiosTable.Type19->StartingAddress, 10);
+ DataRecord.Record.ArrayStartAddress.MemoryArrayEndAddress = LShiftU64((UINT64) SmbiosTable.Type19->EndingAddress + 1, 10) - 1;
+
+ DataRecord.Record.ArrayStartAddress.PhysicalMemoryArrayLink.ProducerName = gEfiMemoryProducerGuid;
+ DataRecord.Record.ArrayStartAddress.PhysicalMemoryArrayLink.Instance = 0;
+ DataRecord.Record.ArrayStartAddress.PhysicalMemoryArrayLink.SubInstance = EFI_SUBCLASS_INSTANCE_NON_APPLICABLE;
+ DataRecord.Record.ArrayStartAddress.MemoryArrayPartitionWidth = (UINT16)(SmbiosTable.Type19->PartitionWidth);
+
+ Status = gDataHub->LogData (
+ gDataHub,
+ &gEfiMemorySubClassGuid,
+ &gEfiMiscProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &DataRecord,
+ sizeof (DataRecord.Header) + sizeof (DataRecord.Record.ArrayStartAddress)
+ );
+
+ return ;
+}
+
+EFI_SUBCLASS_TYPE1_HEADER mMiscSubclassDriverDataHeader = {
+ EFI_MISC_SUBCLASS_VERSION, // Version
+ sizeof (EFI_SUBCLASS_TYPE1_HEADER), // Header Size
+ 0, // Instance, Initialize later
+ EFI_SUBCLASS_INSTANCE_NON_APPLICABLE, // SubInstance
+ 0 // RecordType, Initialize later
+};
+
+VOID
+InstallMiscDataHub (
+ IN VOID *Smbios
+ )
+{
+ EFI_STATUS Status;
+ SMBIOS_STRUCTURE_POINTER SmbiosTable;
+ EFI_MISC_SUBCLASS_DRIVER_DATA DataRecord;
+ CHAR8 *AString;
+ CHAR16 *UString;
+ STRING_REF Token;
+
+ //
+ // BIOS information (TYPE 0)
+ //
+ SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 0, 0);
+ if (SmbiosTable.Raw == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 0 (BIOS Information) not found!\n"));
+ return ;
+ }
+
+ //
+ // Record Header
+ //
+ CopyMem (&DataRecord, &mMiscSubclassDriverDataHeader, sizeof (DataRecord.Header));
+
+ //
+ // Record Type 2
+ //
+ AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type0->BiosVersion);
+ UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE));
+ ASSERT (UString != NULL);
+ CopyMem (UString, FIRMWARE_BIOS_VERSIONE, sizeof(FIRMWARE_BIOS_VERSIONE));
+ AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_BIOS_VERSIONE) / sizeof(CHAR16) - 1);
+
+ Token = 0;
+ Status = gHii->NewString (gHii, NULL, gStringHandle, &Token, UString);
+
+ if (EFI_ERROR (Status)) {
+ gBS->FreePool (UString);
+ return ;
+ }
+ gBS->FreePool (UString);
+
+ DataRecord.Header.RecordType = EFI_MISC_BIOS_VENDOR_RECORD_NUMBER;
+ DataRecord.Record.MiscBiosVendor.BiosVendor = 0;
+ DataRecord.Record.MiscBiosVendor.BiosVersion = Token;
+ DataRecord.Record.MiscBiosVendor.BiosReleaseDate = 0;
+ DataRecord.Record.MiscBiosVendor.BiosStartingAddress = 0;
+ DataRecord.Record.MiscBiosVendor.BiosPhysicalDeviceSize.Value = 0;
+ DataRecord.Record.MiscBiosVendor.BiosPhysicalDeviceSize.Exponent = 0;
+// DataRecord.Record.MiscBiosVendor.BiosCharacteristics1 = {0};
+// DataRecord.Record.MiscBiosVendor.BiosCharacteristics2 = {0};
+ DataRecord.Record.MiscBiosVendor.BiosMajorRelease = 0;
+ DataRecord.Record.MiscBiosVendor.BiosMinorRelease = 0;
+ DataRecord.Record.MiscBiosVendor.BiosEmbeddedFirmwareMajorRelease = 0;
+ DataRecord.Record.MiscBiosVendor.BiosEmbeddedFirmwareMinorRelease = 0;
+
+ Status = gDataHub->LogData (
+ gDataHub,
+ &gEfiMiscSubClassGuid,
+ &gEfiMiscProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &DataRecord,
+ sizeof (DataRecord.Header) + sizeof (DataRecord.Record.MiscBiosVendor)
+ );
+
+ //
+ // System information (TYPE 1)
+ //
+ SmbiosTable = GetSmbiosTableFromType ((SMBIOS_TABLE_ENTRY_POINT *)Smbios, 1, 0);
+ if (SmbiosTable.Raw == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosTable: Type 1 (System Information) not found!\n"));
+ return ;
+ }
+
+ //
+ // Record Type 3
+ //
+ AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type1->ProductName);
+ UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME));
+ ASSERT (UString != NULL);
+ CopyMem (UString, FIRMWARE_PRODUCT_NAME, sizeof(FIRMWARE_PRODUCT_NAME));
+ AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_PRODUCT_NAME) / sizeof(CHAR16) - 1);
+
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+ Status = IfrLibNewString (gStringHandle, &Token, UString);
+#else
+ Token = 0;
+ Status = gHii->NewString (gHii, NULL, gStringHandle, &Token, UString);
+#endif
+ if (EFI_ERROR (Status)) {
+ gBS->FreePool (UString);
+ return ;
+ }
+ gBS->FreePool (UString);
+
+ DataRecord.Header.RecordType = EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER;
+ DataRecord.Record.MiscSystemManufacturer.SystemManufacturer = 0;
+ DataRecord.Record.MiscSystemManufacturer.SystemProductName = Token;
+ DataRecord.Record.MiscSystemManufacturer.SystemVersion = 0;
+ DataRecord.Record.MiscSystemManufacturer.SystemSerialNumber = 0;
+// DataRecord.Record.MiscSystemManufacturer.SystemUuid = {0};
+ DataRecord.Record.MiscSystemManufacturer.SystemWakeupType = 0;
+ DataRecord.Record.MiscSystemManufacturer.SystemSKUNumber = 0;
+ DataRecord.Record.MiscSystemManufacturer.SystemFamily = 0;
+
+ Status = gDataHub->LogData (
+ gDataHub,
+ &gEfiMiscSubClassGuid,
+ &gEfiMiscProducerGuid,
+ EFI_DATA_RECORD_CLASS_DATA,
+ &DataRecord,
+ sizeof (DataRecord.Header) + sizeof (DataRecord.Record.MiscSystemManufacturer)
+ );
+
+ return ;
+}
+
+EFI_STATUS
+EFIAPI
+DataHubGenEntrypoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+ VOID *Smbios;
+
+
+ Smbios = GetSmbiosTablesFromHob ();
+ if (Smbios == NULL) {
+ return EFI_NOT_FOUND;
+ }
+
+ Status = gBS->LocateProtocol (
+ &gEfiDataHubProtocolGuid,
+ NULL,
+ &gDataHub
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+ Status = gBS->LocateProtocol (
+ &gEfiHiiDatabaseProtocolGuid,
+ NULL,
+ &gHiiDatabase
+ );
+#else
+ Status = gBS->LocateProtocol (
+ &gEfiHiiProtocolGuid,
+ NULL,
+ &gHii
+ );
+#endif
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ PrepareHiiPackage ();
+
+ InstallProcessorDataHub (Smbios);
+ InstallCacheDataHub (Smbios);
+ InstallMemoryDataHub (Smbios);
+ InstallMiscDataHub (Smbios);
+
+ return EFI_SUCCESS;
+}
+
+//
+// Internal function
+//
+
+UINTN
+SmbiosTableLength (
+ IN SMBIOS_STRUCTURE_POINTER SmbiosTable
+ )
+{
+ CHAR8 *AChar;
+ UINTN Length;
+
+ AChar = (CHAR8 *)(SmbiosTable.Raw + SmbiosTable.Hdr->Length);
+ while ((*AChar != 0) || (*(AChar + 1) != 0)) {
+ AChar ++;
+ }
+ Length = ((UINTN)AChar - (UINTN)SmbiosTable.Raw + 2);
+
+ return Length;
+}
+
+SMBIOS_STRUCTURE_POINTER
+GetSmbiosTableFromType (
+ IN SMBIOS_TABLE_ENTRY_POINT *Smbios,
+ IN UINT8 Type,
+ IN UINTN Index
+ )
+{
+ SMBIOS_STRUCTURE_POINTER SmbiosTable;
+ UINTN SmbiosTypeIndex;
+
+ SmbiosTypeIndex = 0;
+ SmbiosTable.Raw = (UINT8 *)(UINTN)Smbios->TableAddress;
+ if (SmbiosTable.Raw == NULL) {
+ return SmbiosTable;
+ }
+ while ((SmbiosTypeIndex != Index) || (SmbiosTable.Hdr->Type != Type)) {
+ if (SmbiosTable.Hdr->Type == 127) {
+ SmbiosTable.Raw = NULL;
+ return SmbiosTable;
+ }
+ if (SmbiosTable.Hdr->Type == Type) {
+ SmbiosTypeIndex ++;
+ }
+ SmbiosTable.Raw = (UINT8 *)(SmbiosTable.Raw + SmbiosTableLength (SmbiosTable));
+ }
+
+ return SmbiosTable;
+}
+
+CHAR8 *
+GetSmbiosString (
+ IN SMBIOS_STRUCTURE_POINTER SmbiosTable,
+ IN SMBIOS_TABLE_STRING String
+ )
+{
+ CHAR8 *AString;
+ UINT8 Index;
+
+ Index = 1;
+ AString = (CHAR8 *)(SmbiosTable.Raw + SmbiosTable.Hdr->Length);
+ while (Index != String) {
+ while (*AString != 0) {
+ AString ++;
+ }
+ AString ++;
+ if (*AString == 0) {
+ return AString;
+ }
+ Index ++;
+ }
+
+ return AString;
+}
diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.dxs b/DuetPkg/DataHubGenDxe/DataHubGen.dxs
new file mode 100644
index 0000000000..418f6110a3
--- /dev/null
+++ b/DuetPkg/DataHubGenDxe/DataHubGen.dxs
@@ -0,0 +1,39 @@
+/*++
+
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ DataHub.dxs
+
+Abstract:
+
+ Dependency expression source file.
+
+--*/
+
+
+#include "EfiDepex.h"
+
+#include EFI_PROTOCOL_DEFINITION (DataHub)
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+#include EFI_PROTOCOL_DEFINITION (HiiDatabase)
+#else
+#include EFI_PROTOCOL_DEFINITION (Hii)
+#endif
+
+DEPENDENCY_START
+ EFI_DATA_HUB_PROTOCOL_GUID AND
+#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+ EFI_HII_DATABASE_PROTOCOL_GUID
+#else
+ EFI_HII_PROTOCOL_GUID
+#endif
+DEPENDENCY_END
diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.h b/DuetPkg/DataHubGenDxe/DataHubGen.h
new file mode 100644
index 0000000000..5ac2add1fb
--- /dev/null
+++ b/DuetPkg/DataHubGenDxe/DataHubGen.h
@@ -0,0 +1,74 @@
+/*++
+
+Copyright (c) 2006 - 2007, Intel Corporation
+All rights reserved. This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD License
+which accompanies this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+Module Name:
+
+ DataHubGen.h
+
+Abstract:
+
+--*/
+
+#ifndef _DATA_HUB_GEN_H_
+#define _DATA_HUB_GEN_H_
+
+#include <FrameworkDxe.h>
+#include <IndustryStandard/Smbios.h>
+
+#include <Guid/HobList.h>
+#include <Guid/Smbios.h>
+#include <Guid/DataHubProducer.h>
+#include <Guid/DataHubRecords.h>
+
+#include <Protocol/Datahub.h>
+#include <Protocol/FrameworkHii.h>
+
+#include <Library/BaseLib.h>
+#include <Library/UefiLib.h>
+#include <Library/HobLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/FrameworkHiiLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+
+#define PRODUCT_NAME L"DUET"
+#define PRODUCT_VERSION L"Beta"
+
+#define FIRMWARE_PRODUCT_NAME (PRODUCT_NAME L": ")
+#ifdef EFI32
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+#define FIRMWARE_BIOS_VERSIONE (PRODUCT_NAME L"(IA32.UEFI)" PRODUCT_VERSION L": ")
+#else
+#define FIRMWARE_BIOS_VERSIONE (PRODUCT_NAME L"(IA32.EFI)" PRODUCT_VERSION L": ")
+#endif
+#else // EFIX64
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)
+#define FIRMWARE_BIOS_VERSIONE (PRODUCT_NAME L"(X64.UEFI)" PRODUCT_VERSION L": ")
+#else
+#define FIRMWARE_BIOS_VERSIONE (PRODUCT_NAME L"(X64.EFI)" PRODUCT_VERSION L": ")
+#endif
+#endif
+
+SMBIOS_STRUCTURE_POINTER
+GetSmbiosTableFromType (
+ IN VOID *Smbios,
+ IN UINT8 Type,
+ IN UINTN Index
+ );
+
+CHAR8 *
+GetSmbiosString (
+ IN SMBIOS_STRUCTURE_POINTER SmbiosTable,
+ IN SMBIOS_TABLE_STRING String
+ );
+
+#endif
diff --git a/DuetPkg/DataHubGenDxe/DataHubGen.inf b/DuetPkg/DataHubGenDxe/DataHubGen.inf
new file mode 100644
index 0000000000..fde36e334c
--- /dev/null
+++ b/DuetPkg/DataHubGenDxe/DataHubGen.inf
@@ -0,0 +1,63 @@
+#/*++
+#
+# Copyright (c) 2006 - 2007, Intel Corporation
+# All rights reserved. This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+# Module Name:
+#
+# DataHubGen.inf
+#
+# Abstract:
+#
+# Component description file for DataHubGen module.
+#
+--*/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DataHubGenDxe
+ FILE_GUID = 0021001C-3CE3-41f8-99C6-ECF5DA754731
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x00020000
+ ENTRY_POINT = DataHubGenEntrypoint
+
+[Packages]
+ MdePkg/MdePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+
+[LibraryClasses]
+ UefiLib
+ HobLib
+ UefiBootServicesTableLib
+ BaseMemoryLib
+ MemoryAllocationLib
+ UefiDriverEntryPoint
+ BaseLib
+ FrameworkHiiLib
+
+[Sources.common]
+ DataHubGen.c
+ DataHubGen.h
+ DataHubGenStrings.uni
+
+[Guids.common]
+ gEfiProcessorSubClassGuid
+ gEfiHiiProtocolGuid
+ gEfiMiscSubClassGuid
+ gEfiDataHubProtocolGuid
+ gEfiSmbiosTableGuid
+ gEfiMiscProducerGuid
+ gEfiMemorySubClassGuid
+ gEfiMemoryProducerGuid
+
+[Depex]
+ gEfiDataHubProtocolGuid AND gEfiHiiProtocolGuid \ No newline at end of file
diff --git a/DuetPkg/DataHubGenDxe/DataHubGenStrings.uni b/DuetPkg/DataHubGenDxe/DataHubGenStrings.uni
new file mode 100644
index 0000000000..9d42cb98c0
--- /dev/null
+++ b/DuetPkg/DataHubGenDxe/DataHubGenStrings.uni
Binary files differ