From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=mang.guo@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9E60D2112294A for ; Thu, 6 Sep 2018 23:35:58 -0700 (PDT) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2018 23:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,341,1531810800"; d="dat'59?scan'59,208,59";a="89725487" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga002.jf.intel.com with ESMTP; 06 Sep 2018 23:35:56 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Sep 2018 23:35:56 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 6 Sep 2018 23:35:55 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Fri, 7 Sep 2018 14:35:53 +0800 From: "Guo, Mang" To: "edk2-devel@lists.01.org" CC: "Wei, David" Thread-Topic: [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Generate UUID. Thread-Index: AdRGdQY5T+/DnlE/SGezsR4z2/90PQ== Date: Fri, 7 Sep 2018 06:35:53 +0000 Message-ID: <22D2C85ED001C54AA20BFE3B0E4751D1526D6E9F@SHSMSX103.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <22D2C85ED001C54AA20BFE3B0E4751D1526D6E9F@SHSMSX103.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [Patch][edk2-platforms/devel-IntelAtomProcessorE3900] Generate UUID. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Sep 2018 06:35:58 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Generate UUID for MinnowBoard Max. User can configure their UUID in setup U= I. If user don't configure it in setup, MAC address will be used as UUID. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Guo Mang --- Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h | 1 + .../PlatformSetupDxe/SystemComponent.vfi | 9 +- Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni | Bin 216550 -> 217008 = bytes .../SmBiosMiscDxe/MiscSystemManufacturerFunction.c | 353 ++++++++++++++---= ---- Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf | 5 +- Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageVariable.bin | Bin 253952 -> 253952 = bytes 6 files changed, 247 insertions(+), 121 deletions(-) diff --git a/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h b/Vlv2TbltDevic= ePkg/Include/Guid/SetupVariable.h index f0319b6..1490f76 100644 --- a/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h +++ b/Vlv2TbltDevicePkg/Include/Guid/SetupVariable.h @@ -1311,6 +1311,7 @@ typedef struct { UINT8 RtcBattery; UINT8 LpeAudioReportedByDSDT; UINT8 Uart1Int3511Com; // Report UART1 as COM with _HID INT3511 + CHAR16 SystemUuid[37]; =20 } SYSTEM_CONFIGURATION; #pragma pack() diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SystemComponent.vfi b/Vlv2T= bltDevicePkg/PlatformSetupDxe/SystemComponent.vfi index e21f880..097d324 100644 --- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SystemComponent.vfi +++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SystemComponent.vfi @@ -1,6 +1,6 @@ // // -// Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
// = =20 // This program and the accompanying materials are licensed and made avail= able under // the terms and conditions of the BSD License that accompanies this distr= ibution. =20 @@ -81,6 +81,11 @@ form formid =3D SYSTEM_COMPONENT_FORM_ID, option text =3D STRING_TOKEN(STR_ON), value =3D 1, flags =3D RESET_REQ= UIRED; endoneof; =20 - + string varid =3D Setup.SystemUuid, + prompt =3D STRING_TOKEN (STR_SYSTEM_UUID_TITLE), + help =3D STRING_TOKEN (STR_SYSTEM_UUID_HELP), + minsize =3D 0, + maxsize =3D 36, + endstring; =20 endform; diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/VfrStrings.uni b/Vlv2TbltDe= vicePkg/PlatformSetupDxe/VfrStrings.uni index ad4cf64405e100f8f554d26badb01eb2d38a3128..20fcde03c71597489ac0fa635e6= a3d48f8a8debd 100644 GIT binary patch delta 241 zcmaDhn|H%}-U$wj78@OtrKaC%V3e7hpvcD_$`H!n$>1`5p$4P#v}Q(?$@7-;FarfA z_ZKRI6oA=3D`d9KqJa4;!NU!cv%R$stS%22|fz);DM4`dYqSx`fOtW1VHAZdsObs3DH zP?y0N3UwJwpimd6+6X9W!eGi^#$e81!C=3DW?z>vt01T-lPXh#u4E|6Ekpv1t-z{S8j pz1x^sdUAub-sA~lS|BG+Pq@m&(d;1I?jX$w#7x^Aq?wl)0RWDpGe`gc delta 40 vcmdlmpZD2p-U$wj<{KT8r6#YtDlvV-H72g+2{P>yWEg>%Y5N2jW(8vaR67p} diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction= .c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c index 1d47e4a..26da5ab 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscSystemManufacturerFunction.c @@ -1,6 +1,6 @@ /*++ =20 -Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
=20 This program and the accompanying materials are licensed and made availa= ble under the terms and conditions of the BSD License that accompanies this distri= bution. @@ -31,147 +31,208 @@ Abstract: #include "Library/DebugLib.h" #include #include +#include +#include +#include =20 =20 extern EFI_PLATFORM_INFO_HOB *mPlatformInfo; -static EFI_SMBIOS_HANDLE mSmbiosHandleType1; +EFI_GUID mSystemConfigurationGuid =3D SYSTEM_CONFIGURATIO= N_GUID; =20 =20 -EFI_STATUS -EFIAPI -UpdateSmbiosManuCallback ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - EFI_STATUS Status; - EFI_HANDLE *Handles; - UINTN BufferSize; - CHAR16 *MacStr; - EFI_SMBIOS_PROTOCOL *Smbios; - UINTN SerialNumberOffset; - CHAR8 AsciiData[SMBIOS_STRING_MAX_LENGTH]; - - gBS->CloseEvent (Event); // Unload this event. +/** + Return the description for network boot device. =20 - DEBUG ((EFI_D_INFO, "Executing UpdateSmbiosManuCallback.\n")); + @param Handle Controller handle. =20 - // - //Get handle infomation - // - BufferSize =3D 0; - Handles =3D NULL; - Status =3D gBS->LocateHandle ( - ByProtocol, - &gEfiSimpleNetworkProtocolGuid, + @return The description string. +**/ +CHAR16 * +GetNetworkDescription ( + IN EFI_HANDLE Handle + ) +{ + EFI_STATUS Status; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + MAC_ADDR_DEVICE_PATH *Mac; + CHAR16 *Description; + UINTN DescriptionSize; + + Status =3D gBS->OpenProtocol ( + Handle, + &gEfiLoadFileProtocolGuid, NULL, - &BufferSize, - Handles + gImageHandle, + Handle, + EFI_OPEN_PROTOCOL_TEST_PROTOCOL ); + if (EFI_ERROR (Status)) { + return NULL; + } =20 - if (Status =3D=3D EFI_BUFFER_TOO_SMALL) { - Handles =3D AllocateZeroPool(BufferSize); - if (Handles =3D=3D NULL) { - return (EFI_OUT_OF_RESOURCES); - } - Status =3D gBS->LocateHandle( - ByProtocol, - &gEfiSimpleNetworkProtocolGuid, - NULL, - &BufferSize, - Handles - ); + Status =3D gBS->OpenProtocol ( + Handle, + &gEfiDevicePathProtocolGuid, + (VOID **) &DevicePath, + gImageHandle, + Handle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status) || (DevicePath =3D=3D NULL)) { + return NULL; } =20 // - //Get the MAC string + // The PXE device path is like: + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)] + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...) // - Status =3D NetLibGetMacString ( - *Handles, - NULL, - &MacStr - ); - if (EFI_ERROR (Status)) { - return Status; + // The HTTP device path is like: + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv4(...)/Uri(...) + // ....../Mac(...)[/Vlan(...)][/Wi-Fi(...)]/IPv6(...)/Uri(...) + // + while (!IsDevicePathEnd (DevicePath) && + ((DevicePathType (DevicePath) !=3D MESSAGING_DEVICE_PATH) || + (DevicePathSubType (DevicePath) !=3D MSG_MAC_ADDR_DP)) + ) { + DevicePath =3D NextDevicePathNode (DevicePath); } =20 - ZeroMem (AsciiData, SMBIOS_STRING_MAX_LENGTH); - UnicodeStrToAsciiStr (MacStr, AsciiData); + if (IsDevicePathEnd (DevicePath)) { + return NULL; + } =20 - Status =3D gBS->LocateProtocol ( - &gEfiSmbiosProtocolGuid, - NULL, - (VOID *) &Smbios - ); - ASSERT_EFI_ERROR (Status); + Mac =3D (MAC_ADDR_DEVICE_PATH *) DevicePath; + DevicePath =3D NextDevicePathNode (DevicePath); =20 - SerialNumberOffset =3D 4; - Status =3D Smbios->UpdateString ( - Smbios, - &mSmbiosHandleType1, - &SerialNumberOffset, - AsciiData - ); - if (EFI_ERROR (Status)) { - ASSERT_EFI_ERROR (Status); - return Status; + // + // Skip the optional Wi-Fi node + // + if ((DevicePathType (DevicePath) =3D=3D MESSAGING_DEVICE_PATH) && + (DevicePathSubType (DevicePath) =3D=3D MSG_WIFI_DP) + ) { + DevicePath =3D NextDevicePathNode (DevicePath); } - return EFI_SUCCESS; + + // + // Build description like below: + // "PXEv6 (MAC:112233445566 VLAN1)" + // "HTTPv4 (MAC:112233445566)" + // + DescriptionSize =3D sizeof (L"112233445566"); + Description =3D AllocatePool (DescriptionSize); + ASSERT (Description !=3D NULL); + UnicodeSPrint ( + Description, DescriptionSize, + L"%02x%02x%02x%02x%02x%02x", + Mac->MacAddress.Addr[0], Mac->MacAddress.Addr[1], Mac->MacAddress.Addr= [2], + Mac->MacAddress.Addr[3], Mac->MacAddress.Addr[4], Mac->MacAddress.Addr= [5] + ); + + return Description; } =20 =20 -/** =20 - Publish the smbios type 1. +CHAR16 * +GetMacAddressString( + ) +{ + EFI_HANDLE *Handles; + UINTN HandleCount; + UINT8 Index; + CHAR16 *MacAddressString =3D NULL; + =20 + // + // Parse load file protocol + // + gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiLoadFileProtocolGuid, + NULL, + &HandleCount, + &Handles + ); + for (Index =3D 0; Index < HandleCount; Index++) { + + MacAddressString =3D GetNetworkDescription (Handles[Index]); + + if (MacAddressString !=3D NULL) { + break; + } + } =20 - @param Event Event whose notification function is being invoked (gE= fiDxeSmmReadyToLockProtocolGuid). - @param Context Pointer to the notification functions context, which i= s implementation dependent. + if (HandleCount !=3D 0) { + FreePool (Handles); + } =20 - @retval None + return MacAddressString; +} =20 -**/ -MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) -{ =20 +EFI_STATUS +EFIAPI +AddSmbiosManuCallback ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ CHAR8 *OptionalStrStart; UINTN ManuStrLen; UINTN VerStrLen; UINTN PdNameStrLen; UINTN SerialNumStrLen; UINTN SkuNumberStrLen; - UINTN FamilyNameStrLen; + UINTN FamilyNameStrLen; EFI_STATUS Status; EFI_STRING Manufacturer; EFI_STRING ProductName; EFI_STRING Version; EFI_STRING SerialNumber; EFI_STRING SkuNumber; - EFI_STRING FamilyName; + EFI_STRING FamilyName; STRING_REF TokenToGet; EFI_SMBIOS_HANDLE SmbiosHandle; SMBIOS_TABLE_TYPE1 *SmbiosRecord; EFI_MISC_SYSTEM_MANUFACTURER *ForType1InputData; CHAR16 Buffer[40]; - CHAR16 *MacStr; CHAR16 PlatformNameBuffer[40]; - VOID *UpdateSmbiosManuCallbackNotifyReg; - EFI_EVENT UpdateSmbiosManuCallbackEvent; - static BOOLEAN CallbackIsInstalledT1 =3D FALSE; + CHAR16 *MacAddressString =3D NULL; + CHAR16 SerialNumberBuffer[sizeof (L"112233445= 566")]; + EFI_SMBIOS_PROTOCOL *Smbios; + SYSTEM_CONFIGURATION SetupVarBuffer; + UINTN VariableSize; + CHAR16 *Uuid; + UINT64 TempData; + UINTN Index; + + =20 - ForType1InputData =3D (EFI_MISC_SYSTEM_MANUFACTURER *)RecordData; + + gBS->CloseEvent (Event); // Unload this event. + + DEBUG ((EFI_D_INFO, "Executing AddSmbiosManuCallback.\n")); + + + ForType1InputData =3D (EFI_MISC_SYSTEM_MANUFACTURER *)Context; // // First check for invalid parameters. // - if (RecordData =3D=3D NULL || mPlatformInfo =3D=3D NULL) { + if (Context =3D=3D NULL || mPlatformInfo =3D=3D NULL) { DEBUG ((EFI_D_INFO, "MISC_SMBIOS_TABLE_FUNCTION error.\n")); return EFI_INVALID_PARAMETER; } =20 + Status =3D gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)= &Smbios); + ASSERT_EFI_ERROR (Status); + + if (BOARD_ID_MINNOW2_TURBOT =3D=3D mPlatformInfo->BoardId) { - // - // Detect the board is Turbot board platform - // - UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer),L"%s",L= "Minnowboard Turbot "); + // + // Detect the board is Turbot board platform + // + UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer),L"%s",L"M= innowboard Turbot "); } else { UnicodeSPrint (PlatformNameBuffer, sizeof (PlatformNameBuffer),L"%s",L= "Minnowboard Max "); } @@ -237,9 +298,9 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) DEBUG ((EFI_D_ERROR, "D0 Stepping Detected\n")); break; default: - DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n")); + DEBUG ((EFI_D_ERROR, "Unknow Stepping Detected\n")); break; - } + } =20 if (BOARD_ID_MINNOW2_TURBOT =3D=3D mPlatformInfo->BoardId) { UnicodeSPrint (Buffer, sizeof (Buffer),L"ADI"); @@ -266,8 +327,15 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) return EFI_UNSUPPORTED; } =20 - MacStr =3D L"00000000"; - SerialNumber =3D MacStr; + + MacAddressString =3D GetMacAddressString(); + + if ( MacAddressString !=3D NULL) { + UnicodeSPrint (SerialNumberBuffer, sizeof (L"112233445566"), L"%s", Ge= tMacAddressString()); + HiiSetString (mHiiHandle, STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER)= , SerialNumberBuffer, NULL); + } + TokenToGet =3D STRING_TOKEN (STR_MISC_SYSTEM_SERIAL_NUMBER); + SerialNumber =3D SmbiosMiscGetString (TokenToGet); SerialNumStrLen =3D StrLen(SerialNumber); if (SerialNumStrLen > SMBIOS_STRING_MAX_LENGTH) { return EFI_UNSUPPORTED; @@ -327,9 +395,53 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) // ForType1InputData->SystemUuid.Data1 =3D PcdGet32 (PcdProductSerialNumber= ); ForType1InputData->SystemUuid.Data4[0] =3D PcdGet8 (PcdEmmcManufacturerI= d); + VariableSize =3D sizeof (SYSTEM_CONFIGURATION); + Status =3D gRT->GetVariable ( + L"Setup", + &mSystemConfigurationGuid, + NULL, + &VariableSize, + &SetupVarBuffer + ); + ASSERT_EFI_ERROR (Status); + + Uuid =3D AllocatePool(sizeof(SetupVarBuffer.SystemUuid)); + ASSERT (Uuid !=3D NULL); + CopyMem (Uuid, SetupVarBuffer.SystemUuid, sizeof(SetupVarBuffer.SystemUu= id)); + + if(StrLen(Uuid) !=3D 0) { + DEBUG ((EFI_D_INFO, "CustomerUuid %s\n",SetupVarBuffer.SystemUuid)); + ForType1InputData->SystemUuid.Data1 =3D (UINT32) StrHexToUint64 (Uuid)= ; + ForType1InputData->SystemUuid.Data2 =3D (UINT16) StrHexToUint64 (Uuid = + 9); + ForType1InputData->SystemUuid.Data3 =3D (UINT16) StrHexToUint64 (Uuid = + 14); + ForType1InputData->SystemUuid.Data4[0] =3D (UINT8) StrHexToUint64 (Uui= d + 19); + ForType1InputData->SystemUuid.Data4[1] =3D (UINT8) StrHexToUint64 (Uui= d + 21); + TempData =3D StrHexToUint64 (Uuid + 24); + for(Index =3D sizeof(ForType1InputData->SystemUuid.Data4)/sizeof(UINT8= ); Index > 2; Index--) { + ForType1InputData->SystemUuid.Data4[Index-1] =3D (UINT8) TempData; + TempData =3D TempData >> 8; + } + + ForType1InputData->SystemUuid.Data4[0] =3D (UINT8) StrHexToUint64 (Uui= d + 19); + + } else if (MacAddressString !=3D NULL) { + ForType1InputData->SystemUuid.Data1 =3D (UINT32)MacAddressString [0]= + (((UINT32)MacAddressString [1]) << 16); + ForType1InputData->SystemUuid.Data2 =3D (UINT16)MacAddressString [2]= ; + ForType1InputData->SystemUuid.Data3 =3D (UINT16)MacAddressString [3]= ; + ForType1InputData->SystemUuid.Data4[0] =3D (UINT8)MacAddressString [= 4]; + ForType1InputData->SystemUuid.Data4[1] =3D (UINT8)(MacAddressString = [5]); + ForType1InputData->SystemUuid.Data4[2] =3D (UINT8)MacAddressString [= 6]; + ForType1InputData->SystemUuid.Data4[3] =3D (UINT8)(MacAddressString = [7]); + ForType1InputData->SystemUuid.Data4[4] =3D (UINT8)(MacAddressString = [8]); + ForType1InputData->SystemUuid.Data4[5] =3D (UINT8)(MacAddressString = [9]); + ForType1InputData->SystemUuid.Data4[6] =3D (UINT8)(MacAddressString = [10]); + ForType1InputData->SystemUuid.Data4[7] =3D (UINT8)(MacAddressString = [11]); + } =20 CopyMem ((UINT8 *) (&SmbiosRecord->Uuid),&ForType1InputData->SystemUuid,= 16); =20 + + SmbiosRecord->WakeUpType =3D (UINT8)ForType1InputData->SystemWakeupType; =20 OptionalStrStart =3D (CHAR8 *)(SmbiosRecord + 1); @@ -338,7 +450,7 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) UnicodeStrToAsciiStr(Version, OptionalStrStart + ManuStrLen + 1 + PdName= StrLen + 1); UnicodeStrToAsciiStr(SerialNumber, OptionalStrStart + ManuStrLen + 1 + P= dNameStrLen + 1 + VerStrLen + 1); =20 - UnicodeStrToAsciiStr(SkuNumber, OptionalStrStart + ManuStrLen + 1 + PdNa= meStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1); + UnicodeStrToAsciiStr(SkuNumber, OptionalStrStart + ManuStrLen + 1 + PdNa= meStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1); UnicodeStrToAsciiStr(FamilyName, OptionalStrStart + ManuStrLen + 1 + PdN= ameStrLen + 1 + VerStrLen + 1 + SerialNumStrLen + 1 + SkuNumberStrLen +1); =20 // @@ -353,36 +465,41 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) ); FreePool(SmbiosRecord); =20 - // - // gEfiSimpleNetworkProtocolGuid is ready - // - if (CallbackIsInstalledT1 =3D=3D FALSE) { - CallbackIsInstalledT1 =3D TRUE; // Prevent more than 1 callba= ck. - DEBUG ((EFI_D_INFO, "Create Smbios Type1 callback.\n")); - - mSmbiosHandleType1 =3D SmbiosHandle; - Status =3D gBS->CreateEvent ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - (EFI_EVENT_NOTIFY)UpdateSmbiosManuCallback, - RecordData, - &UpdateSmbiosManuCallbackEvent - ); - - ASSERT_EFI_ERROR (Status); - if (EFI_ERROR (Status)) { - return Status; + return Status; +} =20 - } =20 - Status =3D gBS->RegisterProtocolNotify ( - &gEfiSimpleNetworkProtocolGuid, - UpdateSmbiosManuCallbackEvent, - &UpdateSmbiosManuCallbackNotifyReg - ); +/** + + Publish the smbios type 1. + + @param Event Event whose notification function is being invoked (gE= fiDxeSmmReadyToLockProtocolGuid). + @param Context Pointer to the notification functions context, which i= s implementation dependent. + + @retval None + +**/ +MISC_SMBIOS_TABLE_FUNCTION(MiscSystemManufacturer) +{ + EFI_STATUS Status =3D EFI_SUCCESS; + static BOOLEAN CallbackIsInstalledManu =3D FALSE; + EFI_EVENT AddSmbiosManuCallbackEvent; + + if (CallbackIsInstalledManu =3D=3D FALSE) { + CallbackIsInstalledManu =3D TRUE; // Prevent more than 1 callback. + DEBUG ((EFI_D_INFO, "Create Smbios Manu callback.\n")); + + + Status =3D EfiCreateEventReadyToBootEx ( + TPL_CALLBACK, + (EFI_EVENT_NOTIFY)AddSmbiosManuCallback, + RecordData, + &AddSmbiosManuCallbackEvent + ); return Status; } =20 return EFI_SUCCESS; + } =20 diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf b/Vlv2TbltDe= vicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf index b17e5b7..50bcb8b 100644 --- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf +++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/SmBiosMiscDxe.inf @@ -2,7 +2,7 @@ # Component name for module MiscSubclass # # FIX ME! -# Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials are licensed and made availa= ble under # the terms and conditions of the BSD License that accompanies this distri= bution. @@ -125,6 +125,7 @@ gEfiNormalSetupGuid gEfiPlatformInfoGuid gEfiVlv2VariableGuid + gEfiSetupVariableGuid =20 [Protocols] gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED @@ -136,6 +137,8 @@ gDxePchPlatformPolicyProtocolGuid gEfiSpiProtocolGuid gEfiSimpleNetworkProtocolGuid + gEfiLoadFileProtocolGuid + gEfiDevicePathProtocolGuid =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareReleaseDateString diff --git a/Vlv2TbltDevicePkg/Stitch/Gcc/NvStorageVariable.bin b/Vlv2TbltD= evicePkg/Stitch/Gcc/NvStorageVariable.bin index 2273b251757320e7702c7100ccf895cfb2ca5ec6..5fca3dba4b289996999b9f2729f= ab7316389c2a2 100644 GIT binary patch delta 40 vcmZoTz~69yf5ROq#<`pCN)<6rR+V<0*udHxDAyh+#|Xqs+XLm8(+>gwLzWI=3D delta 37 scmZoTz~69yf5ROq#^B9&rHYuF7s|CSlw$;9rtJ&mnBxyl-XIqQ03>h@)c^nh --=20 2.10.1.windows.1