diff options
Diffstat (limited to 'Vlv2TbltDevicePkg/SmBiosMiscDxe')
5 files changed, 69 insertions, 18 deletions
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c index 6570e7cfd2..24b9d44b7a 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscBaseBoardManufacturerFunction.c @@ -29,8 +29,11 @@ Abstract: #include <Library/NetLib.h> #include "Library/DebugLib.h" #include <Uefi/UefiBaseType.h> +#include <Guid/PlatformInfo.h> +extern EFI_PLATFORM_INFO_HOB *mPlatformInfo; + /** This function makes boot time changes to the contents of the MiscBaseBoardManufacturer (Type 2). @@ -66,16 +69,21 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer) CHAR16 *MacStr; EFI_HANDLE *Handles; UINTN BufferSize; + CHAR16 Buffer[40]; ForType2InputData = (EFI_MISC_BASE_BOARD_MANUFACTURER *)RecordData; // // First check for invalid parameters. // - if (RecordData == NULL) { + if (RecordData == NULL || mPlatformInfo == NULL) { return EFI_INVALID_PARAMETER; } + if (BOARD_ID_MINNOW2_COMPATIBLE == mPlatformInfo->BoardId) { + UnicodeSPrint (Buffer, sizeof (Buffer),L"Compatible Vendor"); + HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_BASE_BOARD_MANUFACTURER), Buffer, NULL); + } TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); Manufacturer = SmbiosMiscGetString (TokenToGet); ManuStrLen = StrLen(Manufacturer); @@ -83,6 +91,10 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscBaseBoardManufacturer) return EFI_UNSUPPORTED; } + if (BOARD_ID_MINNOW2_COMPATIBLE == mPlatformInfo->BoardId) { + UnicodeSPrint (Buffer, sizeof (Buffer),L"MinnowBoard Compatible Platform"); + HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_BASE_BOARD_PRODUCT_NAME1), Buffer, NULL); + } TokenToGet = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME1); Product = SmbiosMiscGetString (TokenToGet); ProductStrLen = StrLen(Product); diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturerFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturerFunction.c index f503a2a640..206167fe58 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturerFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscChassisManufacturerFunction.c @@ -25,8 +25,11 @@ Abstract: #include "CommonHeader.h"
-
#include "MiscSubclassDriver.h"
+#include <Guid/PlatformInfo.h>
+
+
+extern EFI_PLATFORM_INFO_HOB *mPlatformInfo;
/**
This function makes boot time changes to the contents of the
@@ -55,16 +58,21 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer) EFI_SMBIOS_HANDLE SmbiosHandle;
SMBIOS_TABLE_TYPE3 *SmbiosRecord;
EFI_MISC_CHASSIS_MANUFACTURER *ForType3InputData;
+ CHAR16 Buffer[40];
ForType3InputData = (EFI_MISC_CHASSIS_MANUFACTURER *)RecordData;
//
// First check for invalid parameters.
//
- if (RecordData == NULL) {
+ if (RecordData == NULL || mPlatformInfo == NULL) {
return EFI_INVALID_PARAMETER;
}
+ if (BOARD_ID_MINNOW2_COMPATIBLE == mPlatformInfo->BoardId) {
+ UnicodeSPrint (Buffer, sizeof (Buffer),L"Compatible Vendor");
+ HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_CHASSIS_MANUFACTURER), Buffer, NULL);
+ }
TokenToGet = STRING_TOKEN (STR_MISC_CHASSIS_MANUFACTURER);
Manufacturer = SmbiosMiscGetString (TokenToGet);
ManuStrLen = StrLen(Manufacturer);
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c index cae5a8e38a..e2cdb03526 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSubclassDriverEntryPoint.c @@ -26,13 +26,14 @@ Abstract: #include "CommonHeader.h"
-
#include "MiscSubclassDriver.h"
#include <Protocol/HiiString.h>
+#include <Guid/PlatformInfo.h>
+
EFI_HII_HANDLE mHiiHandle;
EFI_HII_STRING_PROTOCOL *mHiiString;
-
+EFI_PLATFORM_INFO_HOB *mPlatformInfo=NULL;
EFI_STRING
EFIAPI
@@ -122,7 +123,19 @@ MiscSubclassDriverEntryPoint ( UINTN Index;
EFI_STATUS EfiStatus;
EFI_SMBIOS_PROTOCOL *Smbios;
+ EFI_PEI_HOB_POINTERS GuidHob;
+
+
+ GuidHob.Raw = GetHobList ();
+ if (GuidHob.Raw != NULL) {
+ if ((GuidHob.Raw = GetNextGuidHob (&gEfiPlatformInfoGuid, GuidHob.Raw)) != NULL) {
+ mPlatformInfo = GET_GUID_HOB_DATA (GuidHob.Guid);
+ }
+ }
+
+ DEBUG ((EFI_D_ERROR, "PlatformInfoHob->BoardId [0x%x]\n", mPlatformInfo->BoardId));
+
//
// Retrieve the pointer to the UEFI HII String Protocol
//
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c index ff08b5b52f..99906d0613 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c @@ -30,6 +30,11 @@ Abstract: #include <Library/NetLib.h> #include "Library/DebugLib.h" #include <Uefi/UefiBaseType.h> +#include <Guid/PlatformInfo.h> + + +extern EFI_PLATFORM_INFO_HOB *mPlatformInfo; + /** @@ -70,77 +75,86 @@ AddSmbiosManuCallback ( EFI_SMBIOS_PROTOCOL *Smbios; CHAR16 Buffer[40]; - CHAR16 *MacStr; - EFI_HANDLE *Handles; - UINTN BufferSize; + CHAR16 *MacStr; + EFI_HANDLE *Handles; + UINTN BufferSize; + CHAR16 PlatformNameBuffer[40]; ForType1InputData = (EFI_MISC_SYSTEM_MANUFACTURER *)Context; // // First check for invalid parameters. // - if (Context == NULL) { + if (Context == NULL || mPlatformInfo == NULL) { return EFI_INVALID_PARAMETER; } Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID *) &Smbios); ASSERT_EFI_ERROR (Status); + + if (BOARD_ID_MINNOW2_COMPATIBLE == mPlatformInfo->BoardId) { + // Detect the board is compatible board platform + UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer),L"%s",L"Minnowboard Compatible "); + } else { + UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer),L"%s",L"Minnowboard Max "); + } + // // Silicon Steppings // switch (PchStepping()) { case PchA0: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX A0 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"A0 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"A0"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "A0 Stepping Detected\n")); break; case PchA1: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX A1 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"A1 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"A1"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "A1 Stepping Detected\n")); break; case PchB0: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX B0 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"B0 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"B0"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "B0 Stepping Detected\n")); break; case PchB1: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX B1 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"B1 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"B1"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "B1 Stepping Detected\n")); break; case PchB2: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX B2 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"B2 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"B2"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "B2 Stepping Detected\n")); break; case PchB3: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX B3 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"B3 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"B3"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "B3 Stepping Detected\n")); break; case PchC0: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX C0 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"C0 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"C0"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); DEBUG ((EFI_D_ERROR, "C0 Stepping Detected\n")); break; case PchD0: - UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"MinnowBoard MAX D0 PLATFORM"); + UnicodeSPrint (Buffer, sizeof (Buffer),L"%s%s", PlatformNameBuffer, L"D0 PLATFORM"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_PRODUCT_NAME), Buffer, NULL); UnicodeSPrint (Buffer, sizeof (Buffer),L"%s",L"D0"); HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_VERSION), Buffer, NULL); @@ -151,7 +165,10 @@ AddSmbiosManuCallback ( break; } - + if (BOARD_ID_MINNOW2_COMPATIBLE == mPlatformInfo->BoardId) { + UnicodeSPrint (Buffer, sizeof (Buffer),L"Compatible Vendor"); + HiiSetString(mHiiHandle,STRING_TOKEN(STR_MISC_SYSTEM_MANUFACTURER), Buffer, NULL); + } TokenToGet = STRING_TOKEN (STR_MISC_SYSTEM_MANUFACTURER); Manufacturer = SmbiosMiscGetString (TokenToGet); ManuStrLen = StrLen(Manufacturer); diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf b/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf index 842dda3600..332d2376d8 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf @@ -114,6 +114,7 @@ PchPlatformLib I2cLib NetLib + HobLib [Guids] gEfiProcessorSubClassGuid |