QuarkPlatformPkg: Add new package for Galileo boards

Changes for V4
==============
1) Move delete of QuarkSocPkg\QuarkNorthCluster\Binary\QuarkMicrocode
   from QuarkPlatformPkg commit to QuarkSocPkg commit
2) Fix incorrect license header in PlatformSecLibModStrs.uni

Changes for V3
==============
1) Set PcdResetOnMemoryTypeInformationChange FALSE in QuarkMin.dsc
   This is required because QuarkMin.dsc uses the emulated variable
   driver that does not preserve any non-volatile UEFI variables
   across reset.  If the condition is met where the memory type
   information variable needs to be updated, then the system will reset
   every time the UEFI Shell is run.  By setting this PCD to FALSE,
   then reset action is disabled.
2) Move one binary file to QuarkSocBinPkg
3) Change RMU.bin FILE statements to INF statement in DSC FD region
   to be compatible with PACKAGES_PATH search for QuarkSocBinPkg

Changes for V2
==============
1) Use new generic PCI serial driver PciSioSerialDxe in MdeModulePkg
2) Configure PcdPciSerialParameters for PCI serial driver for Quark
3) Use new MtrrLib API to reduce time to set MTRRs for all DRAM
4) Convert all UNI files to utf-8
5) Replace tabs with spaces and remove trailing spaces
6) Add License.txt

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19287 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Michael Kinney
2015-12-15 19:23:57 +00:00
committed by mdkinney
parent 9b6bbcdbfd
commit b303605e1b
190 changed files with 39436 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/** @file
Common header file shared by all source files.
This file includes package header files, library classes and protocol, PPI & GUID definitions.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef __COMMON_HEADER_H_
#define __COMMON_HEADER_H_
#include <FrameworkDxe.h>
#include <IndustryStandard/SmBios.h>
#include <Protocol/Smbios.h>
#include <Guid/MdeModuleHii.h>
#include <Guid/DataHubRecords.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/HiiLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiLib.h>
extern EFI_HII_HANDLE gHiiHandle;
#endif

View File

@@ -0,0 +1,25 @@
// /** @file
// System Manufacturer Information
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_BASE_BOARD_MANUFACTURER #language en-US "Intel Corp."
#string STR_MISC_BASE_BOARD_PRODUCT_NAME #language en-US "QUARK"
#string STR_MISC_BASE_BOARD_VERSION #language en-US "FAB-D"
#string STR_MISC_BASE_BOARD_SERIAL_NUMBER #language en-US "XXXXXXXXXXXX"
#string STR_MISC_BASE_BOARD_ASSET_TAG #language en-US "Base Board Asset Tag"
#string STR_MISC_BASE_BOARD_CHASSIS_LOCATION #language en-US "Part Component"

View File

@@ -0,0 +1,51 @@
/** @file
Type 2: Base Board Information.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_BASE_BOARD_MANUFACTURER_DATA, MiscBaseBoardManufacturer)
= {
STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER),
STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME),
STRING_TOKEN(STR_MISC_BASE_BOARD_VERSION),
STRING_TOKEN(STR_MISC_BASE_BOARD_SERIAL_NUMBER),
STRING_TOKEN(STR_MISC_BASE_BOARD_ASSET_TAG),
STRING_TOKEN(STR_MISC_BASE_BOARD_CHASSIS_LOCATION),
{ // BaseBoardFeatureFlags
1, // Motherboard
0, // RequiresDaughterCard
0, // Removable
1, // Replaceable,
0, // HotSwappable
0, // Reserved
},
EfiBaseBoardTypeUnknown, // BaseBoardType
{ // BaseBoardChassisLink
EFI_MISC_SUBCLASS_GUID, // ProducerName
1, // Instance
1, // SubInstance
},
0, // BaseBoardNumberLinks
{ // LinkN
EFI_MISC_SUBCLASS_GUID, // ProducerName
1, // Instance
1, // SubInstance
},
};

View File

@@ -0,0 +1,187 @@
/** @file
Base Board Information boot time changes.
Misc. subclass type 4.
SMBIOS type 2.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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;
STRING_REF TokenToUpdate;
EFI_SMBIOS_HANDLE SmbiosHandle;
SMBIOS_TABLE_TYPE2 *SmbiosRecord;
EFI_MISC_BASE_BOARD_MANUFACTURER *ForType2InputData;
UINTN TypeStringSize;
CHAR16 TypeString[SMBIOS_STRING_MAX_LENGTH];
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 = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
ManuStrLen = StrLen(Manufacturer);
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
StrCpy (TypeString, L"");
TypeStringSize = PcdGetSize (PcdPlatformTypeName);
if (TypeStringSize > 0 && TypeStringSize <= sizeof (TypeString)) {
CopyMem (TypeString, PcdGetPtr (PcdPlatformTypeName), TypeStringSize);
}
if (StrLen (TypeString) == 0) {
StrCpy (TypeString, L"Unknown");
}
TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
HiiSetString (mHiiHandle, TokenToUpdate, TypeString, NULL);
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME);
Product = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
ProductStrLen = StrLen(TypeString);
if (ProductStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION);
Version = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
VerStrLen = StrLen(Version);
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_SERIAL_NUMBER);
SerialNumber = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
SerialNumStrLen = StrLen(SerialNumber);
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_ASSET_TAG);
AssertTag = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
AssertTagStrLen = StrLen(AssertTag);
if (AssertTagStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_CHASSIS_LOCATION);
Chassis = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
ChassisStrLen = StrLen(Chassis);
if (ChassisStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE3) + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen +1 + 1);
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE3) + 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
//
//OptionalStrStart -= 2;
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;
}

View File

@@ -0,0 +1,24 @@
// /** @file
// BIOS vendor information.
// Misc. subclass type 2.
// SMBIOS type 0.
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_BIOS_VENDOR #language en-US "Intel Corp."
#string STR_MISC_BIOS_VERSION #language en-US "BIOS Version"
#string STR_MISC_BIOS_RELEASE_DATE #language en-US "11/03/2015"

View File

@@ -0,0 +1,98 @@
/** @file
BIOS vendor information static data.
Misc. subclass type 2.
SMBIOS type 0.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_BIOS_VENDOR, MiscBiosVendor) = {
STRING_TOKEN (STR_MISC_BIOS_VENDOR), // BiosVendor
STRING_TOKEN (STR_MISC_BIOS_VERSION), // BiosVersion
STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE), // BiosReleaseDate
0xE0000, // BiosStartingAddress
{ // BiosPhysicalDeviceSize
2, // Value
20, // 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
1, // PrintScreenIsSupported :1
1, // Keyboard8042IsSupported :1
1, // SerialIsSupported :1
1, // PrinterIsSupported :1
1, // CgaMonoIsSupported :1
0, // NecPc98 :1
1, // AcpiIsSupported :1
1, // UsbLegacyIsSupported :1
0, // AgpIsSupported :1
0, // I20BootIsSupported :1
0, // Ls120BootIsSupported :1
0, // AtapiZipDriveBootIsSupported :1
0, // Boot1394IsSupported :1
0, // SmartBatteryIsSupported :1
1, // BiosBootSpecIsSupported :1
1, // FunctionKeyNetworkBootIsSupported :1
0 // Reserved :22
},
{ // BiosCharacteristics2
0, // BiosReserved :16
0, // SystemReserved :16
0 // Reserved :32
},
0x1, // System BIOS Major Release
0x0, // System BIOS Minor Release
0xFF, // Embedded controller firmware major Release
0xFF, // Embedded controller firmware minor Release
};

View File

@@ -0,0 +1,228 @@
/** @file
BIOS vendor information boot time changes.
Misc. subclass type 2.
SMBIOS type 0.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
/**
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;
UINTN BiosPhysicalSizeHexValue;
UINTN BiosPhysicalSizeExponent;
CHAR16 Version[SMBIOS_STRING_MAX_LENGTH];
CHAR16 Vendor[SMBIOS_STRING_MAX_LENGTH];
CHAR16 ReleaseDate[SMBIOS_STRING_MAX_LENGTH];
EFI_STRING VersionPtr;
EFI_STRING VendorPtr;
EFI_STRING ReleaseDatePtr;
EFI_STATUS Status;
STRING_REF TokenToGet;
STRING_REF TokenToUpdate;
SMBIOS_TABLE_TYPE0 *SmbiosRecord;
EFI_SMBIOS_HANDLE SmbiosHandle;
EFI_MISC_BIOS_VENDOR *ForType0InputData;
BiosPhysicalSizeHexValue = 0x0;
BiosPhysicalSizeExponent = 0x0;
ForType0InputData = (EFI_MISC_BIOS_VENDOR *)RecordData;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Now update the BiosPhysicalSize
//
BiosPhysicalSizeHexValue = PcdGet32 (PcdFlashAreaSize);
Status= GetValueExponentBase2 (
&BiosPhysicalSizeHexValue,
&BiosPhysicalSizeExponent
);
if(Status == EFI_SUCCESS){
ForType0InputData->BiosPhysicalDeviceSize.Value = (UINT16)BiosPhysicalSizeHexValue;
ForType0InputData->BiosPhysicalDeviceSize.Exponent = (UINT16)BiosPhysicalSizeExponent;
}
//
// Update strings from PCD
//
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosVendor), Vendor);
if (StrLen (Vendor) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VENDOR);
HiiSetString (mHiiHandle, TokenToUpdate, Vendor, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VENDOR);
VendorPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
VendorStrLen = StrLen(VendorPtr);
if (VendorStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
UnicodeSPrint (Version, sizeof (Version), L"0x%08x", PcdGet32 (PcdFirmwareRevision));
if (StrLen (Version) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION);
HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_BIOS_VERSION);
VersionPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
VerStrLen = StrLen(VersionPtr);
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr (PcdSMBIOSBiosReleaseDate), ReleaseDate);
if (StrLen (ReleaseDate) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
HiiSetString (mHiiHandle, TokenToUpdate, ReleaseDate, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_BIOS_RELEASE_DATE);
ReleaseDatePtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
DateStrLen = StrLen(ReleaseDatePtr);
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 = PcdGet16 (PcdSMBIOSBiosStartAddress);
//
// ReleaseDate will be the 3rd optional string following the formatted structure.
//
SmbiosRecord->BiosReleaseDate = 3;
SmbiosRecord->BiosSize = (UINT8)(Base2ToByteWith64KUnit(&ForType0InputData->BiosPhysicalDeviceSize) - 1);
*(UINT64 *)&SmbiosRecord->BiosCharacteristics = PcdGet64 (PcdSMBIOSBiosChar);
//
// CharacterExtensionBytes also store in ForType0InputData->BiosCharacteristics1 later two bytes to save size.
//
SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = PcdGet8 (PcdSMBIOSBiosCharEx1);
SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = PcdGet8 (PcdSMBIOSBiosCharEx2);
SmbiosRecord->SystemBiosMajorRelease = ForType0InputData->BiosMajorRelease;
SmbiosRecord->SystemBiosMinorRelease = ForType0InputData->BiosMinorRelease;
SmbiosRecord->EmbeddedControllerFirmwareMajorRelease = ForType0InputData->BiosEmbeddedFirmwareMajorRelease;
SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = ForType0InputData->BiosEmbeddedFirmwareMinorRelease;
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(VendorPtr, OptionalStrStart);
UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + VendorStrLen + 1);
UnicodeStrToAsciiStr(ReleaseDatePtr, OptionalStrStart + VendorStrLen + 1 + VerStrLen + 1);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,30 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to the DataHub.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data. SMBIOS TYPE 32
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_BOOT_INFORMATION_STATUS, MiscBootInfoStatus) = {
EfiBootInformationStatusNoError, // BootInformationStatus
{0} // BootInformationData
};

View File

@@ -0,0 +1,77 @@
/** @file
boot information boot time changes.
SMBIOS type 32.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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(MiscBootInfoStatus)
{
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;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,23 @@
// /** @file
// Miscellaneous chassis manufacturer information
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_CHASSIS_MANUFACTURER #language en-US "Chassis Manufacturer"
#string STR_MISC_CHASSIS_VERSION #language en-US "Chassis Version"
#string STR_MISC_CHASSIS_SERIAL_NUMBER #language en-US "Chassis Serial Number"
#string STR_MISC_CHASSIS_ASSET_TAG #language en-US "Chassis Asset Tag"

View File

@@ -0,0 +1,42 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to the DataHub.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Chassis Manufacturer data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_CHASSIS_MANUFACTURER, 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
EfiMiscChassisTypeDeskTop, // ChassisType
0, // ChassisLockPresent
0 // Reserved
},
EfiChassisStateSafe, // ChassisBootupState
EfiChassisStateSafe, // ChassisPowerSupplyState
EfiChassisStateOther, // ChassisThermalState
EfiChassisSecurityStatusOther, // ChassisSecurityState
0 // ChassisOemDefined
};

View File

@@ -0,0 +1,174 @@
/** @file
Chassis manufacturer information boot time changes.
SMBIOS type 3.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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;
CHAR16 Manufacturer[SMBIOS_STRING_MAX_LENGTH];
CHAR16 Version[SMBIOS_STRING_MAX_LENGTH];
CHAR16 SerialNumber[SMBIOS_STRING_MAX_LENGTH];
CHAR16 AssertTag[SMBIOS_STRING_MAX_LENGTH];
EFI_STRING ManufacturerPtr;
EFI_STRING VersionPtr;
EFI_STRING SerialNumberPtr;
EFI_STRING AssertTagPtr;
STRING_REF TokenToGet;
STRING_REF TokenToUpdate;
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;
}
//
// Update strings from PCD
//
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisManufacturer), Manufacturer);
if (StrLen (Manufacturer) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);
HiiSetString (mHiiHandle, TokenToUpdate, Manufacturer, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);
ManufacturerPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
ManuStrLen = StrLen(ManufacturerPtr);
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisVersion), Version);
if (StrLen (Version) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);
HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_VERSION);
VersionPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
VerStrLen = StrLen(VersionPtr);
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisSerialNumber), SerialNumber);
if (StrLen (SerialNumber) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);
HiiSetString (mHiiHandle, TokenToUpdate, SerialNumber, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_SERIAL_NUMBER);
SerialNumberPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
SerialNumStrLen = StrLen(SerialNumberPtr);
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSChassisAssetTag), AssertTag);
if (StrLen (AssertTag) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);
HiiSetString (mHiiHandle, TokenToUpdate, AssertTag, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_ASSET_TAG);
AssertTagPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
AssertTagStrLen = StrLen(AssertTagPtr);
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 = PcdGet8 (PcdSMBIOSChassisType);
//
// 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 = PcdGet8 (PcdSMBIOSChassisBootupState);
SmbiosRecord->PowerSupplyState = PcdGet8 (PcdSMBIOSChassisPowerSupplyState);
SmbiosRecord->ThermalState = (UINT8)ForType3InputData->ChassisThermalState;
SmbiosRecord->SecurityStatus = PcdGet8 (PcdSMBIOSChassisSecurityState);
*(UINT32 *)&SmbiosRecord->OemDefined = PcdGet32 (PcdSMBIOSChassisOemDefined);
SmbiosRecord->Height = PcdGet8 (PcdSMBIOSChassisHeight);
SmbiosRecord->NumberofPowerCords = PcdGet8 (PcdSMBIOSChassisNumberPowerCords);
SmbiosRecord->ContainedElementCount = PcdGet8 (PcdSMBIOSChassisElementCount);
SmbiosRecord->ContainedElementRecordLength = PcdGet8 (PcdSMBIOSChassisElementRecordLength);
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(ManufacturerPtr, OptionalStrStart);
UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + ManuStrLen + 1);
UnicodeStrToAsciiStr(SerialNumberPtr, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1);
UnicodeStrToAsciiStr(AssertTagPtr, OptionalStrStart + ManuStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,48 @@
/** @file
Misc class required EFI Device Path definitions (Ports, slots &
onboard devices)
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _MISC_DEVICE_PATH_H
#define _MISC_DEVICE_PATH_H
#pragma pack(1)
//USB
/* For reference:
#define USB1_1_STR "ACPI(PNP0A03,0)/PCI(1D,0)."
#define USB1_2_STR "ACPI(PNP0A03,0)/PCI(1D,1)."
#define USB1_3_STR "ACPI(PNP0A03,0)/PCI(1D,2)."
#define USB2_1_STR "ACPI(PNP0A03,0)/PCI(1D,7)."
*/
#define DP_ACPI { ACPI_DEVICE_PATH,\
ACPI_DP, (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),\
(UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8), EISA_PNP_ID(0x0A03), 0 }
#define DP_PCI( device,function) { HARDWARE_DEVICE_PATH,\
HW_PCI_DP, (UINT8) (sizeof (PCI_DEVICE_PATH)),\
(UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8), function, device }
#define DP_END { END_DEVICE_PATH_TYPE, \
END_ENTIRE_DEVICE_PATH_SUBTYPE, {END_DEVICE_PATH_LENGTH, 0 }}
#define DP_LPC(eisaid,function ){ ACPI_DEVICE_PATH, \
ACPI_DP,(UINT8) (sizeof (ACPI_HID_DEVICE_PATH)),\
(UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8),EISA_PNP_ID(eisaid), function }
#pragma pack()
#endif

View File

@@ -0,0 +1,34 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data to SMBIOS.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES, NumberOfInstallableLanguages) = {
2, // NumberOfInstallableLanguages
{ // LanguageFlags
0, // AbbreviatedLanguageFormat
0 // Reserved
},
1, // CurrentLanguageNumber
};

View File

@@ -0,0 +1,248 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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.
--*/
BOOLEAN
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;
BOOLEAN LangMatch;
Languages = HiiGetSupportedLanguages (HiiHandle);
if (Languages == NULL) {
return FALSE;
}
LangMatch = FALSE;
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.
//
LangMatch = TRUE;
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 LangMatch;
}
/**
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;
BOOLEAN LangMatch;
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
//
LangMatch = FALSE;
ZeroMem(CurrentLang, SMBIOS_STRING_MAX_LENGTH + 1);
LangMatch = 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;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,18 @@
// /** @file
// Unicode string used for SMBIOS type 11 record (OEM string)
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// **/
/=#
#string STR_MISC_OEM_EN_US #language en-US "Intel SSG"

View File

@@ -0,0 +1,26 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to smbios.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) OEM String data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_OEM_STRING, MiscOemString)
= { {STRING_TOKEN(STR_MISC_OEM_EN_US) }};

View File

@@ -0,0 +1,87 @@
/** @file
boot information boot time changes.
SMBIOS type 11.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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(MiscOemString)
{
UINTN OemStrLen;
CHAR8 *OptionalStrStart;
EFI_STATUS Status;
EFI_STRING OemStr;
STRING_REF TokenToGet;
EFI_SMBIOS_HANDLE SmbiosHandle;
SMBIOS_TABLE_TYPE11 *SmbiosRecord;
EFI_MISC_OEM_STRING *ForType11InputData;
ForType11InputData = (EFI_MISC_OEM_STRING *)RecordData;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
TokenToGet = STRING_TOKEN (STR_MISC_OEM_EN_US);
OemStr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
OemStrLen = StrLen(OemStr);
if (OemStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE11) + OemStrLen + 1 + 1);
SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_OEM_STRINGS;
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE11);
//
// Make handle chosen by smbios protocol.add automatically.
//
SmbiosRecord->Hdr.Handle = 0;
SmbiosRecord->StringCount = 1;
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(OemStr, OptionalStrStart);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,24 @@
// /** @file
// Miscellaneous Onboard Device
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// MiscOnboardDevice.Vfr
//
// **/
/=#
#string STR_MISC_ONBOARD_DEVICE_VIDEO #language en-US "Intel(R) Extreme Graphics 3 Controller"
#string STR_MISC_ONBOARD_DEVICE_NETWORK #language en-US "Gigabit Ethernet"
#string STR_MISC_ONBOARD_DEVICE_AUDIO #language en-US "Intel(R) High Definition Audio Device"

View File

@@ -0,0 +1,55 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to smbios.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_ONBOARD_DEVICE, 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, MiscOnboardDeviceNetwork) = {
STRING_TOKEN(STR_MISC_ONBOARD_DEVICE_NETWORK), // OnBoardDeviceDescription
{ // OnBoardDeviceStatus
EfiOnBoardDeviceTypeEthernet, // DeviceType
1, // DeviceEnabled
0 // Reserved
},
{0} // OnBoardDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_ONBOARD_DEVICE, MiscOnboardDeviceAudio) = {
STRING_TOKEN(STR_MISC_ONBOARD_DEVICE_AUDIO), // OnBoardDeviceDescription
{ // OnBoardDeviceStatus
EfiOnBoardDeviceTypeSound, // DeviceType
1, // DeviceEnabled
0 // Reserved
},
DP_END // OnBoardDevicePath
};

View File

@@ -0,0 +1,111 @@
/** @file
Onboard device information boot time changes.
SMBIOS type 10.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
/**
This function makes boot time changes to the contents of the
MiscOnboardDevice (Type 10).
@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(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;
}
DeviceDescription = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
DescriptionStrLen = StrLen(DeviceDescription);
if (DescriptionStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE10) + DescriptionStrLen + 1 + 1);
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE10) + DescriptionStrLen + 1 + 1);
SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION;
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE10);
//
// Make handle chosen by smbios protocol.add automatically.
//
SmbiosRecord->Hdr.Handle = 0;
//
// Status & Type: Bit 7 Devicen Status, Bits 6:0 Type of Device
//
StatusAndType = (UINT8) ForType10InputData->OnBoardDeviceStatus.DeviceType;
if (ForType10InputData->OnBoardDeviceStatus.DeviceEnabled != 0) {
StatusAndType |= 0x80;
} else {
StatusAndType &= 0x7F;
}
SmbiosRecord->Device[0].DeviceType = StatusAndType;
SmbiosRecord->Device[0].DescriptionString = 1;
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(DeviceDescription, OptionalStrStart);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,59 @@
// /** @file
// Miscellaneous Port Internal Connector Information
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_PORT1_INTERNAL_DESIGN #language en-US "P1ICD"
#string STR_MISC_PORT1_EXTERNAL_DESIGN #language en-US "P1ECD"
#string STR_MISC_PORT2_INTERNAL_DESIGN #language en-US "P2ICD"
#string STR_MISC_PORT2_EXTERNAL_DESIGN #language en-US "P2ECD"
#string STR_MISC_PORT3_INTERNAL_DESIGN #language en-US "P3ICD"
#string STR_MISC_PORT3_EXTERNAL_DESIGN #language en-US "P3ECD"
#string STR_MISC_PORT4_INTERNAL_DESIGN #language en-US "P4ICD"
#string STR_MISC_PORT4_EXTERNAL_DESIGN #language en-US "P4ECD"
#string STR_MISC_PORT5_INTERNAL_DESIGN #language en-US "P5ICD"
#string STR_MISC_PORT5_EXTERNAL_DESIGN #language en-US "P5ECD"
#string STR_MISC_PORT6_INTERNAL_DESIGN #language en-US "P6ICD"
#string STR_MISC_PORT6_EXTERNAL_DESIGN #language en-US "P6ECD"
#string STR_MISC_PORT7_INTERNAL_DESIGN #language en-US "P7ICD"
#string STR_MISC_PORT7_EXTERNAL_DESIGN #language en-US "P7ECD"
#string STR_MISC_PORT8_INTERNAL_DESIGN #language en-US "P8ICD"
#string STR_MISC_PORT8_EXTERNAL_DESIGN #language en-US "P8ECD"
#string STR_MISC_PORT9_INTERNAL_DESIGN #language en-US "P9ICD"
#string STR_MISC_PORT9_EXTERNAL_DESIGN #language en-US "P9ECD"
#string STR_MISC_PORT10_INTERNAL_DESIGN #language en-US "P10ICD"
#string STR_MISC_PORT10_EXTERNAL_DESIGN #language en-US "P10ECD"
#string STR_MISC_PORT11_INTERNAL_DESIGN #language en-US "P11ICD"
#string STR_MISC_PORT11_EXTERNAL_DESIGN #language en-US "P11ECD"
#string STR_MISC_PORT12_INTERNAL_DESIGN #language en-US "P12ICD"
#string STR_MISC_PORT12_EXTERNAL_DESIGN #language en-US "P12ECD"
#string STR_MISC_PORT13_INTERNAL_DESIGN #language en-US "P13ICD"
#string STR_MISC_PORT13_EXTERNAL_DESIGN #language en-US "P13ECD"
#string STR_MISC_PORT14_INTERNAL_DESIGN #language en-US "P14ICD"
#string STR_MISC_PORT14_EXTERNAL_DESIGN #language en-US "P14ECD"
#string STR_MISC_PORT15_INTERNAL_DESIGN #language en-US "P15ICD"
#string STR_MISC_PORT15_EXTERNAL_DESIGN #language en-US "P15ECD"
#string STR_MISC_PORT16_INTERNAL_DESIGN #language en-US "P16ICD"
#string STR_MISC_PORT16_EXTERNAL_DESIGN #language en-US "P16ECD"
#string STR_MISC_PORT17_INTERNAL_DESIGN #language en-US "P17ICD"
#string STR_MISC_PORT17_EXTERNAL_DESIGN #language en-US "P17ECD"
#string STR_MISC_PORT18_INTERNAL_DESIGN #language en-US "P18ICD"
#string STR_MISC_PORT18_EXTERNAL_DESIGN #language en-US "P18ECD"
#string STR_MISC_PORT19_INTERNAL_DESIGN #language en-US "P19ICD"
#string STR_MISC_PORT19_EXTERNAL_DESIGN #language en-US "P19ECD"
#string STR_MISC_PORT20_INTERNAL_DESIGN #language en-US "P20ICD"
#string STR_MISC_PORT20_EXTERNAL_DESIGN #language en-US "P20ECD"
#string STR_MISC_PORT21_INTERNAL_DESIGN #language en-US "P21ICD"
#string STR_MISC_PORT21_EXTERNAL_DESIGN #language en-US "P21ECD"

View File

@@ -0,0 +1,190 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data to the DataHub.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector1) = {
STRING_TOKEN (STR_MISC_PORT1_INTERNAL_DESIGN), // PortInternalConnectorDesignator
STRING_TOKEN (STR_MISC_PORT1_EXTERNAL_DESIGN), // PortExternalConnectorDesignator
EfiPortConnectorTypeNone, // PortInternalConnectorType
EfiPortConnectorTypePS2, // PortExternalConnectorType
EfiPortTypeKeyboard, // PortType
//mPs2KbyboardDevicePath // PortPath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector2) = {
STRING_TOKEN (STR_MISC_PORT2_INTERNAL_DESIGN), // PortInternalConnectorDesignator
STRING_TOKEN (STR_MISC_PORT2_EXTERNAL_DESIGN), // PortExternalConnectorDesignator
EfiPortConnectorTypeNone, // PortInternalConnectorType
EfiPortConnectorTypePS2, // PortExternalConnectorType
EfiPortTypeMouse, // PortType
//mPs2MouseDevicePath // PortPath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector3) = {
STRING_TOKEN (STR_MISC_PORT3_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT3_EXTERNAL_DESIGN),
EfiPortConnectorTypeOther,
EfiPortConnectorTypeNone,
EfiPortTypeSerial16550ACompatible,
//mCom1DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector4) = {
STRING_TOKEN (STR_MISC_PORT4_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT4_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeRJ45,
EfiPortTypeSerial16550ACompatible,
//mCom2DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector5) = {
STRING_TOKEN (STR_MISC_PORT5_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT5_EXTERNAL_DESIGN),
EfiPortConnectorTypeOther,
EfiPortConnectorTypeNone,
EfiPortTypeSerial16550ACompatible,
//mCom3DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector6) = {
STRING_TOKEN (STR_MISC_PORT6_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT6_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeRJ45,
EfiPortTypeSerial16550ACompatible,
//mCom3DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector7) = {
STRING_TOKEN (STR_MISC_PORT7_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT7_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeDB25Male,
EfiPortTypeParallelPortEcpEpp,
//mLpt1DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector8) = {
STRING_TOKEN (STR_MISC_PORT8_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT8_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeUsb,
EfiPortTypeUsb,
//mUsb0DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector9) = {
STRING_TOKEN (STR_MISC_PORT9_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT9_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeUsb,
EfiPortTypeUsb,
//mUsb1DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector10) = {
STRING_TOKEN (STR_MISC_PORT10_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT10_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeUsb,
EfiPortTypeUsb,
//mUsb2DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector11) = {
STRING_TOKEN (STR_MISC_PORT11_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT11_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeUsb,
EfiPortTypeUsb,
//mUsb3DevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector12) = {
STRING_TOKEN (STR_MISC_PORT12_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT12_EXTERNAL_DESIGN),
EfiPortConnectorTypeNone,
EfiPortConnectorTypeRJ45,
EfiPortTypeNetworkPort,
//mGbNicDevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector13) = {
STRING_TOKEN (STR_MISC_PORT13_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT13_EXTERNAL_DESIGN),
EfiPortConnectorTypeOnboardFloppy,
EfiPortConnectorTypeNone,
EfiPortTypeOther,
//mFloopyADevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector14) = {
STRING_TOKEN (STR_MISC_PORT14_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT14_EXTERNAL_DESIGN),
EfiPortConnectorTypeOnboardIde,
EfiPortConnectorTypeNone,
EfiPortTypeOther,
//mIdeDevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector15) = {
STRING_TOKEN (STR_MISC_PORT15_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT15_EXTERNAL_DESIGN),
EfiPortConnectorTypeOnboardIde,
EfiPortConnectorTypeNone,
EfiPortTypeOther,
//mSataDevicePath
{{{{0}}}}
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector16) = {
STRING_TOKEN (STR_MISC_PORT16_INTERNAL_DESIGN),
STRING_TOKEN (STR_MISC_PORT16_EXTERNAL_DESIGN),
EfiPortConnectorTypeOnboardIde,
EfiPortConnectorTypeNone,
EfiPortTypeOther,
//mSataDevicePath
{{{{0}}}}
};

View File

@@ -0,0 +1,298 @@
/** @file
Port internal connector designator information boot time changes.
SMBIOS type 8.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//STATIC PS2_CONN_DEVICE_PATH mPs2KeyboardDevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0303,0 ), DP_END };
//STATIC PS2_CONN_DEVICE_PATH mPs2MouseDevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0303,1 ), DP_END };
//STATIC SERIAL_CONN_DEVICE_PATH mCom1DevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0501,0 ), DP_END };
//STATIC SERIAL_CONN_DEVICE_PATH mCom2DevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0501,1 ), DP_END };
//STATIC PARALLEL_CONN_DEVICE_PATH mLpt1DevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0401,0 ), DP_END };
//STATIC FLOOPY_CONN_DEVICE_PATH mFloopyADevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0604,0 ), DP_END };
//STATIC FLOOPY_CONN_DEVICE_PATH mFloopyBDevicePath = { DP_ACPI, DP_PCI( 0x1F,0x00 ),DP_LPC( 0x0604,1 ), DP_END };
//STATIC USB_PORT_DEVICE_PATH mUsb0DevicePath = { DP_ACPI, DP_PCI( 0x1d,0x00 ), DP_END };
//STATIC USB_PORT_DEVICE_PATH mUsb1DevicePath = { DP_ACPI, DP_PCI( 0x1d,0x01 ), DP_END };
//STATIC USB_PORT_DEVICE_PATH mUsb2DevicePath = { DP_ACPI, DP_PCI( 0x1d,0x02 ), DP_END };
//STATIC USB_PORT_DEVICE_PATH mUsb3DevicePath = { DP_ACPI, DP_PCI( 0x1d,0x03 ), DP_END };
//STATIC IDE_DEVICE_PATH mIdeDevicePath = { DP_ACPI, DP_PCI( 0x1F,0x01 ), DP_END };
//STATIC IDE_DEVICE_PATH mSata1DevicePath = { DP_ACPI, DP_PCI( 0x1F,0x02 ), DP_END };
//STATIC GB_NIC_DEVICE_PATH mGbNicDevicePath = { DP_ACPI, DP_PCI( 0x03,0x00 ),DP_PCI( 0x1F,0x00 ),DP_PCI( 0x07,0x00 ), DP_END };
EFI_DEVICE_PATH_PROTOCOL mEndDevicePath = DP_END;
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector1);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector2);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector3);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector4);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector5);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector6);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector7);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector8);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector9);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector10);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector11);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector12);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector13);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector14);
EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *mMiscConnectorArray[SMBIOS_PORT_CONNECTOR_MAX_NUM] =
{
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector1),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector2),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector3),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector4),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector5),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector6),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector7),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector8),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector9),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector10),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector11),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector12),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector13),
MISC_SMBIOS_DATA_TABLE_POINTER(MiscPortConnector14),
};
BOOLEAN PcdMiscPortIsInit = FALSE;
SMBIOS_PORT_CONNECTOR_DESIGNATOR_COFNIG SMBIOSPortConnector = {0};
/**
Get Misc Port Configuration information from PCD
@param SMBIOSPortConnector Pointer to SMBIOSPortConnector table.
**/
VOID
GetMiscPortConfigFromPcd ()
{
//
// Type 8
//
SMBIOSPortConnector.SMBIOSConnectorNumber = PcdGet8 (PcdSMBIOSConnectorNumber);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort1ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[0].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[0].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort1InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[0].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort1ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[0].PortType = PcdGet8 (PcdSMBIOSPort1Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort2ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[1].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[1].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort2InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[1].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort2ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[1].PortType = PcdGet8 (PcdSMBIOSPort2Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort3ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[2].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[2].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort3InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[2].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort3ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[2].PortType = PcdGet8 (PcdSMBIOSPort3Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort4ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[3].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[3].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort4InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[3].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort4ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[3].PortType = PcdGet8 (PcdSMBIOSPort4Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort5ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[4].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[4].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort5InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[4].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort5ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[4].PortType = PcdGet8 (PcdSMBIOSPort5Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort6ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[5].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[5].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort6InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[5].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort6ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[5].PortType = PcdGet8 (PcdSMBIOSPort6Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort7ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[6].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[6].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort7InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[6].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort7ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[6].PortType = PcdGet8 (PcdSMBIOSPort7Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort8ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[7].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[7].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort8InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[7].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort8ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[7].PortType = PcdGet8 (PcdSMBIOSPort8Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort9ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[8].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[8].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort9InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[8].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort9ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[8].PortType = PcdGet8 (PcdSMBIOSPort9Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort10ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[9].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[9].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort10InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[9].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort10ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[9].PortType = PcdGet8 (PcdSMBIOSPort10Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort11ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[10].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[10].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort11InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[10].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort11ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[10].PortType = PcdGet8 (PcdSMBIOSPort11Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort12ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[11].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[11].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort12InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[11].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort12ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[11].PortType = PcdGet8 (PcdSMBIOSPort12Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort13ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[12].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[12].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort13InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[12].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort13ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[12].PortType = PcdGet8 (PcdSMBIOSPort13Type);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14InternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortInternalConnectorDesignator);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSPort14ExternalConnectorDesignator), SMBIOSPortConnector.SMBIOSPortConnector[13].PortExternalConnectorDesignator);
SMBIOSPortConnector.SMBIOSPortConnector[13].PortInternalConnectorType = PcdGet8 (PcdSMBIOSPort14InternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[13].PortExternalConnectorType = PcdGet8 (PcdSMBIOSPort14ExternalConnectorType);
SMBIOSPortConnector.SMBIOSPortConnector[13].PortType = PcdGet8 (PcdSMBIOSPort14Type);
}
/**
This function makes boot time changes to the contents of the
MiscPortConnectorInformation (Type 8).
@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(MiscPortInternalConnectorDesignator)
{
CHAR8 *OptionalStrStart;
UINTN InternalRefStrLen;
UINTN ExternalRefStrLen;
EFI_STRING InternalRef;
EFI_STRING ExternalRef;
STRING_REF TokenForInternal;
STRING_REF TokenForExternal;
STRING_REF TokenToUpdate;
UINT8 InternalType;
UINT8 ExternalType;
UINT8 PortType;
EFI_STATUS Status;
SMBIOS_TABLE_TYPE8 *SmbiosRecord;
EFI_SMBIOS_HANDLE SmbiosHandle;
EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *ForType8InputData;
UINT8 Index;
ForType8InputData = (EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR *)RecordData;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
TokenForInternal = 0;
TokenForExternal = 0;
InternalType = 0;
ExternalType = 0;
PortType = 0;
if (!PcdMiscPortIsInit) {
GetMiscPortConfigFromPcd ();
PcdMiscPortIsInit = TRUE;
}
for (Index = 0; Index < SMBIOS_PORT_CONNECTOR_MAX_NUM; Index++) {
if (ForType8InputData->PortInternalConnectorDesignator == (mMiscConnectorArray[Index])->PortInternalConnectorDesignator) {
//DEBUG ((EFI_D_ERROR, "Found Port Connector Data %d : ", Index));
break;
}
}
if (Index >= SMBIOSPortConnector.SMBIOSConnectorNumber) {
return EFI_SUCCESS;
}
if (Index >= SMBIOS_PORT_CONNECTOR_MAX_NUM) {
return EFI_INVALID_PARAMETER;
}
InternalRef = SMBIOSPortConnector.SMBIOSPortConnector[Index].PortInternalConnectorDesignator;
if (StrLen (InternalRef) > 0) {
TokenToUpdate = STRING_TOKEN ((mMiscConnectorArray[Index])->PortInternalConnectorDesignator);
HiiSetString (mHiiHandle, TokenToUpdate, InternalRef, NULL);
}
ExternalRef = SMBIOSPortConnector.SMBIOSPortConnector[Index].PortExternalConnectorDesignator;
if (StrLen (ExternalRef) > 0) {
TokenToUpdate = STRING_TOKEN ((mMiscConnectorArray[Index])->PortExternalConnectorDesignator);
HiiSetString (mHiiHandle, TokenToUpdate, ExternalRef, NULL);
}
TokenForInternal = STRING_TOKEN ((mMiscConnectorArray[Index])->PortInternalConnectorDesignator);
TokenForExternal = STRING_TOKEN ((mMiscConnectorArray[Index])->PortExternalConnectorDesignator);
InternalType = SMBIOSPortConnector.SMBIOSPortConnector[Index].PortInternalConnectorType;
ExternalType = SMBIOSPortConnector.SMBIOSPortConnector[Index].PortExternalConnectorType;
PortType = SMBIOSPortConnector.SMBIOSPortConnector[Index].PortType;
InternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForInternal, NULL);
InternalRefStrLen = StrLen(InternalRef);
if (InternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
ExternalRef = HiiGetPackageString(&gEfiCallerIdGuid, TokenForExternal, NULL);
ExternalRefStrLen = StrLen(ExternalRef);
if (ExternalRefStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE8) + InternalRefStrLen + 1 + ExternalRefStrLen + 1 + 1);
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 = InternalType;
SmbiosRecord->ExternalReferenceDesignator = 2;
SmbiosRecord->ExternalConnectorType = ExternalType;
SmbiosRecord->PortType = PortType;
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(InternalRef, OptionalStrStart);
UnicodeStrToAsciiStr(ExternalRef, OptionalStrStart + InternalRefStrLen + 1);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,26 @@
// /** @file
// System Manufacturer Information
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_SYSTEM_MANUFACTURER #language en-US "Intel Corp."
#string STR_MISC_SYSTEM_PRODUCT_NAME #language en-US "QUARK"
#string STR_MISC_SYSTEM_VERSION #language en-US "1.0"
#string STR_MISC_SYSTEM_SERIAL_NUMBER #language en-US "Unknown"
#string STR_MISC_SYSTEM_SKU_NUMBER #language en-US "System SKUNumber"
#string STR_MISC_SYSTEM_FAMILY #language en-US "X1000"

View File

@@ -0,0 +1,38 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data using smbios protocol.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) System Manufacturer data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_MANUFACTURER, 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
0x13ffef23, 0x8654, 0x46da, {0xa4, 0x7, 0x39, 0xc9, 0x12, 0x2, 0xd3, 0x56}
},
EfiSystemWakeupTypePowerSwitch, // SystemWakeupType
STRING_TOKEN(STR_MISC_SYSTEM_SKU_NUMBER), // SystemSKUNumber
STRING_TOKEN(STR_MISC_SYSTEM_FAMILY), // SystemFamily
};

View File

@@ -0,0 +1,204 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to smbios.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
/**
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)
{
CHAR8 *OptionalStrStart;
UINTN ManuStrLen;
UINTN VerStrLen;
UINTN PdNameStrLen;
UINTN SerialNumStrLen;
UINTN SKUNumStrLen;
UINTN FamilyStrLen;
EFI_STATUS Status;
CHAR16 Manufacturer[SMBIOS_STRING_MAX_LENGTH];
CHAR16 ProductName[SMBIOS_STRING_MAX_LENGTH];
CHAR16 Version[SMBIOS_STRING_MAX_LENGTH];
CHAR16 SerialNumber[SMBIOS_STRING_MAX_LENGTH];
CHAR16 SKUNumber[SMBIOS_STRING_MAX_LENGTH];
CHAR16 Family[SMBIOS_STRING_MAX_LENGTH];
EFI_STRING ManufacturerPtr;
EFI_STRING ProductNamePtr;
EFI_STRING VersionPtr;
EFI_STRING SerialNumberPtr;
EFI_STRING SKUNumberPtr;
EFI_STRING FamilyPtr;
STRING_REF TokenToGet;
STRING_REF TokenToUpdate;
EFI_SMBIOS_HANDLE SmbiosHandle;
SMBIOS_TABLE_TYPE1 *SmbiosRecord;
EFI_MISC_SYSTEM_MANUFACTURER *ForType1InputData;
ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
//
// Update strings from PCD
//
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemManufacturer), Manufacturer);
if (StrLen (Manufacturer) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
HiiSetString (mHiiHandle, TokenToUpdate, Manufacturer, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER);
ManufacturerPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
ManuStrLen = StrLen(ManufacturerPtr);
if (ManuStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemProductName), ProductName);
if (StrLen (ProductName) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
HiiSetString (mHiiHandle, TokenToUpdate, ProductName, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME);
ProductNamePtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
PdNameStrLen = StrLen(ProductNamePtr);
if (PdNameStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemVersion), Version);
if (StrLen (Version) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
HiiSetString (mHiiHandle, TokenToUpdate, Version, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_VERSION);
VersionPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
VerStrLen = StrLen(VersionPtr);
if (VerStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSerialNumber), SerialNumber);
if (StrLen (SerialNumber) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);
HiiSetString (mHiiHandle, TokenToUpdate, SerialNumber, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER);
SerialNumberPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
SerialNumStrLen = StrLen(SerialNumberPtr);
if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSKUNumber), SKUNumber);
if (StrLen (SKUNumber) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER);
HiiSetString (mHiiHandle, TokenToUpdate, SKUNumber, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_SKU_NUMBER);
SKUNumberPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
SKUNumStrLen = StrLen(SKUNumberPtr);
if (SKUNumStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemFamily), Family);
if (StrLen (Family) > 0) {
TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_FAMILY);
HiiSetString (mHiiHandle, TokenToUpdate, Family, NULL);
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_FAMILY);
FamilyPtr = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
FamilyStrLen = StrLen(FamilyPtr);
if (FamilyStrLen > 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 + SKUNumStrLen + 1 + FamilyStrLen + 1 + 1);
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE1) + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen + 1 + FamilyStrLen + 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;
//
// Serial number will be the 4th optional string following the formatted structure.
//
SmbiosRecord->SerialNumber = 4;
//
// SKU number will be the 5th optional string following the formatted structure.
//
SmbiosRecord->SKUNumber = 5;
//
// Family will be the 6th optional string following the formatted structure.
//
SmbiosRecord->Family = 6;
CopyMem ((UINT8 *) (&SmbiosRecord->Uuid), (UINT8 *)PcdGetPtr(PcdSMBIOSSystemUuid),16);
SmbiosRecord->WakeUpType = (UINT8)ForType1InputData->SystemWakeupType;
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(ManufacturerPtr, OptionalStrStart);
UnicodeStrToAsciiStr(ProductNamePtr, OptionalStrStart + ManuStrLen + 1);
UnicodeStrToAsciiStr(VersionPtr, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1);
UnicodeStrToAsciiStr(SerialNumberPtr, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1);
UnicodeStrToAsciiStr(SKUNumberPtr, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen+ 1);
UnicodeStrToAsciiStr(FamilyPtr, OptionalStrStart + ManuStrLen + 1 + PdNameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SKUNumStrLen+ 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;
}

View File

@@ -0,0 +1,20 @@
// /** @file
// Miscellaneous System Option Strings
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_SYSTEM_OPTION_STRING #language en-US "J1D4:1-2,5-6,9-10Default;2-3CMOS clr,6-7Pswd clr,10-11Recovery"

View File

@@ -0,0 +1,29 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data to smbios.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_OPTION_STRING, SystemOptionString) = {
{STRING_TOKEN (STR_MISC_SYSTEM_OPTION_STRING)}
};

View File

@@ -0,0 +1,90 @@
/** @file
BIOS system option string boot time changes.
SMBIOS type 12.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.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;
EFI_MISC_SYSTEM_OPTION_STRING *ForType12InputData;
ForType12InputData = (EFI_MISC_SYSTEM_OPTION_STRING *)RecordData;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_OPTION_STRING);
OptionString = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
OptStrLen = StrLen(OptionString);
if (OptStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
ZeroMem(SmbiosRecord, sizeof (SMBIOS_TABLE_TYPE12) + OptStrLen + 1 + 1);
SmbiosRecord->Hdr.Type = EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS;
SmbiosRecord->Hdr.Length = sizeof (SMBIOS_TABLE_TYPE12);
//
// Make handle chosen by smbios protocol.add automatically.
//
SmbiosRecord->Hdr.Handle = 0;
SmbiosRecord->StringCount = 1;
OptionalStrStart = (CHAR8*) (SmbiosRecord + 1);
UnicodeStrToAsciiStr(OptionString, OptionalStrStart);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,33 @@
// /** @file
// Miscellaneous Port Connector Information
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_SYSTEM_SLOT1 #language en-US "SLOT1"
#string STR_MISC_SYSTEM_SLOT2 #language en-US "SLOT2"
#string STR_MISC_SYSTEM_SLOT3 #language en-US "SLOT3"
#string STR_MISC_SYSTEM_SLOT4 #language en-US "SLOT4"
#string STR_MISC_SYSTEM_SLOT5 #language en-US "SLOT5"
#string STR_MISC_SYSTEM_SLOT6 #language en-US "SLOT6"
#string STR_MISC_SYSTEM_SLOT7 #language en-US "SLOT7"
#string STR_MISC_SYSTEM_SLOT8 #language en-US "SLOT8"
#string STR_MISC_SYSTEM_SLOT9 #language en-US "SLOT9"
#string STR_MISC_SYSTEM_SLOT10 #language en-US "SLOT10"
#string STR_MISC_SYSTEM_SLOT11 #language en-US "SLOT11"
#string STR_MISC_SYSTEM_SLOT12 #language en-US "SLOT12"
#string STR_MISC_SYSTEM_SLOT13 #language en-US "SLOT13"
#string STR_MISC_SYSTEM_SLOT14 #language en-US "SLOT14"

View File

@@ -0,0 +1,363 @@
/** @file
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to the DataHub.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// Static (possibly build generated) Bios Vendor data.
//
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot1) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT1), // SlotDesignation
EfiSlotTypePci, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
1, // 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, MiscSystemSlot2) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT2), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
1, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot3) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT3), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
2, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot4) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT4), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
2, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot5) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT5), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
3, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot6) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT6), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
3, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot7) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT7), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
3, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot8) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT8), // SlotDesignation
EfiSlotTypePciExpress, // SlotType
EfiSlotDataBusWidth32Bit, // SlotDataBusWidth
EfiSlotUsageAvailable, // SlotUsage
EfiSlotLengthLong , // SlotLength
3, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot9) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT9), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot10) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT10), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot11) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT11), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot12) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT12), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot13) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT13), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};
MISC_SMBIOS_TABLE_DATA(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot14) = {
STRING_TOKEN(STR_MISC_SYSTEM_SLOT14), // SlotDesignation
EfiSlotTypeUnknown, // SlotType
EfiSlotDataBusWidthUnknown, // SlotDataBusWidth
EfiSlotUsageUnknown, // SlotUsage
EfiSlotLengthUnknown , // SlotLength
0, // 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;
1, // HotPlugDevicesSupported :1;
1, // SmbusSignalSupported :1;
0 // Reserved :21;
},
{0} // SlotDevicePath
};

View File

@@ -0,0 +1,291 @@
/** @file
BIOS system slot designator information boot time changes.
SMBIOS type 9.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
MiscSystemSlotDesignatorFunction.c
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
//
//
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot1);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot2);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot3);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot4);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot5);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot6);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot7);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot8);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot9);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot10);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot11);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot12);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot13);
MISC_SMBIOS_DATA_TABLE_EXTERNS (EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot14);
EFI_MISC_SYSTEM_SLOT_DESIGNATION *mMiscSlotArray[SMBIOS_SYSTEM_SLOT_MAX_NUM] =
{
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot1),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot2),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot3),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot4),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot5),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot6),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot7),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot8),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot9),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot10),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot11),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot12),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot13),
MISC_SMBIOS_DATA_TABLE_POINTER (MiscSystemSlot14),
};
BOOLEAN PcdMiscSlotIsInit = FALSE;
SMBIOS_SLOT_COFNIG SMBIOSlotConfig = {0};
/**
Get Misc Slot Configuration information from PCD
@param SMBIOSPortConnector Pointer to SMBIOSPortConnector table.
**/
VOID
GetMiscSLotConfigFromPcd ()
{
//
// Type 9
//
SMBIOSlotConfig.SMBIOSSystemSlotNumber = PcdGet8 (PcdSMBIOSSystemSlotNumber);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot1Designation), SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotType = PcdGet8(PcdSMBIOSSystemSlot1Type);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot1DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot1Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotLength = PcdGet8(PcdSMBIOSSystemSlot1Length);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotId = PcdGet16(PcdSMBIOSSystemSlot1Id);
SMBIOSlotConfig.SMBIOSSystemSlot[0].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot1Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot2Designation), SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotType = PcdGet8(PcdSMBIOSSystemSlot2Type);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot2DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot2Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotLength = PcdGet8(PcdSMBIOSSystemSlot2Length);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotId = PcdGet16(PcdSMBIOSSystemSlot2Id);
SMBIOSlotConfig.SMBIOSSystemSlot[1].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot2Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot3Designation), SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotType = PcdGet8(PcdSMBIOSSystemSlot3Type);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot3DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot3Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotLength = PcdGet8(PcdSMBIOSSystemSlot3Length);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotId = PcdGet16(PcdSMBIOSSystemSlot3Id);
SMBIOSlotConfig.SMBIOSSystemSlot[2].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot3Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot4Designation), SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotType = PcdGet8(PcdSMBIOSSystemSlot4Type);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot4DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot4Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotLength = PcdGet8(PcdSMBIOSSystemSlot4Length);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotId = PcdGet16(PcdSMBIOSSystemSlot4Id);
SMBIOSlotConfig.SMBIOSSystemSlot[3].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot4Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot5Designation), SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotType = PcdGet8(PcdSMBIOSSystemSlot5Type);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot5DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot5Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotLength = PcdGet8(PcdSMBIOSSystemSlot5Length);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotId = PcdGet16(PcdSMBIOSSystemSlot5Id);
SMBIOSlotConfig.SMBIOSSystemSlot[4].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot5Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot6Designation), SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotType = PcdGet8(PcdSMBIOSSystemSlot6Type);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot6DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot6Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotLength = PcdGet8(PcdSMBIOSSystemSlot6Length);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotId = PcdGet16(PcdSMBIOSSystemSlot6Id);
SMBIOSlotConfig.SMBIOSSystemSlot[5].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot6Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot7Designation), SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotType = PcdGet8(PcdSMBIOSSystemSlot7Type);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot7DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot7Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotLength = PcdGet8(PcdSMBIOSSystemSlot7Length);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotId = PcdGet16(PcdSMBIOSSystemSlot7Id);
SMBIOSlotConfig.SMBIOSSystemSlot[6].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot7Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot8Designation), SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotType = PcdGet8(PcdSMBIOSSystemSlot8Type);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot8DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot8Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotLength = PcdGet8(PcdSMBIOSSystemSlot8Length);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotId = PcdGet16(PcdSMBIOSSystemSlot8Id);
SMBIOSlotConfig.SMBIOSSystemSlot[7].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot8Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot9Designation), SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotType = PcdGet8(PcdSMBIOSSystemSlot9Type);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot9DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot9Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotLength = PcdGet8(PcdSMBIOSSystemSlot9Length);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotId = PcdGet16(PcdSMBIOSSystemSlot9Id);
SMBIOSlotConfig.SMBIOSSystemSlot[8].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot9Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot10Designation), SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotType = PcdGet8(PcdSMBIOSSystemSlot10Type);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot10DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot10Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotLength = PcdGet8(PcdSMBIOSSystemSlot10Length);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotId = PcdGet16(PcdSMBIOSSystemSlot10Id);
SMBIOSlotConfig.SMBIOSSystemSlot[9].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot10Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot11Designation), SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotType = PcdGet8(PcdSMBIOSSystemSlot11Type);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot11DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot11Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotLength = PcdGet8(PcdSMBIOSSystemSlot11Length);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotId = PcdGet16(PcdSMBIOSSystemSlot11Id);
SMBIOSlotConfig.SMBIOSSystemSlot[10].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot11Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot12Designation), SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotType = PcdGet8(PcdSMBIOSSystemSlot12Type);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot12DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot12Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotLength = PcdGet8(PcdSMBIOSSystemSlot12Length);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotId = PcdGet16(PcdSMBIOSSystemSlot12Id);
SMBIOSlotConfig.SMBIOSSystemSlot[11].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot12Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot13Designation), SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotType = PcdGet8(PcdSMBIOSSystemSlot13Type);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot13DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot13Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotLength = PcdGet8(PcdSMBIOSSystemSlot13Length);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotId = PcdGet16(PcdSMBIOSSystemSlot13Id);
SMBIOSlotConfig.SMBIOSSystemSlot[12].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot13Characteristics);
AsciiStrToUnicodeStr ((CHAR8 *) PcdGetPtr(PcdSMBIOSSystemSlot14Designation), SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotDesignation);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotType = PcdGet8(PcdSMBIOSSystemSlot14Type);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotDataBusWidth = PcdGet8(PcdSMBIOSSystemSlot14DataBusWidth);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotUsage = PcdGet8(PcdSMBIOSSystemSlot14Usage);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotLength = PcdGet8(PcdSMBIOSSystemSlot14Length);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotId = PcdGet16(PcdSMBIOSSystemSlot14Id);
SMBIOSlotConfig.SMBIOSSystemSlot[13].SlotCharacteristics = PcdGet32(PcdSMBIOSSystemSlot14Characteristics);
}
/**
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(MiscSystemSlotDesignator)
{
CHAR8 *OptionalStrStart;
UINTN SlotDesignationStrLen;
EFI_STATUS Status;
EFI_STRING SlotDesignation;
STRING_REF TokenToUpdate;
STRING_REF TokenToGet;
SMBIOS_TABLE_TYPE9 *SmbiosRecord;
EFI_SMBIOS_HANDLE SmbiosHandle;
EFI_MISC_SYSTEM_SLOT_DESIGNATION* ForType9InputData;
UINT8 Index;
ForType9InputData = (EFI_MISC_SYSTEM_SLOT_DESIGNATION *)RecordData;
TokenToGet = 0;
//
// First check for invalid parameters.
//
if (RecordData == NULL) {
return EFI_INVALID_PARAMETER;
}
if (!PcdMiscSlotIsInit) {
GetMiscSLotConfigFromPcd ();
PcdMiscSlotIsInit = TRUE;
}
for (Index = 0; Index < SMBIOS_SYSTEM_SLOT_MAX_NUM; Index++) {
if (ForType9InputData->SlotDesignation == (mMiscSlotArray[Index])->SlotDesignation) {
//DEBUG ((EFI_D_ERROR, "Found slot Data %d : ", Index));
break;
}
}
if (Index >= SMBIOSlotConfig.SMBIOSSystemSlotNumber) {
return EFI_SUCCESS;
}
if (Index >= SMBIOS_SYSTEM_SLOT_MAX_NUM) {
return EFI_INVALID_PARAMETER;
}
SlotDesignation = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotDesignation;
TokenToGet = STRING_TOKEN ((mMiscSlotArray[Index])->SlotDesignation);
if (StrLen (SlotDesignation) > 0) {
TokenToUpdate = STRING_TOKEN ((mMiscSlotArray[Index])->SlotDesignation);
HiiSetString (mHiiHandle, TokenToUpdate, SlotDesignation, NULL);
}
SlotDesignation = HiiGetPackageString(&gEfiCallerIdGuid, TokenToGet, NULL);
SlotDesignationStrLen = StrLen(SlotDesignation);
if (SlotDesignationStrLen > SMBIOS_STRING_MAX_LENGTH) {
return EFI_UNSUPPORTED;
}
//
// Two zeros following the last string.
//
SmbiosRecord = AllocatePool(sizeof (SMBIOS_TABLE_TYPE9) + SlotDesignationStrLen + 1 + 1);
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 = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotType;
SmbiosRecord->SlotDataBusWidth = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotDataBusWidth;
SmbiosRecord->CurrentUsage = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotUsage;
SmbiosRecord->SlotLength = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotLength;
SmbiosRecord->SlotID = SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotId;
*(UINT16 *)&SmbiosRecord->SlotCharacteristics1 = (UINT16)(SMBIOSlotConfig.SMBIOSSystemSlot[Index].SlotCharacteristics);
//
// Slot Characteristics
//
OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStr(SlotDesignation, OptionalStrStart);
//
// Now we have got the full smbios record, call smbios protocol to add this record.
//
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
Status = Smbios-> Add(
Smbios,
NULL,
&SmbiosHandle,
(EFI_SMBIOS_TABLE_HEADER *) SmbiosRecord
);
FreePool(SmbiosRecord);
return Status;
}

View File

@@ -0,0 +1,29 @@
// /** @file
// System Slot onboard devices
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#string STR_MISC_SYSTEM_SLOT_P64_B1 #language en-US "P64B1"
#string STR_MISC_SYSTEM_SLOT_P64_B2 #language en-US "P64B2"
#string STR_MISC_SYSTEM_SLOT_P64_B3 #language en-US "P64B3"
#string STR_MISC_SYSTEM_SLOT_P64_C1 #language en-US "P64C1"
#string STR_MISC_SYSTEM_SLOT_P64_C2 #language en-US "P64C2"
#string STR_MISC_SYSTEM_SLOT_P64_C3 #language en-US "P64C3"

View File

@@ -0,0 +1,143 @@
/** @file
Header file for the SmbiosMisc Driver.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _SMBIOS_MISC_H
#define _SMBIOS_MISC_H
#include "MiscDevicePath.h"
#include <Library/UefiBootServicesTableLib.h>
#include <Library/PrintLib.h>
///
/// Reference SMBIOS 2.6, chapter 3.1.3.
/// Each text string is limited to 64 significant characters due to system MIF limitations.
///
#define SMBIOS_STRING_MAX_LENGTH 64
#define SMBIOS_PORT_CONNECTOR_MAX_NUM 14
typedef struct {
CHAR16 PortInternalConnectorDesignator[SMBIOS_STRING_MAX_LENGTH];
CHAR16 PortExternalConnectorDesignator[SMBIOS_STRING_MAX_LENGTH];
UINT8 PortInternalConnectorType;
UINT8 PortExternalConnectorType;
UINT8 PortType;
} SMBIOS_PORT_CONNECTOR_DESIGNATOR;
typedef struct {
UINT8 SMBIOSConnectorNumber;
SMBIOS_PORT_CONNECTOR_DESIGNATOR SMBIOSPortConnector[SMBIOS_PORT_CONNECTOR_MAX_NUM];
} SMBIOS_PORT_CONNECTOR_DESIGNATOR_COFNIG;
#define SMBIOS_SYSTEM_SLOT_MAX_NUM 14
typedef struct {
CHAR16 SlotDesignation[SMBIOS_STRING_MAX_LENGTH];
UINT8 SlotType;
UINT8 SlotDataBusWidth;
UINT8 SlotUsage;
UINT8 SlotLength;
UINT16 SlotId;
UINT32 SlotCharacteristics;
} SMBIOS_SLOT_DESIGNATION;
typedef struct {
UINT8 SMBIOSSystemSlotNumber;
SMBIOS_SLOT_DESIGNATION SMBIOSSystemSlot[SMBIOS_SYSTEM_SLOT_MAX_NUM];
} SMBIOS_SLOT_COFNIG;
//
// 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_DATA_TABLE_POINTER(NAME1) \
& NAME1 ## Data
//
// Data Table extern definitions.
//
#define MISC_SMBIOS_DATA_TABLE_EXTERNS(NAME1, NAME2) \
extern NAME1 NAME2 ## Data
//
// Data and function 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 \
)
// Data Table Array
//
extern EFI_MISC_SMBIOS_DATA_TABLE mSmbiosMiscDataTable[];
//
// Data Table Array Entries
//
extern UINTN mSmbiosMiscDataTableEntries;
extern EFI_HII_HANDLE mHiiHandle;
//
// Prototypes
//
EFI_STATUS
PiSmbiosMiscEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
#endif

View File

@@ -0,0 +1,115 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data using SMBIOS protocol.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
//
// External definitions referenced by Data Table entries.
//
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_BIOS_VENDOR, MiscBiosVendor, MiscBiosVendor);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_MANUFACTURER, MiscSystemManufacturer, MiscSystemManufacturer);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_MANUFACTURER, MiscBaseBoardManufacturer, MiscBaseBoardManufacturer);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_CHASSIS_MANUFACTURER, MiscChassisManufacturer, MiscChassisManufacturer);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_BOOT_INFORMATION_STATUS, MiscBootInfoStatus, MiscBootInfoStatus);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_NUMBER_OF_INSTALLABLE_LANGUAGES, NumberOfInstallableLanguages, NumberOfInstallableLanguages);
MISC_SMBIOS_TABLE_EXTERNS (EFI_MISC_SYSTEM_OPTION_STRING, SystemOptionString, SystemOptionString);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_ONBOARD_DEVICE, MiscOnboardDeviceVideo, MiscOnboardDevice);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_OEM_STRING,MiscOemString, MiscOemString);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector1, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector2, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector3, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector4, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector5, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector6, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector7, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector8, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector9, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector10, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector11, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector12, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector13, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_PORT_INTERNAL_CONNECTOR_DESIGNATOR, MiscPortConnector14, MiscPortInternalConnectorDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot1, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot2, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot3, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot4, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot5, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot6, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot7, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot8, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot9, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot10, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot11, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot12, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot13, MiscSystemSlotDesignator);
MISC_SMBIOS_TABLE_EXTERNS(EFI_MISC_SYSTEM_SLOT_DESIGNATION, MiscSystemSlot14, MiscSystemSlotDesignator);
//
// Data Table
//
EFI_MISC_SMBIOS_DATA_TABLE mSmbiosMiscDataTable[] = {
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(MiscPortConnector1, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector2, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector3, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector4, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector5, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector6, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector7, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector8, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector9, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector10, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector11, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector12, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector13, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscPortConnector14, MiscPortInternalConnectorDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot1, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot2, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot3, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot4, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot5, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot6, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot7, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot8, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot9, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot10, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot11, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot12, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot13, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscSystemSlot14, MiscSystemSlotDesignator),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOnboardDeviceVideo, MiscOnboardDevice),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscOemString, MiscOemString),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(SystemOptionString, SystemOptionString),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(NumberOfInstallableLanguages, NumberOfInstallableLanguages),
MISC_SMBIOS_TABLE_ENTRY_DATA_AND_FUNCTION(MiscBootInfoStatus, MiscBootInfoStatus)
};
//
// Number of Data Table entries.
//
UINTN mSmbiosMiscDataTableEntries =
(sizeof mSmbiosMiscDataTable) / sizeof(EFI_MISC_SMBIOS_DATA_TABLE);

View File

@@ -0,0 +1,314 @@
## @file
# Component description file for Smbios Misc module.
#
# This driver parses the mSmbiosMiscDataTable structure
# and reports any generated data using SMBIOS protocol.
# SmBios To Misc.Subclass Map Table.
# SMBIOS Type |SMBIOS Name |Misc Subclass Record |Misc Subclass Name
# 0 | BIOS Information | 0x2 | BiosVendor
# 3 | System/Chassis Enclosure | 0x5 | ChassisManufacturer
# 8 | Port Connector Information | 0x6 | PortInternalConnectorDesignator
# 9 | System Slot Information | 0x7 | SystemSlotDesignator
# 10 | On Board Device Information | 0x8 | OnboardDevice
# 12 | System Configuration Options| 0xA | SystemOptionString
# 13 | BIOS Language Information | 0xB | NumberOfInstallableLanguages
# 32 | Boot Information | 0x1A | BootInformationStatus
# The uni files tagged with "ToolCode="DUMMY"" are included by SmbiosMiscStrings.uni file which is input
# file for StrGather tool.
# Copyright (c) 2013-2015 Intel Corporation.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = SmbiosMisc
FILE_GUID = EF0C99B6-B1D3-4025-9405-BF6A560FE0E0
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = SmbiosMiscEntryPoint
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources]
MiscOemStringFunction.c
MiscOemStringData.c
SmbiosMiscEntryPoint.c
SmbiosMiscDataTable.c
MiscSystemManufacturerData.c
MiscSystemManufacturerFunction.c
MiscBaseBoardManufacturerData.c
MiscBaseBoardManufacturerFunction.c
MiscOnboardDeviceFunction.c
MiscOnboardDeviceData.c
MiscSystemSlotDesignationFunction.c
MiscSystemSlotDesignationData.c
MiscNumberOfInstallableLanguagesFunction.c
MiscNumberOfInstallableLanguagesData.c
MiscChassisManufacturerFunction.c
MiscChassisManufacturerData.c
MiscBootInformationFunction.c
MiscBootInformationData.c
MiscBiosVendorFunction.c
MiscBiosVendorData.c
MiscSystemOptionStringFunction.c
MiscSystemOptionStringData.c
MiscPortInternalConnectorDesignatorFunction.c
MiscPortInternalConnectorDesignatorData.c
SmbiosMisc.h
MiscDevicePath.h
SmbiosMiscStrings.uni
CommonHeader.h
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFrameworkPkg/IntelFrameworkPkg.dec
QuarkPlatformPkg/QuarkPlatformPkg.dec
[LibraryClasses]
PcdLib
HiiLib
MemoryAllocationLib
DevicePathLib
BaseMemoryLib
BaseLib
DebugLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
[Protocols]
gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareRevision
gQuarkPlatformTokenSpaceGuid.PcdPlatformTypeName
gQuarkPlatformTokenSpaceGuid.PcdFlashAreaSize
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosVendor
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosReleaseDate
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosStartAddress
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosChar
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosCharEx1
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBiosCharEx2
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemManufacturer
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemProductName
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemVersion
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSerialNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemUuid
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSKUNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemFamily
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBoardManufacturer
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBoardProductName
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBoardVersion
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSBoardSerialNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisManufacturer
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisVersion
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisSerialNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisAssetTag
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisBootupState
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisPowerSupplyState
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisSecurityState
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisOemDefined
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisHeight
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisNumberPowerCords
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisElementCount
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSChassisElementRecordLength
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSConnectorNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort1InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort1ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort1InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort1ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort1Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort2InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort2ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort2InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort2ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort2Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort3InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort3ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort3InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort3ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort3Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort4InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort4ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort4InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort4ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort4Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort5InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort5ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort5InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort5ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort5Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort6InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort6ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort6InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort6ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort6Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort7InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort7ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort7InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort7ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort7Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort8InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort8ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort8InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort8ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort8Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort9InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort9ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort9InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort9ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort9Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort10InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort10ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort10InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort10ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort10Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort11InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort11ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort11InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort11ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort11Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort12InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort12ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort12InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort12ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort12Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort13InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort13ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort13InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort13ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort13Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort14InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort14ExternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort14InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort14ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort14Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort15InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort15InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort15ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort15Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort16InternalConnectorDesignator
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort16InternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort16ExternalConnectorType
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSPort16Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlotNumber
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot1Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot2Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot3Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot4Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot5Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot6Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot7Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot8Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot9Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot10Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot11Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot12Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot13Characteristics
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Designation
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Type
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14DataBusWidth
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Usage
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Length
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Id
gQuarkPlatformTokenSpaceGuid.PcdSMBIOSSystemSlot14Characteristics
[Depex]
gEfiSmbiosProtocolGuid

View File

@@ -0,0 +1,88 @@
/** @file
This driver parses the mSmbiosMiscDataTable structure and reports
any generated data using SMBIOS protocol.
Copyright (c) 2013-2015 Intel Corporation.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "CommonHeader.h"
#include "SmbiosMisc.h"
extern UINT8 SmbiosMiscStrings[];
EFI_HANDLE mImageHandle;
EFI_HII_HANDLE mHiiHandle;
/**
Standard EFI driver point. This driver parses the mSmbiosMiscDataTable
structure and reports any generated data using SMBIOS protocol.
@param ImageHandle Handle for the image of this driver
@param SystemTable Pointer to the EFI System Table
@retval EFI_SUCCESS The data was successfully stored.
**/
EFI_STATUS
EFIAPI
SmbiosMiscEntryPoint(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
UINTN Index;
EFI_STATUS EfiStatus;
EFI_SMBIOS_PROTOCOL *Smbios;
mImageHandle = ImageHandle;
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,
mImageHandle,
SmbiosMiscStrings,
NULL
);
ASSERT (mHiiHandle != NULL);
for (Index = 0; Index < mSmbiosMiscDataTableEntries; ++Index) {
//
// If the entry have a function pointer, just log the data.
//
if (mSmbiosMiscDataTable[Index].Function != NULL) {
EfiStatus = (*mSmbiosMiscDataTable[Index].Function)(
mSmbiosMiscDataTable[Index].RecordData,
Smbios
);
if (EFI_ERROR(EfiStatus)) {
DEBUG((EFI_D_ERROR, "Misc smbios store error. Index=%d, ReturnStatus=%r\n", Index, EfiStatus));
return EfiStatus;
}
}
}
return EfiStatus;
}

View File

@@ -0,0 +1,32 @@
// /** @file
// SmbiosMisc formset.
//
// Copyright (c) 2013-2015 Intel Corporation.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
//
// **/
/=#
#langdef en-US "English"
#string STR_MISC_SUBCLASS_DRIVER_TITLE #language en-US "SMBIOS Misc subclass driver"
#include "MiscBiosVendor.uni"
#include "MiscChassisManufacturer.uni"
#include "MiscPortInternalConnectorDesignator.uni"
#include "MiscSystemManufacturer.uni"
#include "MiscBaseBoardManufacturer.uni"
#include "MiscSystemOptionString.uni"
#include "MiscSystemSlotDesignation.uni"
#include "MiscOnboardDevice.uni"
#include "MiscOemString.uni"