From nobody Thu May 2 07:53:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+41462+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41462+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1559031110; cv=none; d=zoho.com; s=zohoarc; b=oXyHfib6izHsoX+QbYAo8yFF8sUtCHdUsF6PZFj3+U0zl8HvHLKjT4wB/6YhYt7rUyxMCcXjdz2GLohPuooYwoF3Owq5PyVQO2wawx30GGdaejg6v44qDvV8e9lG0553bZroFcOsdFOWi5+XLSyxg/fkSlK2lOeaPzu1lNp79H0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559031110; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=f98tcW6nVHR3lpvBM2HZNdmLnSlQ+GJ1VE4kHIB7kYg=; b=ISJFDIC5MuuiZuPsEjRB3s7lW18AKhrIBgdJe8gsm2cliwnbgSwXuL4XVonEPlISPuyn8LK5n7adPcTeN043aj6ThzwunHAQ64K5okE4Vy4KBnSdIjozDd7Js8tUQMo38JWXnm1m46YoVZytWBj1UkPSNymIpkVA2VVPVVq6HIQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41462+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 1559031110225171.04446898745414; Tue, 28 May 2019 01:11:50 -0700 (PDT) Return-Path: X-Received: from mga11.intel.com (mga11.intel.com []) by groups.io with SMTP; Tue, 28 May 2019 01:11:49 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 01:11:49 -0700 X-ExtLoop1: 1 X-Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.133]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 01:11:47 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Liming Gao , Michael Kubacki , Sai Chaganty , Oram Isaac W Subject: [edk2-devel] [Patch v3 1/3] [edk2-platform] Maintainers.txt: Add BoardModulePkg in Platform/Intel/ folder. Date: Tue, 28 May 2019 16:11:43 +0800 Message-Id: <20190528081145.10008-2-eric.dong@intel.com> In-Reply-To: <20190528081145.10008-1-eric.dong@intel.com> References: <20190528081145.10008-1-eric.dong@intel.com> MIME-Version: 1.0 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,eric.dong@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1559031109; bh=t8TdeTgAPBrHyksygDRWVsnICH/Hp7Wuuq6VZyfZ+iI=; h=Cc:Date:From:Reply-To:Subject:To; b=Cq6t/RPPGz8xP/8KGw76aT0dcVEDiMWKa2ljQP4Ai955kCUI/zdsxf0vDJP2Az2bUjJ SceDUs+cgJxpnH5+2Aw9HDHFP4OUNNE/e9W1hjMaVxj+0TLf83BMRnwpKFUIraat3BQ05 6l+2K/T2umWcwpUUjxwoGK3Km5Q1vC/bKW0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" V3 change: 1. Fix file path typo. V2 change: Add package DSC file to enable package build. V1 change: Add new package BoardModulePkg which used to keep the modules which is generic for all board. Signed-off-by: Eric Dong Cc: Liming Gao Cc: Michael Kubacki Cc: Sai Chaganty Cc: Oram Isaac W --- Maintainers.txt | 4 + .../Intel/BoardModulePkg/BoardModulePkg.dec | 26 +++++++ .../Intel/BoardModulePkg/BoardModulePkg.dsc | 74 +++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 Platform/Intel/BoardModulePkg/BoardModulePkg.dec create mode 100644 Platform/Intel/BoardModulePkg/BoardModulePkg.dsc diff --git a/Maintainers.txt b/Maintainers.txt index 76feecceb7..2bc4a6c1ca 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -60,6 +60,10 @@ M: Michael Kubacki M: Sai Chaganty R: Liming Gao =20 +Platform/Intel/BoardModulePkg +M: Eric Dong +R: Liming Gao + Platform/Intel/ClevoOpenBoardPkg M: Michael Kubacki M: Ankit Sinha diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dec new file mode 100644 index 0000000000..94de8989c4 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec @@ -0,0 +1,26 @@ +## @file +# This package provides the modules that build for a full feature platform. +# This AdvancedFeaturePkg should only depend on EDKII Core packages and Mi= nPlatformPkg. +# +# 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 BoardModulePkg + PACKAGE_VERSION =3D 0.1 + PACKAGE_GUID =3D 30EEB750-574D-45AA-8895-D77161019BC7 + + +[Includes] + + +[LibraryClasses] diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dsc new file mode 100644 index 0000000000..905fa13b35 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc @@ -0,0 +1,74 @@ +## @file +# This package provides the modules that build for a full feature platform. +# This AdvancedFeaturePkg should only depend on EDKII Core packages and Mi= nPlatformPkg. +# +# 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 BoardModulePkg + PLATFORM_GUID =3D D36FD4CC-6CD1-4CE6-AA0B-EDB469DAE48B + PLATFORM_VERSION =3D 0.1 + DSC_SPECIFICATION =3D 0x00010005 + OUTPUT_DIRECTORY =3D Build/BoardModulePkg + SUPPORTED_ARCHITECTURES =3D IA32|X64 + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER =3D DEFAULT + +[LibraryClasses] + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + +[LibraryClasses.common.PEIM] + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf + +[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM] + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf + +[LibraryClasses.common.DXE_DRIVER] + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf + +[LibraryClasses.common.UEFI_DRIVER] + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf + +[LibraryClasses.common.DXE_RUNTIME_DRIVER] + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf + +##########################################################################= ######################### +# +# Components Section - list of the modules and components that will be pro= cessed by compilation +# tools and the EDK II tools to generate PE32/PE32+/C= off image files. +# +# 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. +# Binary modules do not need to be listed in this section, as they s= hould be +# specified in the FDF file. For example: Shell binary (Shell_Full.e= fi), FAT binary (Fat.efi), +# Logo (Logo.bmp), and etc. +# 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. +# +##########################################################################= ######################### + +[Components] + --=20 2.21.0.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 (#41462): https://edk2.groups.io/g/devel/message/41462 Mute This Topic: https://groups.io/mt/31819525/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- From nobody Thu May 2 07:53:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+41463+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41463+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1559031111; cv=none; d=zoho.com; s=zohoarc; b=Tu7keDuxyHuK4gY9NsXG6Laz15LZ9ud8LU6FnL99Txve+399p7LAt6kWfNH7O2Vdtdy/cyqNxaI4tgh00DO+Te4lEwAYoW/NAwvrbSSI64qSNI3PJJkX/4ZoRfHDNAYLJ2cUTLAFZlYGMa4I0y6wdB01CTyBxz1zHrRaV0qHnes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559031111; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=sKSWPdlEWiruOXDvpH1CicRB60a2XJxvMfB639Ht21g=; b=FpZJbxGvImpRo+iIGu7pAx0Ku2xV45uRCy+wZv2YVnKBfeEhH7K4ma4JOteWvkrF3lfJLcCkNve5joKUczppQdMRtsZ6QA3dmNYYIExMAGl5O8Dw6MpqdHtE0e/nqKn6JRQi2L2XIyME3IvaY5aEMfJyARNG5fouWq/rGWetLlM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41463+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 1559031111885762.3822214387287; Tue, 28 May 2019 01:11:51 -0700 (PDT) Return-Path: X-Received: from mga11.intel.com (mga11.intel.com []) by groups.io with SMTP; Tue, 28 May 2019 01:11:51 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 01:11:50 -0700 X-ExtLoop1: 1 X-Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.133]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 01:11:48 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Liming Gao , Michael Kubacki , Sai Chaganty , Oram Isaac W Subject: [edk2-devel] [Patch v3 2/3] [edk2-platform] Platform/Intel: Add Cmos related modules to BoardModulePkg Date: Tue, 28 May 2019 16:11:44 +0800 Message-Id: <20190528081145.10008-3-eric.dong@intel.com> In-Reply-To: <20190528081145.10008-1-eric.dong@intel.com> References: <20190528081145.10008-1-eric.dong@intel.com> MIME-Version: 1.0 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,eric.dong@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1559031111; bh=OmP1pPsFgDK1yYgvSY3fDNI5+M8U8Yg8yzwGBS0iI5A=; h=Cc:Date:From:Reply-To:Subject:To; b=Ej6i1zXSSYYwoXwQkmoDty5tKlbqZkjKlGdriE6M0BkG21xENd7/31iz08Pzhh0wQeM xP8OlYTmNoiUMO+yfpzP390hmlz1oQqUCWX+wRC4ttK8ONjqnQTNfiAVNoJZo4TZaSHKp rVOj0OkaLdUDa1CDUbE1xTrgxdpW3MdGfZE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" V3 change: 1. Fix file path typo. V2 change: Add BZ link for this change. V1 change: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1552 Add Cmos related libraries to BoardModulePkg. Totally two library have been added, one is CmosAccessLib and the other is PlatformCmosAccessLib. PlatformCmosAccessLib will be used by CmosAccessLib. These two libraries provide the generic operations for CMOS access. APIs exports by PlatformCmosAccessLib include: PlatformCmosGetEntry PlatformCmosGetNmiState APIs exports by CmosAccessLib include: CmosRead8 CmosWrite8 CmosRead16 CmosWrite16 CmosRead32 CmosWrite32 CmosInit Sign-off-by: Eric Dong Cc: Liming Gao Cc: Michael Kubacki Cc: Sai Chaganty Cc: Oram Isaac W Signed-off-by: Eric Dong --- .../Intel/BoardModulePkg/BoardModulePkg.dec | 8 +- .../Intel/BoardModulePkg/BoardModulePkg.dsc | 3 +- .../Include/Library/CmosAccessLib.h | 106 ++++ .../Include/Library/PlatformCmosAccessLib.h | 68 +++ .../Library/CmosAccessLib/CmosAccessLib.c | 486 ++++++++++++++++++ .../Library/CmosAccessLib/CmosAccessLib.inf | 28 + .../CmosAccessLib/CmosAccessLibInternal.h | 35 ++ .../PlatformCmosAccessLibNull.c | 39 ++ .../PlatformCmosAccessLibNull.inf | 23 + 9 files changed, 794 insertions(+), 2 deletions(-) create mode 100644 Platform/Intel/BoardModulePkg/Include/Library/CmosAcces= sLib.h create mode 100644 Platform/Intel/BoardModulePkg/Include/Library/PlatformC= mosAccessLib.h create mode 100644 Platform/Intel/BoardModulePkg/Library/CmosAccessLib/Cmo= sAccessLib.c create mode 100644 Platform/Intel/BoardModulePkg/Library/CmosAccessLib/Cmo= sAccessLib.inf create mode 100644 Platform/Intel/BoardModulePkg/Library/CmosAccessLib/Cmo= sAccessLibInternal.h create mode 100644 Platform/Intel/BoardModulePkg/Library/PlatformCmosAcces= sLibNull/PlatformCmosAccessLibNull.c create mode 100644 Platform/Intel/BoardModulePkg/Library/PlatformCmosAcces= sLibNull/PlatformCmosAccessLibNull.inf diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dec index 94de8989c4..6b41d65aee 100644 --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec @@ -21,6 +21,12 @@ =20 =20 [Includes] - + Include =20 [LibraryClasses] + ## @libraryclass Provide services to access CMOS area. + CmosAccessLib|Include/Library/CmosAccessLib.h + + ## @libraryclass Provide platform relevant services to access CMOS a= rea. + PlatformCmosAccessLib|Include/Library/PlatformCmosAccessLib.h + diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dsc index 905fa13b35..c5a23782ba 100644 --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc @@ -71,4 +71,5 @@ ##########################################################################= ######################### =20 [Components] - + BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf + BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLibNu= ll.inf diff --git a/Platform/Intel/BoardModulePkg/Include/Library/CmosAccessLib.h = b/Platform/Intel/BoardModulePkg/Include/Library/CmosAccessLib.h new file mode 100644 index 0000000000..0bc08670ab --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Include/Library/CmosAccessLib.h @@ -0,0 +1,106 @@ +/** @file + CmosAccessLib header file. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _CMOS_ACCESS_LIB_H_ +#define _CMOS_ACCESS_LIB_H_ + +/** + Read a byte value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The byte value read from the CMOS address. +**/ +UINT8 +EFIAPI +CmosRead8 ( + IN UINT8 Address + ); + +/** + Write a byte value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The byte value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite8 ( + IN UINT8 Address, + IN UINT8 Data + ); + +/** + Read a word value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The word value read from the CMOS address. +**/ +UINT16 +EFIAPI +CmosRead16 ( + IN UINT8 Address + ); + +/** + Write a word value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The word value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite16 ( + IN UINT8 Address, + IN UINT16 Data + ); + +/** + Read a dword value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The dword value read from the CMOS address. +**/ +UINT32 +EFIAPI +CmosRead32 ( + IN UINT8 Address + ); + +/** + Write a dword value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The dword value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite32 ( + IN UINT8 Address, + IN UINT32 Data + ); + +/** + Initialize the CMOS. + + It initialize the CMOS area when Force is TRUE or the checksum is incorr= ect. + + @param[in] Force TRUE indicating initializing the CMOS area without ch= ecking the checksum. + + @retval TRUE The CMOS is initialized to default value. + @retval FALSE The CMOS isn't initialized to default value. +**/ +BOOLEAN +EFIAPI +CmosInit ( + IN BOOLEAN Force + ); + +#endif // _CMOS_ACCESS_LIB_H_ diff --git a/Platform/Intel/BoardModulePkg/Include/Library/PlatformCmosAcce= ssLib.h b/Platform/Intel/BoardModulePkg/Include/Library/PlatformCmosAccessL= ib.h new file mode 100644 index 0000000000..337ff41847 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Include/Library/PlatformCmosAccessLib.h @@ -0,0 +1,68 @@ +/** @file + Platform CMOS Access Library Header File. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _PLATFORM_CMOS_ACCESS_LIB_H_ +#define _PLATFORM_CMOS_ACCESS_LIB_H_ + +/// +/// Flag indicating checksum calculation doesn't include this location. +/// NOTE: If a location isn't shown in platform CMOS entry table, +/// it means checksum calculation doesn't include the location. +/// +#define CMOS_EXCLUDE_FROM_CHECKSUM BIT0 + +/// +/// Flag indicating initialization doesn't cover this location. +/// NOTE: If a location isn't shown in platform CMOS entry table, +/// it means the location is initialized with CMOS_DEFAULT_VALUE (0). +/// +#define CMOS_EXCLUDE_FROM_INIT_DATA BIT1 + +/// +/// Flag indicating the location cannot be accessed. +/// NOTE: 0x0 ~ 0xD is implictly inaccessible. +/// +#define CMOS_EXCLUDE_FROM_ACCESS (BIT3 | CMOS_EXCLUDE_FROM_CHECKSUM |= CMOS_EXCLUDE_FROM_INIT_DATA) + +/// +/// Flag indicating the checksum location +/// NOTE: At most two entries can have this flag set. +/// +#define CMOS_CHECKSUM_LOCATION (BIT2 | CMOS_EXCLUDE_FROM_CHECKSUM |= CMOS_EXCLUDE_FROM_INIT_DATA) + +#define CMOS_DEFAULT_VALUE 0x00 + +typedef struct { + UINT8 Address; + UINT8 DefaultValue; + UINT8 Attributes; +} CMOS_ENTRY; + +/** + Return the platform CMOS entries. + + @param [out] EntryCount Return the count of platform CMOS entries. + + @return Platform CMOS entries. +**/ +CMOS_ENTRY * +EFIAPI +PlatformCmosGetEntry ( + OUT UINTN *EntryCount + ); + +/** + Return the NMI enable status. +**/ +BOOLEAN +EFIAPI +PlatformCmosGetNmiState ( + VOID + ); + +#endif // _PLATFORM_CMOS_ACCESS_LIB_H_ diff --git a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccess= Lib.c b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.c new file mode 100644 index 0000000000..82d512cb9f --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.c @@ -0,0 +1,486 @@ +/** @file + CmosAccessLib implementation. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "CmosAccessLibInternal.h" + +/** + Return the entry for the specified address in entries returned + from platform. + + @param [in] Address The CMOS address to find. + + @return A pointer to CMOS_ENTRY for the specified address, + or NULL if not found. +**/ +CMOS_ENTRY * +CmosAccessLibLocateEntry ( + IN UINT8 Address + ) +{ + UINTN Index; + UINTN Count; + CMOS_ENTRY *Entries; + + Entries =3D PlatformCmosGetEntry (&Count); + for (Index =3D 0; Index < Count; Index++) { + if (Entries[Index].Address =3D=3D Address) { + return &Entries[Index]; + } + } + + return NULL; +} + +/** + Test the attributes of the Entry and return ValueIfSet if test passes + or !ValueIfSet if test fails. It returns DefaultValue if the Entry is + NULL. + + @param [in] Address The CMOS address. + @param [in] Attributes The attributes to test. + @param [in] ValueIfSet The value to return if test passes. + @param [in] DefaultValue The value to return if Entry is NULL. + @param [in] Entry Pointer to entry. + + @retval ValueIfSet If test passes. + @retval !ValueIfSet If test fails. + @retval DefaultValue If the Entry is NULL. +**/ +BOOLEAN +CmosAccessLibCheckAttribute ( + IN UINT8 Address, + IN UINT8 Attributes, + IN BOOLEAN ValueIfSet, + IN BOOLEAN DefaultValue, + IN CMOS_ENTRY *Entry OPTIONAL + ) +{ + if (Entry !=3D NULL) { + ASSERT (Entry->Address =3D=3D Address); + if ((Entry->Attributes & Attributes) =3D=3D Attributes) { + return ValueIfSet; + } else { + return !ValueIfSet; + } + } + + return DefaultValue; +} + +/** + Check if the CMOS address needs Checksum calculation. + + @param [in] Address CMOS address to be checked + @param [in] Entry Pointer to entry. + + @retval TRUE CMOS address needs Checksum calculation. + @retval FALSE CMOS address doesn't need Checksum calculation. +**/ +BOOLEAN +CmosAccessLibNeedChecksum ( + IN UINT8 Address, + IN CMOS_ENTRY *Entry OPTIONAL + ) +{ + return CmosAccessLibCheckAttribute (Address, CMOS_EXCLUDE_FROM_CHECKSUM,= FALSE, FALSE, Entry); +} + + +/** + Check if the CMOS address needs to fill default data. + + @param [in] Address CMOS address to be checked + @param [in] Entry Pointer to entry. + + @retval TRUE CMOS address need to fill default data. + @retval FALSE CMOS address doesn't need to fill default data. +**/ +BOOLEAN +CmosAccessLibNeedFillDefault ( + IN UINT8 Address, + IN CMOS_ENTRY *Entry OPTIONAL + ) +{ + return CmosAccessLibCheckAttribute (Address, CMOS_EXCLUDE_FROM_INIT_DATA= , FALSE, TRUE, Entry); +} + +/** + Check if the CMOS address is accessible. + + @param [in] Address CMOS address to be checked. + @param [in] Entry Pointer to entry. + + @retval TRUE CMOS address is accessible. + @retval FALSE CMOS address isn't accessible. +**/ +BOOLEAN +CmosAccessLibIsAccessible ( + IN UINT8 Address, + IN CMOS_ENTRY *Entry OPTIONAL + ) +{ + // + // CMOS 0-9, A, B, C, D are for RTC. + // + if (Address <=3D 0xD) { + return FALSE; + } + return CmosAccessLibCheckAttribute (Address, CMOS_EXCLUDE_FROM_ACCESS, F= ALSE, TRUE, Entry); +} + +/** + Return the CMOS location to store checksum. + + @param [out] Location Return the CMOS location to store the checksum. +**/ +VOID +CmosAccessLibGetChecksumLocation ( + OUT CMOS_CHECKSUM_LOCATION_INFO *Location + ) +{ + UINTN Index; + UINTN Count; + CMOS_ENTRY *Entries; + + Location->Length =3D 0; + + Entries =3D PlatformCmosGetEntry (&Count); + for (Index =3D 0; Index < Count; Index++) { + if ((Entries[Index].Attributes & CMOS_CHECKSUM_LOCATION) =3D=3D CMOS_C= HECKSUM_LOCATION) { + Location->Length++; + if (Location->Length =3D=3D 1) { + Location->LowByteAddress =3D Entries[Index].Address; + } else if (Location->Length =3D=3D 2) { + Location->HighByteAddress =3D Entries[Index].Address; + break; + } + } + } + + ASSERT (Location->Length <=3D 2); +} + +/** + Calculate the sum of CMOS values who need checksum calculation. + + @param [in] Location The CMOS location to store the checksum. + + @return The sum. +**/ +UINT16 +CmosAccessLibCalculateSum ( + IN CMOS_CHECKSUM_LOCATION_INFO *Location + ) +{ + UINT16 Sum; + UINTN Index; + UINTN Count; + CMOS_ENTRY *Entries; + + if (Location->Length =3D=3D 0) { + return 0; + } + + Sum =3D 0; + Entries =3D PlatformCmosGetEntry (&Count); + for (Index =3D 0; Index < Count; Index++) { + if (CmosAccessLibNeedChecksum (Entries[Index].Address, &Entries[Index]= )) { + Sum +=3D CmosRead8 (Entries[Index].Address); + } + } + + if (Location->Length =3D=3D 1) { + return (UINT8) Sum; + } else { + return Sum; + } +} + +/** + Return the checksum value stored in CMOS. + + @param [in] Location The CMOS location to store the checksum. + + @return The checksum value. +**/ +UINT16 +CmosAccessLibReadChecksum ( + IN CMOS_CHECKSUM_LOCATION_INFO *Location + ) +{ + UINT16 Checksum; + + Checksum =3D 0; + + switch (Location->Length) { + case 2: + Checksum =3D (CmosRead8 (Location->HighByteAddress) << 8); + // + // Fall to case 1 to get the low byte value + // + case 1: + Checksum +=3D CmosRead8 (Location->LowByteAddress); + break; + + default: + break; + } + return Checksum; +} + + +/** + Write the Checksum to appropriate address. + + @param [in] Location The CMOS location to store the checksum. + @param [in] Checksum The checksum value. +**/ +VOID +CmosAccessLibWriteChecksum ( + CMOS_CHECKSUM_LOCATION_INFO *Location, + IN UINT16 Checksum + ) +{ + + switch (Location->Length) { + case 0: + break; + case 2: + CmosWrite8 (Location->HighByteAddress, Checksum >> 8); + // + // Fall to case 1 to update low byte value + // + case 1: + CmosWrite8 (Location->LowByteAddress, (UINT8) Checksum); + break; + } +} + +/** + Read a byte value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The byte value read from the CMOS address. +**/ +UINT8 +EFIAPI +CmosRead8 ( + IN UINT8 Address + ) +{ + if (!CmosAccessLibIsAccessible (Address, CmosAccessLibLocateEntry (Addre= ss))) { + return 0xFF; + } + + if (Address <=3D CMOS_BANK0_LIMIT) { + if (PlatformCmosGetNmiState ()) { + Address |=3D BIT7; + } + IoWrite8 (PORT_70, Address); + return IoRead8 (PORT_71); + } else { + IoWrite8 (PORT_72, Address); + return IoRead8 (PORT_73); + } +} + +/** + Write a byte value to a CMOS address. + + It's an internal function that doesn't update the checksum. + + @param [in] Address Location to write to CMOS. + @param [in] Data The byte value write to the CMOS address. +**/ +VOID +CmosAccessLibICmosWrite8 ( + IN UINT8 Address, + IN UINT8 Data + ) +{ + if (Address <=3D CMOS_BANK0_LIMIT) { + if (PlatformCmosGetNmiState ()) { + Address |=3D BIT7; + } + IoWrite8 (PORT_70, Address); + IoWrite8 (PORT_71, Data); + } else { + IoWrite8 (PORT_72, Address); + IoWrite8 (PORT_73, Data); + } +} + +/** + Write a byte value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The byte value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite8 ( + IN UINT8 Address, + IN UINT8 Data + ) +{ + UINT8 OriginalData; + CMOS_ENTRY *Entry; + CMOS_CHECKSUM_LOCATION_INFO ChecksumLocation; + + Entry =3D CmosAccessLibLocateEntry (Address); + + if (!CmosAccessLibIsAccessible (Address, Entry)) { + return; + } + + OriginalData =3D CmosRead8 (Address); + + CmosAccessLibICmosWrite8 (Address, Data); + + if (CmosAccessLibNeedChecksum (Address, Entry)) { + // + // Sum of Data + Checksum =3D New Sum of Data + New Checksum =3D 0 + // New Sum of Data - Sum of Data =3D Checksum - New Checksum + // New Checksum =3D Checksum - (New Sum of Data - Sum of Data) + // + CmosAccessLibGetChecksumLocation (&ChecksumLocation); + CmosAccessLibWriteChecksum ( + &ChecksumLocation, + CmosAccessLibReadChecksum (&ChecksumLocation) - (Data - OriginalData) + ); + } +} + +/** + Read a word value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The word value read from the CMOS address. +**/ +UINT16 +EFIAPI +CmosRead16 ( + IN UINT8 Address + ) +{ + return CmosRead8 (Address) + (CmosRead8 (Address + 1) << 8); +} + +/** + Write a word value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The word value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite16 ( + IN UINT8 Address, + IN UINT16 Data + ) +{ + CmosWrite8 (Address, (UINT8) Data); + CmosWrite8 (Address + 1, (UINT8) (Data >> 8)); +} + +/** + Read a dword value from a CMOS address. + + @param [in] Address Location to read from CMOS + + @return The dword value read from the CMOS address. +**/ +UINT32 +EFIAPI +CmosRead32 ( + IN UINT8 Address + ) +{ + return CmosRead16 (Address) + (CmosRead16 (Address + 2) << 16); +} + +/** + Write a dword value to a CMOS address. + + @param [in] Address Location to write to CMOS. + @param [in] Data The dword value write to the CMOS address. +**/ +VOID +EFIAPI +CmosWrite32 ( + IN UINT8 Address, + IN UINT32 Data + ) +{ + CmosWrite16 (Address, (UINT16) Data); + CmosWrite16 (Address + 2, (UINT16) (Data >> 16)); +} + + +/** + Initialize the CMOS. + + It initialize the CMOS area when Force is TRUE or the checksum is incorr= ect. + + @param[in] Force TRUE indicating initializing the CMOS area without ch= ecking the checksum. + + @retval TRUE The CMOS is initialized to default value. + @retval FALSE The CMOS isn't initialized to default value. +**/ +BOOLEAN +EFIAPI +CmosInit ( + IN BOOLEAN Force + ) +{ + UINTN Address; + CMOS_ENTRY *Entry; + CMOS_CHECKSUM_LOCATION_INFO ChecksumLocation; + UINT16 Checksum; + + CmosAccessLibGetChecksumLocation (&ChecksumLocation); + + if (!Force) { + // + // Initialize the CMOS area when checksum is incorrect. + // + Checksum =3D CmosAccessLibCalculateSum (&ChecksumLocation) + CmosAcces= sLibReadChecksum (&ChecksumLocation); + if (ChecksumLocation.Length =3D=3D 1) { + Checksum =3D (UINT8) Checksum; + } + + if (Checksum !=3D 0) { + Force =3D TRUE; + } + } + + if (Force) { + // + // Traverse through entire CMOS location and fill it with zero + // + for (Address =3D 0; Address <=3D CMOS_BANK1_LIMIT; Address++) { + Entry =3D CmosAccessLibLocateEntry ((UINT8) Address); + if (CmosAccessLibNeedFillDefault ((UINT8) Address, Entry)) { + CmosAccessLibICmosWrite8 ((UINT8) Address, (Entry =3D=3D NULL) ? C= MOS_DEFAULT_VALUE : Entry->DefaultValue); + } + } + + // + // Write the New checksum to the Checksum field + // + CmosAccessLibWriteChecksum ( + &ChecksumLocation, + (UINT16) (0x10000 - CmosAccessLibCalculateSum (&ChecksumLocation)) + ); + return TRUE; + } + + return FALSE; +} diff --git a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccess= Lib.inf b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib= .inf new file mode 100644 index 0000000000..77ea219f2c --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf @@ -0,0 +1,28 @@ +### @file +# Library producing CMOS access functionality. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D CmosAccessLib + FILE_GUID =3D FF6B645D-C001-4ACE-9CA1-199F97C2D601 + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D BASE + LIBRARY_CLASS =3D CmosAccessLib + +[Sources] + CmosAccessLib.c + CmosAccessLibInternal.h + +[LibraryClasses] + IoLib + DebugLib + PlatformCmosAccessLib + +[Packages] + MdePkg/MdePkg.dec + BoardModulePkg/BoardModulePkg.dec \ No newline at end of file diff --git a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccess= LibInternal.h b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAcc= essLibInternal.h new file mode 100644 index 0000000000..61baec3f92 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLibInte= rnal.h @@ -0,0 +1,35 @@ +/** @file + CmosAccessLib internal header file. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _CMOS_ACCESS_LIB_INTERNALS_ +#define _CMOS_ACCESS_LIB_INTERNALS_ + +#include +#include +#include +#include +#include +#include + +// CMOS access Port address + +#define PORT_70 0x70 +#define PORT_71 0x71 +#define PORT_72 0x72 +#define PORT_73 0x73 + +#define CMOS_BANK0_LIMIT 0x7F +#define CMOS_BANK1_LIMIT 0xFF + +typedef struct { + UINT8 Length; + UINT8 LowByteAddress; + UINT8 HighByteAddress; +} CMOS_CHECKSUM_LOCATION_INFO; + +#endif // _CMOS_ACCESS_LIB_INTERNALS_ diff --git a/Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNul= l/PlatformCmosAccessLibNull.c b/Platform/Intel/BoardModulePkg/Library/Platf= ormCmosAccessLibNull/PlatformCmosAccessLibNull.c new file mode 100644 index 0000000000..dbd7ad5cf4 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platf= ormCmosAccessLibNull.c @@ -0,0 +1,39 @@ +/** @file + Platform CMOS Access Library. + +Copyright (c) 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Return the platform CMOS entries. + + @param [out] EntryCount Return the count of platform CMOS entries. + + @return Platform CMOS entries. +**/ +CMOS_ENTRY * +EFIAPI +PlatformCmosGetEntry ( + OUT UINTN *EntryCount + ) +{ + *EntryCount =3D 0; + return NULL; +} + +/** + Return the NMI enable status. +**/ +BOOLEAN +EFIAPI +PlatformCmosGetNmiState ( + VOID + ) +{ + return FALSE; +} diff --git a/Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNul= l/PlatformCmosAccessLibNull.inf b/Platform/Intel/BoardModulePkg/Library/Pla= tformCmosAccessLibNull/PlatformCmosAccessLibNull.inf new file mode 100644 index 0000000000..4fb158ae48 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platf= ormCmosAccessLibNull.inf @@ -0,0 +1,23 @@ +### @file +# Library producing CMOS access functionalities are relevant to platform. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PlatformCmosAccessLib + FILE_GUID =3D C315A8B6-FF6C-41D1-A934-7330501F308C + VERSION_STRING =3D 1.0 + MODULE_TYPE =3D BASE + LIBRARY_CLASS =3D PlatformCmosAccessLib + + +[Sources] + PlatformCmosAccessLibNull.c + +[Packages] + MdePkg/MdePkg.dec + BoardModulePkg/BoardModulePkg.dec --=20 2.21.0.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 (#41463): https://edk2.groups.io/g/devel/message/41463 Mute This Topic: https://groups.io/mt/31819526/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- From nobody Thu May 2 07:53:16 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+41464+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41464+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1559031113; cv=none; d=zoho.com; s=zohoarc; b=JJeiPVhg09Jvu8ol9YsKb783wyVOWSHWnDduTmDzDucPbCqVuuEvdYgXMzD0CtcQP9SBgcYpPg3TlYF2rnJtKVzq/Vhcasis0LoewfH2pWg+Zp8w6xK1Y6vqfQGr+xZ/hx2EDgcJBEVHeY+o5A/tPpRM7iovpECDBmsKMIioJe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559031113; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=NVNQj8QRrgqcwO0dCkVgmVgL1YZ7FnoWOJ/IMju/i2U=; b=fSacqOrSH54tD9mXiUYA3kxEfxbQ50u8EG02SJGXEt14MyBCad4WpgnwYH4YLIQoTTiyh+HaZ1Tr5lbNm5Bt+UHXYOtUZWQiIN2cb36TPTqbfF1WUtLFp5ef9QJttQvTgG9HKAXZAh4P0bk/wSlX2sE4vBTCtsYcytfwPUFP/64= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+41464+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 1559031113303864.6273128192076; Tue, 28 May 2019 01:11:53 -0700 (PDT) Return-Path: X-Received: from mga11.intel.com (mga11.intel.com []) by groups.io with SMTP; Tue, 28 May 2019 01:11:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 01:11:52 -0700 X-ExtLoop1: 1 X-Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.133]) by orsmga007.jf.intel.com with ESMTP; 28 May 2019 01:11:50 -0700 From: "Dong, Eric" To: devel@edk2.groups.io Cc: Liming Gao , Michael Kubacki , Sai Chaganty , Oram Isaac W Subject: [edk2-devel] [Patch v3 3/3] [edk2-platform] Platform/Intel/BoardModulePkg: Add BiosId Module Date: Tue, 28 May 2019 16:11:45 +0800 Message-Id: <20190528081145.10008-4-eric.dong@intel.com> In-Reply-To: <20190528081145.10008-1-eric.dong@intel.com> References: <20190528081145.10008-1-eric.dong@intel.com> MIME-Version: 1.0 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,eric.dong@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1559031112; bh=4j5X1mbZCyhgR4RPAeT1nYy4/fDwCzMDI8ByZB+ms1E=; h=Cc:Date:From:Reply-To:Subject:To; b=c7DujfHWLun0iyfEDFG3L28Thaho806XDUtJpdVPAWntp66ECclGSjmbMY1MEx7rAvV 4gJ+Q7TPObxQt1OlBuiWtBpUod4GJAxA1kIxa/yGlC5N6qFYFEk07biL9N9NKbOCSO2Wl LgP2WL19biBPnzU4dDUK2RuuRKyqGJ7dPO4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" V3 change: 1. Fix file path typo. V2 change: Add BZ link for this change. V1 change: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1851 Add Bios ID library used to read BIOS ID related info. This library exports APIs like below: GetBiosId GetBiosVersionDateTime Signed-off-by: Eric Dong Cc: Liming Gao Cc: Michael Kubacki Cc: Sai Chaganty Cc: Oram Isaac W --- .../Intel/BoardModulePkg/BoardModulePkg.dec | 6 + .../Intel/BoardModulePkg/BoardModulePkg.dsc | 4 + .../BoardModulePkg/Include/Guid/BiosId.h | 54 +++++ .../Include/Library/BiosIdLib.h | 57 ++++++ .../Library/BiosIdLib/DxeBiosIdLib.c | 175 ++++++++++++++++ .../Library/BiosIdLib/DxeBiosIdLib.inf | 42 ++++ .../Library/BiosIdLib/PeiBiosIdLib.c | 191 ++++++++++++++++++ .../Library/BiosIdLib/PeiBiosIdLib.inf | 42 ++++ 8 files changed, 571 insertions(+) create mode 100644 Platform/Intel/BoardModulePkg/Include/Guid/BiosId.h create mode 100644 Platform/Intel/BoardModulePkg/Include/Library/BiosIdLib= .h create mode 100644 Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBios= IdLib.c create mode 100644 Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBios= IdLib.inf create mode 100644 Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBios= IdLib.c create mode 100644 Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBios= IdLib.inf diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dec index 6b41d65aee..50a783d418 100644 --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec @@ -30,3 +30,9 @@ ## @libraryclass Provide platform relevant services to access CMOS a= rea. PlatformCmosAccessLib|Include/Library/PlatformCmosAccessLib.h =20 + ## @libraryclass Provide services to get BIOS ID information. + BiosIdLib|Include/Library/BiosIdLib.h + +[Guids] + ## Include Include/Guid/BiosId.h + gBiosIdGuid =3D { 0xC3E36D09, 0x8294, 0x4b97, { 0xA8, 0x57, 0xD5, 0x28, = 0x8F, 0xE3, 0x3E, 0x28 } } \ No newline at end of file diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc b/Platform/In= tel/BoardModulePkg/BoardModulePkg.dsc index c5a23782ba..14e4fed88c 100644 --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc @@ -73,3 +73,7 @@ [Components] BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLibNu= ll.inf + + BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf + BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf + diff --git a/Platform/Intel/BoardModulePkg/Include/Guid/BiosId.h b/Platform= /Intel/BoardModulePkg/Include/Guid/BiosId.h new file mode 100644 index 0000000000..ca9afda9bd --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Include/Guid/BiosId.h @@ -0,0 +1,54 @@ +/** @file + GUID and definitions for BIOS ID. + +Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _BIOS_ID_GUID_H_ +#define _BIOS_ID_GUID_H_ + +#include + +extern EFI_GUID gBiosIdGuid; + +// +// $(BOARD_ID)$(BOARD_REV).$(BOARD_EXT).$(VERSION_MAJOR).$(BUILD_TYPE)$(VE= RSION_MINOR).YYMMDDHHMM +// +// Example: "TRFTCRB1.000.0008.D03.1501301017" +// +#pragma pack(1) + +typedef struct { + CHAR16 BoardId[7]; // "TRFTCRB" + CHAR16 BoardRev; // "1" + CHAR16 Dot1; // "." + CHAR16 BoardExt[3]; // "000" + CHAR16 Dot2; // "." + CHAR16 VersionMajor[4]; // "0008" + CHAR16 Dot3; // "." + CHAR16 BuildType; // "D" + CHAR16 VersionMinor[2]; // "03" + CHAR16 Dot4; // "." + CHAR16 TimeStamp[10]; // "YYMMDDHHMM" + CHAR16 NullTerminator; // 0x0000 +} BIOS_ID_STRING; + +// +// A signature precedes the BIOS ID string in the FV to enable search by e= xternal tools. +// +typedef struct { + UINT8 Signature[8]; // "$IBIOSI$" + BIOS_ID_STRING BiosIdString; // "TRFTCRB1.000.0008.D03.1501301017" +} BIOS_ID_IMAGE; + +#pragma pack() + +typedef struct { + EFI_HOB_GUID_TYPE GuidType; + BIOS_ID_IMAGE BiosIdImage; +} BIOS_ID_HOB; + +#endif + diff --git a/Platform/Intel/BoardModulePkg/Include/Library/BiosIdLib.h b/Pl= atform/Intel/BoardModulePkg/Include/Library/BiosIdLib.h new file mode 100644 index 0000000000..6608752da1 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Include/Library/BiosIdLib.h @@ -0,0 +1,57 @@ +/** @file + BIOS ID library functions. + + This library provides functions to get BIOS ID, VERSION, DATE and TIME. + + These functions in this file can be called during DXE and cannot be call= ed during runtime + or in SMM which should use a RT or SMM library. + +Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef _BIOS_ID_LIB_H_ +#define _BIOS_ID_LIB_H_ + +#include + +/** + This function returns BIOS ID by searching HOB or FV. + It also debug print the BIOS ID found. + + @param[out] BiosIdImage The BIOS ID got from HOB or FV. It is optional, + no BIOS ID will be returned if it is NULL as i= nput. + + @retval EFI_SUCCESS BIOS ID has been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + +**/ +EFI_STATUS +EFIAPI +GetBiosId ( + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL + ); + +/** + This function returns the BIOS Version & Release Date and Time by gettin= g and converting BIOS ID. + + @param[out] BiosVersion The Bios Version out of the conversion. + @param[out] BiosReleaseDate The Bios Release Date out of the conversio= n. + @param[out] BiosReleaseTime The Bios Release Time out of the conversio= n. + + @retval EFI_SUCCESS BIOS Version & Release Date and Time h= ave been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + @retval EFI_INVALID_PARAMETER All the parameters are NULL. + +**/ +EFI_STATUS +EFIAPI +GetBiosVersionDateTime ( + OUT CHAR16 *BiosVersion, OPTIONAL + OUT CHAR16 *BiosReleaseDate, OPTIONAL + OUT CHAR16 *BiosReleaseTime OPTIONAL + ); + +#endif + diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c= b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c new file mode 100644 index 0000000000..3e614d9efc --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c @@ -0,0 +1,175 @@ +/** @file + Boot service DXE BIOS ID library implementation. + + These functions in this file can be called during DXE and cannot be call= ed during runtime + or in SMM which should use a RT or SMM library. + + +Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/** + This function returns BIOS ID by searching HOB or FV. + It also debug print the BIOS ID found. + + @param[out] BiosIdImage The BIOS ID got from HOB or FV. It is optional, + no BIOS ID will be returned if it is NULL as i= nput. + + @retval EFI_SUCCESS BIOS ID has been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + +**/ +EFI_STATUS +EFIAPI +GetBiosId ( + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL + ) +{ + EFI_STATUS Status; + BIOS_ID_IMAGE TempBiosIdImage; + VOID *Address; + UINTN Size; + + Address =3D NULL; + Size =3D 0; + + if (BiosIdImage =3D=3D NULL) { + // + // It is NULL as input, so no BIOS ID will be returned. + // Use temp buffer to hold the BIOS ID. + // + BiosIdImage =3D &TempBiosIdImage; + } + + Address =3D GetFirstGuidHob (&gBiosIdGuid); + if (Address !=3D NULL) { + Size =3D sizeof (BIOS_ID_IMAGE); + CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); + + DEBUG ((EFI_D_INFO, "DXE get BIOS ID from HOB successfully\n")); + DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage->BiosId= String)))); + return EFI_SUCCESS; + } + + Status =3D GetSectionFromAnyFv ( + &gBiosIdGuid, + EFI_SECTION_RAW, + 0, + &Address, + &Size + ); + if ((Status =3D=3D EFI_SUCCESS) && (Address !=3D NULL)) { + // + // BIOS ID image is present in FV. + // + Size =3D sizeof (BIOS_ID_IMAGE); + CopyMem ((VOID *) BiosIdImage, Address, Size); + // + // GetSectionFromAnyFv () allocated buffer for Address, now free it. + // + FreePool (Address); + + DEBUG ((EFI_D_INFO, "DXE get BIOS ID from FV successfully\n")); + DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage->BiosId= String)))); + return EFI_SUCCESS; + } + + DEBUG ((EFI_D_ERROR, "DXE get BIOS ID failed: %r\n", EFI_NOT_FOUND)); + return EFI_NOT_FOUND; +} + +/** + This function returns the BIOS Version & Release Date and Time by gettin= g and converting BIOS ID. + + @param[out] BiosVersion The Bios Version out of the conversion. + @param[out] BiosReleaseDate The Bios Release Date out of the conversio= n. + @param[out] BiosReleaseTime The Bios Release Time out of the conversio= n. + + @retval EFI_SUCCESS BIOS Version & Release Date and Time h= ave been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + @retval EFI_INVALID_PARAMETER All the parameters are NULL. + +**/ +EFI_STATUS +EFIAPI +GetBiosVersionDateTime ( + OUT CHAR16 *BiosVersion, OPTIONAL + OUT CHAR16 *BiosReleaseDate, OPTIONAL + OUT CHAR16 *BiosReleaseTime OPTIONAL + ) +{ + EFI_STATUS Status; + BIOS_ID_IMAGE BiosIdImage; + + if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && (BiosR= eleaseTime =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D GetBiosId (&BiosIdImage); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + if (BiosVersion !=3D NULL) { + // + // Fill the BiosVersion data from the BIOS ID. + // + CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof (BIOS_ID_STR= ING)); + } + + if (BiosReleaseDate !=3D NULL) { + // + // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" fo= rmat. + // + BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; + BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; + BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); + + BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; + BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; + BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); + + // + // Add 20 for SMBIOS table + // Current Linux kernel will misjudge 09 as year 0, so using 2009 for = SMBIOS table + // + BiosReleaseDate[6] =3D '2'; + BiosReleaseDate[7] =3D '0'; + BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; + BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; + + BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); + } + + if (BiosReleaseTime !=3D NULL) { + + // + // Fill the build timestamp time from the BIOS ID in the "HH:MM" forma= t. + // + BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; + BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; + BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); + + BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; + BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; + + BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); + } + + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.i= nf b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf new file mode 100644 index 0000000000..39f42e91a0 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf @@ -0,0 +1,42 @@ +### @file +# DXE BIOS ID library. +# +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D DxeBiosIdLib + FILE_GUID =3D D72C04E9-C6C4-49d5-BC16-BD612EBA127B + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BiosIdLib|DXE_CORE DXE_DRIVER DXE_RUNT= IME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources.common] + DxeBiosIdLib.c + +[Packages] + MdePkg/MdePkg.dec + BoardModulePkg/BoardModulePkg.dec + +[LibraryClasses] + BaseLib + DxeServicesLib + BaseMemoryLib + HobLib + MemoryAllocationLib + DebugLib + +[Guids] + ## SOMETIMES_CONSUMES ## HOB + ## SOMETIMES_CONSUMES ## GUID + gBiosIdGuid + diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c= b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c new file mode 100644 index 0000000000..b0f15d2cb8 --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c @@ -0,0 +1,191 @@ +/** @file + Boot service PEI BIOS ID library implementation. + +Copyright (c) 2-015 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include +#include +#include +#include + +#include + +/** + This function returns BIOS ID by searching HOB or FV. + It also debug print the BIOS ID found. + + @param[out] BiosIdImage The BIOS ID got from HOB or FV. It is optional, + no BIOS ID will be returned if it is NULL as i= nput. + + @retval EFI_SUCCESS BIOS ID has been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + +**/ +EFI_STATUS +EFIAPI +GetBiosId ( + OUT BIOS_ID_IMAGE *BiosIdImage OPTIONAL + ) +{ + EFI_STATUS Status; + BIOS_ID_IMAGE TempBiosIdImage; + VOID *Address; + UINTN Size; + UINTN Instance; + EFI_PEI_FV_HANDLE VolumeHandle; + EFI_PEI_FILE_HANDLE FileHandle; + + Address =3D NULL; + Size =3D 0; + + if (BiosIdImage =3D=3D NULL) { + // + // It is NULL as input, so no BIOS ID will be returned. + // Use temp buffer to hold the BIOS ID. + // + BiosIdImage =3D &TempBiosIdImage; + } + + Address =3D GetFirstGuidHob (&gBiosIdGuid); + if (Address !=3D NULL) { + Size =3D sizeof (BIOS_ID_IMAGE); + CopyMem ((VOID *) BiosIdImage, GET_GUID_HOB_DATA (Address), Size); + + DEBUG ((EFI_D_INFO, "PEI get BIOS ID from HOB successfully\n")); + DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage->BiosId= String)))); + return EFI_SUCCESS; + } + + VolumeHandle =3D NULL; + Instance =3D 0; + while (TRUE) { + // + // Traverse all firmware volume instances. + // + Status =3D PeiServicesFfsFindNextVolume (Instance, &VolumeHandle); + if (EFI_ERROR (Status)) { + break; + } + + FileHandle =3D NULL; + Status =3D PeiServicesFfsFindFileByName (&gBiosIdGuid, VolumeHandle, &= FileHandle); + if (!EFI_ERROR (Status)) { + // + // Search RAW section. + // + Status =3D PeiServicesFfsFindSectionData (EFI_SECTION_RAW, FileHandl= e, &Address); + if (!EFI_ERROR (Status)) { + // + // BIOS ID image is present in this FV. + // + Size =3D sizeof (BIOS_ID_IMAGE); + CopyMem ((VOID *) BiosIdImage, Address, Size); + + DEBUG ((EFI_D_INFO, "PEI get BIOS ID from FV successfully\n")); + DEBUG ((EFI_D_INFO, "BIOS ID: %s\n", (CHAR16 *) (&(BiosIdImage->Bi= osIdString)))); + + // + // Build GUID HOB for the BIOS ID image. + // + BuildGuidDataHob (&gBiosIdGuid, Address, Size); + return EFI_SUCCESS; + } + } + + // + // Search the next volume. + // + Instance++; + } + + DEBUG ((EFI_D_ERROR, "PEI get BIOS ID failed: %r\n", EFI_NOT_FOUND)); + return EFI_NOT_FOUND; +} + +/** + This function returns the BIOS Version & Release Date and Time by gettin= g and converting BIOS ID. + + @param[out] BiosVersion The Bios Version out of the conversion. + @param[out] BiosReleaseDate The Bios Release Date out of the conversio= n. + @param[out] BiosReleaseTime The Bios Release Time out of the conversio= n. + + @retval EFI_SUCCESS BIOS Version & Release Date and Time h= ave been got successfully. + @retval EFI_NOT_FOUND BIOS ID image is not found, and no par= ameter will be modified. + @retval EFI_INVALID_PARAMETER All the parameters are NULL. + +**/ +EFI_STATUS +EFIAPI +GetBiosVersionDateTime ( + OUT CHAR16 *BiosVersion, OPTIONAL + OUT CHAR16 *BiosReleaseDate, OPTIONAL + OUT CHAR16 *BiosReleaseTime OPTIONAL + ) +{ + EFI_STATUS Status; + BIOS_ID_IMAGE BiosIdImage; + + if ((BiosVersion =3D=3D NULL) && (BiosReleaseDate =3D=3D NULL) && (BiosR= eleaseTime =3D=3D NULL)) { + return EFI_INVALID_PARAMETER; + } + + Status =3D GetBiosId (&BiosIdImage); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + if (BiosVersion !=3D NULL) { + // + // Fill the BiosVersion data from the BIOS ID. + // + CopyMem (BiosVersion, &(BiosIdImage.BiosIdString), sizeof (BIOS_ID_STR= ING)); + } + + if (BiosReleaseDate !=3D NULL) { + // + // Fill the build timestamp date from the BIOS ID in the "MM/DD/YY" fo= rmat. + // + BiosReleaseDate[0] =3D BiosIdImage.BiosIdString.TimeStamp[2]; + BiosReleaseDate[1] =3D BiosIdImage.BiosIdString.TimeStamp[3]; + BiosReleaseDate[2] =3D (CHAR16) ((UINT8) ('/')); + + BiosReleaseDate[3] =3D BiosIdImage.BiosIdString.TimeStamp[4]; + BiosReleaseDate[4] =3D BiosIdImage.BiosIdString.TimeStamp[5]; + BiosReleaseDate[5] =3D (CHAR16) ((UINT8) ('/')); + + // + // Add 20 for SMBIOS table + // Current Linux kernel will misjudge 09 as year 0, so using 2009 for = SMBIOS table + // + BiosReleaseDate[6] =3D '2'; + BiosReleaseDate[7] =3D '0'; + BiosReleaseDate[8] =3D BiosIdImage.BiosIdString.TimeStamp[0]; + BiosReleaseDate[9] =3D BiosIdImage.BiosIdString.TimeStamp[1]; + + BiosReleaseDate[10] =3D (CHAR16) ((UINT8) ('\0')); + } + + if (BiosReleaseTime !=3D NULL) { + + // + // Fill the build timestamp time from the BIOS ID in the "HH:MM" forma= t. + // + BiosReleaseTime[0] =3D BiosIdImage.BiosIdString.TimeStamp[6]; + BiosReleaseTime[1] =3D BiosIdImage.BiosIdString.TimeStamp[7]; + BiosReleaseTime[2] =3D (CHAR16) ((UINT8) (':')); + + BiosReleaseTime[3] =3D BiosIdImage.BiosIdString.TimeStamp[8]; + BiosReleaseTime[4] =3D BiosIdImage.BiosIdString.TimeStamp[9]; + + BiosReleaseTime[5] =3D (CHAR16) ((UINT8) ('\0')); + } + + return EFI_SUCCESS; +} + diff --git a/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.i= nf b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf new file mode 100644 index 0000000000..e38d17bd9b --- /dev/null +++ b/Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf @@ -0,0 +1,42 @@ +### @file +# PEI BIOS ID library. +# +# Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PeiBiosIdLib + FILE_GUID =3D C97DA4CA-67C1-4523-9A78-CE8CAFE6E239 + MODULE_TYPE =3D PEIM + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D BiosIdLib|PEI_CORE PEIM + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources.common] + PeiBiosIdLib.c + +[Packages] + MdePkg/MdePkg.dec + BoardModulePkg/BoardModulePkg.dec + +[LibraryClasses] + BaseLib + PeiServicesLib + BaseMemoryLib + HobLib + DebugLib + +[Guids] + ## SOMETIMES_CONSUMES ## HOB + ## SOMETIMES_PRODUCES ## HOB + ## SOMETIMES_CONSUMES ## GUID + gBiosIdGuid + --=20 2.21.0.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 (#41464): https://edk2.groups.io/g/devel/message/41464 Mute This Topic: https://groups.io/mt/31819527/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-