From: "Ma, Maurice" <maurice.ma@intel.com>
To: "Dong, Guo" <guo.dong@intel.com>
Cc: "Agyeman, Prince" <prince.agyeman@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] CorebootModulePkg: Add a library to parse platform specific info.
Date: Wed, 26 Oct 2016 20:15:40 +0000 [thread overview]
Message-ID: <7AAC936950815649B5F88FAE785306C28417693F@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <b0df1983792beccb5b1c79793a66ca241c061b80.1476743161.git.guo.dong@intel.com>
Hi, Guo,
Please fix the typos "specif" in commit message.
Other than this, it looks good to me.
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
-----Original Message-----
From: Dong, Guo
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 platform 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 <guo.dong@intel.com>
---
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 CorebootModulePkg/Include/Library/CbPlatformSupportLib.h
create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.c
create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf
create mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.uni
diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
index 366682b..5688bf2 100755
--- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c
+++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.c
@@ -387,6 +387,15 @@ CbPeiEntryPoint (
}
//
+ // Parse platform specific information from coreboot.
+ //
+ Status = CbParsePlatformInfo ();
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Error when parsing platform info, Status = %r\n", Status));
+ return Status;
+ }
+
+ //
// Mask off all legacy 8259 interrupt sources
//
IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.h b/CorebootModulePkg/CbSupportPei/CbSupportPei.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.
-Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this 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 IMPLIED.
#include <Library/CbParseLib.h>
#include <Library/MtrrLib.h>
#include <Library/IoLib.h>
+#include <Library/CbPlatformSupportLib.h>
#include <Guid/SmramMemoryReserve.h>
#include <Guid/MemoryTypeInformation.h> diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.inf b/CorebootModulePkg/CbSupportPei/CbSupportPei.inf
index 4905bdb..f7997ff 100644
--- a/CorebootModulePkg/CbSupportPei/CbSupportPei.inf
+++ b/CorebootModulePkg/CbSupportPei/CbSupportPei.inf
@@ -52,6 +52,7 @@
CbParseLib
MtrrLib
IoLib
+ CbPlatformSupportLib
[Guids]
gEfiSmmPeiSmramMemoryReserveGuid
diff --git a/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h b/CorebootModulePkg/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
+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.<BR> This
+program and the accompanying materials are licensed and made available
+under the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __CB_PLATFORM_SUPPORT_LIB__
+#define __CB_PLATFORM_SUPPORT_LIB__
+
+/**
+ Parse platform specific information from coreboot.
+
+ @retval RETURN_SUCCESS The platform specific coreboot support succeeded.
+ @retval RETURN_DEVICE_ERROR The platform specific coreboot support could not be completed.
+
+**/
+EFI_STATUS
+EFIAPI
+CbParsePlatformInfo (
+ VOID
+ );
+
+#endif // __CB_PLATFORM_SUPPORT_LIB__
+
diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.c b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.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/OEM.
+
+Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> This
+program and the accompanying materials are licensed and made available
+under the terms and conditions of the BSD License which accompanies
+this distribution. The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Uefi.h>
+#include <Library/BaseLib.h>
+#include <Library/UefiLib.h>
+#include <Library/CbPlatformSupportLib.h>
+
+/**
+ Parse platform specific information from coreboot.
+
+ @retval RETURN_SUCCESS The platform specific coreboot support succeeded.
+ @retval RETURN_DEVICE_ERROR The platform specific coreboot support could not be completed.
+
+**/
+EFI_STATUS
+EFIAPI
+CbParsePlatformInfo (
+ VOID
+ )
+{
+ return EFI_SUCCESS;
+}
+
diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.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/OEM.
+#
+# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR> #
+This program and the accompanying materials # are licensed and made
+available under the terms and conditions of the BSD License # which
+accompanies this distribution. The full text of the license may be
+found at # http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
+BASIS, # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = CbPlatformSupportLib
+ MODULE_UNI_FILE = CbPlatformSupportLibNull.uni
+ FILE_GUID = B42AA265-00CA-4d4b-AC14-DBD5268E1BC7
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = CbPlatformSupportLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 EBC
+#
+
+[Sources]
+ CbPlatformSupportLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ CorebootModulePkg/CorebootModulePkg.dec
diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.uni b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.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.<BR> //
+// This program and the accompanying materials // are licensed and made
+available under the terms and conditions of the BSD License // which
+accompanies this distribution. The full text of the license may be
+found at // http://opensource.org/licenses/bsd-license.php
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
+BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "NULL implementation for CbPlatformSupportLib library class interfaces"
+
+#string STR_MODULE_DESCRIPTION #language en-US "NULL implementation for CbPlatformSupportLib library class interfaces."
+
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 4357433..c98a62f 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -170,6 +170,7 @@
SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+
+ CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNul
+ l/CbPlatformSupportLibNull.inf
#
# Misc
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index 3ddc81b..451852f 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -172,6 +172,7 @@
SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
+
+ CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNul
+ l/CbPlatformSupportLibNull.inf
#
# Misc
--
2.7.0.windows.1
parent reply other threads:[~2016-10-26 20:15 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <b0df1983792beccb5b1c79793a66ca241c061b80.1476743161.git.guo.dong@intel.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7AAC936950815649B5F88FAE785306C28417693F@ORSMSX113.amr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox