Revision: 18968
          http://sourceforge.net/p/edk2/code/18968
Author:   lzeng14
Date:     2015-11-26 08:49:26 +0000 (Thu, 26 Nov 2015)
Log Message:
-----------
CorebootPayloadPkg: Use SerialDxe in MdeModulePkg

1. Update fdf and dsc to use SerialDxe in MdeModulePkg.
2. Separate the code that gets SerialRegBase and SerialRegAccessType
   by CbParseLib from CorebootPayloadPkg/Library/SerialPortLib to
   PlatformHookLib, and then leverage BaseSerialPortLib16550 in
   MdeModulePkg.
3. Remove CorebootPayloadPkg/SerialDxe and
   CorebootPayloadPkg/Library/SerialPortLib.

Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Maurice Ma <[email protected]>
Cc: Prince Agyeman <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Maurice Ma <[email protected]>

Modified Paths:
--------------
    trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkg.fdf
    trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
    trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
    trunk/edk2/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h

Added Paths:
-----------
    trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/
    trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
    trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf

Removed Paths:
-------------
    trunk/edk2/CorebootPayloadPkg/Library/SerialPortLib/
    trunk/edk2/CorebootPayloadPkg/SerialDxe/

Modified: trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkg.fdf
===================================================================
--- trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkg.fdf        2015-11-26 
08:48:38 UTC (rev 18967)
+++ trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkg.fdf        2015-11-26 
08:49:26 UTC (rev 18968)
@@ -3,7 +3,7 @@
 #
 # Provides drivers and definitions to create uefi payload for coreboot. 
 #
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2015, 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
@@ -116,7 +116,7 @@
 #
 # ISA Support
 #
-INF CorebootPayloadPkg/SerialDxe/SerialDxe.inf
+INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
 
 #
 # Console Support

Modified: trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
===================================================================
--- trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc    2015-11-26 
08:48:38 UTC (rev 18967)
+++ trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc    2015-11-26 
08:49:26 UTC (rev 18968)
@@ -3,7 +3,7 @@
 #
 # Provides drivers and definitions to create uefi payload for coreboot. 
 #
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2015, 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
@@ -116,7 +116,8 @@
   #
   TimerLib|CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
   ResetSystemLib|CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf
-  SerialPortLib|CorebootPayloadPkg/Library/SerialPortLib/SerialPortLib.inf
+  
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
+  
PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
   PlatformBdsLib|CorebootPayloadPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
   
   #
@@ -214,6 +215,10 @@
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
 !endif
 
+[PcdsPatchableInModule.common]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
+
 
################################################################################
 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
@@ -340,7 +345,7 @@
   #
   # ISA Support
   #
-  CorebootPayloadPkg/SerialDxe/SerialDxe.inf
+  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
   
   #
   # Console Support

Modified: trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
===================================================================
--- trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 2015-11-26 
08:48:38 UTC (rev 18967)
+++ trunk/edk2/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 2015-11-26 
08:49:26 UTC (rev 18968)
@@ -3,7 +3,7 @@
 #
 # Provides drivers and definitions to create uefi payload for coreboot. 
 #
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2015, 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
@@ -116,7 +116,8 @@
   #
   TimerLib|CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf
   ResetSystemLib|CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf
-  SerialPortLib|CorebootPayloadPkg/Library/SerialPortLib/SerialPortLib.inf
+  
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
+  
PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
   PlatformBdsLib|CorebootPayloadPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
   
   #
@@ -216,6 +217,10 @@
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2
 !endif
 
+[PcdsPatchableInModule.common]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
+
 
################################################################################
 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
@@ -342,7 +347,7 @@
   #
   # ISA Support
   #
-  CorebootPayloadPkg/SerialDxe/SerialDxe.inf
+  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
   
   #
   # Console Support

Modified: trunk/edk2/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h
===================================================================
--- trunk/edk2/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h  
2015-11-26 08:48:38 UTC (rev 18967)
+++ trunk/edk2/CorebootPayloadPkg/Library/PlatformBdsLib/BdsPlatform.h  
2015-11-26 08:49:26 UTC (rev 18968)
@@ -1,7 +1,7 @@
 /** @file
   Head file for BDS Platform specific code
 
-Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2014 - 2015, 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
@@ -29,7 +29,6 @@
 #include <Library/DevicePathLib.h>
 
 #include <Protocol/PciIo.h>
-#include <Protocol/SerialIo.h>
 
 #include <Guid/GlobalVariable.h>
 extern BDS_CONSOLE_CONNECT_ENTRY  gPlatformConsole[];
@@ -94,7 +93,7 @@
         (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
       } \
     }, \
-    EFI_SERIAL_IO_PROTOCOL_GUID \
+    {0xD3987D4B, 0x971A, 0x435F, {0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72, 
0x41}} \
   }
     
 #define gUart \

Added: trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c
===================================================================
--- trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c     
                        (rev 0)
+++ trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c     
2015-11-26 08:49:26 UTC (rev 18968)
@@ -0,0 +1,56 @@
+/** @file
+  Platform Hook Library instance for UART device upon coreboot.
+
+  Copyright (c) 2015, 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 <Base.h>
+#include <Uefi/UefiBaseType.h>
+#include <Library/PlatformHookLib.h>
+#include <Library/CbParseLib.h>
+#include <Library/PcdLib.h>
+
+/**
+  Performs platform specific initialization required for the CPU to access
+  the hardware associated with a SerialPortLib instance.  This function does
+  not intiailzie the serial port hardware itself.  Instead, it initializes
+  hardware devices that are required for the CPU to access the serial port
+  hardware.  This function may be called more than once.
+
+  @retval RETURN_SUCCESS       The platform specific initialization succeeded.
+  @retval RETURN_DEVICE_ERROR  The platform specific initialization could not 
be completed.
+
+**/
+RETURN_STATUS
+EFIAPI
+PlatformHookSerialPortInitialize (
+  VOID
+  )
+{
+  RETURN_STATUS     Status;
+  UINT32            SerialRegBase;
+  UINT32            SerialRegAccessType;
+
+  Status = CbParseSerialInfo (&SerialRegBase, &SerialRegAccessType, NULL);
+  if (RETURN_ERROR (Status)) {
+    return Status;
+  }
+
+  if (SerialRegAccessType == 2) { //MMIO
+    PcdSetBoolS (PcdSerialUseMmio, TRUE);
+  } else { //IO
+    PcdSetBoolS (PcdSerialUseMmio, FALSE);
+  }
+  PcdSet64S (PcdSerialRegisterBase, (UINT64) SerialRegBase);
+
+  return RETURN_SUCCESS;
+}
+

Copied: 
trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf (from 
rev 18967, 
trunk/edk2/CorebootPayloadPkg/Library/SerialPortLib/SerialPortLib.inf)
===================================================================
--- trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf   
                        (rev 0)
+++ trunk/edk2/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf   
2015-11-26 08:49:26 UTC (rev 18968)
@@ -0,0 +1,38 @@
+## @file
+#  Platform Hook Library instance for UART device upon coreboot.
+#
+#  Copyright (c) 2015, 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                      = PlatformHookLib
+  FILE_GUID                      = 40A2CBC6-CFB8-447b-A90E-198E88FD345E
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = PlatformHookLib
+
+[Sources]
+  PlatformHookLib.c
+
+[LibraryClasses]
+  CbParseLib
+  PcdLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  CorebootModulePkg/CorebootModulePkg.dec
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio       ## PRODUCES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase  ## PRODUCES
+


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741551&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to