Vlv2TbltDevicePkg: Sync the branch changes to trunk.

Support compatible board, and fixed some bugs. 

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tim He <tim.he@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18149 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Tim He
2015-08-04 02:55:02 +00:00
committed by timhe
parent c5d5379937
commit 6f2ef18e80
23 changed files with 215 additions and 56 deletions

View File

@@ -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);

View File

@@ -25,8 +25,11 @@ Abstract:
MiscChassisManufacturerFunction.c
Abstract:
Abstract:
Chassis manufacturer information boot time changes.
SMBIOS type 3.
--*/
@@ -55,16 +58,21 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscChassisManufacturer)
UINTN VerStrLen;
UINTN AssertTagStrLen;
UINTN SerialNumStrLen;
EFI_STATUS Status;
EFI_STRING Manufacturer;
EFI_STRING Version;
EFI_STRING SerialNumber;
EFI_STRING AssertTag;
STRING_REF TokenToGet;
EFI_SMBIOS_HANDLE SmbiosHandle;
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 || mPlatformInfo == NULL) {
return EFI_INVALID_PARAMETER;

View File

@@ -26,13 +26,14 @@ Abstract:
MiscSubclassDriverEntryPoint.c
Abstract:
This driver parses the mMiscSubclassDataTable structure and reports
any generated data to the DataHub.
**/
#include "CommonHeader.h"
#include "MiscSubclassDriver.h"
#include <Protocol/HiiString.h>
@@ -122,7 +123,19 @@ MiscSubclassDriverEntryPoint (
**/
EFI_STATUS
EFIAPI
MiscSubclassDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
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) {

View File

@@ -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);

View File

@@ -114,6 +114,7 @@
PchPlatformLib
I2cLib
NetLib
HobLib
[Guids]
gEfiProcessorSubClassGuid