Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArmPkg/SmbiosMiscDxe: Improve Smbios Type00 table population #7

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion ArmPkg/ArmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,23 @@
gArmTokenSpaceGuid.PcdProcessorSerialNumber|L""|VOID*|0x30000073
gArmTokenSpaceGuid.PcdProcessorAssetTag|L""|VOID*|0x30000074
gArmTokenSpaceGuid.PcdProcessorPartNumber|L""|VOID*|0x30000075

## Enable/Disable the SMBIOS Type00 Bios characteristics. The default
# value is currently enabling the below characteristics.
# PlugAndPlayIsSupported | BiosIsUpgradable | BiosShadowingAllowed |
# BootFromCdIsSupported | SelectableBootIsSupported |
# This Structured PCD is associated with MISC_BIOS_CHARACTERISTICS
# structure that is defined in Include/IndustryStandard/SmBios.h
# @Prompt Enable/Disable Type00 Bios Characteristics.
gArmTokenSpaceGuid.PcdBiosCharacteristics|{0x80, 0x9A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}|MISC_BIOS_CHARACTERISTICS|0x30000076 {
<Packages>
ArmPkg/ArmPkg.dec
<HeaderFiles>
IndustryStandard/SmBios.h
}
# This PCD is associated with the BIOSCharacteristicsExtensionBytes[2] field
# in the SMBIOS Type00 structure defined in Include/IndustryStandard/SmBios.h
# This PCD is initialized to the same values as defined in the data.c
gArmTokenSpaceGuid.PcdBiosCharacteristicsExtension|0x0C01|UINT16|0x30000077
#
# ARM L2x0 PCDs
#
Expand Down
2 changes: 2 additions & 0 deletions ArmPkg/Universal/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
gArmTokenSpaceGuid.PcdBaseBoardProductName
gArmTokenSpaceGuid.PcdBaseBoardVersion
gArmTokenSpaceGuid.PcdFdBaseAddress
gArmTokenSpaceGuid.PcdBiosCharacteristics
gArmTokenSpaceGuid.PcdBiosCharacteristicsExtension

[Guids]
gEfiGenericVariableGuid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,22 @@ GetBiosVersion (

**/
SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
CHAR8 *OptionalStrStart;
CHAR8 *StrStart;
UINTN VendorStrLen;
UINTN VerStrLen;
UINTN DateStrLen;
UINTN BiosPhysicalSize;
CHAR16 *Vendor;
CHAR16 *Version;
CHAR16 *ReleaseDate;
CHAR16 *Char16String;
EFI_STATUS Status;
EFI_STRING_ID TokenToUpdate;
EFI_STRING_ID TokenToGet;
SMBIOS_TABLE_TYPE0 *SmbiosRecord;
SMBIOS_TABLE_TYPE0 *InputData;
CHAR8 *OptionalStrStart;
CHAR8 *StrStart;
UINTN VendorStrLen;
UINTN VerStrLen;
UINTN DateStrLen;
UINTN BiosPhysicalSize;
CHAR16 *Vendor;
CHAR16 *Version;
CHAR16 *ReleaseDate;
CHAR16 *Char16String;
EFI_STATUS Status;
EFI_STRING_ID TokenToUpdate;
EFI_STRING_ID TokenToGet;
SMBIOS_TABLE_TYPE0 *SmbiosRecord;
SMBIOS_TABLE_TYPE0 *InputData;
MISC_BIOS_CHARACTERISTICS *BiosChar;

//
// First check for invalid parameters.
Expand Down Expand Up @@ -259,6 +260,11 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
SmbiosRecord->EmbeddedControllerFirmwareMinorRelease = (UINT16)
(PcdGet16 (PcdEmbeddedControllerFirmwareRelease) & 0xFF);

BiosChar = (MISC_BIOS_CHARACTERISTICS *)(FixedPcdGetPtr (PcdBiosCharacteristics));
SmbiosRecord->BiosCharacteristics = *(BiosChar);
SmbiosRecord->BIOSCharacteristicsExtensionBytes[0] = (UINT8)(PcdGet16 (PcdBiosCharacteristicsExtension) & 0xFF);
SmbiosRecord->BIOSCharacteristicsExtensionBytes[1] = (UINT8)(PcdGet16 (PcdBiosCharacteristicsExtension) >> 8);

OptionalStrStart = (CHAR8 *)(SmbiosRecord + 1);
UnicodeStrToAsciiStrS (Vendor, OptionalStrStart, VendorStrLen + 1);
StrStart = OptionalStrStart + VendorStrLen + 1;
Expand Down