From nobody Mon Feb 9 16:50:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+51401+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51401+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1574903245; cv=none; d=zohomail.com; s=zohoarc; b=DJCxrU9PbJgaMuiqRKMCM9UB5PPEX2MpDd1whdL8gbNZyxZBoMcOf1HAMqtMAK7EdEhL1bfAUWNCn+rAYVwAiB2RHTc8a9maFEvUXoJKZpSw3EQGZXwZOmOsVJIMgE3+oGmQ7uIoqYKl4Kyxeqy+1UbAzHUc7a8ELSh6TQXzmhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574903245; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=/qx9A3s9ebnvU+3FH+jQHPuuDmMhKLxoWSYaNzQaZKI=; b=C1YEJ9HIpckHtQKcqbdpXTZYdh3jh3ckTM36vLDnFTzKsXpHwjYjknWF1aOqYXxsfqnTuQctlzpnHp5J3hMnNtDoBSkpVEhn9QSYrIvY8wYBcFZwJ2FMX18cVgi25Rpf9EIi/HqZnfHgAEI/j1JtUEgLnoWRo9rGJm2TmYIfWS8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+51401+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1574903245376460.36054744963826; Wed, 27 Nov 2019 17:07:25 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id O8dJYY1788612xK7Ofyar3f2; Wed, 27 Nov 2019 17:07:24 -0800 X-Received: from mga05.intel.com (mga05.intel.com []) by mx.groups.io with SMTP id smtpd.web09.933.1574903199589090118 for ; Wed, 27 Nov 2019 17:07:24 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Nov 2019 17:07:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,251,1571727600"; d="scan'208";a="383667800" X-Received: from makuback-desk1.amr.corp.intel.com ([10.7.159.162]) by orsmga005.jf.intel.com with ESMTP; 27 Nov 2019 17:07:23 -0800 From: "Kubacki, Michael A" To: devel@edk2.groups.io Cc: Sai Chaganty , Liming Gao Subject: [edk2-devel] [edk2-platforms][PATCH V2 16/47] Features/Intel/SmbiosFeaturePkg: Add initial package Date: Wed, 27 Nov 2019 17:05:43 -0800 Message-Id: <20191128010614.43628-17-michael.a.kubacki@intel.com> In-Reply-To: <20191128010614.43628-1-michael.a.kubacki@intel.com> References: <20191128010614.43628-1-michael.a.kubacki@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.a.kubacki@intel.com X-Gm-Message-State: nlvk7TKZcOISDa8SZeLhpFiox1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1574903244; bh=JIBhNiAypsc/PZa8y7NKd76vxf0Djp8clJcRPLcimDc=; h=Cc:Date:From:Reply-To:Subject:To; b=Vq1w0/oqHBJqOVcRd/2s80RbQTeRZpBUzgxY1W7jWop9eStVhJLK4YJswjV7yW9oLjp NAyV7BpxZVgcwtFIlQ99DhQ96y7TsxAuB800jV/dyKwEUGXUO1ZiwsMt22sROoO3OgTiB ybpWUDFW85iwYOPA81djx4W/ZM3ZIUnXVCE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Adds a new feature package for the SMBIOS feature. Cc: Sai Chaganty Cc: Liming Gao Signed-off-by: Michael Kubacki Reviewed-by: Nate DeSimone --- Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec = | 172 ++++++++++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeature.ds= c | 115 +++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc = | 30 ++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.fdf = | 10 ++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PreMemory.fdf = | 8 + Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBas= icDxe.inf | 83 ++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBas= ic.h | 45 +++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBas= icEntryPoint.c | 125 ++++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type0Bios= VendorFunction.c | 81 +++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type1Syst= emManufacturerFunction.c | 114 +++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type2Base= BoardManufacturerFunction.c | 131 +++++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type32Boo= tInformationFunction.c | 56 +++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type3Chas= sisManufacturerFunction.c | 125 ++++++++++++++ Features/Intel/SystemInformation/SmbiosFeaturePkg/Readme.md = | 96 +++++++++++ 14 files changed, 1191 insertions(+) diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeatur= ePkg.dec b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeatureP= kg.dec new file mode 100644 index 0000000000..c06a87aad0 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec @@ -0,0 +1,172 @@ +## @file +# This package provides advanced feature functionality for System Manageme= nt BIOS (SMBIOS). +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION =3D 0x00010017 + PACKAGE_NAME =3D SmbiosFeaturePkg + PACKAGE_GUID =3D 8CCEE569-02AD-4844-8725-F4C7966E320A + PACKAGE_VERSION =3D 0.1 + +[Includes] + Include + +[LibraryClasses] + +[Guids] + gSmbiosFeaturePkgTokenSpaceGuid =3D {0xc1530658, 0xe234, 0x4c13, {0xb6= , 0x82, 0xd3, 0x87, 0x84, 0xf1, 0xd7, 0x16}} + +[PcdsFeatureFlag] + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosFeatureEnable|FALSE|BOOLEAN|0xA= 0000001 + +[PcdsDynamic, PcdsDynamicEx] + # + # SMBIOS Type 0 BIOS Information + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation|{0x0}|SMBI= OS_TABLE_TYPE0|0xD0000001 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.Vendor|0x1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosVersio= n|0x2 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSegmen= t|0xF000 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosReleas= eDate|0x3 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosSize|0= xFF + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.PciIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.PlugAndPlayIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.BiosIsUpgradable|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.BiosShadowingAllowed|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.BootFromCdIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.SelectableBootIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.EDDSpecificationIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.Floppy525_12IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.Floppy35_720IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.Floppy35_288IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.PrintScreenIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.Keyboard8042IsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.SerialIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.PrinterIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BiosCharac= teristics.CgaMonoIsSupported|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSCharac= teristicsExtensionBytes[0]|0x33 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation.BIOSCharac= teristicsExtensionBytes[1]|0x0F + + # + # SMBIOS Type 1 System Information + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation|{0x0}|SM= BIOS_TABLE_TYPE1|0xD0000002 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Manufact= urer|0x1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.ProductN= ame|0x2 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Version|= 0x3 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.SerialNu= mber|0x4 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Uuid|{GU= ID("88888888-8887-8888-8888-878888888888")} + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.WakeUpTy= pe|SystemWakeupTypePowerSwitch + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.SKUNumbe= r|0x5 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation.Family|0= x6 + + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation|{0x0}= |SMBIOS_TABLE_TYPE2|0xD0000003 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + + # + # SMBIOS Type 2 Base Board Information + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Manuf= acturer|0x1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Produ= ctName|0x2 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Versi= on|0x3 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Seria= lNumber|0x4 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Asset= Tag|0x5 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Featu= reFlag.Motherboard|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Featu= reFlag.Replaceable|1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Locat= ionInChassis|0x6 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation.Board= Type|BaseBoardTypeMotherBoard + + # + # SMBIOS Type 3 System Enclosure Chassis + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis|{0x= 0}|SMBIOS_TABLE_TYPE3|0xD0000004 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Man= ufacturer|0x1 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Typ= e|MiscChassisTypeRackMountChassis + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Ver= sion|0x2 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Ser= ialNumber|0x3 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Ass= etTag|0x4 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Boo= tupState|ChassisStateSafe + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Pow= erSupplyState|ChassisStateSafe + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.The= rmalState|ChassisStateSafe + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis.Sec= urityStatus|ChassisSecurityStatusNone + + # + # SMBIOS Type 32 System Boot Information + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation|{0x= 0}|SMBIOS_TABLE_TYPE32|0xD0000005 { + + IndustryStandard/SmBios.h + + MdePkg/MdePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + } + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation.Boo= tStatus|BootInformationStatusNoError + + # + # SMBIOS Type 0 BIOS Information Strings + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate|"200= 8-12-23"|VOID*|0xD1000001 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion|"PURLEY = CV/CRB BIOS Internal"|VOID*|0xD1000002 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor|"Intel Corpor= ation"|VOID*|0xD1000003 + + # + # SMBIOS Type 1 System Information Strings + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily|"Family"|VOID= *|0xD1000004 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer|"Intel = Corporation"|VOID*|0xD1000005 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName|"PURLEY"= |VOID*|0xD1000006 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSerialNumber|"UNKNOW= N"|VOID*|0xD1000007 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber|"SKU Numbe= r"|VOID*|0xD1000008 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion|"1.0"|VOID*|= 0xD1000009 + + # + # SMBIOS Type 2 Base Board Information Strings + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringAssetTag|"Base Board= Asset Tag"|VOID*|0xD100000A + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringLocationInChassis|"P= art Component"|VOID*|0xD100000B + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer|"Intel = Corporation"|VOID*|0xD100000C + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName|"PURLEY"= |VOID*|0xD100000D + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber|"SPRO03= 200016"|VOID*|0xD100000E + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion|"E63448-400"= |VOID*|0xD100000F + + # + # SMBIOS Type 3 System Enclosure Chassis Strings + # + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringAssetTag|"Chassis As= set Tag"|VOID*|0xD1000011 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer|"Intel = Corporation"|VOID*|0xD1000012 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSerialNumber|"UNKNOW= N"|VOID*|0xD1000013 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber|"SKU Numbe= r"|VOID*|0xD1000014 + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion|"0.1"|VOID*|= 0xD1000015 diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/Smbi= osFeature.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/S= mbiosFeature.dsc new file mode 100644 index 0000000000..a59fdf3702 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/SmbiosFeatu= re.dsc @@ -0,0 +1,115 @@ +## @file +# This is a build description file for the SMBIOS advanced feature. +# This file should be included into another package DSC file to build this= feature. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +##########################################################################= ###### +# +# Defines Section - statements that will be processed to create a Makefile. +# +##########################################################################= ###### +[Defines] +!ifndef $(PEI_ARCH) + !error "PEI_ARCH must be specified to build this feature!" +!endif +!ifndef $(DXE_ARCH) + !error "DXE_ARCH must be specified to build this feature!" +!endif + +##########################################################################= ###### +# +# Library Class section - list of all Library Classes needed by this featu= re. +# +##########################################################################= ###### +[LibraryClasses] + ####################################### + # Edk2 Packages + ####################################### + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf + +[LibraryClasses.common.DXE_DRIVER] + ####################################### + # Edk2 Packages + ####################################### + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + +##########################################################################= ###### +# +# Component section - list of all components that need built for this feat= ure. +# +# Note: The EDK II DSC file is not used to specify how compiled binary ima= ges get placed +# into firmware volume images. This section is just a list of module= s to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary f= iles into firmware +# volume images, whose concept is beyond UEFI and is described in PI= specification. +# There may also be modules listed in this section that are not requ= ired in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-com= pliant binary will be +# generated for it, but the binary will not be put into any firmware= volume. +# +##########################################################################= ###### +# +# Feature PEI Components +# + +# @todo: Change below line to [Components.$(PEI_ARCH)] after https://bugzi= lla.tianocore.org/show_bug.cgi?id=3D2308 +# is completed. +[Components.IA32] + ##################################### + # SMBIOS Feature Package + ##################################### + + # Add library instances here that are not included in package components= and should be tested + # in the package build. + + # Add components here that should be included in the package build. + +# +# Feature DXE Components +# + +# @todo: Change below line to [Components.$(DXE_ARCH)] after https://bugzi= lla.tianocore.org/show_bug.cgi?id=3D2308 +# is completed. +[Components.X64] + ##################################### + # SMBIOS Feature Package + ##################################### + + # Add library instances here that are not included in package components= and should be tested + # in the package build. + + # Add components here that should be included in the package build. + SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf + +##########################################################################= ######################### +# +# BuildOptions Section - Define the module specific tool chain flags that = should be used as +# the default flags for a module. These flags are a= ppended to any +# standard flags that are defined by the build proc= ess. They can be +# applied for any modules or only those modules wit= h the specific +# module style (EDK or EDKII) specified in [Compone= nts] section. +# +# For advanced features, it is recommended to enabl= e [BuildOptions] in +# the applicable INF file so it does not affect the= whole board package +# build when this DSC file is active. +# +##########################################################################= ######################### +[BuildOptions] diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeatur= ePkg.dsc b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeatureP= kg.dsc new file mode 100644 index 0000000000..31141c0725 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dsc @@ -0,0 +1,30 @@ +## @file +# This package provides advanced feature functionality for System Manageme= nt BIOS (SMBIOS). +# This package should only depend on EDK II Core packages, IntelSiliconPkg= , and MinPlatformPkg. +# +# The DEC files are used by the utilities that parse DSC and +# INF files to generate AutoGen.c and AutoGen.h files +# for the build infrastructure. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + PLATFORM_NAME =3D SmbiosFeaturePkg + PLATFORM_GUID =3D 44AF1C2A-16AD-4509-8DF6-988E73E23A85 + PLATFORM_VERSION =3D 0.1 + DSC_SPECIFICATION =3D 0x00010005 + OUTPUT_DIRECTORY =3D Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES =3D IA32|X64 + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER =3D DEFAULT + PEI_ARCH =3D IA32 + DXE_ARCH =3D X64 + +# +# This package always builds the feature. +# +!include Include/SmbiosFeature.dsc diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/Post= Memory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/Post= Memory.fdf new file mode 100644 index 0000000000..3ed23bd937 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PostMemory.= fdf @@ -0,0 +1,10 @@ +## @file +# FDF file for post-memory SMBIOS modules. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + + INF SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/SmbiosBasicDxe.inf diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PreM= emory.fdf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PreMe= mory.fdf new file mode 100644 index 0000000000..732c1b69e5 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Include/PreMemory.f= df @@ -0,0 +1,8 @@ +## @file +# FDF file for pre-memory SMBIOS modules. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/SmbiosBasicDxe.inf b/Features/Intel/SystemInformation/SmbiosFeaturePkg/S= mbiosBasicDxe/SmbiosBasicDxe.inf new file mode 100644 index 0000000000..bd8736b621 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Smbi= osBasicDxe.inf @@ -0,0 +1,83 @@ +### @file +# Component description file for the SMBIOS basic module. +# +# Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SmbiosBasic + FILE_GUID =3D 03ADF4A1-A27A-45E3-B211-3177C6C2E7ED + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D SmbiosBasicEntryPoint + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC +# + +[Sources] + SmbiosBasic.h + SmbiosBasicEntryPoint.c + Type0BiosVendorFunction.c + Type1SystemManufacturerFunction.c + Type2BaseBoardManufacturerFunction.c + Type32BootInformationFunction.c + Type3ChassisManufacturerFunction.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + SystemInformation/SmbiosFeaturePkg/SmbiosFeaturePkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + DevicePathLib + HobLib + MemoryAllocationLib + PcdLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + +[Protocols] + gEfiSmbiosProtocolGuid # PROTOCOL ALWAYS_CONSUMED + gEfiVariableArchProtocolGuid + +[Pcd] + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0BiosInformation + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosReleaseDate + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringBiosVersion + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType0StringVendor + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringFamily + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringManufacturer + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringProductName + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSerialNumber + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringSKUNumber + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1StringVersion + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType1SystemInformation + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2BaseBoardInformation + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringAssetTag + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringLocationInChassis + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringManufacturer + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringProductName + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringSerialNumber + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType2StringVersion + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType32SystemBootInformation + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringAssetTag + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringManufacturer + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSerialNumber + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringSKUNumber + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3StringVersion + gSmbiosFeaturePkgTokenSpaceGuid.PcdSmbiosType3SystemEnclosureChassis + +[Depex] + gEfiSmbiosProtocolGuid AND + gEfiVariableArchProtocolGuid diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/SmbiosBasic.h b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Smbios= BasicDxe/SmbiosBasic.h new file mode 100644 index 0000000000..2a349bcd37 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Smbi= osBasic.h @@ -0,0 +1,45 @@ +/** @file + Smbios basic header file. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _SMBIOS_BASIC_DRIVER_H +#define _SMBIOS_BASIC_DRIVER_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + Add an SMBIOS record. + + @param Smbios The EFI_SMBIOS_PROTOCOL instance. + @param SmbiosHandle A unique handle will be assigned to the SM= BIOS record. + @param Record The data for the fixed portion of the SMBI= OS record. The format of the record is + determined by EFI_SMBIOS_TABLE_HEADER.Type= . The size of the formatted area is defined + by EFI_SMBIOS_TABLE_HEADER.Length and eith= er followed by a double-null (0x0000) or + a set of null terminated strings and a nul= l. + + @retval EFI_SUCCESS Record was added. + @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system= resources. + +**/ +EFI_STATUS +AddSmbiosRecord ( + IN EFI_SMBIOS_PROTOCOL *Smbios, + OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TABLE_HEADER *Record + ); + +#endif diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/SmbiosBasicEntryPoint.c b/Features/Intel/SystemInformation/SmbiosFeature= Pkg/SmbiosBasicDxe/SmbiosBasicEntryPoint.c new file mode 100644 index 0000000000..4b24d1a124 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Smbi= osBasicEntryPoint.c @@ -0,0 +1,125 @@ +/** @file + Smbios basic entry point. + +Copyright (c) 2018, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + +EFI_STATUS +EFIAPI +BiosVendorFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +EFI_STATUS +EFIAPI +SystemManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +EFI_STATUS +EFIAPI +BaseBoardManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +EFI_STATUS +EFIAPI +ChassisManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +EFI_STATUS +EFIAPI +BootInfoStatusFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +typedef +EFI_STATUS +(EFIAPI EFI_BASIC_SMBIOS_DATA_FUNCTION) ( + IN EFI_SMBIOS_PROTOCOL *Smbios + ); + +typedef struct { + EFI_BASIC_SMBIOS_DATA_FUNCTION *Function; +} EFI_BASIC_SMBIOS_DATA; + +EFI_BASIC_SMBIOS_DATA mSmbiosBasicDataFuncTable[] =3D { + {&BiosVendorFunction}, + {&SystemManufacturerFunction}, + {&BaseBoardManufacturerFunction}, + {&ChassisManufacturerFunction}, + {&BootInfoStatusFunction}, +}; + +/** + 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 +SmbiosBasicEntryPoint( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + UINTN Index; + EFI_STATUS EfiStatus; + EFI_SMBIOS_PROTOCOL *Smbios; + + EfiStatus =3D gBS->LocateProtocol(&gEfiSmbiosProtocolGuid, NULL, (VOID**= )&Smbios); + if (EFI_ERROR(EfiStatus)) { + DEBUG((DEBUG_ERROR, "Could not locate SMBIOS protocol. %r\n", EfiStat= us)); + return EfiStatus; + } + + for (Index =3D 0; Index < sizeof(mSmbiosBasicDataFuncTable)/sizeof(mSmbi= osBasicDataFuncTable[0]); ++Index) { + EfiStatus =3D (*mSmbiosBasicDataFuncTable[Index].Function) (Smbios); + if (EFI_ERROR(EfiStatus)) { + DEBUG((DEBUG_ERROR, "Basic smbios store error. Index=3D%d, ReturnSt= atus=3D%r\n", Index, EfiStatus)); + return EfiStatus; + } + } + + return EfiStatus; +} + +/** + Add an SMBIOS record. + + @param Smbios The EFI_SMBIOS_PROTOCOL instance. + @param SmbiosHandle A unique handle will be assigned to the SM= BIOS record. + @param Record The data for the fixed portion of the SMBI= OS record. The format of the record is + determined by EFI_SMBIOS_TABLE_HEADER.Type= . The size of the formatted area is defined + by EFI_SMBIOS_TABLE_HEADER.Length and eith= er followed by a double-null (0x0000) or + a set of null terminated strings and a nul= l. + + @retval EFI_SUCCESS Record was added. + @retval EFI_OUT_OF_RESOURCES Record was not added due to lack of system= resources. + +**/ +EFI_STATUS +AddSmbiosRecord ( + IN EFI_SMBIOS_PROTOCOL *Smbios, + OUT EFI_SMBIOS_HANDLE *SmbiosHandle, + IN EFI_SMBIOS_TABLE_HEADER *Record + ) +{ + *SmbiosHandle =3D SMBIOS_HANDLE_PI_RESERVED; + return Smbios->Add ( + Smbios, + NULL, + SmbiosHandle, + Record + ); +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/Type0BiosVendorFunction.c b/Features/Intel/SystemInformation/SmbiosFeatu= rePkg/SmbiosBasicDxe/Type0BiosVendorFunction.c new file mode 100644 index 0000000000..7730756ee5 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type= 0BiosVendorFunction.c @@ -0,0 +1,81 @@ +/** @file + Smbios type 0. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + +/** + This function makes boot time changes to the contents of the + BiosVendor (Type 0). + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +EFI_STATUS +EFIAPI +BiosVendorFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + CHAR8 *VendorStr; + UINTN VendorStrLen; + CHAR8 *VersionStr; + UINTN VerStrLen; + CHAR8 *DateStr; + UINTN DateStrLen; + SMBIOS_TABLE_TYPE0 *SmbiosRecord; + SMBIOS_TABLE_TYPE0 *PcdSmbiosRecord; + EFI_SMBIOS_HANDLE SmbiosHandle; + UINTN StringOffset; + + PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType0BiosInformation); + + VendorStr =3D PcdGetPtr (PcdSmbiosType0StringVendor); + VendorStrLen =3D AsciiStrLen (VendorStr); + ASSERT (VendorStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + VersionStr =3D PcdGetPtr (PcdSmbiosType0StringBiosVersion); + VerStrLen =3D AsciiStrLen (VersionStr); + ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + DateStr =3D PcdGetPtr (PcdSmbiosType0StringBiosReleaseDate); + DateStrLen =3D AsciiStrLen (DateStr); + ASSERT (DateStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Two zeros following the last string. + // + SmbiosRecord =3D AllocateZeroPool (sizeof (SMBIOS_TABLE_TYPE0) + VendorS= trLen + 1 + VerStrLen + 1 + DateStrLen + 1 + 1); + if (SmbiosRecord =3D=3D NULL) { + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE0)); + + SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_BIOS_INFORMATION; + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE0); + SmbiosRecord->Hdr.Handle =3D 0; + + StringOffset =3D SmbiosRecord->Hdr.Length; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VendorStr, VendorStrLen); + StringOffset +=3D VendorStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen); + StringOffset +=3D VerStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, DateStr, DateStrLen); + + // + // Now we have got the full smbios record, call smbios protocol to add t= his record. + // + Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord); + + FreePool (SmbiosRecord); + return Status; +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/Type1SystemManufacturerFunction.c b/Features/Intel/SystemInformation/Smb= iosFeaturePkg/SmbiosBasicDxe/Type1SystemManufacturerFunction.c new file mode 100644 index 0000000000..88c32e018e --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type= 1SystemManufacturerFunction.c @@ -0,0 +1,114 @@ +/** @file + Smbios type 1. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + +/** + This function makes boot time changes to the contents of the + SystemManufacturer (Type 1). + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +EFI_STATUS +EFIAPI +SystemManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + CHAR8 *ManufacturerStr; + CHAR8 *ProductNameStr; + CHAR8 *VersionStr; + CHAR8 *SerialNumberStr; + CHAR8 *SKUNumberStr; + CHAR8 *FamilyStr; + UINTN ManufacturerStrLen; + UINTN ProductNameStrLen; + UINTN VersionStrLen; + UINTN SerialNumberStrLen; + UINTN SKUNumberStrLen; + UINTN FamilyStrLen; + UINTN TableSize; + SMBIOS_TABLE_TYPE1 *PcdSmbiosRecord; + SMBIOS_TABLE_TYPE1 *SmbiosRecord; + EFI_SMBIOS_HANDLE SmbiosHandle; + UINTN StringOffset; + + PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType1SystemInformation); + + ManufacturerStr =3D PcdGetPtr (PcdSmbiosType1StringManufacturer); + ManufacturerStrLen =3D AsciiStrLen (ManufacturerStr); + ASSERT (ManufacturerStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + ProductNameStr =3D PcdGetPtr (PcdSmbiosType1StringProductName); + ProductNameStrLen =3D AsciiStrLen (ProductNameStr); + ASSERT (ProductNameStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + VersionStr =3D PcdGetPtr (PcdSmbiosType1StringVersion); + VersionStrLen =3D AsciiStrLen (VersionStr); + ASSERT (VersionStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + SerialNumberStr =3D PcdGetPtr (PcdSmbiosType1StringSerialNumber); + SerialNumberStrLen =3D AsciiStrLen (SerialNumberStr); + ASSERT (SerialNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + SKUNumberStr =3D PcdGetPtr (PcdSmbiosType1StringSKUNumber); + SKUNumberStrLen =3D AsciiStrLen (SKUNumberStr); + ASSERT (SKUNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + FamilyStr =3D PcdGetPtr (PcdSmbiosType1StringFamily); + FamilyStrLen =3D AsciiStrLen (FamilyStr); + ASSERT (FamilyStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Create table size based on string lengths + // + TableSize =3D sizeof (SMBIOS_TABLE_TYPE1) + ManufacturerStrLen + 1 + Pro= ductNameStrLen + 1 + VersionStrLen + 1 + SerialNumberStrLen + 1 + SKUNumber= StrLen + 1 + FamilyStrLen + 1 + 1; + SmbiosRecord =3D AllocateZeroPool (TableSize); + if (SmbiosRecord =3D=3D NULL) { + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE1)); + + // + // Fill in Type 1 fields + // + + SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_SYSTEM_INFORMATION; + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE1); + SmbiosRecord->Hdr.Handle =3D 0; + + // + // Add strings to bottom of data block + // + StringOffset =3D SmbiosRecord->Hdr.Length; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, Manufact= urerStrLen); + StringOffset +=3D ManufacturerStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ProductNameStr, ProductNa= meStrLen); + StringOffset +=3D ProductNameStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VersionStrLen= ); + StringOffset +=3D VersionStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mberStrLen); + StringOffset +=3D SerialNumberStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SKUNumberStr, SKUNumberSt= rLen); + StringOffset +=3D SKUNumberStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, FamilyStr, FamilyStrLen); + + // + // Now we have got the full smbios record, call smbios protocol to add t= his record. + // + Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord); + + FreePool(SmbiosRecord); + return Status; +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/Type2BaseBoardManufacturerFunction.c b/Features/Intel/SystemInformation/= SmbiosFeaturePkg/SmbiosBasicDxe/Type2BaseBoardManufacturerFunction.c new file mode 100644 index 0000000000..f72e6a67c8 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type= 2BaseBoardManufacturerFunction.c @@ -0,0 +1,131 @@ +/** @file + Smbios type 2. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + +/** + This function makes boot time changes to the contents of the + BaseBoardManufacturer (Type 2). + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +EFI_STATUS +EFIAPI +BaseBoardManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + CHAR8 *ManufacturerStr; + CHAR8 *ProductStr; + CHAR8 *VersionStr; + CHAR8 *SerialNumberStr; + CHAR8 *AssertTagStr; + CHAR8 *ChassisStr; + UINTN ManuStrLen; + UINTN ProductStrLen; + UINTN VerStrLen; + UINTN AssertTagStrLen; + UINTN SerialNumStrLen; + UINTN ChassisStrLen; + EFI_SMBIOS_HANDLE SmbiosHandle; + SMBIOS_TABLE_TYPE2 *PcdSmbiosRecord; + SMBIOS_TABLE_TYPE2 *SmbiosRecord; + UINTN SourceSize; + UINTN TotalSize; + UINTN StringOffset; + + PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType2BaseBoardInformation); + + // + // Get BoardManufacturer String. + // + ManufacturerStr =3D PcdGetPtr (PcdSmbiosType2StringManufacturer); + ManuStrLen =3D AsciiStrLen (ManufacturerStr); + ASSERT (ManuStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get Board ProductName String. + // + ProductStr =3D PcdGetPtr (PcdSmbiosType2StringProductName); + ProductStrLen =3D AsciiStrLen (ProductStr); + ASSERT (ProductStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get Board Version String. + // + VersionStr =3D PcdGetPtr (PcdSmbiosType2StringVersion); + VerStrLen =3D AsciiStrLen (VersionStr); + ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get Board Serial Number String. + // + SerialNumberStr =3D PcdGetPtr (PcdSmbiosType2StringSerialNumber); + SerialNumStrLen =3D AsciiStrLen (SerialNumberStr); + ASSERT (SerialNumStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get Board Asset Tag String. + // + AssertTagStr =3D PcdGetPtr (PcdSmbiosType2StringAssetTag); + AssertTagStrLen =3D AsciiStrLen (AssertTagStr); + ASSERT (AssertTagStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get Board Chassis Location Tag String. + // + ChassisStr =3D PcdGetPtr (PcdSmbiosType2StringLocationInChassis); + ChassisStrLen =3D AsciiStrLen (ChassisStr); + ASSERT (ChassisStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Two zeros following the last string. + // + SourceSize =3D PcdGetSize (PcdSmbiosType2BaseBoardInformation); + TotalSize =3D SourceSize + ManuStrLen + 1 + ProductStrLen + 1 + VerStrLe= n + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + ChassisStrLen + 1 + 1; + SmbiosRecord =3D AllocateZeroPool(TotalSize); + if (SmbiosRecord =3D=3D NULL) { + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CopyMem (SmbiosRecord, PcdSmbiosRecord, SourceSize); + + SmbiosRecord->Hdr.Type =3D SMBIOS_TYPE_BASEBOARD_INFORMATION; + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE2); + if (PcdSmbiosRecord->NumberOfContainedObjectHandles >=3D 2) { + SmbiosRecord->Hdr.Length +=3D (PcdSmbiosRecord->NumberOfContainedObjec= tHandles - 1) * sizeof(PcdSmbiosRecord->ContainedObjectHandles); + } + ASSERT(SourceSize >=3D SmbiosRecord->Hdr.Length); + SmbiosRecord->Hdr.Handle =3D 0; + + StringOffset =3D SmbiosRecord->Hdr.Length; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, ManuStrL= en); + StringOffset +=3D ManuStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ProductStr, ProductStrLen= ); + StringOffset +=3D ProductStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen); + StringOffset +=3D VerStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mStrLen); + StringOffset +=3D SerialNumStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, AssertTagStr, AssertTagSt= rLen); + StringOffset +=3D AssertTagStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ChassisStr, ChassisStrLen= ); + + // + // Now we have got the full smbios record, call smbios protocol to add t= his record. + // + Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord); + + FreePool(SmbiosRecord); + return Status; +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/Type32BootInformationFunction.c b/Features/Intel/SystemInformation/Smbio= sFeaturePkg/SmbiosBasicDxe/Type32BootInformationFunction.c new file mode 100644 index 0000000000..85d8fc4320 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type= 32BootInformationFunction.c @@ -0,0 +1,56 @@ +/** @file + Smbios type 32. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + + +/** + This function makes boot time changes to the contents of the + BootInformation (Type 32). + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +EFI_STATUS +EFIAPI +BootInfoStatusFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + EFI_STATUS Status; + EFI_SMBIOS_HANDLE SmbiosHandle; + SMBIOS_TABLE_TYPE32 *PcdSmbiosRecord; + SMBIOS_TABLE_TYPE32 *SmbiosRecord; + + PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType32SystemBootInformation); + + // + // Two zeros following the last string. + // + SmbiosRecord =3D AllocateZeroPool(sizeof (SMBIOS_TABLE_TYPE32) + 1 + 1); + if (SmbiosRecord =3D=3D NULL) { + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CopyMem (SmbiosRecord, PcdSmbiosRecord, sizeof(SMBIOS_TABLE_TYPE32)); + + SmbiosRecord->Hdr.Type =3D EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION; + SmbiosRecord->Hdr.Length =3D sizeof (SMBIOS_TABLE_TYPE32); + SmbiosRecord->Hdr.Handle =3D 0; + + // + // Now we have got the full smbios record, call smbios protocol to add t= his record. + // + Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord); + + FreePool(SmbiosRecord); + return Status; +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicD= xe/Type3ChassisManufacturerFunction.c b/Features/Intel/SystemInformation/Sm= biosFeaturePkg/SmbiosBasicDxe/Type3ChassisManufacturerFunction.c new file mode 100644 index 0000000000..035e47be4c --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/SmbiosBasicDxe/Type= 3ChassisManufacturerFunction.c @@ -0,0 +1,125 @@ +/** @file + Smbios type 3. + +Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "SmbiosBasic.h" + +/** + This function makes boot time changes to the contents of the + ChassisManufacturer (Type 3). + + @retval EFI_SUCCESS All parameters were valid. + @retval EFI_UNSUPPORTED Unexpected RecordType value. + @retval EFI_INVALID_PARAMETER Invalid parameter was found. + +**/ +EFI_STATUS +EFIAPI +ChassisManufacturerFunction( + IN EFI_SMBIOS_PROTOCOL *Smbios + ) +{ + UINTN ManuStrLen; + UINTN VerStrLen; + UINTN AssertTagStrLen; + UINTN SerialNumStrLen; + UINTN SKUNumberStrLen; + EFI_STATUS Status; + CHAR8 *ManufacturerStr; + CHAR8 *VersionStr; + CHAR8 *SerialNumberStr; + CHAR8 *AssertTagStr; + CHAR8 *SKUNumberStr; + SMBIOS_TABLE_STRING *SKUNumberPtr; + EFI_SMBIOS_HANDLE SmbiosHandle; + SMBIOS_TABLE_TYPE3 *SmbiosRecord; + SMBIOS_TABLE_TYPE3 *PcdSmbiosRecord; + UINTN SourceSize; + UINTN TotalSize; + UINTN StringOffset; + + PcdSmbiosRecord =3D PcdGetPtr (PcdSmbiosType3SystemEnclosureChassis); + + // + // Get ChassisManufacturer String. + // + ManufacturerStr =3D PcdGetPtr (PcdSmbiosType3StringManufacturer); + ManuStrLen =3D AsciiStrLen (ManufacturerStr); + ASSERT (ManuStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get ChassisVersion String. + // + VersionStr =3D PcdGetPtr (PcdSmbiosType3StringVersion); + VerStrLen =3D AsciiStrLen (VersionStr); + ASSERT (VerStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get ChassisSerialNumber String. + // + SerialNumberStr =3D PcdGetPtr (PcdSmbiosType3StringSerialNumber); + SerialNumStrLen =3D AsciiStrLen (SerialNumberStr); + ASSERT (SerialNumStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get ChassisAssetTag String. + // + AssertTagStr =3D PcdGetPtr (PcdSmbiosType3StringAssetTag); + AssertTagStrLen =3D AsciiStrLen (AssertTagStr); + ASSERT (AssertTagStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Get ChassisSKUNumber String. + // + SKUNumberStr =3D PcdGetPtr (PcdSmbiosType3StringSKUNumber); + SKUNumberStrLen =3D AsciiStrLen (SKUNumberStr); + ASSERT (SKUNumberStrLen <=3D SMBIOS_STRING_MAX_LENGTH); + + // + // Two zeros following the last string. + // + SourceSize =3D PcdGetSize(PcdSmbiosType3SystemEnclosureChassis); + TotalSize =3D SourceSize + sizeof(SMBIOS_TABLE_STRING) + ManuStrLen + 1 = + VerStrLen + 1 + SerialNumStrLen + 1 + AssertTagStrLen + 1 + SKUNumberStrL= en + 1 + 1; + SmbiosRecord =3D AllocateZeroPool(TotalSize); + if (SmbiosRecord =3D=3D NULL) { + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + CopyMem (SmbiosRecord, PcdSmbiosRecord, SourceSize); + + SmbiosRecord->Hdr.Type =3D EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE; + SmbiosRecord->Hdr.Length =3D OFFSET_OF (SMBIOS_TABLE_TYPE3, ContainedEle= ments) + sizeof(SMBIOS_TABLE_STRING); + if (PcdSmbiosRecord->ContainedElementCount >=3D 1) { + SmbiosRecord->Hdr.Length +=3D PcdSmbiosRecord->ContainedElementCount *= PcdSmbiosRecord->ContainedElementRecordLength; + } + SmbiosRecord->Hdr.Handle =3D 0; + + if ((PcdSmbiosRecord->ContainedElementCount =3D=3D 0) || (SourceSize < (= UINTN)SmbiosRecord + SmbiosRecord->Hdr.Length)) { + SKUNumberPtr =3D (SMBIOS_TABLE_STRING *)((UINTN)SmbiosRecord + SmbiosR= ecord->Hdr.Length - sizeof(SMBIOS_TABLE_STRING)); + *SKUNumberPtr =3D 5; + } + + StringOffset =3D SmbiosRecord->Hdr.Length; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, ManufacturerStr, ManuStrL= en); + StringOffset +=3D ManuStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, VersionStr, VerStrLen); + StringOffset +=3D VerStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SerialNumberStr, SerialNu= mStrLen); + StringOffset +=3D SerialNumStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, AssertTagStr, AssertTagSt= rLen); + StringOffset +=3D AssertTagStrLen + 1; + CopyMem ((UINT8 *)SmbiosRecord + StringOffset, SKUNumberStr, SKUNumberSt= rLen); + + // + // Now we have got the full smbios record, call smbios protocol to add t= his record. + // + Status =3D AddSmbiosRecord (Smbios, &SmbiosHandle, (EFI_SMBIOS_TABLE_HEA= DER *) SmbiosRecord); + + FreePool(SmbiosRecord); + return Status; +} diff --git a/Features/Intel/SystemInformation/SmbiosFeaturePkg/Readme.md b/= Features/Intel/SystemInformation/SmbiosFeaturePkg/Readme.md new file mode 100644 index 0000000000..7f31094365 --- /dev/null +++ b/Features/Intel/SystemInformation/SmbiosFeaturePkg/Readme.md @@ -0,0 +1,96 @@ +# Overview +* **Feature Name:** System Management BIOS (SMBIOS) +* **PI Phase(s) Supported:** DXE +* **SMM Required?** No + +More Information: +* [SMBIOS Reference Specification](https://www.dmtf.org/standards/smbios) + +## Purpose +System Management BIOS (SMBIOS) is an industry standard for delivering man= agement information via system firmware. +SMBIOS provides a standard format to present management information across= various environments including OS-present, +OS-absent, and pre-OS environments. SMBIOS was originally designed for Int= el® processor architecture systems, SMBIOS +now includes support for IA-32 (x86), x64 (x86-64, Intel64, AMD64, EM64T),= Intel® Itanium® architecture, 32-bit +ARM (Aarch32) and 64-bit ARM (Aarch64). + +The SMBIOS feature includes generic firmware functionality to implement th= e SMBIOS reference specification. Since the +information required by these modules is very platform/board-specific by n= ature this feature requires a high-level of +customization (mostly in the form of PCD values) by the feature consumer. + +# High-Level Theory of Operation +*_TODO_* +A description of how the device works at a high-level. + +The description should not be constrained to implementation details but pr= ovide a simple mental model of how the +feature is supposed to work. + +## Firmware Volumes +*_TODO_* +A bulleted list of the firmware volumes that feature module(s) are placed = in. + +## Modules +*_TODO_* +A bulleted list of the modules that make up the feature. + +## +*_TODO_* +Each module in the feature should have a section that describes the module= in a level of detail that is useful +to better understand the module source code. + +## +*_TODO_* +Each library in the feature should have a section that describes the libra= ry in a level of detail that is useful +to better understand the library source code. + +## Key Functions +*_TODO_* +A bulleted list of key functions for interacting with the feature. + +Not all features need to be listed. Only functions exposed through externa= l interfaces that are important for feature +users to be aware of. + +## Configuration +*_TODO_* +Information that is useful for configuring the feature. + +Not all configuration options need to be listed. This section is used to p= rovide more background on configuration +options than possible elsewhere. + +## Data Flows +*_TODO_* +Architecturally defined data structures and flows for the feature. + +## Control Flows +*_TODO_* +Key control flows for the feature. + +## Build Flows +*_TODO_* +Any special build flows should be described in this section. + +This is particularly useful for features that use custom build tools or re= quire non-standard tool configuration. If the +standard flow in the feature package template is used, this section may be= empty. + +## Test Point Results +*_TODO_* +The test(s) that can verify porting is complete for the feature. + +Each feature must describe at least one test point to verify the feature i= s successful. If the test point is not +implemented, this should be stated. + +## Functional Exit Criteria +*_TODO_* +The testable functionality for the feature. + +This section should provide an ordered list of criteria that a board integ= rator can reference to ensure the feature is +functional on their board. + +## Feature Enabling Checklist +*_TODO_* +An ordered list of required activities to achieve desired functionality fo= r the feature. + +## Common Optimizations +*_TODO_* +Common size or performance tuning options for this feature. + +This section is recommended but not required. If not used, the contents sh= ould be left empty. --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51401): https://edk2.groups.io/g/devel/message/51401 Mute This Topic: https://groups.io/mt/63457883/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-