diff options
author | Guo Mang <mang.guo@intel.com> | 2016-12-23 14:25:51 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:02 +0800 |
commit | 902a617f62e7ce61be23ebff9e8770a4c7510add (patch) | |
tree | 7029e76ce63d933027bafd5b5c3058d992083dda /Platform/BroxtonPlatformPkg | |
parent | 490a6b3db5981e556178a96a194264a509ca5d81 (diff) | |
download | edk2-platforms-902a617f62e7ce61be23ebff9e8770a4c7510add.tar.xz |
BroxtonPlatformPkg: Add SmBiosMiscDxe
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg')
53 files changed, 6098 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/CommonHeader.h b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/CommonHeader.h new file mode 100644 index 0000000000..27ad56236d --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/CommonHeader.h @@ -0,0 +1,38 @@ +/** @file
+ Common header file shared by all source files.
+ This file includes package header files, library classes and protocol, PPI & GUID definitions.
+
+ Copyright (c) 2006 - 2016, 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
+ 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.
+
+**/
+
+#ifndef __COMMON_HEADER_H_
+#define __COMMON_HEADER_H_
+
+#include <FrameworkDxe.h>
+#include <IndustryStandard/SmBios.h>
+#include <Protocol/Smbios.h>
+#include <Guid/DataHubRecords.h>
+#include <Guid/MdeModuleHii.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/HiiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PcdLib.h>
+#include <Library/UefiLib.h>
+#include <Library/SmbiosProcessorLib.h>
+
+#endif
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturer.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturer.uni Binary files differnew file mode 100644 index 0000000000..e53c866ce8 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturer.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerData.c new file mode 100644 index 0000000000..3f7ebf720c --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerData.c @@ -0,0 +1,51 @@ +/** @file
+ Static data of Base board manufacturer information.
+ Base board manufacturer information is Misc. subclass type 4 and SMBIOS type 2.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer) = {
+ STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER),
+ STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME),
+ STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION),
+ STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER),
+ STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG),
+ STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION),
+ { // BaseBoardFeatureFlags
+ 1, // Motherboard
+ 0, // RequiresDaughterCard
+ 0, // Removable
+ 1, // Replaceable,
+ 0, // HotSwappable
+ 0, // Reserved
+ },
+ EfiBaseBoardTypeUnknown, // BaseBoardType
+ { // BaseBoardChassisLink
+ EFI_MISC_SUBCLASS_GUID, // ProducerName
+ 1, // Instance
+ 1, // SubInstance
+ },
+ 0, // BaseBoardNumberLinks
+ { // LinkN
+ EFI_MISC_SUBCLASS_GUID, // ProducerName
+ 1, // Instance
+ 1, // SubInstance
+ },
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c new file mode 100644 index 0000000000..0f73b05e80 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c @@ -0,0 +1,213 @@ +/** @file
+ BaseBoard manufacturer information boot time changes.
+ SMBIOS type 2.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Guid/PlatformInfo.h>
+#include <Library/SteppingLib.h>
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscBaseBoardManufacturer (Type 2).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION (MiscBaseBoardManufacturer)
+{
+ CHAR8 *OptionalStrStart;
+ UINTN ManuStrLen;
+ UINTN ProductStrLen;
+ UINTN VerStrLen;
+ UINTN AssertTagStrLen;
+ UINTN SerialNumStrLen;
+ UINTN ChassisStrLen;
+ EFI_STATUS Status;
+ EFI_STRING Manufacturer;
+ EFI_STRING Product;
+ EFI_STRING Version;
+ EFI_STRING SerialNumber;
+ EFI_STRING AssertTag;
+ EFI_STRING Chassis;
+ STRING_REF TokenToGet;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE2 *SmbiosRecord;
+ EFI_MISC_BASE_BOARD_MANUFACTURER *ForType2InputData;
+ EFI_PEI_HOB_POINTERS GuidHob;
+ EFI_PLATFORM_INFO_HOB *PlatformInfo = NULL;
+
+ ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *) RecordData;
+ ZeroMem (&GuidHob, sizeof (EFI_PEI_HOB_POINTERS));
+ //
+ // Get the HOB list. If it is not present, then ASSERT.
+ //
+ GuidHob.Raw = GetHobList ();
+ if (GuidHob.Raw != NULL) {
+ if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) {
+ PlatformInfo = GET_GUID_HOB_DATA (GuidHob.Guid);
+ }
+ }
+
+ if (PlatformInfo == NULL) {
+ DEBUG ((EFI_D_ERROR, "PlatformInfo is NULL.\n"));
+ return EFI_NOT_FOUND;
+ }
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
+ Manufacturer = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
+ ManuStrLen = StrLen (Manufacturer);
+ if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME1);
+ Product = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ ProductStrLen = StrLen (Product);
+ if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ switch (BxtStepping ()) {
+ case BxtA0:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_A0);
+ break;
+ case BxtA1:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_A1);
+ break;
+ case BxtB0:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_B0);
+ break;
+ case BxtB1:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_B1);
+ break;
+ case BxtC0:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_C0);
+ break;
+ default:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION_A0);
+ break;
+ }
+
+ Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ VerStrLen = StrLen (Version);
+ if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);
+ SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SerialNumStrLen = StrLen (SerialNumber);
+ if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);
+ AssertTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ AssertTagStrLen = StrLen (AssertTag);
+ if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);
+ Chassis = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ ChassisStrLen = StrLen (Chassis);
+ if (ChassisStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE2) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen +1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE2) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen +1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE2);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // Manu will be the 1st optional string following the formatted structure.
+ //
+ SmbiosRecord->Manufacturer = 1;
+ //
+ // ProductName will be the 2st optional string following the formatted structure.
+ //
+ SmbiosRecord->ProductName = 2;
+ //
+ // Version will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->Version = 3;
+ //
+ // SerialNumber will be the 4th optional string following the formatted structure.
+ //
+ SmbiosRecord->SerialNumber = 4;
+ //
+ // AssertTag will be the 5th optional string following the formatted structure.
+ //
+ SmbiosRecord->AssetTag = 5;
+
+ //
+ // LocationInChassis will be the 6th optional string following the formatted structure.
+ //
+ SmbiosRecord->LocationInChassis = 6;
+ SmbiosRecord->FeatureFlag = (*(BASE_BOARD_FEATURE_FLAGS*) &(ForType2InputData->BaseBoardFeatureFlags));
+ SmbiosRecord->ChassisHandle = 0;
+ SmbiosRecord->BoardType = (UINT8) ForType2InputData->BaseBoardType;
+ SmbiosRecord->NumberOfContainedObjectHandles = 0;
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ //
+ // Since we fill NumberOfContainedObjectHandles = 0 for simple, just after this filed to fill string
+ //
+ UnicodeStrToAsciiStr (Manufacturer, OptionalStrStart);
+ UnicodeStrToAsciiStr (Product, OptionalStrStart + ManuStrLen + 1);
+ UnicodeStrToAsciiStr (Version, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1);
+ UnicodeStrToAsciiStr (SerialNumber, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1);
+ UnicodeStrToAsciiStr (AssertTag, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
+ UnicodeStrToAsciiStr (Chassis, OptionalStrStart + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendor.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendor.uni Binary files differnew file mode 100644 index 0000000000..9cc87aa5a0 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendor.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorData.c new file mode 100644 index 0000000000..ffbf2e1e7d --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorData.c @@ -0,0 +1,93 @@ +/** @file
+ Static data of BIOS vendor information.
+ BIOS vendor information is Misc. subclass type 2 and SMBIOS type 0.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor)
+= {
+ STRING_TOKEN(STR_MISC_BIOS_VENDOR), // BiosVendor
+ STRING_TOKEN(STR_MISC_BIOS_VERSION), // BiosVersion
+ STRING_TOKEN(STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate
+ 0xF000, // BiosStartingAddress
+ { // BiosPhysicalDeviceSize
+ 1, // Value
+ 21 , // Exponent
+ },
+ { // BiosCharacteristics1
+ 0, // Reserved1 :2
+ 0, // Unknown :1
+ 0, // BiosCharacteristicsNotSupported :1
+ 0, // IsaIsSupported :1
+ 0, // McaIsSupported :1
+ 0, // EisaIsSupported :1
+ 1, // PciIsSupported :1
+ 0, // PcmciaIsSupported :1
+ 0, // PlugAndPlayIsSupported :1
+ 0, // ApmIsSupported :1
+ 1, // BiosIsUpgradable :1
+ 1, // BiosShadowingAllowed :1
+ 0, // VlVesaIsSupported :1
+ 0, // EscdSupportIsAvailable :1
+ 1, // BootFromCdIsSupported :1
+ 1, // SelectableBootIsSupported :1
+ 0, // RomBiosIsSocketed :1
+ 0, // BootFromPcmciaIsSupported :1
+ 1, // EDDSpecificationIsSupported :1
+ 0, // JapaneseNecFloppyIsSupported :1
+ 0, // JapaneseToshibaFloppyIsSupported :1
+ 0, // Floppy525_360IsSupported :1
+ 0, // Floppy525_12IsSupported :1
+ 0, // Floppy35_720IsSupported :1
+ 0, // Floppy35_288IsSupported :1
+ 0, // PrintScreenIsSupported :1
+ 1, // Keyboard8042IsSupported :1
+ 1, // SerialIsSupported :1
+ 1, // PrinterIsSupported :1
+ 1, // CgaMonoIsSupported :1
+ 0, // NecPc98 :1
+ //
+ //BIOS Characteristics Extension Byte 1
+ //
+ 1, // AcpiIsSupported :1
+ 1, // UsbLegacyIsSupported :1
+ 0, // AgpIsSupported :1
+ 0, // I20BootIsSupported :1
+ 0, // Ls120BootIsSupported :1
+ 1, // AtapiZipDriveBootIsSupported :1
+ 0, // Boot1394IsSupported :1
+ 0, // SmartBatteryIsSupported :1
+ //
+ //BIOS Characteristics Extension Byte 2
+ //
+ 1, // BiosBootSpecIsSupported :1
+ 1, // FunctionKeyNetworkBootIsSupported :1
+ 0x1 // Reserved :19 Bit 2 is SMBiosIsTargContDistEnabled
+ },
+ { // BiosCharacteristics2
+ 0x0001,// BiosReserved :16 Bit 0 is BIOS Splash Screen
+ 0, // SystemReserved :16
+ 0 // Reserved :32
+ },
+ 0xFF, // BiosMajorRelease;
+ 0xFF, // BiosMinorRelease;
+ 0xFF, // BiosEmbeddedFirmwareMajorRelease;
+ 0xFF, // BiosEmbeddedFirmwareMinorRelease;
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorFunction.c new file mode 100644 index 0000000000..6676342a94 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBiosVendorFunction.c @@ -0,0 +1,248 @@ +/** @file
+ BIOS vendor information boot time changes.
+ Misc. subclass type 2.
+ SMBIOS type 0.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Library/BiosIdLib.h>
+#include <Guid/PlatformInfo.h>
+
+#define BCD_TO_DECIMAL(A) (((((A) >> 4) & 0xF) * 10) + ((A) & 0xF))
+#if (ENBDT_PF_ENABLE == 1)
+#include <Include/KscLib.h>
+#endif
+
+/**
+ This function returns the value & exponent to Base2 for a given
+ Hex value. This is used to calculate the BiosPhysicalDeviceSize.
+
+ @param[in] Value The hex value which is to be converted into value-exponent form
+ @param[out] Exponent The exponent out of the conversion
+
+ @retval EFI_SUCCESS All parameters were valid and *Value & *Exponent have been set.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+EFI_STATUS
+GetValueExponentBase2(
+ IN OUT UINTN *Value,
+ OUT UINTN *Exponent
+ )
+{
+ if ((Value == NULL) || (Exponent == NULL)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ while ((*Value % 2) == 0) {
+ *Value=*Value/2;
+ (*Exponent)++;
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Field Filling Function. Transform an EFI_EXP_BASE2_DATA to a byte, with '64k'
+ as the unit.
+
+ @param[in] Base2Data Pointer to Base2_Data
+
+ @retval EFI_SUCCESS Transform successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+UINT16
+Base2ToByteWith64KUnit (
+ IN EFI_EXP_BASE2_DATA *Base2Data
+ )
+{
+ UINT16 Value;
+ UINT16 Exponent;
+
+ Value = Base2Data->Value;
+ Exponent = Base2Data->Exponent;
+ Exponent -= 16;
+ Value <<= Exponent;
+
+ return Value;
+}
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscBiosVendor (Type 0).
+
+ @param[in] RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscBiosVendor)
+{
+ CHAR8 *OptionalStrStart;
+ UINTN VendorStrLen;
+ UINTN VerStrLen;
+ UINTN DateStrLen;
+ CHAR16 *Version;
+ CHAR16 *ReleaseDate;
+ CHAR16 BiosVersion[0x100]; //Assuming that strings are < 100 UCHAR
+ CHAR16 BiosReleaseDate[100]; //Assuming that strings are < 100 UCHAR
+ CHAR16 BiosReleaseTime[100]; //Assuming that strings are < 100 UCHAR
+ EFI_STATUS Status;
+ EFI_STRING Char16String;
+ STRING_REF TokenToGet;
+ STRING_REF TokenToUpdate;
+ SMBIOS_TABLE_TYPE0 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_BIOS_VENDOR *ForType0InputData;
+ BIOS_ID_IMAGE BiosIdImage;
+ EFI_PEI_HOB_POINTERS GuidHob;
+ EFI_PLATFORM_INFO_HOB *PlatformInfo;
+
+ ForType0InputData = (EFI_MISC_BIOS_VENDOR *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+ GetBiosId (&BiosIdImage);
+
+ //
+ // Add BXT BIOS Version and Release data
+ //
+ SetMem (BiosVersion, sizeof (BiosVersion), 0);
+ SetMem (BiosReleaseDate, sizeof (BiosReleaseDate), 0);
+ SetMem (BiosReleaseTime, sizeof (BiosReleaseTime), 0);
+ Status = GetBiosVersionDateTime (BiosVersion, BiosReleaseDate, BiosReleaseTime);
+
+ DEBUG ((EFI_D_INFO, "GetBiosVersionDateTime :%s %s %s \n", BiosVersion, BiosReleaseDate, BiosReleaseTime));
+ if (StrLen (BiosVersion) > 0) {
+ TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
+ HiiSetString (mHiiHandle, TokenToUpdate, BiosVersion, NULL);
+ }
+
+ if (StrLen (BiosReleaseDate) > 0) {
+ TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
+ HiiSetString (mHiiHandle, TokenToUpdate, BiosReleaseDate, NULL);
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);
+ Char16String = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ VendorStrLen = StrLen (Char16String);
+ if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);
+ Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ VerStrLen = StrLen (Version);
+ if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
+ ReleaseDate = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ DateStrLen = StrLen (ReleaseDate);
+ if (DateStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE0) + VendorStrLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE0);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // Vendor will be the 1st optional string following the formatted structure.
+ //
+ SmbiosRecord->Vendor = 1;
+ //
+ // Version will be the 2nd optional string following the formatted structure.
+ //
+ SmbiosRecord->BiosVersion = 2;
+ SmbiosRecord->BiosSegment = (UINT16)ForType0InputData->BiosStartingAddress;
+ //
+ // ReleaseDate will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->BiosReleaseDate = 3;
+ //
+ // Tiger has no PCD value to indicate BIOS Size, just fill 0 for simply.
+ //
+ SmbiosRecord->BiosSize = 0;
+ SmbiosRecord->BiosCharacteristics = *(MISC_BIOS_CHARACTERISTICS*) (&ForType0InputData->BiosCharacteristics1);
+ //
+ // CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.
+ //
+ SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 4);
+ SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = *((UINT8 *) &ForType0InputData->BiosCharacteristics1 + 5);
+
+ SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;
+ SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;
+ SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;
+ SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;
+
+ //
+ // Update the EC Revision
+ //
+ GuidHob.Raw = GetHobList ();
+ if (GuidHob.Raw != NULL) {
+ if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) {
+ PlatformInfo = GET_GUID_HOB_DATA (GuidHob.Guid);
+ SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = BCD_TO_DECIMAL (PlatformInfo->EcMajorRevision);
+ SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = BCD_TO_DECIMAL (PlatformInfo->EcMinorRevision);
+ }
+ }
+
+#if (ENBDT_PF_ENABLE == 1)
+ SmbiosRecord->SystemBiosMajorRelease = (UINT8) StrDecimalToUintn (BiosIdImage.BiosIdString.VersionMajor);
+ SmbiosRecord->SystemBiosMinorRelease = (UINT8) StrDecimalToUintn (BiosIdImage.BiosIdString.VersionMinor);
+#endif
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (Char16String, OptionalStrStart);
+ UnicodeStrToAsciiStr (Version, OptionalStrStart + VendorStrLen + 1);
+ UnicodeStrToAsciiStr (ReleaseDate, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationData.c new file mode 100644 index 0000000000..06c5152217 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationData.c @@ -0,0 +1,28 @@ +/** @file
+ Static data of Boot information.
+ Boot information is Misc. subclass type 26 and SMBIOS type 32.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus)
+= {
+ EfiBootInformationStatusNoError, // BootInformationStatus
+ 0 // BootInformationData
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationFunction.c new file mode 100644 index 0000000000..928c0914ad --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscBootInformationFunction.c @@ -0,0 +1,80 @@ +/** @file
+ Boot information boot time changes.
+ SMBIOS type 32.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscBootInformation (Type 32).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+
+MISC_SMBIOS_TABLE_FUNCTION(BootInformationStatus)
+{
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE32 *SmbiosRecord;
+ EFI_MISC_BOOT_INFORMATION_STATUS* ForType32InputData;
+
+ ForType32InputData = (EFI_MISC_BOOT_INFORMATION_STATUS *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE32);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->BootStatus = (UINT8) ForType32InputData->BootInformationStatus;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturer.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturer.uni Binary files differnew file mode 100644 index 0000000000..8fc00a7bea --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturer.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerData.c new file mode 100644 index 0000000000..0a76213567 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerData.c @@ -0,0 +1,50 @@ +/** @file
+ Static data is Chassis Manufacturer information.
+ Chassis Manufacturer information is Misc. subclass type 5 and SMBIOS type 3.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Chassis Manufacturer data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer) = {
+ STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER), // ChassisManufactrurer
+ STRING_TOKEN(STR_MISC_CHASSIS_VERSION), // ChassisVersion
+ STRING_TOKEN(STR_MISC_CHASSIS_SERIAL_NUMBER), // ChassisSerialNumber
+ STRING_TOKEN(STR_MISC_CHASSIS_ASSET_TAG), // ChassisAssetTag
+ { // ChassisTypeStatus
+ EfiMiscChassisTypeHandHeld, // ChassisType
+ 0, // ChassisLockPresent
+ 0 // Reserved
+ },
+ EfiChassisStateSafe, // ChassisBootupState
+ EfiChassisStateSafe, // ChassisPowerSupplyState
+ EfiChassisStateOther, // ChassisThermalState
+ EfiChassisSecurityStatusOther, // ChassisSecurityState
+ 0, // ChassisOemDefined
+ 0, // ChassisHeight
+ 0, // ChassisNumberPowerCords
+ 0, // ChassisElementCount
+ 0, // ChassisElementRecordLength
+ { // ChassisElements
+ {0, 0, 0}, // ChassisElementType
+ 0, // ChassisElementStructure
+ EfiBaseBoardTypeUnknown, // ChassisBaseBoard
+ 0, // ChassisElementMinimum
+ 0 // ChassisElementMaximum
+ },
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerFunction.c new file mode 100644 index 0000000000..36cfb3e74b --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscChassisManufacturerFunction.c @@ -0,0 +1,144 @@ +/** @file
+ Chassis manufacturer information boot time changes.
+ SMBIOS type 3.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscChassisManufacturer (Type 3).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)
+{
+ CHAR8 *OptionalStrStart;
+ UINTN ManuStrLen;
+ UINTN VerStrLen;
+ UINTN AssertTagStrLen;
+ UINTN SerialNumStrLen;
+ EFI_STATUS Status;
+ EFI_STRING Manufacturer;
+ EFI_STRING Version;
+ EFI_STRING SerialNumber;
+ EFI_STRING AssertTag;
+ STRING_REF TokenToGet;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE3 *SmbiosRecord;
+ EFI_MISC_CHASSIS_MANUFACTURER *ForType3InputData;
+
+ ForType3InputData = (EFI_MISC_CHASSIS_MANUFACTURER *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);
+ Manufacturer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ ManuStrLen = StrLen (Manufacturer);
+ if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);
+ Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ VerStrLen = StrLen (Version);
+ if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);
+ SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SerialNumStrLen = StrLen (SerialNumber);
+ if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);
+ AssertTag = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ AssertTagStrLen = StrLen (AssertTag);
+ if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE3);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // Manu will be the 1st optional string following the formatted structure.
+ //
+ SmbiosRecord->Manufacturer = 1;
+ SmbiosRecord->Type = (UINT8) ForType3InputData->ChassisType.ChassisType;
+ //
+ // Version will be the 2nd optional string following the formatted structure.
+ //
+ SmbiosRecord->Version = 2;
+ //
+ // SerialNumber will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->SerialNumber = 3;
+ //
+ // AssertTag will be the 4th optional string following the formatted structure.
+ //
+ SmbiosRecord->AssetTag = 4;
+ SmbiosRecord->BootupState = (UINT8) ForType3InputData->ChassisBootupState;
+ SmbiosRecord->PowerSupplyState = (UINT8) ForType3InputData->ChassisPowerSupplyState;
+ SmbiosRecord->ThermalState = (UINT8) ForType3InputData->ChassisThermalState;
+ SmbiosRecord->SecurityStatus = (UINT8) ForType3InputData->ChassisSecurityState;
+ CopyMem (SmbiosRecord->OemDefined,(UINT8*) &ForType3InputData->ChassisOemDefined, 4);
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (Manufacturer, OptionalStrStart);
+ UnicodeStrToAsciiStr (Version, OptionalStrStart + ManuStrLen + 1);
+ UnicodeStrToAsciiStr (SerialNumber, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1);
+ UnicodeStrToAsciiStr (AssertTag, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesData.c new file mode 100644 index 0000000000..99266f3a4e --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesData.c @@ -0,0 +1,31 @@ +/** @file
+ Static data of the Number of installable languages information.
+ Number of installable languages information is Misc. subclass type 11 and SMBIOS type 13.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages) = {
+ 1, // NumberOfInstallableLanguages
+ { // LanguageFlags
+ 1, // AbbreviatedLanguageFormat
+ 0 // Reserved
+ },
+ STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_EN_US) // CurrentLanguageNumber
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesFunction.c new file mode 100644 index 0000000000..f52cad23ff --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscNumberOfInstallableLanguagesFunction.c @@ -0,0 +1,249 @@ +/** @file
+ This driver parses the mSmbiosMiscDataTable structure and reports
+ any generated data.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+/**
+ Check whether the language is supported for given HII handle
+
+ @param[in] HiiHandle The HII package list handle.
+ @param[out] Offset The offest of current lanague in the supported languages.
+ @param[out] CurrentLang The language code.
+
+ @retval TRUE Supported.
+ @retval FALSE Not Supported.
+
+**/
+VOID
+EFIAPI
+CurrentLanguageMatch (
+ IN EFI_HII_HANDLE HiiHandle,
+ OUT UINT16 *Offset,
+ OUT CHAR8 *CurrentLang
+ )
+{
+ CHAR8 *DefaultLang;
+ CHAR8 *BestLanguage;
+ CHAR8 *Languages;
+ CHAR8 *MatchLang;
+ CHAR8 *EndMatchLang;
+ UINTN CompareLength;
+
+ Languages = HiiGetSupportedLanguages (HiiHandle);
+ if (Languages == NULL) {
+ return;
+ }
+
+ GetEfiGlobalVariable2 (L"PlatformLang", &CurrentLang, NULL);
+ DefaultLang = (CHAR8 *) PcdGetPtr (PcdUefiVariableDefaultPlatformLang);
+ BestLanguage = GetBestLanguage (
+ Languages,
+ FALSE,
+ (CurrentLang != NULL) ? CurrentLang : "",
+ DefaultLang,
+ NULL
+ );
+ if (BestLanguage != NULL) {
+ //
+ // Find the best matching RFC 4646 language, compute the offset.
+ //
+ CompareLength = AsciiStrLen (BestLanguage);
+ for (MatchLang = Languages, (*Offset) = 0; MatchLang != '\0'; (*Offset)++) {
+ //
+ // Seek to the end of current match language.
+ //
+ for (EndMatchLang = MatchLang; *EndMatchLang != '\0' && *EndMatchLang != ';'; EndMatchLang++);
+
+ if ((EndMatchLang == MatchLang + CompareLength) && AsciiStrnCmp(MatchLang, BestLanguage, CompareLength) == 0) {
+ //
+ // Find the current best Language in the supported languages
+ //
+ break;
+ }
+ //
+ // best language match be in the supported language.
+ //
+ ASSERT (*EndMatchLang == ';');
+ MatchLang = EndMatchLang + 1;
+ }
+ FreePool (BestLanguage);
+ }
+
+ FreePool (Languages);
+ if (CurrentLang != NULL) {
+ FreePool (CurrentLang);
+ }
+
+ return ;
+}
+
+
+/**
+ Get next language from language code list (with separator ';').
+
+ @param[in, out] LangCode Input: point to first language in the list. On
+ Otput: point to next language in the list, or
+ NULL if no more language in the list.
+ @param[out] Lang The first language in the list.
+
+**/
+VOID
+EFIAPI
+GetNextLanguage (
+ IN OUT CHAR8 **LangCode,
+ OUT CHAR8 *Lang
+ )
+{
+ UINTN Index;
+ CHAR8 *StringPtr;
+
+ ASSERT (LangCode != NULL);
+ ASSERT (*LangCode != NULL);
+ ASSERT (Lang != NULL);
+
+ Index = 0;
+ StringPtr = *LangCode;
+ while (StringPtr[Index] != 0 && StringPtr[Index] != ';') {
+ Index++;
+ }
+
+ CopyMem (Lang, StringPtr, Index);
+ Lang[Index] = 0;
+
+ if (StringPtr[Index] == ';') {
+ Index++;
+ }
+ *LangCode = StringPtr + Index;
+}
+
+
+/**
+ This function returns the number of supported languages on HiiHandle.
+
+ @param[in] HiiHandle The HII package list handle.
+
+ @retval The number of supported languages.
+
+**/
+UINT16
+EFIAPI
+GetSupportedLanguageNumber (
+ IN EFI_HII_HANDLE HiiHandle
+ )
+{
+ CHAR8 *Lang;
+ CHAR8 *Languages;
+ CHAR8 *LanguageString;
+ UINT16 LangNumber;
+
+ Languages = HiiGetSupportedLanguages (HiiHandle);
+ if (Languages == NULL) {
+ return 0;
+ }
+
+ LangNumber = 0;
+ Lang = AllocatePool (AsciiStrSize (Languages));
+ if (Lang != NULL) {
+ LanguageString = Languages;
+ while (*LanguageString != 0) {
+ GetNextLanguage (&LanguageString, Lang);
+ LangNumber++;
+ }
+ FreePool (Lang);
+ }
+ FreePool (Languages);
+
+ return LangNumber;
+}
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscNumberOfInstallableLanguages (Type 13).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(NumberOfInstallableLanguages)
+{
+ UINTN LangStrLen;
+ CHAR8 CurrentLang[SMBIOS_STRING_MAX_LENGTH + 1];
+ CHAR8 *OptionalStrStart;
+ UINT16 Offset;
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE13 *SmbiosRecord;
+ EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *ForType13InputData;
+
+ ForType13InputData = (EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ ForType13InputData->NumberOfInstallableLanguages = GetSupportedLanguageNumber (mHiiHandle);
+
+ //
+ // Try to check if current langcode matches with the langcodes in installed languages
+ //
+ ZeroMem (CurrentLang, SMBIOS_STRING_MAX_LENGTH + 1);
+ CurrentLanguageMatch (mHiiHandle, &Offset, CurrentLang);
+ LangStrLen = AsciiStrLen (CurrentLang);
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+
+ SmbiosRecord->InstallableLanguages = (UINT8) ForType13InputData->NumberOfInstallableLanguages;
+ SmbiosRecord->Flags = (UINT8) ForType13InputData->LanguageFlags.AbbreviatedLanguageFormat;
+ SmbiosRecord->CurrentLanguages = 1;
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ AsciiStrCpyS (OptionalStrStart, (sizeof (SMBIOS_TABLE_TYPE13) + LangStrLen + 1) / sizeof (CHAR8), CurrentLang);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemString.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemString.uni Binary files differnew file mode 100644 index 0000000000..610187dac4 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemString.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringData.c new file mode 100644 index 0000000000..45c42c338f --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringData.c @@ -0,0 +1,29 @@ +/** @file
+ Static data of OEM String information.
+ OEM String information is Misc. subclass type 9 and SMBIOS type 11.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING, MiscOemString) = {
+ STRING_TOKEN(STR_INTEL_ETK_VER)
+};
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING_DATA, OemString) = {
+ STRING_TOKEN(STR_MISC_OEM_EN_US)
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringFunction.c new file mode 100644 index 0000000000..c6bf2af1ae --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemStringFunction.c @@ -0,0 +1,88 @@ +/** @file
+ Boot information boot time changes.
+ SMBIOS type 11.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemString (Type 11).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(OemString)
+{
+ UINTN OemStrLen;
+ CHAR8 *OptionalStrStart;
+ EFI_STATUS Status;
+ EFI_STRING OemStr;
+ STRING_REF TokenToGet;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE11 *SmbiosRecord;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_OEM_EN_US);
+ OemStr = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ OemStrLen = StrLen (OemStr);
+ if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->StringCount = 1;
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (OemStr, OptionalStrStart);
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Data.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Data.c new file mode 100644 index 0000000000..6594fddc93 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Data.c @@ -0,0 +1,28 @@ +/** @file
+ This file contains the Misc Oem Data (SMBIOS data type 0x83)
+
+ Copyright (c) 2012 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Oem data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_TYPE_0x83, MiscOemType0x83) = {
+ 0,
+ 0,
+ 0,
+ 0,
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Function.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Function.c new file mode 100644 index 0000000000..dac6e6f833 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x83Function.c @@ -0,0 +1,195 @@ +/** @file
+ The function that processes the Smbios data type 0x83 for SEC.
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Protocol/SeCOperation.h>
+#include <Library/PrintLib.h>
+
+
+EFI_STATUS
+EFIAPI
+AddSmbiosT0x83 (
+IN VOID *RecordData
+ )
+{
+ EFI_STATUS Status;
+ SMBIOS_TABLE_TYPE83 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_OEM_TYPE_0x83 *ForType83InputData;
+ SEC_OPERATION_PROTOCOL *SeCOp;
+ SEC_INFOMATION SeCInfo;
+ EFI_SMBIOS_PROTOCOL *Smbios;
+
+ ForType83InputData = (EFI_MISC_OEM_TYPE_0x83 *) RecordData;
+
+ DEBUG ((EFI_D_INFO, "OEM type 0x83.\n"));
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &Smbios);
+ ASSERT_EFI_ERROR (Status);
+
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE83) + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE83) + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SEC_INFO;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE83);
+
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // Get SEC VERSION
+ //
+ Status = gBS->LocateProtocol (
+ &gEfiSeCOperationProtocolGuid,
+ NULL,
+ (VOID **) &SeCOp
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = SeCOp->GetPlatformSeCInfo(
+ &SeCInfo
+ );
+ if (SeCInfo.SeCVerValid) {
+ SmbiosRecord->SeCCapabilities.SecFwMinorVersion = SeCInfo.SeCVer.CodeMinor;
+ SmbiosRecord->SeCCapabilities.SecFwMajorVersion = SeCInfo.SeCVer.CodeMajor;
+ SmbiosRecord->SeCCapabilities.SecFwBuildVersion = SeCInfo.SeCVer.CodeBuildNo;
+ SmbiosRecord->SeCCapabilities.SecFwHotfixVersion= SeCInfo.SeCVer.CodeHotFix;
+ SmbiosRecord->SeCCapabilities.SecEnable = SeCInfo.SeCEnable;
+ } else {
+ SmbiosRecord->SeCCapabilities.SecFwMinorVersion = ForType83InputData->SecFwMinorVersion;
+ SmbiosRecord->SeCCapabilities.SecFwMajorVersion = ForType83InputData->SecFwMajorVersion;
+ SmbiosRecord->SeCCapabilities.SecFwBuildVersion = ForType83InputData->SecFwBuildVersion;
+ SmbiosRecord->SeCCapabilities.SecFwHotfixVersion= ForType83InputData->SecFwHotfixVersion;
+ SmbiosRecord->SeCCapabilities.SecEnable = 0;
+ }
+ }
+
+ SmbiosRecord->BiosSeCCapabilities.SecBiosSetup = 1;
+ //
+ // AT is not supported yet.
+ //
+ SmbiosRecord->SeCCapabilities.ATSupport = 0;
+ SmbiosRecord->BiosSeCCapabilities.ATPBA = 0;
+ SmbiosRecord->BiosSeCCapabilities.ATWWAN = 0;
+ SmbiosRecord->SeCCfgState.ATConfigured = 0;
+
+ //
+ //This field is the unique identifier for Intel? vPro specific SMBIOS type 131 structure
+ //
+ SmbiosRecord->StructureIdentifer.Identifer = IntelIdentifer;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
+
+/**
+ Smbios OEM type 0x83 callback.
+
+ @param[in] Event Event whose notification function is being invoked (gEfiSeCOperationProtocolGuid).
+ @param[in] Context Pointer to the notification functions context, which is implementation dependent.
+
+ @retval None
+
+**/
+VOID
+EFIAPI
+AddSmbiosT0x83Callback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ AddSmbiosT0x83 (Context);
+}
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemType0x83 (Type 0x83).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+
+MISC_SMBIOS_TABLE_FUNCTION(MiscOemType0x83)
+{
+ EFI_STATUS Status;
+ VOID *AddSmbiosT0x83CallbackNotifyReg;
+ EFI_EVENT AddSmbiosT0x83CallbackEvent;
+ SEC_OPERATION_PROTOCOL *SeCOp;
+
+ Status = gBS->LocateProtocol (
+ &gEfiSeCOperationProtocolGuid,
+ NULL,
+ (VOID **) &SeCOp
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = AddSmbiosT0x83 (RecordData);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ } else {
+ //
+ // Create a callback function when gEfiSeCOperationProtocolGuid is ready
+ //
+ Status = gBS->CreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ AddSmbiosT0x83Callback,
+ RecordData,
+ &AddSmbiosT0x83CallbackEvent
+ );
+
+ ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ Status = gBS->RegisterProtocolNotify (
+ &gEfiSeCOperationProtocolGuid,
+ AddSmbiosT0x83CallbackEvent,
+ &AddSmbiosT0x83CallbackNotifyReg
+ );
+ }
+
+ return EFI_SUCCESS;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90.uni Binary files differnew file mode 100644 index 0000000000..8e897ce18f --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Data.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Data.c new file mode 100644 index 0000000000..c6e172b43e --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Data.c @@ -0,0 +1,30 @@ +/** @file
+ This file contains the Misc Oem Data (SMBIOS data type 0x90)
+
+ Copyright (c) 2012 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Oem data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_TYPE_0x90, MiscOemType0x90) = {
+
+STRING_TOKEN (STR_MISC_SEC_VERSION),
+STRING_TOKEN (STR_MISC_UCODE_VERSION),
+STRING_TOKEN (STR_MISC_GOP_VERSION),
+STRING_TOKEN (STR_MISC_PROCESSOR_STEPPING),
+
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Function.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Function.c new file mode 100644 index 0000000000..a90abfeef9 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x90Function.c @@ -0,0 +1,486 @@ +/** @file
+ The function that processes the Smbios data type 0x88 before they
+ are submitted to Data Hub.
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Protocol/SeCOperation.h>
+#include <Library/PrintLib.h>
+#include <Library/CpuIA32.h>
+#include <Protocol/DxeSmmReadyToLock.h>
+
+
+VOID
+GetCPUStepping (
+ )
+{
+ CHAR16 Buffer[40];
+ UINT16 FamilyId;
+ UINT8 Model;
+ UINT8 SteppingId;
+ UINT8 ProcessorType;
+
+ EfiCpuVersion (&FamilyId, &Model, &SteppingId, &ProcessorType);
+ //
+ // we need raw Model data
+ //
+ Model = Model & 0xf;
+ //
+ // Family/Model/Step
+ //
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%d/%d/%d", FamilyId, Model, SteppingId);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_PROCESSOR_STEPPING), Buffer, NULL);
+
+}
+
+
+EFI_STATUS
+SearchChildHandle (
+ EFI_HANDLE Father,
+ EFI_HANDLE *Child
+ )
+{
+ EFI_STATUS Status;
+ UINTN HandleIndex;
+ EFI_GUID **ProtocolGuidArray = NULL;
+ UINTN ArrayCount;
+ UINTN ProtocolIndex;
+ UINTN OpenInfoCount;
+ UINTN OpenInfoIndex;
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo = NULL;
+ UINTN mHandleCount;
+ EFI_HANDLE *mHandleBuffer= NULL;
+
+ //
+ // Retrieve the list of all handles from the handle database
+ //
+ Status = gBS->LocateHandleBuffer (
+ AllHandles,
+ NULL,
+ NULL,
+ &mHandleCount,
+ &mHandleBuffer
+ );
+
+ for (HandleIndex = 0; HandleIndex < mHandleCount; HandleIndex++) {
+ //
+ // Retrieve the list of all the protocols on each handle
+ //
+ Status = gBS->ProtocolsPerHandle (
+ mHandleBuffer[HandleIndex],
+ &ProtocolGuidArray,
+ &ArrayCount
+ );
+ if (!EFI_ERROR (Status)) {
+ for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
+ Status = gBS->OpenProtocolInformation (
+ mHandleBuffer[HandleIndex],
+ ProtocolGuidArray[ProtocolIndex],
+ &OpenInfo,
+ &OpenInfoCount
+ );
+ if (!EFI_ERROR (Status)) {
+ for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
+ if (OpenInfo[OpenInfoIndex].AgentHandle == Father) {
+ if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) == EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) {
+ *Child = mHandleBuffer[HandleIndex];
+ Status = EFI_SUCCESS;
+ goto TryReturn;
+ }
+ }
+ }
+ Status = EFI_NOT_FOUND;
+ }
+ }
+ if (OpenInfo != NULL) {
+ FreePool (OpenInfo);
+ OpenInfo = NULL;
+ }
+ }
+ if (ProtocolGuidArray != NULL) {
+ FreePool (ProtocolGuidArray);
+ ProtocolGuidArray = NULL;
+ }
+ }
+TryReturn:
+ if (OpenInfo != NULL) {
+ FreePool (OpenInfo);
+ OpenInfo = NULL;
+ }
+ if (ProtocolGuidArray != NULL) {
+ FreePool (ProtocolGuidArray);
+ ProtocolGuidArray = NULL;
+ }
+ if (mHandleBuffer != NULL) {
+ FreePool (mHandleBuffer);
+ mHandleBuffer = NULL;
+ }
+
+ return Status;
+}
+
+
+EFI_STATUS
+JudgeHandleIsPCIDevice (
+ EFI_HANDLE Handle,
+ UINT8 Device,
+ UINT8 Funs
+ )
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH *DPath;
+ EFI_DEVICE_PATH *DevicePath;
+
+ Status = gBS->HandleProtocol (
+ Handle,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &DPath
+ );
+ if (!EFI_ERROR (Status)) {
+ DevicePath = DPath;
+ while (!IsDevicePathEnd(DPath)) {
+ if ((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
+ PCI_DEVICE_PATH *PCIPath;
+ PCIPath = (PCI_DEVICE_PATH*) DPath;
+ DPath = NextDevicePathNode (DPath);
+
+ if (IsDevicePathEnd (DPath) && (PCIPath->Device == Device) && (PCIPath->Function == Funs)) {
+ return EFI_SUCCESS;
+ }
+ } else {
+ DPath = NextDevicePathNode (DPath);
+ }
+ }
+ }
+
+ return EFI_UNSUPPORTED;
+}
+
+
+EFI_STATUS
+GetDriverName (
+ EFI_HANDLE Handle
+ )
+{
+ EFI_DRIVER_BINDING_PROTOCOL *BindHandle = NULL;
+ EFI_STATUS Status;
+ UINT32 Version;
+ UINT16 *Ptr;
+ CHAR16 Buffer[40];
+ STRING_REF TokenToUpdate;
+
+ Status = gBS->OpenProtocol (
+ Handle,
+ &gEfiDriverBindingProtocolGuid,
+ (VOID **) &BindHandle,
+ NULL,
+ NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+ if (EFI_ERROR (Status)) {
+ return EFI_NOT_FOUND;
+ }
+
+ Version = BindHandle->Version;
+ Ptr = (UINT16 *) &Version;
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"7.0.%04d", *(Ptr));
+
+ TokenToUpdate = (STRING_REF) STR_MISC_GOP_VERSION;
+ HiiSetString (mHiiHandle, TokenToUpdate, Buffer, NULL);
+
+ return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+GetGOPDriverName (
+ )
+{
+ UINTN HandleCount;
+ EFI_HANDLE *Handles= NULL;
+ UINTN Index;
+ EFI_STATUS Status;
+ EFI_HANDLE Child = 0;
+
+ Status = gBS->LocateHandleBuffer(
+ ByProtocol,
+ &gEfiDriverBindingProtocolGuid,
+ NULL,
+ &HandleCount,
+ &Handles
+ );
+
+ for (Index = 0; Index < HandleCount; Index++) {
+ Status = SearchChildHandle (Handles[Index], &Child);
+ if (!EFI_ERROR (Status)) {
+ Status = JudgeHandleIsPCIDevice (Child, 0x02, 0x00);
+ if (!EFI_ERROR (Status)) {
+ return GetDriverName (Handles[Index]);
+ }
+ }
+ }
+
+ return EFI_UNSUPPORTED;
+}
+
+
+VOID
+GetUcodeVersion (
+ )
+{
+ UINT32 MicroCodeVersion;
+ CHAR16 Buffer[40];
+ //
+ // Microcode Revision
+ //
+ EfiWriteMsr (EFI_MSR_IA32_BIOS_SIGN_ID, 0);
+ EfiCpuid (EFI_CPUID_VERSION_INFO, NULL);
+ MicroCodeVersion = (UINT32) RShiftU64 (EfiReadMsr (EFI_MSR_IA32_BIOS_SIGN_ID), 32);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", MicroCodeVersion);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_UCODE_VERSION), Buffer, NULL);
+}
+
+
+VOID
+GetSeCVersion (
+ )
+{
+ UINTN Length = 0;
+ STRING_REF TokenToUpdate;
+ CHAR16 *SeCVersion;
+ EFI_STATUS Status;
+ SEC_OPERATION_PROTOCOL *SeCOp;
+ SEC_INFOMATION SeCInfo;
+
+ Status = gBS->LocateProtocol (
+ &gEfiSeCOperationProtocolGuid,
+ NULL,
+ (VOID **) &SeCOp
+ );
+ if (EFI_ERROR (Status)) return;
+
+ Status = SeCOp->GetPlatformSeCInfo (
+ &SeCInfo
+ );
+
+ if (SeCInfo.SeCVerValid) {
+ Length = 40;
+ SeCVersion = AllocateZeroPool ((Length+2) * sizeof (CHAR16));
+ UnicodeSPrint (
+ SeCVersion, Length, L"%d.%d.%d.%d",
+ SeCInfo.SeCVer.CodeMajor,
+ SeCInfo.SeCVer.CodeMinor,
+ SeCInfo.SeCVer.CodeHotFix,
+ SeCInfo.SeCVer.CodeBuildNo
+ );
+ } else {
+ SeCVersion = L"NA";
+ }
+ TokenToUpdate = (STRING_REF) STR_MISC_SEC_VERSION;
+ HiiSetString (mHiiHandle, TokenToUpdate, SeCVersion, NULL);
+
+}
+
+
+/**
+ Publish the smbios OEM type 0x90.
+
+ @param[in] Event Event whose notification function is being invoked (gEfiDxeSmmReadyToLockProtocolGuid).
+ @param[in] Context Pointer to the notification functions context, which is implementation dependent.
+
+ @retval None
+
+**/
+VOID
+EFIAPI
+AddSmbiosT0x90Callback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+ UINTN SECVerStrLen = 0;
+ UINTN uCodeVerStrLen = 0;
+ UINTN GOPStrLen = 0;
+ UINTN SteppingStrLen = 0;
+ SMBIOS_TABLE_TYPE90 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_OEM_TYPE_0x90 *ForType90InputData;
+ CHAR16 *SECVer;
+ CHAR16 *uCodeVer;
+ CHAR16 *GOPVer;
+ CHAR16 *Stepping;
+ STRING_REF TokenToGet;
+ CHAR8 *OptionalStrStart;
+ EFI_SMBIOS_PROTOCOL *SmbiosProtocol;
+
+ ForType90InputData = (EFI_MISC_OEM_TYPE_0x90 *)Context;
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x90 callback.\n"));
+
+ gBS->CloseEvent (Event); // Unload this event.
+
+ //
+ // First check for invalid parameters.
+ //
+ if (Context == NULL) {
+ return;
+ }
+
+ Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &SmbiosProtocol);
+ ASSERT_EFI_ERROR (Status);
+
+ GetSeCVersion ();
+ GetUcodeVersion ();
+ GetGOPDriverName ();
+ GetCPUStepping ();
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SEC_VERSION);
+ SECVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SECVerStrLen = StrLen (SECVer);
+ if (SECVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_UCODE_VERSION);
+ uCodeVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ uCodeVerStrLen = StrLen (uCodeVer);
+ if (uCodeVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_GOP_VERSION);
+ GOPVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ GOPStrLen = StrLen (GOPVer);
+ if (GOPStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PROCESSOR_STEPPING);
+ Stepping = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SteppingStrLen = StrLen (Stepping);
+
+
+ if (SteppingStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE90) + SECVerStrLen + 1 + uCodeVerStrLen + 1 + GOPStrLen + 1 + SteppingStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE90) + SECVerStrLen + 1 + uCodeVerStrLen + 1 + GOPStrLen + 1 + SteppingStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_FIRMWARE_VERSION_INFO;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE90);
+
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // SEC VERSION will be the 1st optional string following the formatted structure.
+ //
+ SmbiosRecord->SECVersion = 1;
+ //
+ // Microcode VERSION will be the 2nd optional string following the formatted structure.
+ //
+ SmbiosRecord->uCodeVersion = 2;
+ //
+ // GOP VERSION will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->GOPVersion = 3;
+ //
+ // CPU Stepping will be the 4th optional string following the formatted structure.
+ //
+ SmbiosRecord->CpuStepping = 4;
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (SECVer, OptionalStrStart);
+ UnicodeStrToAsciiStr (uCodeVer, OptionalStrStart + SECVerStrLen + 1);
+ UnicodeStrToAsciiStr (GOPVer, OptionalStrStart + SECVerStrLen + 1 + uCodeVerStrLen + 1);
+ UnicodeStrToAsciiStr (Stepping, OptionalStrStart + SECVerStrLen + 1 + uCodeVerStrLen + 1 + GOPStrLen + 1);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = SmbiosProtocol-> Add (
+ SmbiosProtocol,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+ return;
+}
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemType0x90 (Type 0x90).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscOemType0x90)
+{
+ EFI_STATUS Status;
+ static BOOLEAN CallbackIsInstalledT0x90 = FALSE;
+ VOID *AddSmbiosT0x90CallbackNotifyReg;
+ EFI_EVENT AddSmbiosT0x90CallbackEvent;
+
+ //
+ // This callback will create a OEM Type 0x90 record.
+ //
+ if (CallbackIsInstalledT0x90 == FALSE) {
+ CallbackIsInstalledT0x90 = TRUE; // Prevent more than 1 callback.
+ DEBUG ((EFI_D_INFO, "Create Smbios T0x90 callback.\n"));
+
+ //
+ // gEfiDxeSmmReadyToLockProtocolGuid is ready
+ //
+ Status = gBS->CreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ AddSmbiosT0x90Callback,
+ RecordData,
+ &AddSmbiosT0x90CallbackEvent
+ );
+
+ ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ return Status;
+
+ }
+
+ Status = gBS->RegisterProtocolNotify (
+ &gEfiDxeSmmReadyToLockProtocolGuid,
+ AddSmbiosT0x90CallbackEvent,
+ &AddSmbiosT0x90CallbackNotifyReg
+ );
+
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94.uni Binary files differnew file mode 100644 index 0000000000..b1e358c8fd --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Data.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Data.c new file mode 100644 index 0000000000..32fe113858 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Data.c @@ -0,0 +1,76 @@ +/** @file
+ This file contains the Misc version Data (SMBIOS data type 0x94)
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Oem data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_TYPE_0x94, MiscOemType0x94) = {
+
+STRING_TOKEN (STR_MISC_FVI_PLATFORM),
+STRING_TOKEN (STR_MISC_IFWI_VERSION_STRING),
+STRING_TOKEN (STR_MISC_IFWI_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_BIOS_VERSION_STRING),
+STRING_TOKEN (STR_MISC_BIOS_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_CSE_VERSION_STRING),
+STRING_TOKEN (STR_MISC_CSE_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_GOP_VERSION_STRING),
+STRING_TOKEN (STR_MISC_GOP_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_MRC_VERSION_STRING),
+STRING_TOKEN (STR_MISC_MRC_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_UCODE_STRING),
+STRING_TOKEN (STR_MISC_UCODE_VALUE),
+STRING_TOKEN (STR_MISC_PUNIT_FW_STRING),
+STRING_TOKEN (STR_MISC_PUNIT_FW_VALUE),
+STRING_TOKEN (STR_MISC_PMC_FW_STRING),
+STRING_TOKEN (STR_MISC_PMC_FW_VALUE),
+STRING_TOKEN (STR_MISC_ISH_FW_STRING),
+STRING_TOKEN (STR_MISC_ISH_FW_VALUE),
+STRING_TOKEN (STR_MISC_SOC_STRING),
+STRING_TOKEN (STR_MISC_SOC_VALUE),
+STRING_TOKEN (STR_MISC_BOARD_ID_STRING),
+STRING_TOKEN (STR_MISC_BOARD_ID_VALUE),
+STRING_TOKEN (STR_MISC_FAB_ID_STRING),
+STRING_TOKEN (STR_MISC_FAB_ID_VALUE),
+STRING_TOKEN (STR_MISC_CPU_FLAVOR_STRING),
+STRING_TOKEN (STR_MISC_CPU_FLAVOR_VALUE),
+STRING_TOKEN (STR_MISC_PMIC_VERSION_STRING),
+STRING_TOKEN (STR_MISC_PMIC_VERSION_VALUE),
+STRING_TOKEN (STR_MISC_SECURE_BOOT_STRING),
+STRING_TOKEN (STR_MISC_SECURE_BOOT_VALUE),
+STRING_TOKEN (STR_MISC_BOOT_MODE_STRING),
+STRING_TOKEN (STR_MISC_BOOT_MODE_VALUE),
+STRING_TOKEN (STR_MISC_SPEED_STEP_STRING),
+STRING_TOKEN (STR_MISC_SPEED_STEP_VALUE),
+STRING_TOKEN (STR_MISC_CPU_TURBO_STRING),
+STRING_TOKEN (STR_MISC_CPU_TURBO_VALUE),
+STRING_TOKEN (STR_MISC_CSTATE_STRING),
+STRING_TOKEN (STR_MISC_CSTATE_VALUE),
+STRING_TOKEN (STR_MISC_ENHANCED_CSTATE_STRING),
+STRING_TOKEN (STR_MISC_ENHANCED_CSTATE_VALUE),
+STRING_TOKEN (STR_MISC_PACKAGE_CSTATE_STRING),
+STRING_TOKEN (STR_MISC_PACKAGE_CSTATE_VALUE),
+STRING_TOKEN (STR_MISC_CORE_CSTATE_STRING),
+STRING_TOKEN (STR_MISC_CORE_CSTATE_VALUE),
+STRING_TOKEN (STR_MISC_GFX_TURBO_STRING),
+STRING_TOKEN (STR_MISC_GFX_TURBO_VALUE),
+STRING_TOKEN (STR_MISC_S0IX_STRING),
+STRING_TOKEN (STR_MISC_S0IX_VALUE),
+STRING_TOKEN (STR_MISC_RC6_STRING),
+STRING_TOKEN (STR_MISC_RC6_VALUE),
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c new file mode 100644 index 0000000000..0382858feb --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOemType0x94Function.c @@ -0,0 +1,1587 @@ +/** @file
+ The function that processes the Smbios data type 0x94.
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Protocol/DataHub.h>
+#include <Library/HiiLib.h>
+#include <Protocol/SeCOperation.h>
+#include <Protocol/CpuIo2.h>
+#include <Library/PrintLib.h>
+#include <Protocol/PciRootBridgeIo.h>
+#include <Protocol/SimpleNetwork.h>
+#include <Protocol/DevicePath.h>
+#include <Protocol/DiskInfo.h>
+#include <Protocol/IdeControllerInit.h>
+#include <Protocol/MpService.h>
+#include <Protocol/SeCOperation.h>
+#include <Protocol/CpuIo2.h>
+#include <Library/IoLib.h>
+#include <Library/PlatformSecureDefaultsLib.h>
+#include <Library/I2clib.h>
+#include <Library/CpuIA32.h>
+#include <Library/DriverLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/PmicLib.h>
+#include <Guid/PlatformInfo.h>
+#include <Guid/SetupVariable.h>
+#include "SetupMode.h"
+#include <PlatformBaseAddresses.h>
+#include <Library/SteppingLib.h>
+#include <Library/PmcIpcLib.h>
+#include <Library/BiosIdLib.h>
+
+#include <Guid/MemoryConfigData.h>
+#include <Guid/HobList.h>
+#include <Library/HeciMsgLib.h>
+
+#define MRC_DATA_REQUIRED_FROM_OUTSIDE
+#include <MmrcData.h>
+
+#define LEFT_JUSTIFY 0x01
+#define PREFIX_SIGN 0x02
+#define PREFIX_BLANK 0x04
+#define COMMA_TYPE 0x08
+#define LONG_TYPE 0x10
+#define PREFIX_ZERO 0x20
+#define CHARACTER_NUMBER_FOR_VALUE 30
+#define MSR_IA32_PLATFORM_ID 0x17
+
+#define MSR_IA32_BIOS_SIGN_ID 0x0000008B
+#define IPC_CMD_ID_PMC_VER 0xE7 // PMC FW version
+#define IPC_SUBCMD_ID_PMC_VER_READ 0x00 // Read PMC FW version
+
+#define PREFIX_ZERO 0x20
+
+#ifndef MmPciAddress
+#define MmPciAddress( Segment, Bus, Device, Function, Register ) \
+ ( (UINTN)0xE0000000 + \
+ (UINTN)(Bus << 20) + \
+ (UINTN)(Device << 15) + \
+ (UINTN)(Function << 12) + \
+ (UINTN)(Register) \
+ )
+#endif
+
+static CHAR16 mHexStr[] = { L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7',
+ L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F' };
+
+
+extern EFI_GUID gIFWIVersionHobGuid;
+extern EFI_GUID gEfiHobListGuid;
+extern EFI_GUID gEfiMemoryConfigDataGuid;
+
+
+/**
+ VSPrint worker function that prints a Value as a decimal number in Buffer.
+
+ @param[in] Buffer Location to place ASCII decimal number string of Value.
+ @param[in] Value Decimal value to convert to a string in Buffer.
+ @param[in] Flags Flags to use in printing decimal string, see file header for details.
+ @param[in] Width Width of hex value.
+
+ @Returns Number of characters printed.
+
+**/
+UINTN
+EfiValueToString (
+ IN OUT CHAR16 *Buffer,
+ IN INT64 Value,
+ IN UINTN Flags,
+ IN UINTN Width
+ )
+{
+ CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
+ CHAR16 *TempStr;
+ CHAR16 *BufferPtr;
+ UINTN Count;
+ UINTN ValueCharNum;
+ UINTN Remainder;
+ CHAR16 Prefix;
+ UINTN Index;
+ BOOLEAN ValueIsNegative;
+ UINT64 TempValue;
+
+ TempStr = TempBuffer;
+ BufferPtr = Buffer;
+ Count = 0;
+ ValueCharNum = 0;
+ ValueIsNegative = FALSE;
+
+ if (Width > CHARACTER_NUMBER_FOR_VALUE - 1) {
+ Width = CHARACTER_NUMBER_FOR_VALUE - 1;
+ }
+
+ if (Value < 0) {
+ Value = -Value;
+ ValueIsNegative = TRUE;
+ }
+
+ do {
+ TempValue = Value;
+ Value = (INT64) DivU64x32 ((UINT64)Value, 10);
+ Remainder = (UINTN) ((UINT64)TempValue - 10 * Value);
+ *(TempStr++) = (CHAR16) (Remainder + '0');
+ ValueCharNum++;
+ Count++;
+ if ((Flags & COMMA_TYPE) == COMMA_TYPE) {
+ if (ValueCharNum % 3 == 0 && Value != 0) {
+ *(TempStr++) = ',';
+ Count++;
+ }
+ }
+ } while (Value != 0);
+
+ if (ValueIsNegative) {
+ *(TempStr++) = '-';
+ Count++;
+ }
+
+ if ((Flags & PREFIX_ZERO) && !ValueIsNegative) {
+ Prefix = '0';
+ } else {
+ Prefix = ' ';
+ }
+
+ Index = Count;
+ if (!(Flags & LEFT_JUSTIFY)) {
+ for (; Index < Width; Index++) {
+ *(TempStr++) = Prefix;
+ }
+ }
+
+ //
+ // Reverse temp string into Buffer.
+ //
+ if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
+ TempStr = TempBuffer + Width;
+ }
+ Index = 0;
+ while (TempStr != TempBuffer) {
+ *(BufferPtr++) = *(--TempStr);
+ Index++;
+ }
+
+ *BufferPtr = 0;
+ return Index;
+}
+
+
+/**
+ VSPrint worker function that prints a Value as a hex number in Buffer
+
+ @param[in] Buffer Location to place ASCII hex string of Value.
+ @param[in] Value Hex value to convert to a string in Buffer.
+ @param[in] Flags Flags to use in printing Hex string, see file header for details.
+ @param[in] Width Width of hex value.
+
+ @Returns Number of characters printed.
+
+**/
+UINTN
+EfiValueToHexStr (
+ IN OUT CHAR16 *Buffer,
+ IN UINT64 Value,
+ IN UINTN Flags,
+ IN UINTN Width
+ )
+{
+ CHAR16 TempBuffer[CHARACTER_NUMBER_FOR_VALUE];
+ CHAR16 *TempStr;
+ CHAR16 Prefix;
+ CHAR16 *BufferPtr;
+ UINTN Count;
+ UINTN Index;
+
+ TempStr = TempBuffer;
+ BufferPtr = Buffer;
+
+ //
+ // Count starts at one since we will null terminate. Each iteration of the
+ // loop picks off one nibble. Oh yea TempStr ends up backwards
+ //
+ Count = 0;
+
+ if (Width > CHARACTER_NUMBER_FOR_VALUE - 1) {
+ Width = CHARACTER_NUMBER_FOR_VALUE - 1;
+ }
+
+ do {
+ Index = ((UINTN) Value & 0xf);
+ *(TempStr++) = mHexStr[Index];
+ Value = RShiftU64 (Value, 4);
+ Count++;
+ } while (Value != 0);
+
+ if (Flags & PREFIX_ZERO) {
+ Prefix = '0';
+ } else {
+ Prefix = ' ';
+ }
+
+ Index = Count;
+ if (!(Flags & LEFT_JUSTIFY)) {
+ for (; Index < Width; Index++) {
+ *(TempStr++) = Prefix;
+ }
+ }
+
+ //
+ // Reverse temp string into Buffer.
+ //
+ if (Width > 0 && (UINTN) (TempStr - TempBuffer) > Width) {
+ TempStr = TempBuffer + Width;
+ }
+ Index = 0;
+ while (TempStr != TempBuffer) {
+ *(BufferPtr++) = *(--TempStr);
+ Index++;
+ }
+
+ *BufferPtr = 0;
+ return Index;
+}
+
+
+/**
+ Converts MAC address to Unicode string.
+ The value is 64-bit and the resulting string will be 12
+ digit hex number in pairs of digits separated by dashes.
+
+ @param[in] String String that will contain the value
+ @param[in] MacAddr Converts MAC address
+ @param[in] AddrSize Size of MAC address
+
+**/
+CHAR16 *
+StrMacToString (
+ OUT CHAR16 *String,
+ IN EFI_MAC_ADDRESS *MacAddr,
+ IN UINT32 AddrSize
+ )
+{
+ UINT32 i;
+
+ for (i = 0; i < AddrSize; i++) {
+ EfiValueToHexStr (
+ &String[2 * i],
+ MacAddr->Addr[i] & 0xFF,
+ PREFIX_ZERO,
+ 2
+ );
+ }
+ //
+ // Terminate the string.
+ //
+ String[2 * AddrSize] = L'\0';
+
+ return String;
+}
+
+
+EFI_STATUS
+TJudgeHandleIsPCIDevice(
+ EFI_HANDLE Handle,
+ UINT8 Device,
+ UINT8 Funs
+)
+{
+ EFI_STATUS Status;
+ EFI_DEVICE_PATH *DPath;
+ EFI_DEVICE_PATH *DevicePath;
+
+ Status = gBS->HandleProtocol (
+ Handle,
+ &gEfiDevicePathProtocolGuid,
+ (VOID **) &DPath
+ );
+ if (!EFI_ERROR(Status)) {
+ DevicePath = DPath;
+ while (!IsDevicePathEnd (DPath)) {
+ if ((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
+ PCI_DEVICE_PATH *PCIPath;
+
+ PCIPath = (PCI_DEVICE_PATH*) DPath;
+ DPath = NextDevicePathNode (DPath);
+ if (IsDevicePathEnd(DPath) && (PCIPath->Device == Device) && (PCIPath->Function == Funs)) {
+ return EFI_SUCCESS;
+ }
+ } else {
+ DPath = NextDevicePathNode (DPath);
+ }
+ }
+ }
+
+ return EFI_UNSUPPORTED;
+}
+
+
+EFI_STATUS
+TSearchChildHandle (
+ EFI_HANDLE Father,
+ EFI_HANDLE *Child
+ )
+{
+ EFI_STATUS Status;
+ UINTN HandleIndex;
+ EFI_GUID **ProtocolGuidArray = NULL;
+ UINTN ArrayCount;
+ UINTN ProtocolIndex;
+ UINTN OpenInfoCount;
+ UINTN OpenInfoIndex;
+ EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfo = NULL;
+ UINTN mHandleCount;
+ EFI_HANDLE *mHandleBuffer= NULL;
+
+ //
+ // Retrieve the list of all handles from the handle database
+ //
+ Status = gBS->LocateHandleBuffer (
+ AllHandles,
+ NULL,
+ NULL,
+ &mHandleCount,
+ &mHandleBuffer
+ );
+
+ for (HandleIndex = 0; HandleIndex < mHandleCount; HandleIndex++) {
+ //
+ // Retrieve the list of all the protocols on each handle
+ //
+ Status = gBS->ProtocolsPerHandle (
+ mHandleBuffer[HandleIndex],
+ &ProtocolGuidArray,
+ &ArrayCount
+ );
+ if (!EFI_ERROR (Status)) {
+ for (ProtocolIndex = 0; ProtocolIndex < ArrayCount; ProtocolIndex++) {
+ Status = gBS->OpenProtocolInformation (
+ mHandleBuffer[HandleIndex],
+ ProtocolGuidArray[ProtocolIndex],
+ &OpenInfo,
+ &OpenInfoCount
+ );
+ if (!EFI_ERROR (Status)) {
+ for (OpenInfoIndex = 0; OpenInfoIndex < OpenInfoCount; OpenInfoIndex++) {
+ if (OpenInfo[OpenInfoIndex].AgentHandle == Father) {
+ if ((OpenInfo[OpenInfoIndex].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) == EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) {
+ *Child = mHandleBuffer[HandleIndex];
+ Status = EFI_SUCCESS;
+ goto TryReturn;
+ }
+ }
+ }
+ Status = EFI_NOT_FOUND;
+ }
+ }
+ if (OpenInfo != NULL) {
+ FreePool (OpenInfo);
+ OpenInfo = NULL;
+ }
+ }
+ FreePool (ProtocolGuidArray);
+ ProtocolGuidArray = NULL;
+ }
+TryReturn:
+ if (OpenInfo != NULL) {
+ FreePool (OpenInfo);
+ OpenInfo = NULL;
+ }
+ if (ProtocolGuidArray != NULL) {
+ FreePool (ProtocolGuidArray);
+ ProtocolGuidArray = NULL;
+ }
+ if (mHandleBuffer != NULL) {
+ FreePool (mHandleBuffer);
+ mHandleBuffer = NULL;
+ }
+
+ return Status;
+}
+
+
+EFI_STATUS
+TGetDriverName(
+ EFI_HANDLE Handle,
+ CHAR16 *Name
+ )
+{
+ EFI_DRIVER_BINDING_PROTOCOL *BindHandle = NULL;
+ EFI_STATUS Status;
+ UINT32 Version;
+ UINT16 *Ptr;
+
+ Status = gBS->OpenProtocol (
+ Handle,
+ &gEfiDriverBindingProtocolGuid,
+ (VOID**)&BindHandle,
+ NULL,
+ NULL,
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL
+ );
+
+ if (EFI_ERROR (Status)) {
+ return EFI_NOT_FOUND;
+ }
+
+ Version = BindHandle->Version;
+ Ptr = (UINT16*) &Version;
+ UnicodeSPrint (Name, 40, L"%d.%d.%d", Version >> 24 , (Version >>16)& 0x0f ,*(Ptr));
+
+ return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+TGetGOPDriverName(
+ CHAR16 *Name
+ )
+{
+ UINTN HandleCount;
+ EFI_HANDLE *Handles= NULL;
+ UINTN Index;
+ EFI_STATUS Status;
+ EFI_HANDLE Child = 0;
+
+ Status = gBS->LocateHandleBuffer(
+ ByProtocol,
+ &gEfiDriverBindingProtocolGuid,
+ NULL,
+ &HandleCount,
+ &Handles
+ );
+ for (Index = 0; Index < HandleCount; Index++) {
+ Status = TSearchChildHandle (Handles[Index], &Child);
+ if (!EFI_ERROR (Status)) {
+ Status = TJudgeHandleIsPCIDevice (Child, 0x02, 0x00);
+ if (!EFI_ERROR (Status)) {
+ return TGetDriverName (Handles[Index], Name);
+ }
+ }
+ }
+
+ return EFI_UNSUPPORTED;
+}
+
+
+EFI_STATUS
+SmbiosGetImageFwVersion (
+ VOID
+ )
+{
+ EFI_STATUS Status;
+ FW_VERSION_CMD_RESP_DATA MsgGetFwVersionRespData;
+ UINT8 Index;
+ CHAR16 Buffer[40];
+ CHAR8 *CseManName;
+ CHAR8 *IshManName;
+
+ DEBUG ((EFI_D_INFO, "Executing SmbiosGetImageFwVersion().\n"));
+ SetMem (&MsgGetFwVersionRespData, sizeof (FW_VERSION_CMD_RESP_DATA), 0x0);
+ SetMem (Buffer, sizeof (Buffer), 0x0);
+ CseManName = "FTPR.man"; //CSE manifest file name
+ IshManName = "ISHC.man"; //ISH manifest file name
+
+ Status = HeciGetImageFwVerMsg (&MsgGetFwVersionRespData);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ for (Index = 0; Index < MAX_IMAGE_MODULE_NUMBER; Index++) {
+ if (!CompareMem (MsgGetFwVersionRespData.ModuleEntries[Index].EntryName, CseManName, AsciiStrLen (CseManName))) {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%d.%d.%d.%d",
+ MsgGetFwVersionRespData.ModuleEntries[Index].Major,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Minor,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Hotfix,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Build);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_CSE_VERSION_VALUE), Buffer, NULL);
+ }
+
+ if (!CompareMem (MsgGetFwVersionRespData.ModuleEntries[Index].EntryName, IshManName, AsciiStrLen (IshManName))) {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%d.%d.%d.%d",
+ MsgGetFwVersionRespData.ModuleEntries[Index].Major,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Minor,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Hotfix,
+ MsgGetFwVersionRespData.ModuleEntries[Index].Build);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_ISH_FW_VALUE), Buffer, NULL);
+ }
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+EFI_STATUS
+UpdatePlatformInformation (
+ )
+{
+ UINT32 MicroCodeVersion;
+ CHAR16 Buffer[0x100];
+ EFI_STATUS Status;
+ UINT8 CpuFlavor = 0;
+ EFI_PEI_HOB_POINTERS GuidHob;
+ EFI_PLATFORM_INFO_HOB *PlatformInfo = NULL;
+ UINT32 SoCStepping;
+ UINT8 Data8;
+ CHAR16 Name[40];
+ SYSTEM_CONFIGURATION SystemConfiguration;
+ UINTN VarSize;
+ EFI_BOOT_MODE BootMode;
+ UINT8 PMCVersion[8];
+ CHAR16 ReleaseDate[100];
+ CHAR16 ReleaseTime[100];
+ VOID *HobList = NULL;
+ VOID *HobData = NULL;
+ UINTN DataSize;
+ MRC_PARAMS_SAVE_RESTORE *MemInfoHob = NULL;
+ UINT32 MrcVersion;
+ UINTN Index;
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x94 Update.\n"));
+ //
+ // Get the HOB list. If it is not present, then ASSERT.
+ //
+ GuidHob.Raw = GetHobList ();
+ if (GuidHob.Raw != NULL) {
+ if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) {
+ PlatformInfo = GET_GUID_HOB_DATA (GuidHob.Guid);
+ }
+ }
+
+ if (GetBxtSeries () == BxtP) {
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"Broxton-P");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_FVI_PLATFORM), Buffer, NULL);
+ }
+
+ Status = TGetGOPDriverName (Name);
+ if (!EFI_ERROR (Status)) {
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_GOP_VERSION_VALUE), Name, NULL);
+ }
+
+ //
+ //CpuFlavor
+ //
+ //BXT
+ //BXT Tablet 000
+ //BXT Notebook 001
+ //BXT Desktop 010
+ //
+ // CPU flavor
+ //
+ CpuFlavor = RShiftU64 (EfiReadMsr (MSR_IA32_PLATFORM_ID), 50) & 0x07;
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", CpuFlavor);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_CPU_FLAVOR_VALUE), Buffer, NULL);
+
+ if (PlatformInfo != NULL) {
+ //
+ // Board Id
+ //
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", PlatformInfo->BoardId);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_BOARD_ID_VALUE), Buffer, NULL);
+
+ //
+ // FAB ID
+ //
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", PlatformInfo->BoardRev);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_FAB_ID_VALUE), Buffer, NULL);
+ }
+
+ //
+ // SOC
+ //
+ SoCStepping = BxtStepping ();
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", SoCStepping);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_SOC_VALUE), Buffer, NULL);
+
+ //
+ // uCode
+ //
+ MicroCodeVersion = (UINT32) RShiftU64 (AsmReadMsr64 (MSR_IA32_BIOS_SIGN_ID), 32);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", MicroCodeVersion);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_UCODE_VALUE), Buffer, NULL);
+
+ //
+ // PUNIT
+ //
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_PUNIT_FW_VALUE), Buffer, NULL);
+
+ //
+ // PMC
+ //
+ IpcSendCommandEx (IPC_CMD_ID_PMC_VER, IPC_SUBCMD_ID_PMC_VER_READ, PMCVersion, 8);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%02x.%02x", PMCVersion[1], PMCVersion[0]);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_PMC_FW_VALUE), Buffer, NULL);
+
+ //
+ // CSE and ISH
+ //
+ Status = SmbiosGetImageFwVersion ();
+
+ //
+ // MRC
+ //
+ Status = EfiGetSystemConfigurationTable (&gEfiHobListGuid, &HobList);
+ ASSERT_EFI_ERROR (Status);
+
+ if ((HobList = GetNextGuidHob (&gFspNonVolatileStorageHobGuid, HobList)) != NULL) {
+ HobData = GET_GUID_HOB_DATA (HobList);
+ DataSize = GET_GUID_HOB_DATA_SIZE (HobList);
+ MemInfoHob = (MRC_PARAMS_SAVE_RESTORE *) HobData;
+ }
+
+ if (!EFI_ERROR (Status) && NULL != HobData ) {
+ MrcVersion = MemInfoHob->MrcVer >> 16;
+ MrcVersion &= 0xffff;
+ Index = EfiValueToString (Buffer, MrcVersion/256, PREFIX_ZERO, 0);
+ StrCatS (Buffer, sizeof (Buffer) / sizeof (CHAR16), L".");
+ EfiValueToString (Buffer + Index + 1, MrcVersion%256, PREFIX_ZERO, 0);
+ HiiSetString (mHiiHandle,STRING_TOKEN (STR_MISC_MRC_VERSION_VALUE), Buffer, NULL);
+ }
+
+ //
+ // BIOS
+ //
+ GetBiosVersionDateTime (Buffer, ReleaseDate, ReleaseTime);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_BIOS_VERSION_VALUE), Buffer, NULL);
+
+
+ Status = gRT->GetVariable (
+ L"Setup",
+ &gEfiSetupVariableGuid,
+ NULL,
+ &VarSize,
+ &SystemConfiguration
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ //
+ // Secure boot
+ //
+ Data8 = SystemConfiguration.SecureBoot;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SECURE_BOOT_VALUE), Buffer, NULL);
+
+ //
+ //Bootmode
+ //
+ BootMode = GetBootModeHob ();
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", BootMode);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_BOOT_MODE_VALUE), Buffer, NULL);
+
+ //
+ //SpeedStep
+ //
+ Data8 = SystemConfiguration.EnableGv;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SPEED_STEP_VALUE), Buffer, NULL);
+
+ //
+ //CPU Turbo
+ //
+ if (BxtStepping () == BxtA0) {
+ Data8 = 0;
+ } else {
+ Data8 = SystemConfiguration.TurboModeEnable;
+ }
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_CPU_TURBO_VALUE), Buffer, NULL);
+
+ //
+ //C-states
+ //
+ Data8 = SystemConfiguration.EnableCx;
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_CSTATE_VALUE), Buffer, NULL);
+
+ //
+ //Enhanced C-states
+ //
+ Data8 = SystemConfiguration.EnableCxe;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_ENHANCED_CSTATE_VALUE), Buffer, NULL);
+
+ //
+ //PkgCState
+ //
+ Data8 = SystemConfiguration.MaxPkgCState;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_PACKAGE_CSTATE_VALUE), Buffer, NULL);
+
+ //
+ //CoreCState
+ //
+ Data8 = SystemConfiguration.MaxCoreCState;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_CORE_CSTATE_VALUE), Buffer, NULL);
+
+ //
+ //S0ix
+ //
+ Data8 = SystemConfiguration.LowPowerS0Idle;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_S0IX_VALUE), Buffer, NULL);
+
+ //
+ //RC6
+ //
+ Data8 = SystemConfiguration.EnableRenderStandby;
+ UnicodeSPrint (Buffer, sizeof(Buffer), L"%x", Data8);
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_RC6_VALUE), Buffer, NULL);
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x94 Update end.\n"));
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+ Smbios OEM type 0x94 callback.
+
+ @param[in] Event Event whose notification function is being invoked.
+ @param[in] Context Pointer to the notification functions context, which is implementation dependent.
+
+ @retval None
+
+**/
+VOID
+AddSmbiosT0x94Callback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+ //
+ // For FVI name string length definition
+ //
+ UINTN StrFviPlatformStrLen = 0;
+ UINTN StrIFWIVerStrLen = 0;
+ UINTN StrCseVerStrLen = 0;
+ UINTN StruCodeVerStrLen = 0;
+ UINTN StrGOPStrLen = 0;
+ UINTN StrMRCVersionStrLen = 0;
+ UINTN StrPMCVersionStrLen = 0;
+ UINTN StrPunitVersionStrLen = 0;
+ UINTN StrISHVersionStrLen = 0;
+ UINTN StrSOCVersionStrLen = 0;
+ UINTN StrBOARDVersionStrLen = 0;
+ UINTN StrFABVersionStrLen = 0;
+ UINTN StrCPUFLAVORStrLen = 0;
+ UINTN StrBIOSVersionStrLen = 0;
+ UINTN StrPMICVersionStrLen = 0;
+ UINTN StrSecureBootModeLen = 0;
+ UINTN StrBootModeLen = 0;
+ UINTN StrSpeedStepModeLen = 0;
+ UINTN StrCStateEnLen = 0;
+ UINTN StrEnhancedCStateEnLen = 0;
+ UINTN StrMaxCoreCStateLen = 0;
+ UINTN StrMaxPkgCStateLen = 0;
+ UINTN StrCpuTurboLen = 0;
+ UINTN StrGfxTurboLen = 0;
+ UINTN StrS0ixLen = 0;
+ UINTN StrRC6Len = 0;
+
+ //
+ // For FVI value length definition
+ //
+ UINTN IFWIVerStrLen = 0;
+ UINTN CseVerStrLen = 0;
+ UINTN uCodeVerStrLen = 0;
+ UINTN GOPStrLen = 0;
+ UINTN MRCVersionStrLen = 0;
+ UINTN PMCVersionStrLen = 0;
+ UINTN PunitVersionStrLen = 0;
+ UINTN ISHVersionStrLen = 0;
+ UINTN SOCVersionStrLen = 0;
+ UINTN BOARDVersionStrLen = 0;
+ UINTN FABVersionStrLen = 0;
+ UINTN CPUFLAVORStrLen = 0;
+ UINTN BIOSVersionStrLen = 0;
+ UINTN PMICVersionStrLen = 0;
+ UINTN SecureBootModeLen = 0;
+ UINTN BootModeLen = 0;
+ UINTN SpeedStepModeLen = 0;
+ UINTN CStateEnLen = 0;
+ UINTN EnhancedCStateEnLen = 0;
+ UINTN MaxCoreCStateLen = 0;
+ UINTN MaxPkgCStateLen = 0;
+ UINTN CpuTurboLen = 0;
+ UINTN GfxTurboLen = 0;
+ UINTN S0ixLen = 0;
+ UINTN RC6Len = 0;
+
+ SMBIOS_TABLE_TYPE94 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_OEM_TYPE_0x94 *ForType94InputData;
+
+ //
+ // FVI name string pointer
+ //
+ CHAR16 *StrFviPlatform;
+ CHAR16 *StrIFWIVer;
+ CHAR16 *StrCseVer;
+ CHAR16 *StruCodeVer;
+ CHAR16 *StrGOPVer;
+ CHAR16 *StrMrcVer;
+ CHAR16 *StrPmcVer;
+ CHAR16 *StrPunitVer;
+ CHAR16 *StrIshVer;
+ CHAR16 *StrSocVer;
+ CHAR16 *StrBoardVer;
+ CHAR16 *StrFabVer;
+ CHAR16 *StrCpuFlavor;
+ CHAR16 *StrBiosVer;
+ CHAR16 *StrPmicVer;
+ CHAR16 *StrSecureBootMode;
+ CHAR16 *StrBootMode;
+ CHAR16 *StrSpeedStepMode;
+ CHAR16 *StrMaxPkgCState;
+ CHAR16 *StrMaxCoreCState;
+ CHAR16 *StrCStateEn;
+ CHAR16 *StrEnhancedCStateEn;
+ CHAR16 *StrCpuTurbo;
+ CHAR16 *StrGfxTurbo;
+ CHAR16 *StrS0ix;
+ CHAR16 *StrRC6;
+
+ //
+ // FVI value string pointer
+ //
+ CHAR16 *IFWIVer;
+ CHAR16 *CseVer;
+ CHAR16 *uCodeVer;
+ CHAR16 *GOPVer;
+ CHAR16 *MrcVer;
+ CHAR16 *PmcVer;
+ CHAR16 *PunitVer;
+ CHAR16 *IshVer;
+ CHAR16 *SocVer;
+ CHAR16 *BoardVer;
+ CHAR16 *FabVer;
+ CHAR16 *CpuFlavor;
+ CHAR16 *BiosVer;
+ CHAR16 *PmicVer;
+ CHAR16 *SecureBootMode;
+ CHAR16 *BootMode;
+ CHAR16 *SpeedStepMode;
+ CHAR16 *MaxPkgCState;
+ CHAR16 *MaxCoreCState;
+ CHAR16 *CStateEn;
+ CHAR16 *EnhancedCStateEn;
+ CHAR16 *CpuTurbo;
+ CHAR16 *GfxTurbo;
+ CHAR16 *S0ix;
+ CHAR16 *RC6;
+
+ UINTN RecordLen = 0;
+ UINTN StrIdx = 0;
+
+
+ STRING_REF TokenToGet;
+ CHAR8 *OptionalStrStart;
+ EFI_SMBIOS_PROTOCOL *SmbiosProtocol;
+
+ ForType94InputData = (EFI_MISC_OEM_TYPE_0x94 *) Context;
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x94 callback.\n"));
+
+ gBS->CloseEvent (Event); // Unload this event.
+
+ //
+ // First check for invalid parameters.
+ //
+ if (Context == NULL) {
+ return;
+ }
+
+ UpdatePlatformInformation ();
+
+ Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID *) &SmbiosProtocol);
+ ASSERT_EFI_ERROR (Status);
+
+ TokenToGet = STRING_TOKEN (STR_MISC_FVI_PLATFORM);
+ StrFviPlatform = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrFviPlatformStrLen = StrLen(StrFviPlatform);
+ if (StrFviPlatformStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_IFWI_VERSION_STRING);
+ StrIFWIVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrIFWIVerStrLen = StrLen (StrIFWIVer);
+ if (StrIFWIVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_IFWI_VERSION_VALUE);
+ IFWIVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ IFWIVerStrLen = StrLen (IFWIVer);
+ if (IFWIVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION_STRING);
+ StrBiosVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrBIOSVersionStrLen = StrLen (StrBiosVer);
+ if (StrBIOSVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION_VALUE);
+ BiosVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ BIOSVersionStrLen = StrLen (BiosVer);
+ if (BIOSVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CSE_VERSION_STRING);
+ StrCseVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrCseVerStrLen = StrLen (StrCseVer);
+ if (StrCseVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CSE_VERSION_VALUE);
+ CseVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ CseVerStrLen = StrLen (CseVer);
+ if (CseVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_GOP_VERSION_STRING);
+ StrGOPVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrGOPStrLen = StrLen (StrGOPVer);
+ if (StrGOPStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_GOP_VERSION_VALUE);
+ GOPVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ GOPStrLen = StrLen (GOPVer);
+ if (GOPStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_MRC_VERSION_STRING);
+ StrMrcVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrMRCVersionStrLen = StrLen (StrMrcVer);
+ if (StrMRCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_MRC_VERSION_VALUE);
+ MrcVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ MRCVersionStrLen = StrLen (MrcVer);
+ if (MRCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_UCODE_STRING);
+ StruCodeVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StruCodeVerStrLen = StrLen (StruCodeVer);
+ if (StruCodeVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_UCODE_VALUE);
+ uCodeVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ uCodeVerStrLen = StrLen (uCodeVer);
+ if (uCodeVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PUNIT_FW_STRING);
+ StrPunitVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrPunitVersionStrLen = StrLen (StrPunitVer);
+ if (StrPunitVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PUNIT_FW_VALUE);
+ PunitVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ PunitVersionStrLen = StrLen (PunitVer);
+ if (PunitVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PMC_FW_STRING);
+ StrPmcVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrPMCVersionStrLen = StrLen (StrPmcVer);
+ if (StrPMCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PMC_FW_VALUE);
+ PmcVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ PMCVersionStrLen = StrLen(PmcVer);
+ if (PMCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_ISH_FW_STRING);
+ StrIshVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrISHVersionStrLen = StrLen (StrIshVer);
+ if (StrISHVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_ISH_FW_VALUE);
+ IshVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ ISHVersionStrLen = StrLen (IshVer);
+ if (ISHVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SOC_STRING);
+ StrSocVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrSOCVersionStrLen = StrLen (StrSocVer);
+ if (StrSOCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SOC_VALUE);
+ SocVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SOCVersionStrLen = StrLen (SocVer);
+ if (SOCVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BOARD_ID_STRING);
+ StrBoardVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrBOARDVersionStrLen = StrLen (StrBoardVer);
+ if (StrBOARDVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BOARD_ID_VALUE);
+ BoardVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ BOARDVersionStrLen = StrLen (BoardVer);
+ if (BOARDVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_FAB_ID_STRING);
+ StrFabVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrFABVersionStrLen = StrLen (StrFabVer);
+ if (StrFABVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_FAB_ID_VALUE);
+ FabVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ FABVersionStrLen = StrLen (FabVer);
+ if (FABVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CPU_FLAVOR_STRING);
+ StrCpuFlavor = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrCPUFLAVORStrLen = StrLen (StrCpuFlavor);
+ if (StrCPUFLAVORStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CPU_FLAVOR_VALUE);
+ CpuFlavor = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ CPUFLAVORStrLen = StrLen (CpuFlavor);
+ if (CPUFLAVORStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PMIC_VERSION_STRING);
+ StrPmicVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrPMICVersionStrLen = StrLen (StrPmicVer);
+ if (StrPMICVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PMIC_VERSION_VALUE);
+ PmicVer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ PMICVersionStrLen = StrLen (PmicVer);
+ if (PMICVersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SECURE_BOOT_STRING);
+ StrSecureBootMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrSecureBootModeLen = StrLen (StrSecureBootMode);
+ if (StrSecureBootModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SECURE_BOOT_VALUE);
+ SecureBootMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SecureBootModeLen = StrLen (SecureBootMode);
+ if (SecureBootModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BOOT_MODE_STRING);
+ StrBootMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrBootModeLen = StrLen (StrBootMode);
+ if (StrBootModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_BOOT_MODE_VALUE);
+ BootMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ BootModeLen = StrLen (BootMode);
+ if (BootModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SPEED_STEP_STRING);
+ StrSpeedStepMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrSpeedStepModeLen = StrLen (StrSpeedStepMode);
+ if (StrSpeedStepModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SPEED_STEP_VALUE);
+ SpeedStepMode = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SpeedStepModeLen = StrLen (SpeedStepMode);
+ if (SpeedStepModeLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CPU_TURBO_STRING);
+ StrCpuTurbo = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrCpuTurboLen = StrLen (StrCpuTurbo);
+ if (StrCpuTurboLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CPU_TURBO_VALUE);
+ CpuTurbo = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ CpuTurboLen = StrLen (CpuTurbo);
+ if (CpuTurboLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CSTATE_STRING);
+ StrCStateEn= HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrCStateEnLen = StrLen (StrCStateEn);
+ if (StrCStateEnLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CSTATE_VALUE);
+ CStateEn= HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ CStateEnLen = StrLen (CStateEn);
+ if (CStateEnLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_ENHANCED_CSTATE_STRING);
+ StrEnhancedCStateEn = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrEnhancedCStateEnLen = StrLen (StrEnhancedCStateEn);
+ if (StrEnhancedCStateEnLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_ENHANCED_CSTATE_VALUE);
+ EnhancedCStateEn = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ EnhancedCStateEnLen = StrLen (EnhancedCStateEn);
+ if (EnhancedCStateEnLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PACKAGE_CSTATE_STRING);
+ StrMaxPkgCState = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrMaxPkgCStateLen = StrLen (StrMaxPkgCState);
+ if (StrMaxPkgCStateLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_PACKAGE_CSTATE_VALUE);
+ MaxPkgCState = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ MaxPkgCStateLen = StrLen (MaxPkgCState);
+ if (MaxPkgCStateLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CORE_CSTATE_STRING);
+ StrMaxCoreCState = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrMaxCoreCStateLen = StrLen (StrMaxCoreCState);
+ if (StrMaxCoreCStateLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_CORE_CSTATE_VALUE);
+ MaxCoreCState = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ MaxCoreCStateLen = StrLen (MaxCoreCState);
+ if (MaxCoreCStateLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_GFX_TURBO_STRING);
+ StrGfxTurbo = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrGfxTurboLen = StrLen (StrGfxTurbo);
+ if (StrGfxTurboLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_GFX_TURBO_VALUE);
+ GfxTurbo = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ GfxTurboLen = StrLen (GfxTurbo);
+ if (GfxTurboLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_S0IX_STRING);
+ StrS0ix = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrS0ixLen = StrLen (StrS0ix);
+ if (StrS0ixLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_S0IX_VALUE);
+ S0ix = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ S0ixLen = StrLen (S0ix);
+ if (S0ixLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_RC6_STRING);
+ StrRC6 = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrRC6Len = StrLen (StrRC6);
+ if (StrRC6Len > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_RC6_VALUE);
+ RC6 = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ RC6Len = StrLen (RC6);
+ if (RC6Len > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ RecordLen = sizeof (SMBIOS_TABLE_TYPE94) + StrFviPlatformStrLen + 1 + StrIFWIVerStrLen + 1 + IFWIVerStrLen + 1 + StrBIOSVersionStrLen + 1 + \
+ BIOSVersionStrLen + 1 + StrCseVerStrLen + 1 + CseVerStrLen + 1 + StrGOPStrLen + 1 + GOPStrLen + 1 + \
+ StrMRCVersionStrLen + 1 + MRCVersionStrLen + 1 + StruCodeVerStrLen + 1 + uCodeVerStrLen + 1 + StrPunitVersionStrLen + 1 + \
+ PunitVersionStrLen + 1 + StrPMCVersionStrLen + 1 + PMCVersionStrLen + 1 + StrISHVersionStrLen + 1 + ISHVersionStrLen + 1 + \
+ StrSOCVersionStrLen + 1 + SOCVersionStrLen + 1 + StrBOARDVersionStrLen + 1 + BOARDVersionStrLen + 1 + StrFABVersionStrLen + 1 + \
+ FABVersionStrLen + 1 + StrCPUFLAVORStrLen + 1 + CPUFLAVORStrLen + 1 + StrPMICVersionStrLen + 1 + PMICVersionStrLen + 1 + \
+ StrSecureBootModeLen + 1 + SecureBootModeLen + 1 + StrBootModeLen + 1 + BootModeLen + 1 + StrSpeedStepModeLen + 1 + SpeedStepModeLen + 1 + \
+ StrCpuTurboLen + 1 + CpuTurboLen + 1 + StrCStateEnLen + 1 + CStateEnLen + 1 + StrEnhancedCStateEnLen + 1 + EnhancedCStateEnLen + 1 + \
+ StrMaxPkgCStateLen + 1 + MaxPkgCStateLen + 1 + StrMaxCoreCStateLen + 1 + MaxCoreCStateLen + 1 + StrGfxTurboLen + 1 + GfxTurboLen + 1 + \
+ StrS0ixLen + 1 + S0ixLen + 1 + StrRC6Len + 1 + RC6Len + 1 + 1;
+
+ SmbiosRecord = AllocatePool (RecordLen);
+ if (SmbiosRecord == NULL) {
+ return;
+ }
+
+ ZeroMem(SmbiosRecord, RecordLen);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_MISC_VERSION_INFO;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE94);
+
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+
+ SmbiosRecord->FviPlatform = 1;
+
+ SmbiosRecord->IFWIVersionStr = 2;
+ SmbiosRecord->IFWIVersion = 3;
+
+ SmbiosRecord->BiosVersionStr = 4;
+ SmbiosRecord->BiosVersion = 5;
+
+ SmbiosRecord->CseVersionStr = 6;
+ SmbiosRecord->CseVersion = 7;
+
+ SmbiosRecord->GopVersionStr = 8;
+ SmbiosRecord->GopVersion = 9;
+
+ SmbiosRecord->MRCVersionStr = 10;
+ SmbiosRecord->MRCVersion = 11;
+
+ SmbiosRecord->UCodeVersionStr= 12;
+ SmbiosRecord->UCodeVersion = 13;
+
+ SmbiosRecord->PunitVersionStr= 14;
+ SmbiosRecord->PunitVersion = 15;
+
+ SmbiosRecord->PMCVersionStr = 16;
+ SmbiosRecord->PMCVersion = 17;
+
+ SmbiosRecord->ISHVersionStr = 18;
+ SmbiosRecord->ISHVersion = 19;
+
+ SmbiosRecord->SoCVersionStr = 20;
+ SmbiosRecord->SoCVersion = 21;
+
+ SmbiosRecord->BoardVersionStr= 22;
+ SmbiosRecord->BoardVersion = 23;
+
+ SmbiosRecord->FabVersionStr = 24;
+ SmbiosRecord->FabVersion = 25;
+
+ SmbiosRecord->CPUFlavorStr = 26;
+ SmbiosRecord->CPUFlavor = 27;
+
+ SmbiosRecord->PmicVersionStr = 28;
+ SmbiosRecord->PmicVersion = 29;
+
+ SmbiosRecord->SecureBootStr = 30;
+ SmbiosRecord->SecureBoot = 31;
+
+ SmbiosRecord->BootModeStr = 32;
+ SmbiosRecord->BootMode = 33;
+
+ SmbiosRecord->SpeedStepModeStr = 34;
+ SmbiosRecord->SpeedStepMode = 35;
+
+ SmbiosRecord->CPUTurboModeStr= 36;
+ SmbiosRecord->CPUTurboMode = 37;
+
+ SmbiosRecord->CStateStr = 38;
+ SmbiosRecord->CState = 39;
+
+ SmbiosRecord->EnhancedCStateStr = 40;
+ SmbiosRecord->EnhancedCState = 41;
+
+ SmbiosRecord->MaxPkgCStateStr= 42;
+ SmbiosRecord->MaxPkgCState = 43;
+
+ SmbiosRecord->MaxCoreCStateStr = 44;
+ SmbiosRecord->MaxCoreCState = 45;
+
+ SmbiosRecord->GfxTurboStr = 46;
+ SmbiosRecord->GfxTurbo = 47;
+
+ SmbiosRecord->S0ixStr = 48;
+ SmbiosRecord->S0ix = 49;
+
+ SmbiosRecord->RC6Str = 50;
+ SmbiosRecord->RC6 = 51;
+
+ //
+ // Type 0x94 Version
+ //
+ // Version [4:0]: Version Field
+ //
+ // Different platform maintains different table version.
+ // Version number should start from 1 and increase when table structure is changed.
+ //
+ // Version[7:5]: Format Field
+ // 0x0 - Indicate that this table uses fixed definition to describe platform information.
+ // 0x1 - Indicate that this table uses [key, value] combination to describe platform information.
+ // 0x2 - Indicate that this table uses [key, type, value] combination to describe platform information.
+ //
+ SmbiosRecord->FviVersion = 0x21;
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+
+ UnicodeStrToAsciiStr (StrFviPlatform, OptionalStrStart);
+ StrIdx += StrFviPlatformStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrIFWIVer, OptionalStrStart + StrIdx);
+ StrIdx += StrIFWIVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (IFWIVer, OptionalStrStart + StrIdx);
+ StrIdx += IFWIVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrBiosVer, OptionalStrStart + StrIdx);
+ StrIdx += StrBIOSVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (BiosVer, OptionalStrStart + StrIdx);
+ StrIdx += BIOSVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrCseVer, OptionalStrStart + StrIdx);
+ StrIdx += StrCseVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (CseVer, OptionalStrStart + StrIdx);
+ StrIdx += CseVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrGOPVer, OptionalStrStart + StrIdx);
+ StrIdx += StrGOPStrLen + 1;
+
+ UnicodeStrToAsciiStr (GOPVer, OptionalStrStart + StrIdx);
+ StrIdx += GOPStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrMrcVer, OptionalStrStart + StrIdx);
+ StrIdx += StrMRCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (MrcVer, OptionalStrStart + StrIdx);
+ StrIdx += MRCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StruCodeVer, OptionalStrStart + StrIdx);
+ StrIdx += StruCodeVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (uCodeVer, OptionalStrStart + StrIdx);
+ StrIdx += uCodeVerStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrPunitVer, OptionalStrStart + StrIdx);
+ StrIdx += StrPunitVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (PunitVer, OptionalStrStart + StrIdx);
+ StrIdx += PunitVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrPmcVer, OptionalStrStart + StrIdx);
+ StrIdx += StrPMCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (PmcVer, OptionalStrStart + StrIdx);
+ StrIdx += PMCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrIshVer, OptionalStrStart + StrIdx);
+ StrIdx += StrISHVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (IshVer, OptionalStrStart + StrIdx);
+ StrIdx += ISHVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrSocVer, OptionalStrStart + StrIdx);
+ StrIdx += StrSOCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (SocVer, OptionalStrStart + StrIdx);
+ StrIdx += SOCVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrBoardVer, OptionalStrStart + StrIdx);
+ StrIdx += StrBOARDVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (BoardVer, OptionalStrStart + StrIdx);
+ StrIdx += BOARDVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrFabVer, OptionalStrStart + StrIdx);
+ StrIdx += StrFABVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (FabVer, OptionalStrStart + StrIdx);
+ StrIdx += FABVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrCpuFlavor, OptionalStrStart + StrIdx);
+ StrIdx += StrCPUFLAVORStrLen + 1;
+
+ UnicodeStrToAsciiStr (CpuFlavor, OptionalStrStart + StrIdx);
+ StrIdx += CPUFLAVORStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrPmicVer, OptionalStrStart + StrIdx);
+ StrIdx += StrPMICVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (PmicVer, OptionalStrStart + StrIdx);
+ StrIdx += PMICVersionStrLen + 1;
+
+ UnicodeStrToAsciiStr (StrSecureBootMode, OptionalStrStart + StrIdx);
+ StrIdx += StrSecureBootModeLen + 1;
+
+ UnicodeStrToAsciiStr (SecureBootMode, OptionalStrStart + StrIdx);
+ StrIdx += SecureBootModeLen + 1;
+
+ UnicodeStrToAsciiStr (StrBootMode, OptionalStrStart + StrIdx);
+ StrIdx += StrBootModeLen + 1;
+
+ UnicodeStrToAsciiStr (BootMode, OptionalStrStart + StrIdx);
+ StrIdx += BootModeLen + 1;
+
+ UnicodeStrToAsciiStr (StrSpeedStepMode, OptionalStrStart + StrIdx);
+ StrIdx += StrSpeedStepModeLen + 1;
+
+ UnicodeStrToAsciiStr (SpeedStepMode, OptionalStrStart + StrIdx);
+ StrIdx += SpeedStepModeLen + 1;
+
+ UnicodeStrToAsciiStr (StrCpuTurbo, OptionalStrStart + StrIdx);
+ StrIdx += StrCpuTurboLen + 1;
+
+ UnicodeStrToAsciiStr (CpuTurbo, OptionalStrStart + StrIdx);
+ StrIdx += CpuTurboLen + 1;
+
+ UnicodeStrToAsciiStr (StrCStateEn, OptionalStrStart + StrIdx);
+ StrIdx += StrCStateEnLen + 1;
+
+ UnicodeStrToAsciiStr (CStateEn, OptionalStrStart + StrIdx);
+ StrIdx += CStateEnLen + 1;
+
+ UnicodeStrToAsciiStr (StrEnhancedCStateEn, OptionalStrStart + StrIdx);
+ StrIdx += StrEnhancedCStateEnLen + 1;
+
+ UnicodeStrToAsciiStr (EnhancedCStateEn, OptionalStrStart + StrIdx);
+ StrIdx += EnhancedCStateEnLen + 1;
+
+ UnicodeStrToAsciiStr (StrMaxPkgCState, OptionalStrStart + StrIdx);
+ StrIdx += StrMaxPkgCStateLen + 1;
+
+ UnicodeStrToAsciiStr (MaxPkgCState, OptionalStrStart + StrIdx);
+ StrIdx += MaxPkgCStateLen + 1;
+
+ UnicodeStrToAsciiStr (StrMaxCoreCState, OptionalStrStart + StrIdx);
+ StrIdx += StrMaxCoreCStateLen + 1;
+
+ UnicodeStrToAsciiStr (MaxCoreCState, OptionalStrStart + StrIdx);
+ StrIdx += MaxCoreCStateLen + 1;
+
+ UnicodeStrToAsciiStr (StrGfxTurbo, OptionalStrStart + StrIdx);
+ StrIdx += StrGfxTurboLen + 1;
+
+ UnicodeStrToAsciiStr (GfxTurbo, OptionalStrStart + StrIdx);
+ StrIdx += GfxTurboLen + 1;
+
+ UnicodeStrToAsciiStr (StrS0ix, OptionalStrStart + StrIdx);
+ StrIdx += StrS0ixLen + 1;
+
+ UnicodeStrToAsciiStr (S0ix, OptionalStrStart + StrIdx);
+ StrIdx += S0ixLen + 1;
+
+ UnicodeStrToAsciiStr (StrRC6, OptionalStrStart + StrIdx);
+ StrIdx += StrRC6Len + 1;
+
+ UnicodeStrToAsciiStr (RC6, OptionalStrStart + StrIdx);
+ StrIdx += RC6Len + 1;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = SmbiosProtocol->Add (
+ SmbiosProtocol,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x94 callback end.\n"));
+ return;
+}
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemType0x94 (Type 0x94).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+
+MISC_SMBIOS_TABLE_FUNCTION(MiscOemType0x94)
+{
+ EFI_STATUS Status;
+ EFI_EVENT AddSmbiosT0x94CallbackEvent;
+
+ Status = EfiCreateEventReadyToBootEx (
+ TPL_CALLBACK,
+ AddSmbiosT0x94Callback,
+ RecordData,
+ &AddSmbiosT0x94CallbackEvent
+ );
+
+ ASSERT_EFI_ERROR (Status);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDevice.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDevice.uni Binary files differnew file mode 100644 index 0000000000..3b86bebbc7 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDevice.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceData.c new file mode 100644 index 0000000000..60cc875551 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceData.c @@ -0,0 +1,52 @@ +/** @file
+ Static data of Onboard device information .
+ The onboard device information is Misc. subclass type 8 and SMBIOS type 10.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceVideo) = {
+ STRING_TOKEN(STR_MISC_ONBOARD_DEVICE_VIDEO), // OnBoardDeviceDescription
+ { // OnBoardDeviceStatus
+ EfiOnBoardDeviceTypeVideo, // DeviceType
+ 1, // DeviceEnabled
+ 0 // Reserved
+ },
+ 0 // OnBoardDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceNetwork) = {
+ STRING_TOKEN(STR_MISC_ONBOARD_DEVICE_NETWORK), // OnBoardDeviceDescription
+ { // OnBoardDeviceStatus
+ EfiOnBoardDeviceTypeEthernet, // DeviceType
+ 1, // DeviceEnabled
+ 0 // Reserved
+ },
+ 0 // OnBoardDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceAudio) = {
+ STRING_TOKEN(STR_MISC_ONBOARD_DEVICE_AUDIO), // OnBoardDeviceDescription
+ { // OnBoardDeviceStatus
+ EfiOnBoardDeviceTypeSound, // DeviceType
+ 1, // DeviceEnabled
+ 0 // Reserved
+ },
+ 0 // OnBoardDevicePath
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceFunction.c new file mode 100644 index 0000000000..3c6378c1b1 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscOnboardDeviceFunction.c @@ -0,0 +1,131 @@ +/** @file
+ Create the device path for the Onboard device.
+ The Onboard device information is Misc. subclass type 8 and SMBIOS type 10.
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This is a macro defined function, in fact, the function is
+ MiscOnboardDeviceFunction (RecordType, RecordLen, RecordData, LogRecordData)
+ This function makes boot time changes to the contents of the
+ MiscOnboardDevice structure.
+
+ @param MiscOnboardDevice The string which is used to create the function
+ The Arguments in fact:
+ @param RecordType Type of record to be processed from the Data
+ Table. mMiscSubclassDataTable[].RecordType
+ @param RecordLen Size of static RecordData from the Data Table.
+ mMiscSubclassDataTable[].RecordLen
+ @param RecordData Pointer to RecordData, which will be written to
+ the Data Hub
+ @param LogRecordData TRUE to log RecordData to Data Hub. FALSE when
+ there is no more data to log.
+
+ @retval EFI_SUCCESS *RecordData and *LogRecordData have been set.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER One of the following parameter conditions was
+ true: RecordLen was zero. RecordData was NULL.
+ LogRecordData was NULL.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION (
+ MiscOnboardDevice
+ )
+{
+ CHAR8 *OptionalStrStart;
+ UINT8 StatusAndType;
+ UINTN DescriptionStrLen;
+ EFI_STRING DeviceDescription;
+ STRING_REF TokenToGet;
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE10 *SmbiosRecord;
+ EFI_MISC_ONBOARD_DEVICE *ForType10InputData;
+
+ ForType10InputData = (EFI_MISC_ONBOARD_DEVICE *) RecordData;
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = 0;
+ switch (ForType10InputData->OnBoardDeviceDescription) {
+ case STR_MISC_ONBOARD_DEVICE_VIDEO:
+ TokenToGet = STRING_TOKEN (STR_MISC_ONBOARD_DEVICE_VIDEO);
+ break;
+ case STR_MISC_ONBOARD_DEVICE_AUDIO:
+ TokenToGet = STRING_TOKEN (STR_MISC_ONBOARD_DEVICE_AUDIO);
+ break;
+ case STR_MISC_ONBOARD_DEVICE_NETWORK:
+ TokenToGet = STRING_TOKEN (STR_MISC_ONBOARD_DEVICE_NETWORK);
+ break;
+ }
+
+ DeviceDescription = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ DescriptionStrLen = StrLen (DeviceDescription);
+ if (DescriptionStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE10) + DescriptionStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE10) + DescriptionStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE10);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+
+ //
+ // Status & Type: Bit 7 Devicen Status, Bits 6:0 Type of Device
+ //
+ StatusAndType = (UINT8) ForType10InputData->OnBoardDeviceStatus.DeviceType;
+ if (ForType10InputData->OnBoardDeviceStatus.DeviceEnabled != 0) {
+ StatusAndType |= 0x80;
+ } else {
+ StatusAndType &= 0x7F;
+ }
+
+ SmbiosRecord->Device[0].DeviceType = StatusAndType;
+ SmbiosRecord->Device[0].DescriptionString = 1;
+ OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
+ UnicodeStrToAsciiStr(DeviceDescription, OptionalStrStart);
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArray.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArray.uni Binary files differnew file mode 100644 index 0000000000..39ed8fcf34 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArray.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayData.c new file mode 100644 index 0000000000..562ad93192 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayData.c @@ -0,0 +1,30 @@ +/** @file
+ BIOS Physical Array static data.
+ SMBIOS type 16.
+
+ Copyright (c) 2006 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Physical Memory Array Dat.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MEMORY_ARRAY_LOCATION_DATA, MiscPhysicalMemoryArray) = {
+ EfiMemoryArrayLocationSystemBoard, // Memory location
+ EfiMemoryArrayUseSystemMemory, // Memory array use
+ EfiMemoryErrorCorrectionNone, // Memory error correction
+ 0, // Maximum Memory Capacity
+ 0x01 // Number of Devices
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayFunction.c new file mode 100644 index 0000000000..ab250595db --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPhysicalArrayFunction.c @@ -0,0 +1,97 @@ +/** @file
+ BIOS system Physical Array boot time changes.
+ SMBIOS type 16.
+
+ Copyright (c) 2012 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscPhysicalArrayFunction (Type 16).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+
+MISC_SMBIOS_TABLE_FUNCTION(MiscPhysicalMemoryArray)
+{
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE16 *SmbiosRecord;
+ EFI_MEMORY_ARRAY_LOCATION_DATA *ForType16InputData;
+ UINT32 TopOfMemory = 4 * 1024 * 1024;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ ForType16InputData = (EFI_MEMORY_ARRAY_LOCATION_DATA *)RecordData;
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE16) + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE16) + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE16);
+
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+
+ //
+ // ReleaseDate will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->Location = *(UINT8 *) &ForType16InputData ->MemoryArrayLocation;
+ SmbiosRecord->Use = *(UINT8 *) &ForType16InputData ->MemoryArrayUse;
+ SmbiosRecord->MemoryErrorCorrection = *(UINT8 *) &ForType16InputData->MemoryErrorCorrection;
+ //
+ // System does not provide the error information structure
+ //
+ SmbiosRecord->MemoryErrorInformationHandle = 0xFFFE;
+ //
+ // Maximum memory capacity
+ //
+ SmbiosRecord-> MaximumCapacity = TopOfMemory;
+ SmbiosRecord-> NumberOfMemoryDevices= 0x02;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignator.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignator.uni Binary files differnew file mode 100644 index 0000000000..4be6e194a3 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignator.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorData.c new file mode 100644 index 0000000000..81c7200a4f --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorData.c @@ -0,0 +1,50 @@ +/** @file
+ Static data of Port internal connector designator information.
+ Port internal connector designator information is Misc. subclass type 6 and
+ SMBIOS type 8.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Port connector designations
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortIde1) = {
+ STRING_TOKEN(STR_MISC_PORT_INTERNAL_IDE1),
+ STRING_TOKEN(STR_MISC_PORT_EXTERNAL_IDE1),
+ EfiPortConnectorTypeOnboardIde,
+ EfiPortConnectorTypeNone,
+ EfiPortTypeOther,
+ 0
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortIde2) = {
+ STRING_TOKEN(STR_MISC_PORT_INTERNAL_IDE2),
+ STRING_TOKEN(STR_MISC_PORT_EXTERNAL_IDE2),
+ EfiPortConnectorTypeOnboardIde,
+ EfiPortConnectorTypeNone,
+ EfiPortTypeOther,
+ 0
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortAtxPower) = {
+ STRING_TOKEN(STR_MISC_PORT_INTERNAL_ATX_POWER),
+ STRING_TOKEN(STR_MISC_PORT_EXTERNAL_ATX_POWER),
+ EfiPortConnectorTypeOther,
+ EfiPortConnectorTypeNone,
+ EfiPortTypeOther,
+ 0
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorFunction.c new file mode 100644 index 0000000000..f71d78719f --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscPortInternalConnectorDesignatorFunction.c @@ -0,0 +1,147 @@ +/** @file
+ Create the device path for the Port internal connector designator.
+ Port internal connector designator information is Misc. subclass type 6
+ and SMBIOS type 8.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This is a macro defined function, in fact, the function is
+ MiscPortInternalConnectorDesignatorFunction (RecordType, RecordLen, RecordData, LogRecordData)
+ This function makes boot time changes to the contents of the
+ MiscPortConnectorInformation.
+
+ @param MiscPortInternalConnectorDesignator The string which is used to create
+ the function
+ The Arguments in fact:
+ @param RecordType Type of record to be processed from
+ the Data Table.
+ mMiscSubclassDataTable[].RecordType
+ @param RecordLen Size of static RecordData from the
+ Data Table.
+ mMiscSubclassDataTable[].RecordLen
+ @param RecordData Pointer to RecordData, which will be
+ written to the Data Hub
+ @param LogRecordData TRUE to log RecordData to Data Hub.
+ FALSE when there is no more data to
+ log.
+
+ @retval EFI_SUCCESS *RecordData and *LogRecordData have
+ been set.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER One of the following parameter
+ conditions was true: RecordLen was
+ zero. RecordData was NULL.
+ LogRecordData was NULL.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION (
+ MiscPortInternalConnectorDesignator
+ )
+{
+ CHAR8 *OptionalStrStart;
+ UINTN InternalRefStrLen;
+ UINTN ExternalRefStrLen;
+ EFI_STRING InternalRef;
+ EFI_STRING ExternalRef;
+ STRING_REF TokenForInternal;
+ STRING_REF TokenForExternal;
+ EFI_STATUS Status;
+ SMBIOS_TABLE_TYPE8 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *ForType8InputData;
+
+ ForType8InputData = (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *)RecordData;
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenForInternal = 0;
+ TokenForExternal = 0;
+
+ switch (ForType8InputData->PortInternalConnectorDesignator) {
+ case STR_MISC_PORT_INTERNAL_IDE1:
+ TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_IDE1);
+ TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_IDE1);
+ break;
+ case STR_MISC_PORT_INTERNAL_IDE2:
+ TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_IDE2);
+ TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_IDE2);
+ break;
+ case STR_MISC_PORT_INTERNAL_ATX_POWER:
+ TokenForInternal = STRING_TOKEN (STR_MISC_PORT_INTERNAL_ATX_POWER);
+ TokenForExternal = STRING_TOKEN(STR_MISC_PORT_EXTERNAL_ATX_POWER);
+ break;
+ default:
+ break;
+ }
+
+ InternalRef = HiiGetPackageString (&gEfiCallerIdGuid, TokenForInternal, NULL);
+ InternalRefStrLen = StrLen (InternalRef);
+ if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ ExternalRef = HiiGetPackageString (&gEfiCallerIdGuid, TokenForExternal, NULL);
+ ExternalRefStrLen = StrLen (ExternalRef);
+ if (ExternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE8);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->InternalReferenceDesignator = 1;
+ SmbiosRecord->InternalConnectorType = (UINT8) ForType8InputData->PortInternalConnectorType;
+ SmbiosRecord->ExternalReferenceDesignator = 2;
+ SmbiosRecord->ExternalConnectorType = (UINT8) ForType8InputData->PortExternalConnectorType;
+ SmbiosRecord->PortType = (UINT8) ForType8InputData->PortType;
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (InternalRef, OptionalStrStart);
+ UnicodeStrToAsciiStr (ExternalRef, OptionalStrStart + InternalRefStrLen + 1);
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios-> Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesData.c new file mode 100644 index 0000000000..cf5a91775e --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesData.c @@ -0,0 +1,36 @@ +/** @file
+ Static data of Reset Capabilities information.
+ Reset Capabilities information is Misc. subclass type 17 and SMBIOS type 23.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_RESET_CAPABILITIES, MiscResetCapabilities) = {
+ { // ResetCapabilities
+ 0, // Status
+ 0, // BootOption
+ 0, // BootOptionOnLimit
+ 0, // WatchdogTimerPresent
+ 0 // Reserved
+ },
+ 0xFFFF, // ResetCount
+ 0xFFFF, // ResetLimit
+ 0xFFFF, // ResetTimerInterval
+ 0xFFFF // ResetTimeout
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesFunction.c new file mode 100644 index 0000000000..e372575c2a --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscResetCapabilitiesFunction.c @@ -0,0 +1,83 @@ +/** @file
+ Reset Capabilities.
+ SMBIOS type 23.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemString (Type 11).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscResetCapabilities)
+{
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE23 *SmbiosRecord;
+ EFI_MISC_RESET_CAPABILITIES *ForType23InputData;
+
+ ForType23InputData = (EFI_MISC_RESET_CAPABILITIES *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE23) + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_RESET;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE23);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->Capabilities = *(UINT8*) &(ForType23InputData->ResetCapabilities);
+ SmbiosRecord->ResetCount = (UINT16) ForType23InputData->ResetCount;
+ SmbiosRecord->ResetLimit = (UINT16) ForType23InputData->ResetLimit;
+ SmbiosRecord->TimerInterval = (UINT16) ForType23InputData->ResetTimerInterval;
+ SmbiosRecord->Timeout = (UINT16) ForType23InputData->ResetTimeout;
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.h b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.h new file mode 100644 index 0000000000..8db998a5b2 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.h @@ -0,0 +1,304 @@ +/** @file
+ Header file for MiscSubclass Driver.
+
+ Copyright (c) 1999 - 2016, 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
+ 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.
+
+**/
+
+#ifndef _MISC_SUBCLASS_DRIVER_H
+#define _MISC_SUBCLASS_DRIVER_H
+
+
+#include "CommonHeader.h"
+
+extern UINT8 MiscSubclassStrings[];
+
+
+#define T14_FVI_STRING "Driver/firmware version"
+#define EFI_SMBIOS_TYPE_FIRMWARE_VERSION_INFO 0x90
+#define EFI_SMBIOS_TYPE_MISC_VERSION_INFO 0x94
+#define EFI_SMBIOS_TYPE_SEC_INFO 0x83
+#define IntelIdentifer 0x6F725076
+//
+// Data table entry update function.
+//
+typedef EFI_STATUS (EFIAPI EFI_MISC_SMBIOS_DATA_FUNCTION) (
+ IN VOID *RecordData,
+ IN EFI_SMBIOS_PROTOCOL *Smbios
+ );
+
+//
+// Data table entry definition.
+//
+typedef struct {
+ //
+ // intermediat input data for SMBIOS record
+ //
+ VOID *RecordData;
+ EFI_MISC_SMBIOS_DATA_FUNCTION *Function;
+} EFI_MISC_SMBIOS_DATA_TABLE;
+
+//
+// Data Table extern definitions.
+//
+#define MISC_SMBIOS_TABLE_EXTERNS(NAME1, NAME2, NAME3) \
+extern NAME1 NAME2 ## Data; \
+extern EFI_MISC_SMBIOS_DATA_FUNCTION NAME3 ## Function
+
+
+//
+// Data Table entries
+//
+#define MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NAME1, NAME2) \
+{ \
+ & NAME1 ## Data, \
+ & NAME2 ## Function \
+}
+
+//
+// Global definition macros.
+//
+#define MISC_SMBIOS_TABLE_DATA(NAME1, NAME2) \
+ NAME1 NAME2 ## Data
+
+#define MISC_SMBIOS_TABLE_FUNCTION(NAME2) \
+ EFI_STATUS EFIAPI NAME2 ## Function( \
+ IN VOID *RecordData, \
+ IN EFI_SMBIOS_PROTOCOL *Smbios \
+ )
+
+#pragma pack(1)
+//
+// This is definition for SMBIOS Oem data type 0x83
+//
+typedef struct {
+ UINT32 SecEnable :1;
+ UINT32 Reserved0 :12;
+ UINT32 ATSupport :1;
+ UINT32 Reserved1 :18;
+ UINT32 SecFwMinorVersion :16;
+ UINT32 SecFwMajorVersion :16;
+ UINT32 SecFwBuildVersion :16;
+ UINT32 SecFwHotfixVersion :16;
+} SEC_CAPABILITYS;
+
+typedef struct {
+ UINT32 Reserved0 :5;
+ UINT32 ATConfigured :1;
+ UINT32 Reserved1 :26;
+} SEC_CFG_STATE;
+
+typedef struct {
+ UINT32 Reserved0 :4;
+ UINT32 SecBiosSetup :1;
+ UINT32 Reserved1 :1;
+ UINT32 ATPBA :1;
+ UINT32 ATWWAN :1;
+ UINT32 Reserved2 :24;
+} BIOS_SEC_CAPABILITYS;
+
+typedef struct {
+ UINT32 Identifer;
+} STRUCTURE_IDENTIFIER;
+
+typedef struct {
+ UINT32 SecFwMinorVersion :16;
+ UINT32 SecFwMajorVersion :16;
+ UINT32 SecFwBuildVersion :16;
+ UINT32 SecFwHotfixVersion :16;
+} EFI_MISC_OEM_TYPE_0x83;
+
+//
+// This is definition for SMBIOS Oem data type 0x83
+//
+typedef struct {
+ SMBIOS_STRUCTURE Hdr;
+ UINT32 Reserved0;
+ UINT32 Reserved1;
+ UINT32 Reserved2;
+ UINT32 Reserved3;
+ UINT32 Reserved4;
+ SEC_CAPABILITYS SeCCapabilities;
+ SEC_CFG_STATE SeCCfgState;
+ UINT32 Reserved5;
+ UINT32 Reserved6;
+ UINT32 Reserved7;
+ BIOS_SEC_CAPABILITYS BiosSeCCapabilities;
+ STRUCTURE_IDENTIFIER StructureIdentifer;
+ UINT32 Reserverd8;
+} SMBIOS_TABLE_TYPE83;
+
+
+//
+// This is definition for SMBIOS Oem data type 0x90
+//
+typedef struct {
+ STRING_REF SECVersion;
+ STRING_REF uCodeVersion;
+ STRING_REF GOPVersion;
+ STRING_REF CpuStepping;
+} EFI_MISC_OEM_TYPE_0x90;
+
+//
+// This is definition for SMBIOS Oem data type 0x90
+//
+typedef struct {
+ SMBIOS_STRUCTURE Hdr;
+ SMBIOS_TABLE_STRING SECVersion;
+ SMBIOS_TABLE_STRING uCodeVersion;
+ SMBIOS_TABLE_STRING GOPVersion;
+ SMBIOS_TABLE_STRING CpuStepping;
+} SMBIOS_TABLE_TYPE90;
+
+typedef struct {
+ STRING_REF FviPlatform;
+ UINT8 FviVersion;
+ STRING_REF IFWIVersionStr;
+ STRING_REF IFWIVersion;
+ STRING_REF BiosVersionStr;
+ STRING_REF BiosVersion;
+ STRING_REF CseVersionStr;
+ STRING_REF CseVersion;
+ STRING_REF GopVersionStr;
+ STRING_REF GopVersion;
+ STRING_REF MRCVersionStr;
+ STRING_REF MRCVersion;
+ STRING_REF UCodeVersionStr;
+ STRING_REF UCodeVersion;
+ STRING_REF PunitVersionStr;
+ STRING_REF PunitVersion;
+ STRING_REF PMCVersionStr;
+ STRING_REF PMCVersion;
+ STRING_REF ISHVersionStr;
+ STRING_REF ISHVersion;
+ STRING_REF SoCVersionStr;
+ STRING_REF SoCVersion;
+ STRING_REF BoardVersionStr;
+ STRING_REF BoardVersion;
+ STRING_REF FabVersionStr;
+ STRING_REF FabVersion;
+ STRING_REF CPUFlavorStr;
+ STRING_REF CPUFlavor;
+ STRING_REF PmicVersionStr;
+ STRING_REF PmicVersion;
+ STRING_REF SecureBootStr;
+ STRING_REF SecureBoot;
+ STRING_REF BootModeStr;
+ STRING_REF BootMode;
+ STRING_REF SpeedStepModeStr;
+ STRING_REF SpeedStepMode;
+ STRING_REF CPUTurboModeStr;
+ STRING_REF CPUTurboMode;
+ STRING_REF CStateStr;
+ STRING_REF CState;
+ STRING_REF EnhancedCStateStr;
+ STRING_REF EnhancedCState;
+ STRING_REF MaxPkgCStateStr;
+ STRING_REF MaxPkgCState;
+ STRING_REF MaxCoreCStateStr;
+ STRING_REF MaxCoreCState;
+ STRING_REF GfxTurboStr;
+ STRING_REF GfxTurbo;
+ STRING_REF S0ixStr;
+ STRING_REF S0ix;
+ STRING_REF RC6Str;
+ STRING_REF RC6;
+} EFI_MISC_OEM_TYPE_0x94;
+
+
+typedef struct {
+ SMBIOS_STRUCTURE Hdr;
+ SMBIOS_TABLE_STRING FviPlatform;
+ UINT8 FviVersion;
+ SMBIOS_TABLE_STRING IFWIVersionStr;
+ SMBIOS_TABLE_STRING IFWIVersion;
+ SMBIOS_TABLE_STRING BiosVersionStr;
+ SMBIOS_TABLE_STRING BiosVersion;
+ SMBIOS_TABLE_STRING CseVersionStr;
+ SMBIOS_TABLE_STRING CseVersion;
+ SMBIOS_TABLE_STRING GopVersionStr;
+ SMBIOS_TABLE_STRING GopVersion;
+ SMBIOS_TABLE_STRING MRCVersionStr;
+ SMBIOS_TABLE_STRING MRCVersion;
+ SMBIOS_TABLE_STRING UCodeVersionStr;
+ SMBIOS_TABLE_STRING UCodeVersion;
+ SMBIOS_TABLE_STRING PunitVersionStr;
+ SMBIOS_TABLE_STRING PunitVersion;
+ SMBIOS_TABLE_STRING PMCVersionStr;
+ SMBIOS_TABLE_STRING PMCVersion;
+ SMBIOS_TABLE_STRING ISHVersionStr;
+ SMBIOS_TABLE_STRING ISHVersion;
+ SMBIOS_TABLE_STRING SoCVersionStr;
+ SMBIOS_TABLE_STRING SoCVersion;
+ SMBIOS_TABLE_STRING BoardVersionStr;
+ SMBIOS_TABLE_STRING BoardVersion;
+ SMBIOS_TABLE_STRING FabVersionStr;
+ SMBIOS_TABLE_STRING FabVersion;
+ SMBIOS_TABLE_STRING CPUFlavorStr;
+ SMBIOS_TABLE_STRING CPUFlavor;
+ SMBIOS_TABLE_STRING PmicVersionStr;
+ SMBIOS_TABLE_STRING PmicVersion;
+ SMBIOS_TABLE_STRING SecureBootStr;
+ SMBIOS_TABLE_STRING SecureBoot;
+ SMBIOS_TABLE_STRING BootModeStr;
+ SMBIOS_TABLE_STRING BootMode;
+ SMBIOS_TABLE_STRING SpeedStepModeStr;
+ SMBIOS_TABLE_STRING SpeedStepMode;
+ SMBIOS_TABLE_STRING CPUTurboModeStr;
+ SMBIOS_TABLE_STRING CPUTurboMode;
+ SMBIOS_TABLE_STRING CStateStr;
+ SMBIOS_TABLE_STRING CState;
+ SMBIOS_TABLE_STRING EnhancedCStateStr;
+ SMBIOS_TABLE_STRING EnhancedCState;
+ SMBIOS_TABLE_STRING MaxPkgCStateStr;
+ SMBIOS_TABLE_STRING MaxPkgCState;
+ SMBIOS_TABLE_STRING MaxCoreCStateStr;
+ SMBIOS_TABLE_STRING MaxCoreCState;
+ SMBIOS_TABLE_STRING GfxTurboStr;
+ SMBIOS_TABLE_STRING GfxTurbo;
+ SMBIOS_TABLE_STRING S0ixStr;
+ SMBIOS_TABLE_STRING S0ix;
+ SMBIOS_TABLE_STRING RC6Str;
+ SMBIOS_TABLE_STRING RC6;
+} SMBIOS_TABLE_TYPE94;
+
+#pragma pack()
+//
+// Data Table Array
+//
+extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];
+//
+// For BXTM B0
+//
+extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTableB0[];
+
+//
+// Data Table Array Entries
+//
+extern UINTN mMiscSubclassDataTableEntries;
+//
+// For BXTM B0
+//
+extern UINTN mMiscSubclassDataTableEntriesB0;
+extern EFI_HII_HANDLE mHiiHandle;
+
+//
+// Prototypes
+//
+EFI_STATUS
+EFIAPI
+MiscSubclassDriverEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+#endif
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.uni Binary files differnew file mode 100644 index 0000000000..e05f00574c --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriver.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverDataTable.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverDataTable.c new file mode 100644 index 0000000000..a844230161 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverDataTable.c @@ -0,0 +1,107 @@ +/** @file
+ Create the mMiscSubclassDataTable structure, and it is used to report
+ any generate data to the DataHub.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// External definitions referenced by Data Table entries.
+//
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_BIOS_VENDOR_DATA, MiscBiosVendor, MiscBiosVendor);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer, MiscSystemManufacturer);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer, MiscBaseBoardManufacturer);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_CHASSIS_MANUFACTURER_DATA, MiscChassisManufacturer, MiscChassisManufacturer);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MEMORY_ARRAY_LOCATION_DATA, MiscPhysicalMemoryArray,MiscPhysicalMemoryArray);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MEMORY_ARRAY_LINK_DATA, MiscMemoryDevice, MiscMemoryDevice);
+
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortIde1, MiscPortInternalConnectorDesignator);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortIde2, MiscPortInternalConnectorDesignator);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR_DATA, MiscPortAtxPower, MiscPortInternalConnectorDesignator);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx16Slot1, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx16Slot2, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx4, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot1, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot2, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot3, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI1, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI2, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI3, MiscSystemSlotDesignation);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceVideo, MiscOnboardDevice);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceNetwork, MiscOnboardDevice);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_ONBOARD_DEVICE_DATA, MiscOnboardDeviceAudio, MiscOnboardDevice);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES_DATA, NumberOfInstallableLanguages, NumberOfInstallableLanguages);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString, SystemLanguageString);
+MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_BOOT_INFORMATION_STATUS_DATA, BootInformationStatus, BootInformationStatus);
+
+//
+// Data Table.
+//
+EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[] = {
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscBiosVendor, MiscBiosVendor),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemManufacturer, MiscSystemManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscBaseBoardManufacturer, MiscBaseBoardManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscChassisManufacturer, MiscChassisManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortIde1, MiscPortInternalConnectorDesignator),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortIde2, MiscPortInternalConnectorDesignator),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortAtxPower, MiscPortInternalConnectorDesignator),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx16Slot1, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx16Slot2, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx4, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx1Slot1, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx1Slot2, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx1Slot3, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCI1, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCI2, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCI3, MiscSystemSlotDesignation),
+#if defined( ALWAYS_DISABLE_ONBOARD_VIDEO ) && \
+ ( ALWAYS_DISABLE_ONBOARD_VIDEO != 0 )
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceNetwork, MiscOnboardDevice),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceAudio, MiscOnboardDevice),
+#else
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceVideo, MiscOnboardDevice),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceNetwork, MiscOnboardDevice),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceAudio, MiscOnboardDevice),
+#endif
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NumberOfInstallableLanguages, NumberOfInstallableLanguages),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(SystemLanguageString, SystemLanguageString),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(BootInformationStatus, BootInformationStatus),
+};
+
+//
+// Data Table for BXTM B0.
+//
+EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTableB0[] = {
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscBiosVendor, MiscBiosVendor),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemManufacturer, MiscSystemManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscBaseBoardManufacturer, MiscBaseBoardManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscChassisManufacturer, MiscChassisManufacturer),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx1Slot1, MiscSystemSlotDesignation),
+ MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlotPCIEx1Slot2, MiscSystemSlotDesignation),
+};
+
+
+//
+// Number of Data Table entries.
+//
+UINTN mMiscSubclassDataTableEntries =
+ (sizeof mMiscSubclassDataTable) / sizeof(EFI_MISC_SMBIOS_DATA_TABLE);
+
+//
+// Number of Data Table entries for BTXM B0.
+//
+UINTN mMiscSubclassDataTableEntriesB0 =
+ (sizeof mMiscSubclassDataTableB0) / sizeof(EFI_MISC_SMBIOS_DATA_TABLE);
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c new file mode 100644 index 0000000000..05425ca062 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c @@ -0,0 +1,246 @@ +/** @file
+ This driver parses the mMiscSubclassDataTable structure and reports
+ any generated data to the DataHub.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+#include <Library/SteppingLib.h>
+EFI_HII_HANDLE mHiiHandle;
+
+
+/**
+ Publish the Driver/firmware version info using smbios type 14, group association.
+
+ @param[in] Event Event whose notification function is being invoked (Ready To Boot).
+ @param[in] Context Pointer to the notification functions context, which is implementation dependent.
+
+ @retval None
+
+**/
+VOID
+EFIAPI
+AddSmbiosT14Callback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_SMBIOS_PROTOCOL *SmbiosProtocol;
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_SMBIOS_TABLE_HEADER *Record;
+ UINT32 FviTypeCount; // number of Fvi records locates.
+ UINT32 FviT14Size; // Size of the SMBIOS record to be installed.
+ GROUP_STRUCT *FviTableOld; // Pointers to discovered Fvi entries.
+ GROUP_STRUCT *FviTableNew;
+ SMBIOS_TABLE_TYPE14 *SmbiosTableType14;
+ UINT8 *GroupName;
+ static UINT8 T14FviString[sizeof (T14_FVI_STRING)] = T14_FVI_STRING;
+
+ SmbiosProtocol = NULL;
+ FviTableNew = NULL;
+
+ DEBUG ((EFI_D_INFO, "Executing SMBIOS T14 callback.\n"));
+
+ gBS->CloseEvent (Event); // Unload this event.
+
+ //
+ // Parse the SMBIOS records for
+ //
+ Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &SmbiosProtocol);
+ ASSERT_EFI_ERROR (Status);
+
+ FviTypeCount = 0;
+ SmbiosHandle = 0;
+
+ do {
+ Status = SmbiosProtocol->GetNext (SmbiosProtocol, &SmbiosHandle, NULL, &Record, NULL);
+ if (EFI_ERROR (Status)) {
+ break;
+ }
+ //
+ // Only One EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS with the label T14FviString.
+ // is allowed in the system.
+ //
+ if (Record->Type == EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS) {
+ GroupName = ((UINT8 * )Record) + Record->Length;
+ if (AsciiStrnCmp ((CHAR8 *) GroupName, (CHAR8 *) T14FviString, AsciiStrLen ((CHAR8 *) GroupName)) == 0) {
+ FviTypeCount = 0; // mark the set as empty
+ break;
+ }
+ }
+ //
+ // Locate the FviSmbiosType records.
+ //
+ if (Record->Type == EFI_SMBIOS_TYPE_FIRMWARE_VERSION_INFO) {
+ FviTypeCount++;
+ FviTableOld = FviTableNew;
+ FviTableNew = AllocateZeroPool (sizeof (GROUP_STRUCT) * FviTypeCount);
+ if (FviTableNew == NULL) {
+ DEBUG ((EFI_D_ERROR, "FviTableNew is NULL.\n"));
+ return;
+ }
+
+ if (FviTypeCount > 1) {
+ CopyMem (FviTableNew, FviTableOld, (sizeof (GROUP_STRUCT) * FviTypeCount));
+ }
+
+ if (FviTableOld != NULL) {
+ gBS->FreePool (FviTableOld);
+ }
+
+ FviTableNew[FviTypeCount - 1].ItemType = Record->Type;
+ FviTableNew[FviTypeCount - 1].ItemHandle = Record->Handle;
+ }
+ } while (SmbiosHandle != 0); // End of retrieving Smbios FviSmbiosType records.
+
+
+ if (FviTypeCount != 0) {
+
+ //
+ // Add the Record to the SMBIOS table.
+ //
+ FviT14Size = sizeof (SMBIOS_TABLE_TYPE14) + (UINT32) AsciiStrLen (T14_FVI_STRING) + (sizeof (GROUP_STRUCT) * (FviTypeCount - 1)) + 2;
+
+ SmbiosTableType14 = AllocateZeroPool (FviT14Size);
+ if (SmbiosTableType14 == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosTableType14 is NULL.\n"));
+ return;
+ }
+
+ SmbiosTableType14->Hdr.Type = EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS;
+ SmbiosTableType14->Hdr.Length = (UINT8) (sizeof (SMBIOS_TABLE_TYPE14) + (sizeof (GROUP_STRUCT) * (FviTypeCount - 1)));
+ SmbiosTableType14->Hdr.Handle = SMBIOS_HANDLE_PI_RESERVED; // Assign an unused handle.
+ SmbiosTableType14->GroupName = 1;
+ CopyMem (SmbiosTableType14->Group, FviTableNew, sizeof (GROUP_STRUCT) * FviTypeCount);
+ CopyMem ((&SmbiosTableType14->Group[FviTypeCount].ItemType), T14FviString, sizeof (T14FviString));
+
+ Status = SmbiosProtocol->Add (
+ SmbiosProtocol,
+ NULL,
+ &SmbiosTableType14->Hdr.Handle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosTableType14
+ );
+ FreePool (SmbiosTableType14);
+ }
+ if (FviTableNew != NULL) {
+ FreePool (FviTableNew);
+ }
+}
+
+
+/**
+ Standard EFI driver point. This driver parses the mMiscSubclassDataTable
+ structure and reports any generated data to the DataHub.
+
+ @param[in] ImageHandle Handle for the image of this driver
+ @param[in] SystemTable Pointer to the EFI System Table
+
+ @retval EFI_SUCCESS The data was successfully reported to the Data Hub.
+ @retval EFI_DEVICE_ERROR Can not locate any protocols
+
+**/
+EFI_STATUS
+EFIAPI
+MiscSubclassDriverEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ UINTN Index;
+ EFI_STATUS EfiStatus;
+ EFI_SMBIOS_PROTOCOL *Smbios;
+ static BOOLEAN CallbackIsInstalledT14 = FALSE;
+ EFI_EVENT Event;
+
+ EfiStatus = gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID **) &Smbios);
+
+ if (EFI_ERROR (EfiStatus)) {
+ DEBUG ((EFI_D_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStatus));
+ return EfiStatus;
+ }
+
+ mHiiHandle = HiiAddPackages (
+ &gEfiCallerIdGuid,
+ NULL,
+ MiscSubclassStrings,
+ NULL
+ );
+ ASSERT (mHiiHandle != NULL);
+
+ if (GetBxtSeries () != Bxt1) {
+ for (Index = 0; Index < mMiscSubclassDataTableEntries; ++Index) {
+ //
+ // If the entry have a function pointer, just log the data.
+ //
+ if (mMiscSubclassDataTable[Index].Function != NULL) {
+ EfiStatus = (*mMiscSubclassDataTable[Index].Function) (
+ mMiscSubclassDataTable[Index].RecordData,
+ Smbios
+ );
+
+ if (EFI_ERROR (EfiStatus)) {
+ DEBUG ((EFI_D_ERROR, "Misc smbios store error. Index=%d, ReturnStatus=%r\n", Index, EfiStatus));
+ return EfiStatus;
+ }
+ }
+ }
+ } else {
+ //
+ // BXTM B0 SMBIOS tables
+ //
+ for (Index = 0; Index < mMiscSubclassDataTableEntriesB0; ++Index) {
+ //
+ // If the entry have a function pointer, just log the data.
+ //
+ if (mMiscSubclassDataTableB0[Index].Function != NULL) {
+ EfiStatus = (*mMiscSubclassDataTableB0[Index].Function)(
+ mMiscSubclassDataTableB0[Index].RecordData,
+ Smbios
+ );
+
+ if (EFI_ERROR(EfiStatus)) {
+ DEBUG((EFI_D_ERROR, "Misc smbios store error. Index=%d, ReturnStatus=%r\n", Index, EfiStatus));
+ return EfiStatus;
+ }
+ }
+ }
+ }
+
+ //
+ // Add Smbios Type 4 and Type7 information
+ //
+ EfiStatus = AddSmbiosProcessorAndCacheTables ();
+ if (EFI_ERROR (EfiStatus)) {
+ DEBUG ((EFI_D_ERROR, "Add Smbios Processor And Cache Tables, Return Status =%d\n", EfiStatus));
+ return EfiStatus;
+ }
+ //
+ // This callback will parse the SMBIOS table for FVI and create a Type 14 record.
+ //
+ if (CallbackIsInstalledT14 == FALSE) {
+ CallbackIsInstalledT14 = TRUE; // Prevent more than 1 callback.
+ DEBUG ((EFI_D_INFO, "Create Smbios T14 callback.\n"));
+ EfiStatus = EfiCreateEventReadyToBootEx (
+ TPL_CALLBACK,
+ AddSmbiosT14Callback,
+ NULL,
+ &Event
+ );
+ ASSERT_EFI_ERROR (EfiStatus);
+ }
+
+ return EfiStatus;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageString.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageString.uni Binary files differnew file mode 100644 index 0000000000..2635c8fe53 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageString.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringData.c new file mode 100644 index 0000000000..e10214768b --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringData.c @@ -0,0 +1,27 @@ +/** @file
+ Static data of System language string information.
+ System language string information is Misc. subclass type 12 and SMBIOS type 13.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_LANGUAGE_STRING_DATA, SystemLanguageString) = {
+ 0,
+ STRING_TOKEN(STR_MISC_SYSTEM_LANGUAGE_EN_US)
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringFunction.c new file mode 100644 index 0000000000..acdcd78d39 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemLanguageStringFunction.c @@ -0,0 +1,93 @@ +/** @file
+ Reset Capabilities.
+ SMBIOS type 23.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscOemString (Type 11).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(SystemLanguageString)
+{
+ EFI_STATUS Status;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE13 *SmbiosRecord;
+ UINTN StrLeng;
+ CHAR8 *OptionalStrStart;
+ EFI_STRING Str;
+ STRING_REF TokenToGet;
+
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_LANGUAGE_EN_US);
+ Str = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ StrLeng = StrLen (Str);
+ if (StrLeng > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE13) + StrLeng + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE13);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->InstallableLanguages = 1;
+ SmbiosRecord->Flags = 1;
+ SmbiosRecord->CurrentLanguages = 1;
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (Str, OptionalStrStart);
+
+
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturer.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturer.uni Binary files differnew file mode 100644 index 0000000000..da8647f6c7 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturer.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerData.c new file mode 100644 index 0000000000..6cf1092dc0 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerData.c @@ -0,0 +1,33 @@ +/** @file
+ Static data of System manufacturer information.
+ System manufacturer information is Misc. subclass type 3 and SMBIOS type 1.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) System Manufacturer data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER_DATA, MiscSystemManufacturer) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER), // SystemManufactrurer
+ STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), // SystemProductName
+ STRING_TOKEN(STR_MISC_SYSTEM_VERSION), // SystemVersion
+ STRING_TOKEN(STR_MISC_SYSTEM_SERIAL_NUMBER), // SystemSerialNumber
+ { // SystemUuid
+ 0xa5000288, 0x6462, 0x4524, 0x98, 0x6a, 0x9b, 0x77, 0x37, 0xe3, 0x15, 0xcf
+ },
+ EfiSystemWakeupTypePowerSwitch // SystemWakeupType
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c new file mode 100644 index 0000000000..225f424a43 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemManufacturerFunction.c @@ -0,0 +1,292 @@ +/** @file
+ This driver parses the mMiscSubclassDataTable structure and reports
+ any generated data.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include <Library/SteppingLib.h>
+#include "MiscSubclassDriver.h"
+#include <Protocol/DxeSmmReadyToLock.h>
+#include <Library/PrintLib.h>
+
+
+
+/**
+ Publish the smbios type 1.
+
+ @param[in] Event Event whose notification function is being invoked (gEfiDxeSmmReadyToLockProtocolGuid).
+ @param[in] Context Pointer to the notification functions context, which is implementation dependent.
+
+ @retval None
+
+**/
+VOID
+EFIAPI
+AddSmbiosManuCallback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ CHAR8 *OptionalStrStart;
+ UINTN ManuStrLen;
+ UINTN VerStrLen;
+ UINTN PdNameStrLen;
+ UINTN SerialNumStrLen;
+ UINTN SkuNumberStrLen;
+ UINTN FamilyNameStrLen;
+ EFI_STATUS Status;
+ EFI_STRING Manufacturer;
+ EFI_STRING ProductName;
+ EFI_STRING Version;
+ EFI_STRING SerialNumber;
+ EFI_STRING SkuNumber;
+ EFI_STRING FamilyName;
+ STRING_REF TokenToGet;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE1 *SmbiosRecord;
+ EFI_MISC_SYSTEM_MANUFACTURER *ForType1InputData;
+ EFI_SMBIOS_PROTOCOL *Smbios;
+ CHAR16 Buffer[40];
+ CHAR16 PlatformNameBuffer[40];
+
+ ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *) Context;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (Context == NULL) {
+ return;
+ }
+
+ Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **) &Smbios);
+ ASSERT_EFI_ERROR (Status);
+
+ UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer), L"%s", L"MinnowBoard V3 ");
+
+ //
+ // Silicon Steppings
+ //
+ switch (BxtStepping ()) {
+ case BxtA0:
+ case BxtPA0:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"A0 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"A0");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "A0 Stepping Detected\n"));
+ break;
+ case BxtA1:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"A1 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"A1");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "A1 Stepping Detected\n"));
+ break;
+ case BxtB0:
+ case BxtPB0:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"B0 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"B0");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "B0 Stepping Detected\n"));
+ break;
+ case BxtB1:
+ case BxtPB1:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"B1 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"B1");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "B1 Stepping Detected\n"));
+ break;
+ case BxtPB2:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"B2 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"B2");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "B2 Stepping Detected\n"));
+ break;
+ case BxtC0:
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s%s", PlatformNameBuffer, L"C0 PLATFORM");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
+ UnicodeSPrint (Buffer, sizeof (Buffer), L"%s", L"C0");
+ HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_VERSION), Buffer, NULL);
+ DEBUG ((EFI_D_ERROR, "C0 Stepping Detected\n"));
+ break;
+ default:
+ DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n"));
+ break;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
+ Manufacturer = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ ManuStrLen = StrLen (Manufacturer);
+ if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
+ ProductName = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ PdNameStrLen = StrLen (ProductName);
+ if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
+ Version = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ VerStrLen = StrLen (Version);
+ if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);
+ SerialNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SerialNumStrLen = StrLen (SerialNumber);
+ if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER);
+ SkuNumber = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SkuNumberStrLen = StrLen (SkuNumber);
+ if (SkuNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_FAMILY_NAME1);
+ FamilyName = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ FamilyNameStrLen = StrLen (FamilyName);
+ if (FamilyNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SkuNumberStrLen + 1 + FamilyNameStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SkuNumberStrLen + 1 + FamilyNameStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_INFORMATION;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE1);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+ //
+ // Manu will be the 1st optional string following the formatted structure.
+ //
+ SmbiosRecord->Manufacturer = 1;
+ //
+ // ProductName will be the 2nd optional string following the formatted structure.
+ //
+ SmbiosRecord->ProductName = 2;
+ //
+ // Version will be the 3rd optional string following the formatted structure.
+ //
+ SmbiosRecord->Version = 3;
+ //
+ // Version will be the 4th optional string following the formatted structure.
+ //
+ SmbiosRecord->SerialNumber = 4;
+
+ SmbiosRecord->SKUNumber= 5;
+ SmbiosRecord->Family= 6;
+ //
+ // Unique UUID
+ //
+ ForType1InputData->SystemUuid.Data1 = PcdGet32 (PcdProductSerialNumber);
+ ForType1InputData->SystemUuid.Data4[0] = PcdGet8 (PcdEmmcManufacturerId);
+
+ CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,16);
+
+ SmbiosRecord->WakeUpType = (UINT8) ForType1InputData->SystemWakeupType;
+
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (Manufacturer, OptionalStrStart);
+ UnicodeStrToAsciiStr (ProductName, OptionalStrStart + ManuStrLen + 1);
+ UnicodeStrToAsciiStr (Version, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);
+ UnicodeStrToAsciiStr (SerialNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);
+
+ UnicodeStrToAsciiStr (SkuNumber, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
+ UnicodeStrToAsciiStr (FamilyName, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SkuNumberStrLen +1);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return;
+}
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscSystemManufacturer (Type 1).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer)
+{
+ EFI_STATUS Status;
+ static BOOLEAN CallbackIsInstalledManu = FALSE;
+ VOID *AddSmbiosManuCallbackNotifyReg;
+ EFI_EVENT AddSmbiosManuCallbackEvent;
+
+
+ if (CallbackIsInstalledManu == FALSE) {
+ CallbackIsInstalledManu = TRUE; // Prevent more than 1 callback.
+ DEBUG ((EFI_D_INFO, "Create Smbios Manu callback.\n"));
+
+ //
+ // gEfiDxeSmmReadyToLockProtocolGuid is ready
+ //
+ Status = gBS->CreateEvent (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ AddSmbiosManuCallback,
+ RecordData,
+ &AddSmbiosManuCallbackEvent
+ );
+
+ ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ return Status;
+
+ }
+
+ Status = gBS->RegisterProtocolNotify (
+ &gEfiDxeSmmReadyToLockProtocolGuid,
+ AddSmbiosManuCallbackEvent,
+ &AddSmbiosManuCallbackNotifyReg
+ );
+
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionString.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionString.uni Binary files differnew file mode 100644 index 0000000000..826698eedb --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionString.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringData.c new file mode 100644 index 0000000000..90f2afa02e --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringData.c @@ -0,0 +1,26 @@ +/** @file
+ Static data of System option string.
+ System option string is Miscellaneous subclass type: 10 and SMBIOS type: 13.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING_DATA, SystemOptionString) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_OPTION_EN_US)
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringFunction.c new file mode 100644 index 0000000000..f00291aaa6 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemOptionStringFunction.c @@ -0,0 +1,90 @@ +/** @file
+ BIOS system option string boot time changes.
+ SMBIOS type 12.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscSystemOptionString (Type 12).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(SystemOptionString)
+{
+ CHAR8 *OptionalStrStart;
+ UINTN OptStrLen;
+ EFI_STRING OptionString;
+ EFI_STATUS Status;
+ STRING_REF TokenToGet;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ SMBIOS_TABLE_TYPE12 *SmbiosRecord;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_OPTION_EN_US);
+ OptionString = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ OptStrLen = StrLen (OptionString);
+ if (OptStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE12);
+ //
+ // Make handle chosen by smbios protocol.add automatically.
+ //
+ SmbiosRecord->Hdr.Handle = 0;
+
+ SmbiosRecord->StringCount = 1;
+ OptionalStrStart = (CHAR8*) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (OptionString, OptionalStrStart);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignation.uni b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignation.uni Binary files differnew file mode 100644 index 0000000000..0c9e799efb --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignation.uni diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationData.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationData.c new file mode 100644 index 0000000000..34df29fd89 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationData.c @@ -0,0 +1,238 @@ +/** @file
+ Static data of System Slot Designation.
+ System Slot Designation is Misc. subclass type 7 and SMBIOS type 9.
+
+ Copyright (c) 2004 - 2016, 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
+ 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.
+
+**/
+
+#include "CommonHeader.h"
+#include "MiscSubclassDriver.h"
+
+//
+// Static (possibly build generated) Bios Vendor data.
+//
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx16Slot1) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX16_1), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth16xOrx16, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x06, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 0, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 0, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx16Slot2) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX16_2), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth16xOrx16, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x04, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 0, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 0, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx4) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX4), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth4xOrx4, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x03, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 0, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 0, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot1) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX1_1), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth1xOrx1, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x02, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot2) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX1_2), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth1xOrx1, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x15, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCIEx1Slot3) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCIEX1_3), // SlotDesignation
+ EfiSlotTypePciExpress, // SlotType
+ EfiSlotDataBusWidth1xOrx1, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthShort, // SlotLength
+ 0x16, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI1) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCI1), // SlotDesignation
+ EfiSlotTypePci, // SlotType
+ EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthLong , // SlotLength
+ 0x07, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI2) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCI2), // SlotDesignation
+ EfiSlotTypePci, // SlotType
+ EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthLong , // SlotLength
+ 0x18, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
+MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION_DATA, MiscSystemSlotPCI3) = {
+ STRING_TOKEN(STR_MISC_SYSTEM_SLOT_PCI3), // SlotDesignation
+ EfiSlotTypePci, // SlotType
+ EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
+ EfiSlotUsageAvailable, // SlotUsage
+ EfiSlotLengthLong , // SlotLength
+ 0x17, // SlotId
+ { // SlotCharacteristics
+ 0, // CharacteristicsUnknown :1;
+ 0, // Provides50Volts :1;
+ 1, // Provides33Volts :1;
+ 0, // SharedSlot :1;
+ 0, // PcCard16Supported :1;
+ 0, // CardBusSupported :1;
+ 0, // ZoomVideoSupported :1;
+ 0, // ModemRingResumeSupported:1;
+ 1, // PmeSignalSupported :1;
+ 0, // HotPlugDevicesSupported :1;
+ 1, // SmbusSignalSupported :1;
+ 0 // Reserved :21;
+ },
+ 0 // SlotDevicePath
+};
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationFunction.c b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationFunction.c new file mode 100644 index 0000000000..69691cefa1 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/MiscSystemSlotDesignationFunction.c @@ -0,0 +1,129 @@ +/** @file
+ BIOS system slot designator information boot time changes.
+ SMBIOS type 9.
+
+ Copyright (c) 2009 - 2016, 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
+ 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.
+
+**/
+
+#include "MiscSubclassDriver.h"
+
+
+/**
+ This function makes boot time changes to the contents of the
+ MiscSystemSlotDesignator structure (Type 9).
+
+ @param RecordData Pointer to copy of RecordData from the Data Table.
+
+ @retval EFI_SUCCESS All parameters were valid.
+ @retval EFI_UNSUPPORTED Unexpected RecordType value.
+ @retval EFI_INVALID_PARAMETER Invalid parameter was found.
+
+**/
+MISC_SMBIOS_TABLE_FUNCTION(MiscSystemSlotDesignation)
+{
+ CHAR8 *OptionalStrStart;
+ UINTN SlotDesignationStrLen;
+ EFI_STATUS Status;
+ EFI_STRING SlotDesignation;
+ STRING_REF TokenToGet;
+ SMBIOS_TABLE_TYPE9 *SmbiosRecord;
+ EFI_SMBIOS_HANDLE SmbiosHandle;
+ EFI_MISC_SYSTEM_SLOT_DESIGNATION* ForType9InputData;
+
+ ForType9InputData = (EFI_MISC_SYSTEM_SLOT_DESIGNATION *) RecordData;
+
+ //
+ // First check for invalid parameters.
+ //
+ if (RecordData == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ TokenToGet = 0;
+ switch (ForType9InputData->SlotDesignation) {
+ case STR_MISC_SYSTEM_SLOT_PCIEX16_1:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX16_1);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCIEX16_2:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX16_2);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCIEX4:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX4);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCIEX1_1:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX1_1);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCIEX1_2:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX1_2);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCIEX1_3:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCIEX1_3);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCI1:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCI1);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCI2:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCI2);
+ break;
+ case STR_MISC_SYSTEM_SLOT_PCI3:
+ TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SLOT_PCI3);
+ break;
+ default:
+ break;
+ }
+
+ SlotDesignation = HiiGetPackageString (&gEfiCallerIdGuid, TokenToGet, NULL);
+ SlotDesignationStrLen = StrLen (SlotDesignation);
+ if (SlotDesignationStrLen > SMBIOS_STRING_MAX_LENGTH) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Two zeros following the last string.
+ //
+ SmbiosRecord = AllocatePool (sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);
+ if (SmbiosRecord == NULL) {
+ DEBUG ((EFI_D_ERROR, "SmbiosRecord is NULL.\n"));
+ return EFI_OUT_OF_RESOURCES;
+ }
+ ZeroMem (SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);
+
+ SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_SLOTS;
+ SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE9);
+ SmbiosRecord->Hdr.Handle = 0;
+ SmbiosRecord->SlotDesignation = 1;
+ SmbiosRecord->SlotType = (UINT8) ForType9InputData->SlotType;
+ SmbiosRecord->SlotDataBusWidth = (UINT8) ForType9InputData->SlotDataBusWidth;
+ SmbiosRecord->CurrentUsage = (UINT8) ForType9InputData->SlotUsage;
+ SmbiosRecord->SlotLength = (UINT8) ForType9InputData->SlotLength;
+ SmbiosRecord->SlotID = ForType9InputData->SlotId;
+
+ //
+ // Slot Characteristics
+ //
+ CopyMem ((UINT8 *) &SmbiosRecord->SlotCharacteristics1,(UINT8 *) &ForType9InputData->SlotCharacteristics,2);
+ OptionalStrStart = (CHAR8 *) (SmbiosRecord + 1);
+ UnicodeStrToAsciiStr (SlotDesignation, OptionalStrStart);
+ //
+ // Now we have got the full smbios record, call smbios protocol to add this record.
+ //
+ SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+ Status = Smbios->Add (
+ Smbios,
+ NULL,
+ &SmbiosHandle,
+ (EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
+ );
+ FreePool (SmbiosRecord);
+ return Status;
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf new file mode 100644 index 0000000000..db40a0b636 --- /dev/null +++ b/Platform/BroxtonPlatformPkg/Common/Features/Smbios/SmBiosMiscDxe/SmBiosMiscDxe.inf @@ -0,0 +1,143 @@ +## @file
+# Component name for module MiscSubclass.
+#
+# Copyright (c) 2006 - 2016, 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
+# 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.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = MiscSubclass
+ FILE_GUID = 4EFFB560-B28B-4e57-9DAD-4344E32EA3BA
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = MiscSubclassDriverEntryPoint
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources]
+ MiscBaseBoardManufacturer.uni
+ MiscBaseBoardManufacturerData.c
+ MiscBaseBoardManufacturerFunction.c
+ MiscBiosVendor.uni
+ MiscBiosVendorData.c
+ MiscBiosVendorFunction.c
+ MiscBootInformationData.c
+ MiscBootInformationFunction.c
+ MiscChassisManufacturer.uni
+ MiscChassisManufacturerData.c
+ MiscChassisManufacturerFunction.c
+ MiscNumberOfInstallableLanguagesData.c
+ MiscNumberOfInstallableLanguagesFunction.c
+ MiscOemString.uni
+ MiscOemStringData.c
+ MiscOemStringFunction.c
+ MiscOnboardDevice.uni
+ MiscOnboardDeviceData.c
+ MiscOnboardDeviceFunction.c
+ MiscPortInternalConnectorDesignator.uni
+ MiscPortInternalConnectorDesignatorData.c
+ MiscPortInternalConnectorDesignatorFunction.c
+ MiscResetCapabilitiesData.c
+ MiscResetCapabilitiesFunction.c
+ MiscSystemLanguageString.uni
+ MiscSystemLanguageStringData.c
+ MiscSystemLanguageStringFunction.c
+ MiscSystemManufacturer.uni
+ MiscSystemManufacturerData.c
+ MiscSystemManufacturerFunction.c
+ MiscSystemOptionString.uni
+ MiscSystemOptionStringData.c
+ MiscSystemOptionStringFunction.c
+ MiscSystemSlotDesignation.uni
+ MiscSystemSlotDesignationData.c
+ MiscSystemSlotDesignationFunction.c
+ MiscSubclassDriver.h
+ MiscSubclassDriver.uni
+ MiscSubclassDriverDataTable.c
+ MiscSubclassDriverEntryPoint.c
+ CommonHeader.h
+ MiscOemType0x90Function.c
+ MiscOemType0x90Data.c
+ MiscOemType0x90.uni
+ MiscOemType0x94Function.c
+ MiscOemType0x94Data.c
+ MiscOemType0x94.uni
+ MiscPhysicalArray.uni
+ MiscPhysicalArrayData.c
+ MiscPhysicalArrayFunction.c
+ MiscOemType0x83Function.c
+ MiscOemType0x83Data.c
+
+[Packages]
+ MdeModulePkg/MdeModulePkg.dec
+ BroxtonPlatformPkg/PlatformPkg.dec
+ MdePkg/MdePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+ BroxtonSiPkg/BroxtonSiPkg.dec
+ BroxtonSiPkg/NorthCluster/MemoryInit/MemoryInit.dec
+ IntelFsp2Pkg/IntelFsp2Pkg.dec
+
+[LibraryClasses]
+ HiiLib
+ DevicePathLib
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+ BaseMemoryLib
+ DebugLib
+ BaseLib
+ MemoryAllocationLib
+ PcdLib
+ UefiLib
+ BiosIdLib
+ PrintLib
+ CpuIA32Lib
+ SteppingLib
+ BaseIpcLib
+ HeciMsgLib
+ DxeSmbiosProcessorLib
+
+[Guids]
+ gEfiProcessorSubClassGuid
+ gEfiCacheSubClassGuid
+ gEfiSetupVariableGuid
+ gEfiPlatformInfoGuid
+ gIFWIVersionHobGuid
+ gEfiHobListGuid
+ gEfiMemoryConfigDataGuid
+ gIFWIVersionHobGuid
+ gEfiPlatformInfoGuid
+ gFspNonVolatileStorageHobGuid ##CONSUMES
+
+[Protocols]
+ gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+ gEfiSeCOperationProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+ gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
+ gEfiDataHubProtocolGuid
+ gEfiMpServiceProtocolGuid
+ gMemInfoProtocolGuid
+ gCpuInfoProtocolGuid
+
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+ gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
+ gEfiBxtTokenSpaceGuid.PcdEmmcManufacturerId
+ gEfiBxtTokenSpaceGuid.PcdProductSerialNumber
+
+[Depex]
+ gEfiSmbiosProtocolGuid AND
+ gMemInfoProtocolGuid AND
+ gEfiMpServiceProtocolGuid
|