From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 22C751A1E77 for ; Wed, 26 Oct 2016 13:15:42 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 26 Oct 2016 13:15:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,551,1473145200"; d="scan'208";a="24101827" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga005.jf.intel.com with ESMTP; 26 Oct 2016 13:15:41 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.50]) by ORSMSX104.amr.corp.intel.com ([169.254.4.86]) with mapi id 14.03.0248.002; Wed, 26 Oct 2016 13:15:41 -0700 From: "Ma, Maurice" To: "Dong, Guo" CC: "Agyeman, Prince" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] CorebootModulePkg: Add a library to parse platform specific info. Thread-Index: AQHSKMbDo928MeSMF02/BP+2rmp6FaC7OFiQ Date: Wed, 26 Oct 2016 20:15:40 +0000 Message-ID: <7AAC936950815649B5F88FAE785306C28417693F@ORSMSX113.amr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDI0NzU0ZGItNTQ1NC00NWQwLWI3ZjAtNzU1MGFmODgyNzUzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IklZTmN1Uk5HaHJja3Nmb3JtMTJLNkQ0RnZQRFhGVys2ejZDRVZHaE5scDA9In0= x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [PATCH] CorebootModulePkg: Add a library to parse platform specific info. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 20:15:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, Guo, Please fix the typos "specif" in commit message.=20 Other than this, it looks good to me. Reviewed-by: Maurice Ma -----Original Message----- From: Dong, Guo=20 Sent: Monday, October 17, 2016 3:33 PM To: edk2-devel@lists.01.org Cc: Ma, Maurice; Agyeman, Prince; Dong, Guo Subject: [edk2] [PATCH] CorebootModulePkg: Add a library to parse platform = specific info. Update CbSupportPei to consume the new library, so platform could provide p= latform specific library instance to parse platform specif info. And add a NULL library instance to pass build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: gdong1 --- CorebootModulePkg/CbSupportPei/CbSupportPei.c | 9 ++++++ CorebootModulePkg/CbSupportPei/CbSupportPei.h | 3 +- CorebootModulePkg/CbSupportPei/CbSupportPei.inf | 1 + .../Include/Library/CbPlatformSupportLib.h | 34 ++++++++++++++++++= +++ .../CbPlatformSupportLibNull.c | 35 ++++++++++++++++++= ++++ .../CbPlatformSupportLibNull.inf | 35 ++++++++++++++++++= ++++ .../CbPlatformSupportLibNull.uni | 19 ++++++++++++ CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 1 + CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 1 + 9 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 Core= bootModulePkg/Include/Library/CbPlatformSupportLib.h create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.c create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.inf create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.uni diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModule= Pkg/CbSupportPei/CbSupportPei.c index 366682b..5688bf2 100755 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c +++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c @@ -387,6 +387,15 @@ CbPeiEntryPoint ( } =20 // + // Parse platform specific information from coreboot.=20 + // + Status =3D CbParsePlatformInfo (); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "Error when parsing platform info, Status =3D %r\= n", Status)); + return Status; + } + + // // Mask off all legacy 8259 interrupt sources // IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); diff --git a/Coreboot= ModulePkg/CbSupportPei/CbSupportPei.h b/CorebootModulePkg/CbSupportPei/CbSu= pportPei.h index 3c9a3fe..f897dc4 100644 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.h +++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.h @@ -1,7 +1,7 @@ /** @file The header file of Coreboot Support PEIM. =20 -Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availab= le under the terms and conditions of the BSD License which accompanies thi= s distribution. The full text of the license may be found at @@ -28,6 +28,= 7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. #include #include #include +#include =20 #include #include diff --git a/CorebootModulePkg/CbS= upportPei/CbSupportPei.inf b/CorebootModulePkg/CbSupportPei/CbSupportPei.in= f index 4905bdb..f7997ff 100644 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.inf +++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.inf @@ -52,6 +52,7 @@ CbParseLib MtrrLib IoLib + CbPlatformSupportLib =20 [Guids] gEfiSmmPeiSmramMemoryReserveGuid diff --git a/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h b/Cor= ebootModulePkg/Include/Library/CbPlatformSupportLib.h new file mode 100644 index 0000000..153d3d8 --- /dev/null +++ b/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h @@ -0,0 +1,34 @@ +/** @file + Coreboot Platform Support library. Platform can provide an=20 +implementation of this + library class to provide hooks that may be required for some type of + platform features. + +Copyright (c) 2016, Intel Corporation. All rights reserved.
This=20 +program and the accompanying materials are licensed and made available=20 +under the terms and conditions of the BSD License that accompanies this di= stribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. = =20 + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#ifndef __CB_PLATFORM_SUPPORT_LIB__ +#define __CB_PLATFORM_SUPPORT_LIB__ + +/** + Parse platform specific information from coreboot.=20 + + @retval RETURN_SUCCESS The platform specific coreboot support succ= eeded. + @retval RETURN_DEVICE_ERROR The platform specific coreboot support coul= d not be completed. +=20 +**/ +EFI_STATUS +EFIAPI +CbParsePlatformInfo ( + VOID + ); + +#endif // __CB_PLATFORM_SUPPORT_LIB__ + diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.c b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlat= formSupportLibNull.c new file mode 100644 index 0000000..ecdad1a --- /dev/null +++ b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSuppo +++ rtLibNull.c @@ -0,0 +1,35 @@ +/** @file + Include all platform specific features which can be customized by IBV/OE= M. + +Copyright (c) 2016, Intel Corporation. All rights reserved.
This=20 +program and the accompanying materials are licensed and made available=20 +under the terms and conditions of the BSD License which accompanies=20 +this distribution. The full text of the license may be found at=20 +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=20 +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLI= ED. + +**/ + +#include +#include +#include +#include + +/** + Parse platform specific information from coreboot. + + @retval RETURN_SUCCESS The platform specific coreboot support succ= eeded. + @retval RETURN_DEVICE_ERROR The platform specific coreboot support coul= d not be completed. + +**/ +EFI_STATUS +EFIAPI +CbParsePlatformInfo ( + VOID + ) +{ + return EFI_SUCCESS; +} + diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.inf b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.inf new file mode 100644 index 0000000..7e25df3 --- /dev/null +++ b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSuppo +++ rtLibNull.inf @@ -0,0 +1,35 @@ +## @file +# Include all platform specific features which can be customized by IBV/O= EM. +# +# Copyright (c) 2016, Intel Corporation. All rights reserved.
# =20 +This program and the accompanying materials # are licensed and made=20 +available under the terms and conditions of the BSD License # which=20 +accompanies this distribution. The full text of the license may be=20 +found at # http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"=20 +BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES= S OR IMPLIED. +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D CbPlatformSupportLib + MODULE_UNI_FILE =3D CbPlatformSupportLibNull.uni + FILE_GUID =3D B42AA265-00CA-4d4b-AC14-DBD5268E1BC7 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D CbPlatformSupportLib + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 EBC +# + +[Sources] + CbPlatformSupportLibNull.c + +[Packages] + MdePkg/MdePkg.dec + CorebootModulePkg/CorebootModulePkg.dec diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.uni b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.uni new file mode 100644 index 0000000..3102916 --- /dev/null +++ b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSuppo +++ rtLibNull.uni @@ -0,0 +1,19 @@ +// /** @file +// NULL implementation for CbPlatformSupportLib library class interfaces. +// +// Copyright (c) 2016, Intel Corporation. All rights reserved.
//=20 +// This program and the accompanying materials // are licensed and made=20 +available under the terms and conditions of the BSD License // which=20 +accompanies this distribution. The full text of the license may be=20 +found at // http://opensource.org/licenses/bsd-license.php +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"=20 +BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRES= S OR IMPLIED. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "NULL implementati= on for CbPlatformSupportLib library class interfaces" + +#string STR_MODULE_DESCRIPTION #language en-US "NULL implementati= on for CbPlatformSupportLib library class interfaces." + diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloa= dPkg/CorebootPayloadPkgIa32.dsc index 4357433..c98a62f 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc @@ -170,6 +170,7 @@ SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSeria= lPortLib16550.inf PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookL= ib.inf PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib= /PlatformBootManagerLib.inf + =20 + CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNul + l/CbPlatformSupportLibNull.inf =20 # # Misc diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPay= loadPkg/CorebootPayloadPkgIa32X64.dsc index 3ddc81b..451852f 100644 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc +++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc @@ -172,6 +172,7 @@ SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSeria= lPortLib16550.inf PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookL= ib.inf PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib= /PlatformBootManagerLib.inf + =20 + CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNul + l/CbPlatformSupportLibNull.inf =20 # # Misc -- 2.7.0.windows.1