CorebootModulePkg: Add a library to parse platform specific info.
authorgdong1 <guo.dong@intel.com>
Mon, 17 Oct 2016 21:47:07 +0000 (14:47 -0700)
committerMaurice Ma <maurice.ma@intel.com>
Wed, 26 Oct 2016 22:34:30 +0000 (15:34 -0700)
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>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
CorebootModulePkg/CbSupportPei/CbSupportPei.c
CorebootModulePkg/CbSupportPei/CbSupportPei.h
CorebootModulePkg/CbSupportPei/CbSupportPei.inf
CorebootModulePkg/Include/Library/CbPlatformSupportLib.h [new file with mode: 0644]
CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.c [new file with mode: 0644]
CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf [new file with mode: 0644]
CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.uni [new file with mode: 0644]
CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc

index 9d5803449e2519b07f04e40e163f284d5fd15528..80fd611bc8e43ba584ca703e2a76b72e92ffd9d1 100755 (executable)
@@ -387,6 +387,15 @@ CbPeiEntryPoint (
     DEBUG ((EFI_D_ERROR, "Create frame buffer info guid hob\n"));\r
   }\r
 \r
+  //\r
+  // Parse platform specific information from coreboot. \r
+  //\r
+  Status = CbParsePlatformInfo ();\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((EFI_D_ERROR, "Error when parsing platform info, Status = %r\n", Status));\r
+    return Status;\r
+  }\r
+\r
   //\r
   // Mask off all legacy 8259 interrupt sources\r
   //\r
index 3c9a3fe61ec47ca7b44d7a0622b3a81c13d0e248..f897dc4ac5146d69961c01f14332afac45fe4636 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of Coreboot Support PEIM.\r
 \r
-Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -28,6 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/CbParseLib.h>\r
 #include <Library/MtrrLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/CbPlatformSupportLib.h>\r
 \r
 #include <Guid/SmramMemoryReserve.h>\r
 #include <Guid/MemoryTypeInformation.h>\r
index 4905bdbd8ed26f8dae72a79b47be0c24bf3be52b..f7997ff70252099c140095d0cdcfc65047e2401d 100644 (file)
@@ -52,6 +52,7 @@
   CbParseLib\r
   MtrrLib\r
   IoLib\r
+  CbPlatformSupportLib\r
 \r
 [Guids]\r
   gEfiSmmPeiSmramMemoryReserveGuid\r
diff --git a/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h b/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h
new file mode 100644 (file)
index 0000000..153d3d8
--- /dev/null
@@ -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 (file)
index 0000000..ecdad1a
--- /dev/null
@@ -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 (file)
index 0000000..7e25df3
--- /dev/null
@@ -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 (file)
index 0000000..3102916
--- /dev/null
@@ -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."
+
index 83b1f9abbfa8ea8e700a653ec9fd42602294290e..cc29af53719af51a5584b36ea620d80f0975cea6 100644 (file)
   SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf\r
   PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf\r
   PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf\r
+  CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf\r
 \r
   #\r
   # Misc\r
index b0aec3d7b282d43bbdd29c46041808b5be8d40ad..a22e57646513df7a0aeb51bcc6066adf2beb7a25 100644 (file)
   SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf\r
   PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf\r
   PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf\r
+  CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportLibNull.inf\r
 \r
   #\r
   # Misc\r