Upload BSD-licensed Vlv2TbltDevicePkg and Vlv2DeviceRefCodePkg to
https://svn.code.sf.net/p/edk2/code/trunk/edk2/, which are for MinnowBoard MAX open source project. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: David Wei <david.wei@intel.com> Reviewed-by: Mike Wu <mike.wu@intel.com> Reviewed-by: Hot Tian <hot.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16599 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
44
Vlv2TbltDevicePkg/SmBiosMiscDxe/CommonHeader.h
Normal file
44
Vlv2TbltDevicePkg/SmBiosMiscDxe/CommonHeader.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/**@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 - 2014, 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 that 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>
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturer.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturer.uni
Normal file
Binary file not shown.
@@ -0,0 +1,63 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBaseBoardManufacturerData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of Base board manufacturer information.
|
||||
Base board manufacturer information is Misc. subclass type 4 and SMBIOS type 2.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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
|
@@ -0,0 +1,232 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBaseBoardManufacturerFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BaseBoard manufacturer information boot time changes.
|
||||
SMBIOS type 2.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Library/NetLib.h>
|
||||
#include "Library/DebugLib.h"
|
||||
#include <Uefi/UefiBaseType.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;
|
||||
|
||||
CHAR16 *MacStr;
|
||||
EFI_HANDLE *Handles;
|
||||
UINTN BufferSize;
|
||||
|
||||
ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *)RecordData;
|
||||
|
||||
//
|
||||
// First check for invalid parameters.
|
||||
//
|
||||
if (RecordData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER);
|
||||
Manufacturer = SmbiosMiscGetString (TokenToGet);
|
||||
ManuStrLen = StrLen(Manufacturer);
|
||||
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME1);
|
||||
Product = SmbiosMiscGetString (TokenToGet);
|
||||
ProductStrLen = StrLen(Product);
|
||||
if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
|
||||
Version = SmbiosMiscGetString (TokenToGet);
|
||||
VerStrLen = StrLen(Version);
|
||||
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
//Get handle infomation
|
||||
//
|
||||
BufferSize = 0;
|
||||
Handles = NULL;
|
||||
Status = gBS->LocateHandle (
|
||||
ByProtocol,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Handles
|
||||
);
|
||||
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
Handles = AllocateZeroPool(BufferSize);
|
||||
if (Handles == NULL) {
|
||||
return (EFI_OUT_OF_RESOURCES);
|
||||
}
|
||||
Status = gBS->LocateHandle(
|
||||
ByProtocol,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Handles
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
//Get the MAC string
|
||||
//
|
||||
Status = NetLibGetMacString (
|
||||
*Handles,
|
||||
NULL,
|
||||
&MacStr
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
SerialNumber = MacStr;
|
||||
SerialNumStrLen = StrLen(SerialNumber);
|
||||
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
DEBUG ((EFI_D_ERROR, "MAC Address: %S\n", MacStr));
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);
|
||||
AssertTag = SmbiosMiscGetString (TokenToGet);
|
||||
AssertTagStrLen = StrLen(AssertTag);
|
||||
if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);
|
||||
Chassis = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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;
|
||||
}
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendor.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendor.uni
Normal file
Binary file not shown.
106
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorData.c
Normal file
106
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorData.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBiosVendorData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of BIOS vendor information.
|
||||
BIOS vendor information is Misc. subclass type 2 and SMBIOS type 0.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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
|
341
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction.c
Normal file
341
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBiosVendorFunction.c
Normal file
@@ -0,0 +1,341 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBiosVendorFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS vendor information boot time changes.
|
||||
Misc. subclass type 2.
|
||||
SMBIOS type 0.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Library/BiosIdLib.h>
|
||||
#include <Library/SpiFlash.H>
|
||||
|
||||
EFI_SPI_PROTOCOL *mSpiProtocol = NULL;
|
||||
|
||||
|
||||
/**
|
||||
This function read the data from Spi Rom.
|
||||
|
||||
@param BaseAddress The starting address of the read.
|
||||
@param Byte The pointer to the destination buffer.
|
||||
@param Length The number of bytes.
|
||||
@param SpiRegionType Spi Region Type.
|
||||
|
||||
@retval Status
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
FlashRead (
|
||||
IN UINTN BaseAddress,
|
||||
IN UINT8 *Byte,
|
||||
IN UINTN Length,
|
||||
IN SPI_REGION_TYPE SpiRegionType
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status = EFI_SUCCESS;
|
||||
UINT32 SectorSize;
|
||||
UINT32 SpiAddress;
|
||||
UINT8 Buffer[SECTOR_SIZE_4KB];
|
||||
|
||||
SpiAddress = (UINT32)(UINTN)(BaseAddress);
|
||||
SectorSize = SECTOR_SIZE_4KB;
|
||||
|
||||
Status = mSpiProtocol->Execute (
|
||||
mSpiProtocol,
|
||||
SPI_READ,
|
||||
SPI_WREN,
|
||||
TRUE,
|
||||
TRUE,
|
||||
FALSE,
|
||||
(UINT32) SpiAddress,
|
||||
SectorSize,
|
||||
Buffer,
|
||||
SpiRegionType
|
||||
);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
#ifdef _SHOW_LOG_
|
||||
Print(L"Read SPI ROM Failed [%08x]\n", SpiAddress);
|
||||
#endif
|
||||
return Status;
|
||||
}
|
||||
|
||||
CopyMem (Byte, (void *)Buffer, Length);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
This function returns the value & exponent to Base2 for a given
|
||||
Hex value. This is used to calculate the BiosPhysicalDeviceSize.
|
||||
|
||||
@param Value The hex value which is to be converted into value-exponent form
|
||||
@param 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 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 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[100]; //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;
|
||||
UINT16 UVerStr[32];
|
||||
UINTN LoopIndex;
|
||||
UINTN CopyIndex;
|
||||
MANIFEST_OEM_DATA *IFWIVerStruct;
|
||||
UINT8 *Data8 = NULL;
|
||||
UINT16 SpaceVer[2]={0x0020,0x0000};
|
||||
UINT16 BIOSVersionTemp[100];
|
||||
|
||||
ForType0InputData = (EFI_MISC_BIOS_VENDOR *)RecordData;
|
||||
|
||||
//
|
||||
// First check for invalid parameters.
|
||||
//
|
||||
if (RecordData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
GetBiosId (&BiosIdImage);
|
||||
|
||||
//
|
||||
// Add VLV2 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_ERROR, "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 = SmbiosMiscGetString (TokenToGet);
|
||||
VendorStrLen = StrLen(Char16String);
|
||||
if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);
|
||||
Version = SmbiosMiscGetString (TokenToGet);
|
||||
|
||||
ZeroMem (UVerStr, 2*32);
|
||||
ZeroMem (BIOSVersionTemp, 2*100);
|
||||
StrCat (BIOSVersionTemp,Version);
|
||||
Data8 = AllocatePool (SECTOR_SIZE_4KB);
|
||||
ZeroMem (Data8, SECTOR_SIZE_4KB);
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiSpiProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&mSpiProtocol
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
//
|
||||
// Get data form SPI ROM.
|
||||
//
|
||||
Status = FlashRead (
|
||||
MEM_IFWIVER_START,
|
||||
Data8,
|
||||
SECTOR_SIZE_4KB,
|
||||
EnumSpiRegionAll
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
for(LoopIndex = 0; LoopIndex <= SECTOR_SIZE_4KB; LoopIndex++) {
|
||||
IFWIVerStruct = (MANIFEST_OEM_DATA *)(Data8 + LoopIndex);
|
||||
if(IFWIVerStruct->Signature == SIGNATURE_32('$','F','U','D')) {
|
||||
DEBUG ((EFI_D_ERROR, "the IFWI Length is:%d\n", IFWIVerStruct->IFWIVersionLen));
|
||||
if(IFWIVerStruct->IFWIVersionLen < 32) {
|
||||
for(CopyIndex = 0; CopyIndex < IFWIVerStruct->IFWIVersionLen; CopyIndex++) {
|
||||
UVerStr[CopyIndex] = (UINT16)IFWIVerStruct->IFWIVersion[CopyIndex];
|
||||
}
|
||||
UVerStr[CopyIndex] = 0x0000;
|
||||
DEBUG ((EFI_D_ERROR, "The IFWI Version is :%s,the IFWI Length is:%d\n", UVerStr,IFWIVerStruct->IFWIVersionLen));
|
||||
StrCat(BIOSVersionTemp,SpaceVer);
|
||||
StrCat(BIOSVersionTemp,UVerStr);
|
||||
DEBUG ((EFI_D_ERROR, "The BIOS and IFWI Version is :%s\n", BIOSVersionTemp));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FreePool(Data8);
|
||||
|
||||
VerStrLen = StrLen(BIOSVersionTemp);
|
||||
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
|
||||
ReleaseDate = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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;
|
||||
|
||||
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
|
||||
UnicodeStrToAsciiStr(Char16String, OptionalStrStart);
|
||||
UnicodeStrToAsciiStr(BIOSVersionTemp, 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(
|
39
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBootInformationData.c
Normal file
39
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBootInformationData.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBootInformationData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of Boot information.
|
||||
Boot information is Misc. subclass type 26 and SMBIOS type 32.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
@@ -0,0 +1,87 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBootInformationFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
boot information boot time changes.
|
||||
SMBIOS type 32.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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);
|
||||
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;
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturer.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturer.uni
Normal file
Binary file not shown.
@@ -0,0 +1,62 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscChassisManufacturerData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data is Chassis Manufacturer information.
|
||||
Chassis Manufacturer information is Misc. subclass type 5 and SMBIOS type 3.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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
|
||||
EfiMiscChassisTypeUnknown, // ChassisType
|
||||
0, // ChassisLockPresent
|
||||
0 // Reserved
|
||||
},
|
||||
EfiChassisStateSafe, // ChassisBootupState
|
||||
EfiChassisStateSafe, // ChassisPowerSupplyState
|
||||
EfiChassisStateOther, // ChassisThermalState
|
||||
EfiChassisSecurityStatusOther, // ChassisSecurityState
|
||||
0, // ChassisOemDefined
|
||||
0, // ChassisHeight
|
||||
0, // ChassisNumberPowerCords
|
||||
0, // ChassisElementCount
|
@@ -0,0 +1,155 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscChassisManufacturerFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Chassis manufacturer information boot time changes.
|
||||
SMBIOS type 3.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenToGet);
|
||||
ManuStrLen = StrLen(Manufacturer);
|
||||
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);
|
||||
Version = SmbiosMiscGetString (TokenToGet);
|
||||
VerStrLen = StrLen(Version);
|
||||
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);
|
||||
SerialNumber = SmbiosMiscGetString (TokenToGet);
|
||||
SerialNumStrLen = StrLen(SerialNumber);
|
||||
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);
|
||||
AssertTag = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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(
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDevice.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDevice.uni
Normal file
Binary file not shown.
50
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDeviceData.c
Normal file
50
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDeviceData.c
Normal file
@@ -0,0 +1,50 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscMemoryDeviceData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Memory Device
|
||||
Misc. subclass type 17.
|
||||
SMBIOS type 17.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
MISC_SMBIOS_TABLE_DATA(EFI_MEMORY_ARRAY_LINK_DATA, MiscMemoryDevice) = {
|
||||
STRING_TOKEN (STR_MISC_MEM_DEV_LOCATOR0), // Memory Device locator
|
||||
STRING_TOKEN (STR_MISC_MEM_BANK_LOCATOR0), // Memory Bank Locator
|
||||
STRING_TOKEN (STR_MISC_MEM_MANUFACTURER), // Memory manufacturer
|
||||
STRING_TOKEN (STR_MISC_MEM_SERIAL_NO), // Memory serial Number
|
||||
STRING_TOKEN (STR_MISC_MEM_ASSET_TAG), // Memory Asset Tag
|
||||
STRING_TOKEN (STR_MISC_MEM_PART_NUMBER), // Memory Part Number
|
||||
0, // Memory Array Link
|
||||
0, // Memory SubArray link
|
||||
0, // UINT16 MemoryTotalWidth
|
||||
0, // UINT16 MemoryDatawidth
|
324
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDeviceFunction.c
Normal file
324
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscMemoryDeviceFunction.c
Normal file
@@ -0,0 +1,324 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscMemoryDeviceFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Memory Device
|
||||
Misc. subclass type 17.
|
||||
SMBIOS type 17.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Protocol/DataHub.h>
|
||||
#include <Guid/DataHubRecords.h>
|
||||
#include <Protocol/MemInfo.h>
|
||||
|
||||
|
||||
#define FREQ_800 0x00
|
||||
#define FREQ_1066 0x01
|
||||
#define FREQ_1333 0x02
|
||||
#define FREQ_1600 0x03
|
||||
|
||||
#define MAX_SOCKETS 2
|
||||
#define EfiMemoryTypeDdr3 0x18
|
||||
|
||||
enum {
|
||||
DDRType_DDR3 = 0,
|
||||
DDRType_DDR3L = 1,
|
||||
DDRType_DDR3U = 2,
|
||||
DDRType_DDR3All = 3,
|
||||
DDRType_LPDDR2 = 4,
|
||||
DDRType_LPDDR3 = 5,
|
||||
DDRType_DDR4 = 6
|
||||
};
|
||||
|
||||
|
||||
typedef struct {
|
||||
EFI_PHYSICAL_ADDRESS MemoryArrayStartAddress;
|
||||
EFI_PHYSICAL_ADDRESS MemoryArrayEndAddress;
|
||||
EFI_INTER_LINK_DATA PhysicalMemoryArrayLink;
|
||||
UINT16 MemoryArrayPartitionWidth;
|
||||
} EFI_MEMORY_ARRAY_START_ADDRESS;
|
||||
|
||||
/**
|
||||
This function makes boot time changes to the contents of the
|
||||
MiscBiosVendor (Type 0).
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
VOID
|
||||
GetType16Hndl (
|
||||
IN EFI_SMBIOS_PROTOCOL *Smbios,
|
||||
OUT EFI_SMBIOS_HANDLE *Handle
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_SMBIOS_TYPE RecordType;
|
||||
EFI_SMBIOS_TABLE_HEADER *Buffer;
|
||||
|
||||
*Handle = 0;
|
||||
RecordType = EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY;
|
||||
|
||||
Status = Smbios->GetNext (
|
||||
Smbios,
|
||||
Handle,
|
||||
&RecordType,
|
||||
&Buffer,
|
||||
NULL
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
return;
|
||||
}
|
||||
*Handle = 0xFFFF;
|
||||
}
|
||||
|
||||
MISC_SMBIOS_TABLE_FUNCTION( MiscMemoryDevice )
|
||||
{
|
||||
CHAR8 *OptionalStrStart;
|
||||
UINTN MemDeviceStrLen;
|
||||
UINTN MemBankLocatorStrLen;
|
||||
UINTN MemManufacturerStrLen;
|
||||
UINTN MemSerialNumberStrLen;
|
||||
UINTN MemAssetTagStrLen;
|
||||
UINTN MemPartNumberStrLen;
|
||||
CHAR16 *MemDevice;
|
||||
CHAR16 *MemBankLocator;
|
||||
CHAR16 *MemManufacturer;
|
||||
CHAR16 *MemSerialNumber;
|
||||
CHAR16 *MemAssetTag;
|
||||
CHAR16 *MemPartNumber;
|
||||
EFI_STATUS Status;
|
||||
STRING_REF TokenToGet;
|
||||
SMBIOS_TABLE_TYPE17 *SmbiosRecord;
|
||||
EFI_SMBIOS_HANDLE SmbiosHandle;
|
||||
EFI_MEMORY_ARRAY_LINK_DATA *ForType17InputData;
|
||||
UINT16 DdrFreq=0;
|
||||
UINT16 Type16Handle=0;
|
||||
MEM_INFO_PROTOCOL *MemInfoHob;
|
||||
UINT8 MemoryType;
|
||||
|
||||
UINT8 Dimm;
|
||||
UINT8 NumSlots;
|
||||
STRING_REF DevLocator[] = {
|
||||
STRING_TOKEN(STR_MISC_MEM_DEV_LOCATOR0), STRING_TOKEN(STR_MISC_MEM_DEV_LOCATOR1)
|
||||
};
|
||||
STRING_REF BankLocator[] = {
|
||||
STRING_TOKEN(STR_MISC_MEM_BANK_LOCATOR0), STRING_TOKEN(STR_MISC_MEM_BANK_LOCATOR1)
|
||||
};
|
||||
|
||||
//
|
||||
// First check for invalid parameters.
|
||||
//
|
||||
if (RecordData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
ForType17InputData = (EFI_MEMORY_ARRAY_LINK_DATA *)RecordData;
|
||||
|
||||
//
|
||||
// Get Memory size parameters for each rank from the chipset registers
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gMemInfoProtocolGuid,
|
||||
NULL,
|
||||
(void **)&MemInfoHob
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
NumSlots = (UINT8)(MAX_SOCKETS);
|
||||
|
||||
//
|
||||
// Memory Freq
|
||||
//
|
||||
switch (MemInfoHob->MemInfoData.ddrFreq){
|
||||
case FREQ_800:
|
||||
DdrFreq = 800;
|
||||
break;
|
||||
case FREQ_1066:
|
||||
DdrFreq = 1066;
|
||||
break;
|
||||
case FREQ_1333:
|
||||
DdrFreq = 1333;
|
||||
break;
|
||||
case FREQ_1600:
|
||||
DdrFreq = 1600;
|
||||
break;
|
||||
default:
|
||||
DdrFreq = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Type
|
||||
//
|
||||
switch (MemInfoHob->MemInfoData.ddrType) {
|
||||
case DDRType_LPDDR2:
|
||||
MemoryType = EfiMemoryTypeDdr2;
|
||||
break;
|
||||
case DDRType_DDR3:
|
||||
case DDRType_DDR3L:
|
||||
case DDRType_DDR3U:
|
||||
case DDRType_LPDDR3:
|
||||
MemoryType = EfiMemoryTypeDdr3;
|
||||
break;
|
||||
default:
|
||||
MemoryType = EfiMemoryTypeUnknown;
|
||||
break;
|
||||
}
|
||||
|
||||
for (Dimm = 0; Dimm < NumSlots; Dimm++) {
|
||||
//
|
||||
// Memory Device Locator
|
||||
//
|
||||
TokenToGet = DevLocator[Dimm];
|
||||
MemDevice = SmbiosMiscGetString (TokenToGet);
|
||||
MemDeviceStrLen = StrLen(MemDevice);
|
||||
if (MemDeviceStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = DevLocator[Dimm];
|
||||
MemDevice = SmbiosMiscGetString (TokenToGet);
|
||||
MemDeviceStrLen = StrLen(MemDevice);
|
||||
if (MemDeviceStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Bank Locator
|
||||
//
|
||||
TokenToGet = BankLocator[Dimm];
|
||||
MemBankLocator = SmbiosMiscGetString (TokenToGet);
|
||||
MemBankLocatorStrLen = StrLen(MemBankLocator);
|
||||
if (MemBankLocatorStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Manufacturer
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_MEM_MANUFACTURER);
|
||||
MemManufacturer = SmbiosMiscGetString (TokenToGet);
|
||||
MemManufacturerStrLen = StrLen(MemManufacturer);
|
||||
if (MemManufacturerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Serial Number
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_MEM_SERIAL_NO);
|
||||
MemSerialNumber = SmbiosMiscGetString (TokenToGet);
|
||||
MemSerialNumberStrLen = StrLen(MemSerialNumber);
|
||||
if (MemSerialNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Asset Tag Number
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_MEM_ASSET_TAG);
|
||||
MemAssetTag = SmbiosMiscGetString (TokenToGet);
|
||||
MemAssetTagStrLen = StrLen(MemAssetTag);
|
||||
if (MemAssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Memory Part Number
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_MEM_PART_NUMBER);
|
||||
MemPartNumber = SmbiosMiscGetString (TokenToGet);
|
||||
MemPartNumberStrLen = StrLen(MemPartNumber);
|
||||
if (MemPartNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Two zeros following the last string.
|
||||
//
|
||||
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE17) + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1 + MemManufacturerStrLen + 1 + MemSerialNumberStrLen + 1 + MemAssetTagStrLen+1 + MemPartNumberStrLen + 1 + 1);
|
||||
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE17) + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1 + MemManufacturerStrLen + 1 + MemSerialNumberStrLen + 1 + MemAssetTagStrLen+1 + MemPartNumberStrLen + 1 + 1);
|
||||
|
||||
SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_MEMORY_DEVICE;
|
||||
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE17);
|
||||
|
||||
//
|
||||
// Make handle chosen by smbios protocol.add automatically.
|
||||
//
|
||||
SmbiosRecord->Hdr.Handle = 0;
|
||||
|
||||
//
|
||||
// Memory Array Handle will be the 3rd optional string following the formatted structure.
|
||||
//
|
||||
GetType16Hndl( Smbios, &Type16Handle);
|
||||
SmbiosRecord->MemoryArrayHandle = Type16Handle;
|
||||
|
||||
//
|
||||
// Memory Size
|
||||
//
|
||||
if ((MemInfoHob->MemInfoData.dimmSize[Dimm])!=0){
|
||||
SmbiosRecord->TotalWidth = 32;
|
||||
SmbiosRecord->DataWidth = 32;
|
||||
SmbiosRecord->Size = MemInfoHob->MemInfoData.dimmSize[Dimm];
|
||||
SmbiosRecord->Speed = DdrFreq;
|
||||
SmbiosRecord->ConfiguredMemoryClockSpeed = DdrFreq;
|
||||
SmbiosRecord->FormFactor = EfiMemoryFormFactorDimm;
|
||||
}
|
||||
|
||||
SmbiosRecord->DeviceSet =(UINT8) ForType17InputData->MemoryDeviceSet;
|
||||
SmbiosRecord->DeviceLocator= 1;
|
||||
SmbiosRecord->BankLocator = 2;
|
||||
|
||||
|
||||
SmbiosRecord->Manufacturer = 3;
|
||||
SmbiosRecord->SerialNumber= 4;
|
||||
SmbiosRecord->AssetTag= 5;
|
||||
SmbiosRecord->PartNumber= 6;
|
||||
SmbiosRecord->Attributes = (UINT8) ForType17InputData->MemoryState;
|
||||
SmbiosRecord->MemoryType = MemoryType;
|
||||
|
||||
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
|
||||
UnicodeStrToAsciiStr(MemDevice, OptionalStrStart);
|
||||
UnicodeStrToAsciiStr(MemBankLocator, OptionalStrStart + MemDeviceStrLen + 1);
|
||||
UnicodeStrToAsciiStr(MemManufacturer, OptionalStrStart + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1);
|
||||
UnicodeStrToAsciiStr(MemSerialNumber, OptionalStrStart + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1 + MemManufacturerStrLen + 1);
|
||||
UnicodeStrToAsciiStr(MemAssetTag, OptionalStrStart + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1 + MemManufacturerStrLen + 1 + MemSerialNumberStrLen + 1);
|
||||
UnicodeStrToAsciiStr(MemPartNumber, OptionalStrStart + MemDeviceStrLen + 1 + MemBankLocatorStrLen + 1 + MemManufacturerStrLen + 1 + MemSerialNumberStrLen + 1+ MemAssetTagStrLen+1 );
|
||||
|
||||
//
|
||||
// Now we have got the full smbios record, call smbios protocol to add this record.
|
||||
//
|
||||
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
|
||||
Status = Smbios-> Add(
|
@@ -0,0 +1,43 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscNumberOfInstallableLanguagesData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of the Number of installable languages information.
|
||||
Number of installable languages information is Misc. subclass type 11 and SMBIOS type 13.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
//
|
||||
// Static (possibly build generated) Bios Vendor data.
|
||||
//
|
@@ -0,0 +1,254 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscNumberOfInstallableLanguagesFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This driver parses the mSmbiosMiscDataTable structure and reports
|
||||
any generated data.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
/**
|
||||
Check whether the language is supported for given HII handle
|
||||
|
||||
@param HiiHandle The HII package list handle.
|
||||
@param Offset The offest of current lanague in the supported languages.
|
||||
@param 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;
|
||||
}
|
||||
|
||||
CurrentLang = GetEfiGlobalVariable (L"PlatformLang");
|
||||
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 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 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 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);
|
||||
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);
|
||||
AsciiStrCpy(OptionalStrStart, CurrentLang);
|
||||
|
||||
//
|
||||
// Now we have got the full smbios record, call smbios protocol to add this record.
|
||||
//
|
||||
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemString.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemString.uni
Normal file
Binary file not shown.
39
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemStringData.c
Normal file
39
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemStringData.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOemStringData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of OEM String information.
|
||||
OEM String information is Misc. subclass type 9 and SMBIOS type 11.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
94
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemStringFunction.c
Normal file
94
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemStringFunction.c
Normal file
@@ -0,0 +1,94 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOemStringFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
boot information boot time changes.
|
||||
SMBIOS type 11.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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;
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90.uni
Normal file
Binary file not shown.
41
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Data.c
Normal file
41
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Data.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOemType0x90Data.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This file contains the Misc Oem Data (SMBIOS data type 0x90)
|
||||
|
||||
--*/
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
|
||||
//
|
||||
// Static (possibly build generated) Oem data.
|
452
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
Normal file
452
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
Normal file
@@ -0,0 +1,452 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOemType0x88Function.c
|
||||
|
||||
Abstract:
|
||||
|
||||
The function that processes the Smbios data type 0x88 before they
|
||||
are submitted to Data Hub
|
||||
|
||||
--*/
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.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"%d.%d.%d", Version >> 24 , (Version >>16)& 0x0f ,*(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);
|
||||
}
|
||||
|
||||
/**
|
||||
Publish the smbios OEM type 0x90.
|
||||
|
||||
@param Event - Event whose notification function is being invoked (gEfiDxeSmmReadyToLockProtocolGuid).
|
||||
@param Context - Pointer to the notification functions context, which is implementation dependent.
|
||||
|
||||
@retval None
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
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 EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiSmbiosProtocolGuid,
|
||||
NULL,
|
||||
(VOID *) &SmbiosProtocol
|
||||
);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
GetUcodeVersion();
|
||||
GetGOPDriverName();
|
||||
GetCPUStepping();
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SEC_VERSION);
|
||||
SECVer = SmbiosMiscGetString (TokenToGet);
|
||||
SECVerStrLen = StrLen(SECVer);
|
||||
if (SECVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_UCODE_VERSION);
|
||||
uCodeVer = SmbiosMiscGetString (TokenToGet);
|
||||
uCodeVerStrLen = StrLen(uCodeVer);
|
||||
if (uCodeVerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_GOP_VERSION);
|
||||
GOPVer = SmbiosMiscGetString (TokenToGet);
|
||||
GOPStrLen = StrLen(GOPVer);
|
||||
if (GOPStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_PROCESSOR_STEPPING);
|
||||
Stepping = SmbiosMiscGetString (TokenToGet);
|
||||
SteppingStrLen = StrLen(Stepping);
|
||||
|
||||
|
||||
if (SteppingStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE90) + SECVerStrLen + 1 + uCodeVerStrLen + 1 + GOPStrLen + 1 + SteppingStrLen + 1 + 1);
|
||||
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 = 0;
|
||||
|
||||
//
|
||||
// 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 Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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,
|
||||
(EFI_EVENT_NOTIFY)AddSmbiosT0x90Callback,
|
||||
RecordData,
|
||||
&AddSmbiosT0x90CallbackEvent
|
||||
);
|
||||
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
|
||||
}
|
||||
|
||||
Status = gBS->RegisterProtocolNotify (
|
||||
&gEfiDxeSmmReadyToLockProtocolGuid,
|
||||
AddSmbiosT0x90CallbackEvent,
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94.uni
Normal file
Binary file not shown.
59
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94Data.c
Normal file
59
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94Data.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
|
||||
|
||||
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOemType0x94Data.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This file contains the Misc version Data (SMBIOS data type 0x94)
|
||||
|
||||
--*/
|
||||
|
||||
#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_GOP_VERSION),
|
||||
STRING_TOKEN (STR_MISC_SEC_VERSION),
|
||||
STRING_TOKEN (STR_MISC_MRC_VERSION_VALUE),
|
||||
STRING_TOKEN (STR_MISC_UCODE_VERSION),
|
||||
STRING_TOKEN (STR_MISC_PUNIT_FW_VALUE),
|
||||
STRING_TOKEN (STR_MISC_PMC_FW_VALUE),
|
||||
STRING_TOKEN (STR_MISC_ULPMC_FW_VALUE),
|
||||
STRING_TOKEN (STR_MISC_SOC_VALUE),
|
||||
STRING_TOKEN (STR_MISC_BOARD_ID_VALUE),
|
||||
STRING_TOKEN (STR_MISC_FAB_ID_VALUE),
|
||||
STRING_TOKEN (STR_MISC_CPU_FLAVOR_VALUE),
|
||||
STRING_TOKEN (STR_MISC_BIOS_VERSION),
|
||||
STRING_TOKEN (STR_MISC_PMIC_VERSION),
|
||||
STRING_TOKEN (STR_MISC_TOUCH_VERSION),
|
||||
STRING_TOKEN (STR_MISC_SECURE_BOOT),
|
1223
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94Function.c
Normal file
1223
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x94Function.c
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDevice.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDevice.uni
Normal file
Binary file not shown.
53
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDeviceData.c
Normal file
53
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDeviceData.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOnboardDeviceData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of Onboard device information .
|
||||
The onboard device information is Misc. subclass type 8 and SMBIOS type 10.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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, MiscOnboardDeviceAudio) = {
|
140
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDeviceFunction.c
Normal file
140
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOnboardDeviceFunction.c
Normal file
@@ -0,0 +1,140 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 1999 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOnboardDeviceFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Create the device path for the Onboard device.
|
||||
The Onboard device information is Misc. subclass type 8 and SMBIOS type 10.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DeviceDescription = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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;
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArray.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArray.uni
Normal file
Binary file not shown.
43
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArrayData.c
Normal file
43
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArrayData.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscPhysicalArrayData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS Physical Array static data.
|
||||
SMBIOS type 16.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Static (possibly build generated) Physical Memory Array Dat.
|
106
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArrayFunction.c
Normal file
106
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscPhysicalArrayFunction.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2012 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscPhysicalArrayFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS system Physical Array boot time changes.
|
||||
SMBIOS type 16.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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 = 8 * 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);
|
||||
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(
|
Binary file not shown.
@@ -0,0 +1,61 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscPortInternalConnectorDesignatorData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of Port internal connector designator information.
|
||||
Port internal connector designator information is Misc. subclass type 6 and
|
||||
SMBIOS type 8.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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
|
||||
};
|
@@ -0,0 +1,157 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscPortInternalConnectorDesignatorFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Create the device path for the Port internal connector designator.
|
||||
Port internal connector designator information is Misc. subclass type 6
|
||||
and SMBIOS type 8.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenForInternal);
|
||||
InternalRefStrLen = StrLen(InternalRef);
|
||||
if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
ExternalRef = SmbiosMiscGetString (TokenForExternal);
|
||||
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);
|
||||
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;
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCache.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCache.uni
Normal file
Binary file not shown.
38
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheData.c
Normal file
38
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheData.c
Normal file
@@ -0,0 +1,38 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2012 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscBiosProcessorCache.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Processor cache static data.
|
||||
Misc. subclass type 7.
|
||||
SMBIOS type 7.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
202
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
Normal file
202
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
Normal file
@@ -0,0 +1,202 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscProcessorCacheFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS processor cache details.
|
||||
Misc. subclass type 7.
|
||||
SMBIOS type 7.
|
||||
|
||||
--*/
|
||||
#include "CommonHeader.h"
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Protocol/DataHub.h>
|
||||
#include <Guid/DataHubRecords.h>
|
||||
|
||||
|
||||
extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL1;
|
||||
extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL2;
|
||||
extern SMBIOS_TABLE_TYPE7 *SmbiosRecordL3;
|
||||
|
||||
|
||||
UINT32
|
||||
ConvertBase2ToRaw (
|
||||
IN EFI_EXP_BASE2_DATA *Data)
|
||||
{
|
||||
UINTN Index;
|
||||
UINT32 RawData;
|
||||
|
||||
RawData = Data->Value;
|
||||
for (Index = 0; Index < (UINTN) Data->Exponent; Index++) {
|
||||
RawData <<= 1;
|
||||
}
|
||||
|
||||
return RawData;
|
||||
}
|
||||
|
||||
|
||||
MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
|
||||
{
|
||||
EFI_SMBIOS_HANDLE SmbiosHandle;
|
||||
SMBIOS_TABLE_TYPE7 *SmbiosRecordL1;
|
||||
SMBIOS_TABLE_TYPE7 *SmbiosRecordL2;
|
||||
|
||||
EFI_CACHE_SRAM_TYPE_DATA CacheSramType;
|
||||
CHAR16 *SocketDesignation;
|
||||
CHAR8 *OptionalStrStart;
|
||||
UINTN SocketStrLen;
|
||||
STRING_REF TokenToGet;
|
||||
EFI_DATA_HUB_PROTOCOL *DataHub;
|
||||
UINT64 MonotonicCount;
|
||||
EFI_DATA_RECORD_HEADER *Record;
|
||||
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
|
||||
UINT8 *SrcData;
|
||||
UINT32 SrcDataSize;
|
||||
EFI_STATUS Status;
|
||||
|
||||
//
|
||||
// Memory Device LOcator
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "type 7\n"));
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_SOCKET_DESIGNATION);
|
||||
SocketDesignation = SmbiosMiscGetString (TokenToGet);
|
||||
SocketStrLen = StrLen(SocketDesignation);
|
||||
if (SocketStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
SmbiosRecordL1 = AllocatePool(sizeof (SMBIOS_TABLE_TYPE7) + 7 + 1 + 1);
|
||||
ASSERT (SmbiosRecordL1 != NULL);
|
||||
ZeroMem(SmbiosRecordL1, sizeof (SMBIOS_TABLE_TYPE7) + 7 + 1 + 1);
|
||||
|
||||
SmbiosRecordL2 = AllocatePool(sizeof (SMBIOS_TABLE_TYPE7) + 7 + 1 + 1);
|
||||
ASSERT (SmbiosRecordL2 != NULL);
|
||||
ZeroMem(SmbiosRecordL2, sizeof (SMBIOS_TABLE_TYPE7) + 7 + 1 + 1);
|
||||
|
||||
//
|
||||
// Get the Data Hub Protocol. Assume only one instance
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDataHubProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&DataHub
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
MonotonicCount = 0;
|
||||
Record = NULL;
|
||||
|
||||
do {
|
||||
Status = DataHub->GetNextRecord (
|
||||
DataHub,
|
||||
&MonotonicCount,
|
||||
NULL,
|
||||
&Record
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
|
||||
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
|
||||
SrcData = (UINT8 *)(DataHeader + 1);
|
||||
SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
|
||||
if (CompareGuid(&Record->DataRecordGuid, &gEfiCacheSubClassGuid) && (DataHeader->RecordType == CacheSizeRecordType)) {
|
||||
if (DataHeader->SubInstance == EFI_CACHE_L1) {
|
||||
SmbiosRecordL1->InstalledSize += (UINT16) (ConvertBase2ToRaw((EFI_EXP_BASE2_DATA *)SrcData) >> 10);
|
||||
SmbiosRecordL1->MaximumCacheSize = SmbiosRecordL1->InstalledSize;
|
||||
}
|
||||
else if (DataHeader->SubInstance == EFI_CACHE_L2) {
|
||||
SmbiosRecordL2->InstalledSize += (UINT16) (ConvertBase2ToRaw((EFI_EXP_BASE2_DATA *)SrcData) >> 10);
|
||||
SmbiosRecordL2->MaximumCacheSize = SmbiosRecordL2->InstalledSize;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (!EFI_ERROR(Status) && (MonotonicCount != 0));
|
||||
|
||||
//
|
||||
//Filling SMBIOS type 7 information for different cache levels.
|
||||
//
|
||||
|
||||
SmbiosRecordL1->Hdr.Type = EFI_SMBIOS_TYPE_CACHE_INFORMATION;
|
||||
SmbiosRecordL1->Hdr.Length = (UINT8) sizeof (SMBIOS_TABLE_TYPE7);
|
||||
SmbiosRecordL1->Hdr.Handle = 0;
|
||||
|
||||
SmbiosRecordL1->Associativity = CacheAssociativity8Way;
|
||||
SmbiosRecordL1->SystemCacheType = CacheTypeUnknown;
|
||||
SmbiosRecordL1->SocketDesignation = 0x01;
|
||||
SmbiosRecordL1->CacheSpeed = 0;
|
||||
SmbiosRecordL1->CacheConfiguration = 0x0180;
|
||||
ZeroMem (&CacheSramType, sizeof (EFI_CACHE_SRAM_TYPE_DATA));
|
||||
CacheSramType.Synchronous = 1;
|
||||
CopyMem(&SmbiosRecordL1->SupportedSRAMType, &CacheSramType, 2);
|
||||
CopyMem(&SmbiosRecordL1->CurrentSRAMType, &CacheSramType, 2);
|
||||
SmbiosRecordL1->ErrorCorrectionType = EfiCacheErrorSingleBit;
|
||||
|
||||
|
||||
SmbiosRecordL2->Hdr.Type = EFI_SMBIOS_TYPE_CACHE_INFORMATION;
|
||||
SmbiosRecordL2->Hdr.Length = (UINT8) sizeof (SMBIOS_TABLE_TYPE7);
|
||||
SmbiosRecordL2->Hdr.Handle = 0;
|
||||
|
||||
SmbiosRecordL2->Associativity = CacheAssociativity16Way;
|
||||
SmbiosRecordL2->SystemCacheType = CacheTypeInstruction;
|
||||
SmbiosRecordL2->SocketDesignation = 0x01;
|
||||
SmbiosRecordL2->CacheSpeed = 0;
|
||||
SmbiosRecordL2->CacheConfiguration = 0x0281;
|
||||
ZeroMem (&CacheSramType, sizeof (EFI_CACHE_SRAM_TYPE_DATA));
|
||||
CacheSramType.Synchronous = 1;
|
||||
CopyMem(&SmbiosRecordL2->SupportedSRAMType, &CacheSramType, 2);
|
||||
CopyMem(&SmbiosRecordL2->CurrentSRAMType, &CacheSramType, 2);
|
||||
SmbiosRecordL2->ErrorCorrectionType = EfiCacheErrorSingleBit;
|
||||
|
||||
|
||||
|
||||
//
|
||||
//Adding SMBIOS type 7 records to SMBIOS table.
|
||||
//
|
||||
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
|
||||
OptionalStrStart = (CHAR8 *)(SmbiosRecordL1 + 1);
|
||||
UnicodeStrToAsciiStr(SocketDesignation, OptionalStrStart);
|
||||
|
||||
Smbios-> Add(
|
||||
Smbios,
|
||||
NULL,
|
||||
&SmbiosHandle,
|
||||
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecordL1
|
||||
);
|
||||
|
||||
//
|
||||
//VLV2 incorporates two SLM modules (quad cores) in the SoC. 2 cores share BIU/L2 cache
|
||||
//
|
||||
SmbiosRecordL2->InstalledSize = (SmbiosRecordL2->InstalledSize)/2;
|
||||
SmbiosRecordL2->MaximumCacheSize = SmbiosRecordL2->InstalledSize;
|
||||
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
|
||||
|
||||
OptionalStrStart = (CHAR8 *)(SmbiosRecordL2 + 1);
|
||||
UnicodeStrToAsciiStr(SocketDesignation, OptionalStrStart);
|
||||
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformation.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformation.uni
Normal file
Binary file not shown.
@@ -0,0 +1,76 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscOnboardDeviceData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This driver parses the mMiscSubclassDataTable structure and reports
|
||||
any generated data to smbios.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
|
||||
/*
|
||||
EFI_PROCESSOR_CORE_FREQUENCY_LIST_DATA ProcessorCoreFrequencyList;
|
||||
EFI_PROCESSOR_FSB_FREQUENCY_LIST_DATA ProcessorFsbFrequencyList;
|
||||
EFI_PROCESSOR_SERIAL_NUMBER_DATA ProcessorSerialNumber;
|
||||
EFI_PROCESSOR_CORE_FREQUENCY_DATA ProcessorCoreFrequency;
|
||||
EFI_PROCESSOR_FSB_FREQUENCY_DATA ProcessorFsbFrequency;
|
||||
EFI_PROCESSOR_MAX_CORE_FREQUENCY_DATA ProcessorMaxCoreFrequency;
|
||||
EFI_PROCESSOR_MAX_FSB_FREQUENCY_DATA ProcessorMaxFsbFrequency;
|
||||
EFI_PROCESSOR_VERSION_DATA ProcessorVersion;
|
||||
EFI_PROCESSOR_MANUFACTURER_DATA ProcessorManufacturer;
|
||||
EFI_PROCESSOR_ID_DATA ProcessorId;
|
||||
EFI_PROCESSOR_TYPE_DATA ProcessorType;
|
||||
EFI_PROCESSOR_FAMILY_DATA ProcessorFamily;
|
||||
EFI_PROCESSOR_VOLTAGE_DATA ProcessorVoltage;
|
||||
EFI_PROCESSOR_APIC_BASE_ADDRESS_DATA ProcessorApicBase;
|
||||
EFI_PROCESSOR_APIC_ID_DATA ProcessorApicId;
|
||||
EFI_PROCESSOR_APIC_VERSION_NUMBER_DATA ProcessorApicVersionNumber;
|
||||
EFI_PROCESSOR_MICROCODE_REVISION_DATA CpuUcodeRevisionData;
|
||||
EFI_PROCESSOR_STATUS_DATA ProcessorStatus;
|
||||
EFI_PROCESSOR_SOCKET_TYPE_DATA ProcessorSocketType;
|
||||
EFI_PROCESSOR_SOCKET_NAME_DATA ProcessorSocketName;
|
||||
EFI_PROCESSOR_ASSET_TAG_DATA ProcessorAssetTag;
|
||||
EFI_PROCESSOR_HEALTH_STATUS ProcessorHealthStatus;
|
||||
EFI_PROCESSOR_PACKAGE_NUMBER_DATA ProcessorPackageNumber;
|
||||
} EFI_CPU_VARIABLE_RECORD;
|
||||
*/
|
||||
|
||||
|
||||
// Static (possibly build generated) Bios Vendor data.
|
||||
//
|
||||
MISC_SMBIOS_TABLE_DATA(EFI_CPU_DATA_RECORD, MiscProcessorInformation) = {
|
||||
|
||||
0,
|
||||
/*
|
||||
STRING_TOKEN (STR_MISC_SOCKET_NAME), // Processor Socket Name
|
||||
STRING_TOKEN (STR_MISC_PROCESSOR_MAUFACTURER), // Processor Manufacturer
|
@@ -0,0 +1,455 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscProcessorInformationFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Onboard processor information boot time changes.
|
||||
SMBIOS type 4.
|
||||
|
||||
--*/
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
|
||||
#include <Protocol/MpService.h>
|
||||
#include <Protocol/DataHub.h>
|
||||
#include <Guid/DataHubRecords.h>
|
||||
#include <Library/CpuIA32.h>
|
||||
|
||||
#define EfiProcessorFamilyIntelAtomProcessor 0x2B
|
||||
|
||||
EFI_GUID mProcessorProducerGuid;
|
||||
|
||||
|
||||
/**
|
||||
Get cache SMBIOS record handle.
|
||||
|
||||
@param Smbios Pointer to SMBIOS protocol instance.
|
||||
@param CacheLevel Level of cache, starting from one.
|
||||
@param Handle Returned record handle.
|
||||
|
||||
**/
|
||||
|
||||
VOID
|
||||
GetCacheHandle (
|
||||
IN EFI_SMBIOS_PROTOCOL *Smbios,
|
||||
IN UINT8 CacheLevel,
|
||||
OUT EFI_SMBIOS_HANDLE *Handle
|
||||
)
|
||||
{
|
||||
UINT16 CacheConfig;
|
||||
EFI_STATUS Status;
|
||||
EFI_SMBIOS_TYPE RecordType;
|
||||
EFI_SMBIOS_TABLE_HEADER *Buffer;
|
||||
|
||||
*Handle = 0;
|
||||
RecordType = EFI_SMBIOS_TYPE_CACHE_INFORMATION;
|
||||
|
||||
do {
|
||||
Status = Smbios->GetNext (
|
||||
Smbios,
|
||||
Handle,
|
||||
&RecordType,
|
||||
&Buffer,
|
||||
NULL
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
CacheConfig = *(UINT16*)((UINT8*)Buffer + 5);
|
||||
if ((CacheConfig & 0x7) == (CacheLevel -1) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} while (!EFI_ERROR(Status));
|
||||
|
||||
*Handle = 0xFFFF;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
This function makes boot time changes to the contents of the
|
||||
MiscProcessorInformation (Type 4).
|
||||
|
||||
@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.
|
||||
|
||||
**/
|
||||
UINT32
|
||||
ConvertBase10ToRaw (
|
||||
IN EFI_EXP_BASE10_DATA *Data)
|
||||
{
|
||||
UINTN Index;
|
||||
UINT32 RawData;
|
||||
|
||||
RawData = Data->Value;
|
||||
for (Index = 0; Index < (UINTN) Data->Exponent; Index++) {
|
||||
RawData *= 10;
|
||||
}
|
||||
|
||||
return RawData;
|
||||
}
|
||||
|
||||
#define BSEL_CR_OVERCLOCK_CONTROL 0xCD
|
||||
#define FUSE_BSEL_MASK 0x03
|
||||
|
||||
|
||||
|
||||
UINT16 miFSBFrequencyTable[4] = {
|
||||
83, // 83.3MHz
|
||||
100, // 100MHz
|
||||
133, // 133MHz
|
||||
117 // 116.7MHz
|
||||
};
|
||||
|
||||
/**
|
||||
Determine the processor core frequency
|
||||
|
||||
@param None
|
||||
|
||||
@retval Processor core frequency multiplied by 3
|
||||
|
||||
|
||||
**/
|
||||
UINT16
|
||||
DetermineiFsbFromMsr (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
//
|
||||
// Determine the processor core frequency
|
||||
//
|
||||
UINT64 Temp;
|
||||
Temp = (EfiReadMsr (BSEL_CR_OVERCLOCK_CONTROL)) & FUSE_BSEL_MASK;
|
||||
return miFSBFrequencyTable[(UINT32)(Temp)];
|
||||
|
||||
}
|
||||
|
||||
MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)
|
||||
{
|
||||
CHAR8 *OptionalStrStart;
|
||||
EFI_STRING SerialNumber;
|
||||
CHAR16 *Version=NULL;
|
||||
CHAR16 *Manufacturer=NULL;
|
||||
CHAR16 *Socket=NULL;
|
||||
CHAR16 *AssetTag=NULL;
|
||||
CHAR16 *PartNumber=NULL;
|
||||
UINTN SerialNumberStrLen=0;
|
||||
UINTN VersionStrLen=0;
|
||||
UINTN ManufacturerStrLen=0;
|
||||
UINTN SocketStrLen=0;
|
||||
UINTN AssetTagStrLen=0;
|
||||
UINTN PartNumberStrLen=0;
|
||||
UINTN ProcessorVoltage=0xAE;
|
||||
UINT32 Eax01;
|
||||
UINT32 Ebx01;
|
||||
UINT32 Ecx01;
|
||||
UINT32 Edx01;
|
||||
STRING_REF TokenToGet;
|
||||
EFI_STATUS Status;
|
||||
EFI_SMBIOS_HANDLE SmbiosHandle;
|
||||
SMBIOS_TABLE_TYPE4 *SmbiosRecord;
|
||||
EFI_CPU_DATA_RECORD *ForType4InputData;
|
||||
UINT16 L1CacheHandle=0;
|
||||
UINT16 L2CacheHandle=0;
|
||||
UINT16 L3CacheHandle=0;
|
||||
UINTN NumberOfEnabledProcessors=0 ;
|
||||
UINTN NumberOfProcessors=0;
|
||||
UINT64 Frequency = 0;
|
||||
EFI_MP_SERVICES_PROTOCOL *MpService;
|
||||
EFI_DATA_HUB_PROTOCOL *DataHub;
|
||||
UINT64 MonotonicCount;
|
||||
EFI_DATA_RECORD_HEADER *Record;
|
||||
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
|
||||
UINT8 *SrcData;
|
||||
UINT32 SrcDataSize;
|
||||
EFI_PROCESSOR_VERSION_DATA *ProcessorVersion;
|
||||
CHAR16 *NewStringToken;
|
||||
STRING_REF TokenToUpdate;
|
||||
PROCESSOR_ID_DATA *ProcessorId = NULL;
|
||||
|
||||
|
||||
//
|
||||
// First check for invalid parameters.
|
||||
//
|
||||
if (RecordData == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
ForType4InputData = (EFI_CPU_DATA_RECORD *)RecordData;
|
||||
|
||||
ProcessorId = AllocateZeroPool(sizeof(PROCESSOR_ID_DATA));
|
||||
if (ProcessorId == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the Data Hub Protocol. Assume only one instance
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiDataHubProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&DataHub
|
||||
);
|
||||
ASSERT_EFI_ERROR(Status);
|
||||
|
||||
MonotonicCount = 0;
|
||||
Record = NULL;
|
||||
|
||||
do {
|
||||
Status = DataHub->GetNextRecord (
|
||||
DataHub,
|
||||
&MonotonicCount,
|
||||
NULL,
|
||||
&Record
|
||||
);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
|
||||
|
||||
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
|
||||
SrcData = (UINT8 *)(DataHeader + 1);
|
||||
SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
|
||||
|
||||
//
|
||||
// Processor
|
||||
//
|
||||
if (CompareGuid(&Record->DataRecordGuid, &gEfiProcessorSubClassGuid)) {
|
||||
CopyMem (&mProcessorProducerGuid, &Record->ProducerName, sizeof(EFI_GUID));
|
||||
switch (DataHeader->RecordType) {
|
||||
case ProcessorVoltageRecordType:
|
||||
ProcessorVoltage = (((EFI_EXP_BASE10_DATA *)SrcData)->Value)/100 + 0x80;
|
||||
break;
|
||||
case ProcessorCoreFrequencyRecordType:
|
||||
DEBUG ((EFI_D_ERROR, "ProcessorCoreFrequencyRecordType SrcData1 =%d\n", ConvertBase10ToRaw((EFI_EXP_BASE10_DATA *)SrcData)/1000000));
|
||||
Frequency = (ConvertBase10ToRaw((EFI_EXP_BASE10_DATA *)SrcData)/1000000);
|
||||
break;
|
||||
case ProcessorVersionRecordType:
|
||||
ProcessorVersion = (EFI_PROCESSOR_VERSION_DATA *)SrcData;
|
||||
NewStringToken = HiiGetPackageString(&mProcessorProducerGuid, *ProcessorVersion, NULL);
|
||||
TokenToUpdate = (STRING_REF)STR_MISC_PROCESSOR_VERSION;
|
||||
HiiSetString(mHiiHandle, TokenToUpdate, NewStringToken, NULL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (!EFI_ERROR(Status) && (MonotonicCount != 0));
|
||||
|
||||
//
|
||||
// Token to get for Socket Name
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SOCKET_NAME);
|
||||
Socket = SmbiosMiscGetString (TokenToGet);
|
||||
SocketStrLen = StrLen(Socket);
|
||||
if (SocketStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Token to get for Processor Manufacturer
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_PROCESSOR_MAUFACTURER);
|
||||
Manufacturer = SmbiosMiscGetString (TokenToGet);
|
||||
ManufacturerStrLen = StrLen(Manufacturer);
|
||||
if (ManufacturerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Token to get for Processor Version
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_PROCESSOR_VERSION);
|
||||
Version = SmbiosMiscGetString (TokenToGet);
|
||||
VersionStrLen = StrLen(Version);
|
||||
if (VersionStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Token to get for Serial Number
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_PROCESSOR_SERIAL_NUMBER);
|
||||
SerialNumber = SmbiosMiscGetString (TokenToGet);
|
||||
SerialNumberStrLen = StrLen(SerialNumber);
|
||||
if (SerialNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Token to get for Assert Tag Information
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_ASSERT_TAG_DATA);
|
||||
AssetTag = SmbiosMiscGetString (TokenToGet);
|
||||
AssetTagStrLen = StrLen(AssetTag);
|
||||
if (AssetTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Token to get for part number Information
|
||||
//
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_PART_NUMBER);
|
||||
PartNumber = SmbiosMiscGetString (TokenToGet);
|
||||
PartNumberStrLen = StrLen(PartNumber);
|
||||
if (PartNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// Two zeros following the last string.
|
||||
//
|
||||
SmbiosRecord = AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE4) + AssetTagStrLen + 1 + SocketStrLen + 1+ ManufacturerStrLen +1 + VersionStrLen+ 1+ SerialNumberStrLen + 1 + PartNumberStrLen+ 1 + 1);
|
||||
|
||||
SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION;
|
||||
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE4);
|
||||
|
||||
//
|
||||
// Make handle chosen by smbios protocol.add automatically.
|
||||
//
|
||||
SmbiosRecord->Hdr.Handle = 0;
|
||||
|
||||
SmbiosRecord-> Socket= 1;
|
||||
SmbiosRecord -> ProcessorManufacture = 2;
|
||||
SmbiosRecord -> ProcessorVersion = 3;
|
||||
SmbiosRecord ->SerialNumber =4;
|
||||
|
||||
SmbiosRecord-> AssetTag= 5;
|
||||
SmbiosRecord-> PartNumber= 6;
|
||||
|
||||
//
|
||||
// Processor Type
|
||||
//
|
||||
ForType4InputData-> VariableRecord.ProcessorType= EfiCentralProcessor;
|
||||
SmbiosRecord -> ProcessorType = ForType4InputData-> VariableRecord.ProcessorType;
|
||||
|
||||
//
|
||||
// Processor Family
|
||||
//
|
||||
ForType4InputData-> VariableRecord.ProcessorFamily= EfiProcessorFamilyIntelAtomProcessor; //0x2B;;
|
||||
SmbiosRecord -> ProcessorFamily = ForType4InputData-> VariableRecord.ProcessorFamily;
|
||||
SmbiosRecord -> ExternalClock = DetermineiFsbFromMsr();
|
||||
|
||||
//
|
||||
// Processor ID
|
||||
//
|
||||
AsmCpuid(0x001, &Eax01, &Ebx01, &Ecx01, &Edx01);
|
||||
ProcessorId->Signature = *(PROCESSOR_SIGNATURE *)&Eax01;
|
||||
ProcessorId->FeatureFlags = *(PROCESSOR_FEATURE_FLAGS *)&Edx01;
|
||||
SmbiosRecord -> ProcessorId = *(PROCESSOR_ID_DATA *)ProcessorId;
|
||||
|
||||
//
|
||||
// Processor Voltage
|
||||
//
|
||||
ForType4InputData-> VariableRecord.ProcessorVoltage= *(EFI_PROCESSOR_VOLTAGE_DATA *)&ProcessorVoltage;
|
||||
SmbiosRecord -> Voltage = *(PROCESSOR_VOLTAGE *) &(ForType4InputData-> VariableRecord.ProcessorVoltage);
|
||||
|
||||
//
|
||||
// Status
|
||||
//
|
||||
ForType4InputData-> VariableRecord.ProcessorHealthStatus= 0x41;//0x41;
|
||||
SmbiosRecord -> Status = ForType4InputData-> VariableRecord.ProcessorHealthStatus;
|
||||
|
||||
//
|
||||
// Processor Upgrade
|
||||
//
|
||||
SmbiosRecord -> ProcessorUpgrade = 0x008;
|
||||
|
||||
//
|
||||
// Processor Family 2
|
||||
//
|
||||
SmbiosRecord -> ProcessorFamily2 = ForType4InputData-> VariableRecord.ProcessorFamily;
|
||||
|
||||
//
|
||||
// Processor speed
|
||||
//
|
||||
SmbiosRecord-> CurrentSpeed = *(UINT16*) & Frequency;
|
||||
SmbiosRecord-> MaxSpeed = *(UINT16*) & Frequency;
|
||||
|
||||
//
|
||||
// Processor Characteristics
|
||||
//
|
||||
AsmCpuid(0x8000000, NULL, NULL, NULL, &Edx01);
|
||||
Edx01= Edx01 >> 28;
|
||||
Edx01 &= 0x01;
|
||||
SmbiosRecord-> ProcessorCharacteristics= (UINT16)Edx01;
|
||||
|
||||
//
|
||||
// Processor Core Count and Enabled core count
|
||||
//
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiMpServiceProtocolGuid,
|
||||
NULL,
|
||||
(void **)&MpService
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Determine the number of processors
|
||||
//
|
||||
MpService->GetNumberOfProcessors (
|
||||
MpService,
|
||||
&NumberOfProcessors,
|
||||
&NumberOfEnabledProcessors
|
||||
);
|
||||
}
|
||||
SmbiosRecord-> CoreCount= (UINT8)NumberOfProcessors;
|
||||
SmbiosRecord-> EnabledCoreCount= (UINT8)NumberOfEnabledProcessors;
|
||||
SmbiosRecord-> ThreadCount= (UINT8)NumberOfEnabledProcessors;
|
||||
SmbiosRecord-> ProcessorCharacteristics = 0x2; // Unknown
|
||||
|
||||
//
|
||||
// Processor Cache Handle
|
||||
//
|
||||
GetCacheHandle( Smbios,1, &L1CacheHandle);
|
||||
GetCacheHandle( Smbios,2, &L2CacheHandle);
|
||||
GetCacheHandle( Smbios,3, &L3CacheHandle);
|
||||
|
||||
//
|
||||
// Updating Cache Handle Information
|
||||
//
|
||||
SmbiosRecord->L1CacheHandle = L1CacheHandle;
|
||||
SmbiosRecord->L2CacheHandle = L2CacheHandle;
|
||||
SmbiosRecord->L3CacheHandle = L3CacheHandle;
|
||||
|
||||
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
|
||||
UnicodeStrToAsciiStr(Socket, OptionalStrStart);
|
||||
UnicodeStrToAsciiStr(Manufacturer, OptionalStrStart + SocketStrLen + 1);
|
||||
UnicodeStrToAsciiStr(Version, OptionalStrStart + SocketStrLen + 1 + ManufacturerStrLen+ 1);
|
||||
UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + SocketStrLen + 1 + VersionStrLen + 1 + ManufacturerStrLen + 1);
|
||||
UnicodeStrToAsciiStr(AssetTag, OptionalStrStart + SerialNumberStrLen + 1 + VersionStrLen + 1 + ManufacturerStrLen + 1 + SocketStrLen + 1);
|
||||
UnicodeStrToAsciiStr(PartNumber, OptionalStrStart + SerialNumberStrLen + 1 + VersionStrLen + 1 + ManufacturerStrLen + 1 + SocketStrLen + 1 + AssetTagStrLen + 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,
|
48
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscResetCapabilitiesData.c
Normal file
48
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscResetCapabilitiesData.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscResetCapabilitiesData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of Reset Capabilities information.
|
||||
Reset Capabilities information is Misc. subclass type 17 and SMBIOS type 23.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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,0 +1,90 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscResetCapabilitiesFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
ResetCapabilities.
|
||||
SMBIOS type 23.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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);
|
||||
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(
|
193
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriver.h
Normal file
193
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriver.h
Normal file
@@ -0,0 +1,193 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSubclassDriver.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Header file for MiscSubclass Driver.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
#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 TOUCH_ACPI_ID "I2C05\\SFFFF\\400K"
|
||||
#define TOUCH_RESET_GPIO_MMIO 0xFED0C508
|
||||
#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 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 GopVersion;
|
||||
STRING_REF UCodeVersion;
|
||||
STRING_REF MRCVersion;
|
||||
STRING_REF SECVersion;
|
||||
STRING_REF ULPMCVersion;
|
||||
STRING_REF PMCVersion;
|
||||
STRING_REF PUnitVersion;
|
||||
STRING_REF SoCVersion;
|
||||
STRING_REF BoardVersion;
|
||||
STRING_REF FabVersion;
|
||||
STRING_REF CPUFlavor;
|
||||
STRING_REF BiosVersion;
|
||||
STRING_REF PmicVersion;
|
||||
STRING_REF TouchVersion;
|
||||
STRING_REF SecureBoot;
|
||||
STRING_REF BootMode;
|
||||
STRING_REF SpeedStepMode;
|
||||
STRING_REF CPUTurboMode;
|
||||
STRING_REF MaxCState;
|
||||
STRING_REF GfxTurbo;
|
||||
STRING_REF IdleReserve;
|
||||
STRING_REF RC6;
|
||||
}EFI_MISC_OEM_TYPE_0x94;
|
||||
|
||||
typedef struct {
|
||||
SMBIOS_STRUCTURE Hdr;
|
||||
SMBIOS_TABLE_STRING GopVersion;
|
||||
SMBIOS_TABLE_STRING uCodeVersion;
|
||||
SMBIOS_TABLE_STRING MRCVersion;
|
||||
SMBIOS_TABLE_STRING SECVersion;
|
||||
SMBIOS_TABLE_STRING ULPMCVersion;
|
||||
SMBIOS_TABLE_STRING PMCVersion;
|
||||
SMBIOS_TABLE_STRING PUnitVersion;
|
||||
SMBIOS_TABLE_STRING SoCVersion;
|
||||
SMBIOS_TABLE_STRING BoardVersion;
|
||||
SMBIOS_TABLE_STRING FabVersion;
|
||||
SMBIOS_TABLE_STRING CPUFlavor;
|
||||
SMBIOS_TABLE_STRING BiosVersion;
|
||||
SMBIOS_TABLE_STRING PmicVersion;
|
||||
SMBIOS_TABLE_STRING TouchVersion;
|
||||
SMBIOS_TABLE_STRING SecureBoot;
|
||||
SMBIOS_TABLE_STRING BootMode;
|
||||
SMBIOS_TABLE_STRING SpeedStepMode;
|
||||
SMBIOS_TABLE_STRING CPUTurboMode;
|
||||
SMBIOS_TABLE_STRING MaxCState;
|
||||
SMBIOS_TABLE_STRING GfxTurbo;
|
||||
SMBIOS_TABLE_STRING IdleReserve;
|
||||
SMBIOS_TABLE_STRING RC6;
|
||||
}SMBIOS_TABLE_TYPE94;
|
||||
|
||||
#pragma pack()
|
||||
//
|
||||
// Data Table Array
|
||||
//
|
||||
extern EFI_MISC_SMBIOS_DATA_TABLE mMiscSubclassDataTable[];
|
||||
|
||||
//
|
||||
// Data Table Array Entries
|
||||
//
|
||||
extern UINTN mMiscSubclassDataTableEntries;
|
||||
extern EFI_HII_HANDLE mHiiHandle;
|
||||
|
||||
//
|
||||
// Prototypes
|
||||
//
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
MiscSubclassDriverEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriver.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriver.uni
Normal file
Binary file not shown.
103
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverDataTable.c
Normal file
103
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverDataTable.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSubclassDriverDataTable.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Create the mMiscSubclassDataTable structure, and it is used to report
|
||||
any generate data to the DataHub.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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_CACHE_VARIABLE_RECORD, MiscProcessorCache, MiscProcessorCache); //type 7
|
||||
MISC_SMBIOS_TABLE_EXTERNS(EFI_CPU_DATA_RECORD, MiscProcessorInformation, MiscProcessorInformation); //type 4
|
||||
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(MiscProcessorCache, MiscProcessorCache), //type 7
|
||||
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscProcessorInformation, MiscProcessorInformation), //type 4
|
||||
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPhysicalMemoryArray, MiscPhysicalMemoryArray), //Type 16
|
||||
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscMemoryDevice, MiscMemoryDevice), //Type 17
|
||||
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(MiscOnboardDeviceAudio, MiscOnboardDevice),
|
||||
#endif
|
174
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c
Normal file
174
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c
Normal file
@@ -0,0 +1,174 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSubclassDriverEntryPoint.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This driver parses the mMiscSubclassDataTable structure and reports
|
||||
any generated data to the DataHub.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Protocol/HiiString.h>
|
||||
|
||||
EFI_HII_HANDLE mHiiHandle;
|
||||
EFI_HII_STRING_PROTOCOL *mHiiString;
|
||||
|
||||
|
||||
EFI_STRING
|
||||
EFIAPI
|
||||
SmbiosMiscGetString (
|
||||
IN EFI_STRING_ID StringId
|
||||
){
|
||||
|
||||
EFI_STATUS Status;
|
||||
UINTN StringSize;
|
||||
CHAR16 TempString;
|
||||
EFI_STRING String;
|
||||
String = NULL;
|
||||
|
||||
//
|
||||
// Retrieve the size of the string in the string package for the BestLanguage
|
||||
//
|
||||
StringSize = 0;
|
||||
Status = mHiiString->GetString (
|
||||
mHiiString,
|
||||
"en-US",
|
||||
mHiiHandle,
|
||||
StringId,
|
||||
&TempString,
|
||||
&StringSize,
|
||||
NULL
|
||||
);
|
||||
//
|
||||
// If GetString() returns EFI_SUCCESS for a zero size,
|
||||
// then there are no supported languages registered for HiiHandle. If GetString()
|
||||
// returns an error other than EFI_BUFFER_TOO_SMALL, then HiiHandle is not present
|
||||
// in the HII Database
|
||||
//
|
||||
if (Status != EFI_BUFFER_TOO_SMALL) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate a buffer for the return string
|
||||
//
|
||||
String = AllocateZeroPool (StringSize);
|
||||
if (String == NULL) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve the string from the string package
|
||||
//
|
||||
Status = mHiiString->GetString (
|
||||
mHiiString,
|
||||
"en-US",
|
||||
mHiiHandle,
|
||||
StringId,
|
||||
String,
|
||||
&StringSize,
|
||||
NULL
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Free the buffer and return NULL if the supported languages can not be retrieved.
|
||||
//
|
||||
FreePool (String);
|
||||
String = NULL;
|
||||
}
|
||||
Error:
|
||||
|
||||
return String;
|
||||
}
|
||||
|
||||
/**
|
||||
Standard EFI driver point. This driver parses the mMiscSubclassDataTable
|
||||
structure and reports any generated data to the DataHub.
|
||||
|
||||
@param ImageHandle - Handle for the image of this driver
|
||||
@param 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;
|
||||
|
||||
//
|
||||
// Retrieve the pointer to the UEFI HII String Protocol
|
||||
//
|
||||
EfiStatus = gBS->LocateProtocol (
|
||||
&gEfiHiiStringProtocolGuid,
|
||||
NULL,
|
||||
(VOID **) &mHiiString
|
||||
);
|
||||
ASSERT_EFI_ERROR (EfiStatus);
|
||||
|
||||
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);
|
||||
|
||||
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)) {
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemLanguageString.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemLanguageString.uni
Normal file
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemLanguageStringData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of System language string information.
|
||||
System language string information is Misc. subclass type 12 and SMBIOS type 13.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
|
||||
#include "MiscSubclassDriver.h"
|
@@ -0,0 +1,98 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscResetCapabilitiesFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
ResetCapabilities.
|
||||
SMBIOS type 23.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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(
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturer.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturer.uni
Normal file
Binary file not shown.
53
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerData.c
Normal file
53
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerData.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemManufacturerData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of System manufacturer information.
|
||||
System manufacturer information is Misc. subclass type 3 and SMBIOS type 1.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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
|
||||
//
|
||||
// Undefined GUID but can be programmed later.
|
||||
//0xFFFFFFFF, 0xFFFF, 0xFFFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
|
353
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
Normal file
353
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c
Normal file
@@ -0,0 +1,353 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemManufacturerFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
This driver parses the mMiscSubclassDataTable structure and reports
|
||||
any generated data.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#include "CommonHeader.h"
|
||||
#include "MiscSubclassDriver.h"
|
||||
#include <Protocol/DxeSmmReadyToLock.h>
|
||||
#include <Library/NetLib.h>
|
||||
#include "Library/DebugLib.h"
|
||||
#include <Uefi/UefiBaseType.h>
|
||||
|
||||
/**
|
||||
|
||||
Publish the smbios type 1.
|
||||
|
||||
@param Event Event whose notification function is being invoked (gEfiDxeSmmReadyToLockProtocolGuid).
|
||||
@param Context Pointer to the notification functions context, which is implementation dependent.
|
||||
|
||||
@retval None
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
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 *MacStr;
|
||||
EFI_HANDLE *Handles;
|
||||
UINTN BufferSize;
|
||||
|
||||
ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)Context;
|
||||
|
||||
//
|
||||
// First check for invalid parameters.
|
||||
//
|
||||
if (Context == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID *) &Smbios);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
|
||||
//
|
||||
// Silicon Steppings
|
||||
//
|
||||
switch (PchStepping()) {
|
||||
case PchA0:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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 PchA1:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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 PchB0:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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 PchB1:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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 PchB2:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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 PchB3:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX B3 PLATFORM");
|
||||
HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"B3");
|
||||
HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL);
|
||||
DEBUG ((EFI_D_ERROR, "B3 Stepping Detected\n"));
|
||||
break;
|
||||
case PchC0:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX 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;
|
||||
case PchD0:
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX D0 PLATFORM");
|
||||
HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL);
|
||||
UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"D0");
|
||||
HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL);
|
||||
DEBUG ((EFI_D_ERROR, "D0 Stepping Detected\n"));
|
||||
break;
|
||||
default:
|
||||
DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
|
||||
Manufacturer = SmbiosMiscGetString (TokenToGet);
|
||||
ManuStrLen = StrLen(Manufacturer);
|
||||
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
|
||||
ProductName = SmbiosMiscGetString (TokenToGet);
|
||||
PdNameStrLen = StrLen(ProductName);
|
||||
if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
|
||||
Version = SmbiosMiscGetString (TokenToGet);
|
||||
VerStrLen = StrLen(Version);
|
||||
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
//Get handle infomation
|
||||
//
|
||||
BufferSize = 0;
|
||||
Handles = NULL;
|
||||
Status = gBS->LocateHandle (
|
||||
ByProtocol,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Handles
|
||||
);
|
||||
|
||||
if (Status == EFI_BUFFER_TOO_SMALL) {
|
||||
Handles = AllocateZeroPool(BufferSize);
|
||||
if (Handles == NULL) {
|
||||
return (EFI_OUT_OF_RESOURCES);
|
||||
}
|
||||
Status = gBS->LocateHandle(
|
||||
ByProtocol,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
NULL,
|
||||
&BufferSize,
|
||||
Handles
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
//Get the MAC string
|
||||
//
|
||||
Status = NetLibGetMacString (
|
||||
*Handles,
|
||||
NULL,
|
||||
&MacStr
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
SerialNumber = MacStr;
|
||||
SerialNumStrLen = StrLen(SerialNumber);
|
||||
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER);
|
||||
SkuNumber = SmbiosMiscGetString (TokenToGet);
|
||||
SkuNumberStrLen = StrLen(SkuNumber);
|
||||
if (SkuNumberStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_FAMILY_NAME1);
|
||||
FamilyName = SmbiosMiscGetString (TokenToGet);
|
||||
FamilyNameStrLen = StrLen(FamilyName);
|
||||
if (FamilyNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
//
|
||||
// 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);
|
||||
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 Status;
|
||||
}
|
||||
|
||||
/**
|
||||
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,
|
||||
(EFI_EVENT_NOTIFY)AddSmbiosManuCallback,
|
||||
RecordData,
|
||||
&AddSmbiosManuCallbackEvent
|
||||
);
|
||||
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
|
||||
}
|
||||
|
||||
Status = gBS->RegisterProtocolNotify (
|
||||
&gEfiDxeSmmReadyToLockProtocolGuid,
|
||||
AddSmbiosManuCallbackEvent,
|
||||
&AddSmbiosManuCallbackNotifyReg
|
||||
);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
}
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemOptionString.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemOptionString.uni
Normal file
Binary file not shown.
36
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemOptionStringData.c
Normal file
36
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemOptionStringData.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemOptionStringData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of System option string.
|
||||
System option string is Miscellaneous subclass type: 10 and SMBIOS type: 13.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
@@ -0,0 +1,98 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemOptionStringFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS system option string boot time changes.
|
||||
SMBIOS type 12.
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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(
|
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemSlotDesignation.uni
Normal file
BIN
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemSlotDesignation.uni
Normal file
Binary file not shown.
251
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemSlotDesignationData.c
Normal file
251
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemSlotDesignationData.c
Normal file
@@ -0,0 +1,251 @@
|
||||
/** @file
|
||||
|
||||
Copyright (c) 2004 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemSlotDesignationData.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Static data of System Slot Designation.
|
||||
System Slot Designation is Misc. subclass type 7 and SMBIOS type 9.
|
||||
|
||||
|
||||
**/
|
||||
|
||||
|
||||
#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,0 +1,132 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2009 - 2014, 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 that accompanies this distribution.
|
||||
|
||||
The full text of the license may be found at
|
||||
|
||||
http://opensource.org/licenses/bsd-license.php.
|
||||
|
||||
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Module Name:
|
||||
|
||||
MiscSystemSlotDesignatorFunction.c
|
||||
|
||||
Abstract:
|
||||
|
||||
BIOS system slot designator information boot time changes.
|
||||
SMBIOS type 9.
|
||||
|
||||
--*/
|
||||
|
||||
#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 = SmbiosMiscGetString (TokenToGet);
|
||||
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);
|
||||
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;
|
144
Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf
Normal file
144
Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf
Normal file
@@ -0,0 +1,144 @@
|
||||
## @file
|
||||
# Component name for module MiscSubclass
|
||||
#
|
||||
# FIX ME!
|
||||
# Copyright (c) 2006 - 2014, 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 that 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
|
||||
MiscProcessorInformation.uni
|
||||
MiscProcessorInformationData.c
|
||||
MiscProcessorInformationFunction.c
|
||||
MiscProcessorCache.uni
|
||||
MiscProcessorCacheData.c
|
||||
MiscProcessorCacheFunction.c
|
||||
MiscPhysicalArray.uni
|
||||
MiscPhysicalArrayData.c
|
||||
MiscPhysicalArrayFunction.c
|
||||
MiscMemoryDevice.uni
|
||||
MiscMemoryDeviceData.c
|
||||
MiscMemoryDeviceFunction.c
|
||||
|
||||
[Packages]
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
Vlv2TbltDevicePkg/PlatformPkg.dec
|
||||
MdePkg/MdePkg.dec
|
||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||
Vlv2DeviceRefCodePkg/Vlv2DeviceRefCodePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
HiiLib
|
||||
DevicePathLib
|
||||
UefiBootServicesTableLib
|
||||
UefiRuntimeServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
BaseMemoryLib
|
||||
DebugLib
|
||||
BaseLib
|
||||
MemoryAllocationLib
|
||||
PcdLib
|
||||
UefiLib
|
||||
BiosIdLib
|
||||
PrintLib
|
||||
CpuIA32Lib
|
||||
PchPlatformLib
|
||||
I2cLib
|
||||
NetLib
|
||||
|
||||
[Guids]
|
||||
gEfiProcessorSubClassGuid
|
||||
gEfiCacheSubClassGuid
|
||||
gEfiNormalSetupGuid
|
||||
gEfiPlatformInfoGuid
|
||||
gEfiVlv2VariableGuid
|
||||
|
||||
[Protocols]
|
||||
gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiDxeSmmReadyToLockProtocolGuid # PROTOCOL ALWAYS_CONSUMED
|
||||
gEfiDataHubProtocolGuid
|
||||
gEfiMpServiceProtocolGuid
|
||||
gMemInfoProtocolGuid
|
||||
gEfiTdtOperationProtocolGuid
|
||||
gDxePchPlatformPolicyProtocolGuid
|
||||
gEfiSpiProtocolGuid
|
||||
gEfiSimpleNetworkProtocolGuid
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
|
||||
gEfiVLVTokenSpaceGuid.PcdEmmcManufacturerId
|
||||
gEfiVLVTokenSpaceGuid.PcdProductSerialNumber
|
||||
|
||||
[Depex]
|
||||
gEfiSmbiosProtocolGuid AND gMemInfoProtocolGuid AND gEfiMpServiceProtocolGuid AND gEfiSimpleNetworkProtocolGuid
|
Reference in New Issue
Block a user