Re: [edk2-devel][Patch 0/7] Implement Capsule On Disk.

2019-05-28 Thread Zhang, Chao B
Yes, will check in after Q2 tag

From: Gao, Liming
Sent: Wednesday, May 29, 2019 8:34 AM
To: Xu, Wei6 ; devel@edk2.groups.io
Cc: Wang, Jian J ; Wu, Hao A ; 
Kinney, Michael D ; Zhang, Chao B 

Subject: RE: [edk2-devel][Patch 0/7] Implement Capsule On Disk.

So, this feature is for next Q3 stable tag. Right?

> -Original Message-
> From: Xu, Wei6
> Sent: Wednesday, May 29, 2019 1:06 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J mailto:jian.j.w...@intel.com>>; Wu, 
> Hao A mailto:hao.a...@intel.com>>; Kinney, Michael D 
> mailto:michael.d.kin...@intel.com>>; Gao,
> Liming mailto:liming@intel.com>>; Zhang, Chao B 
> mailto:chao.b.zh...@intel.com>>
> Subject: [edk2-devel][Patch 0/7] Implement Capsule On Disk.
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1852
>
> This patch set implements Capsule On Disk.
> Depends on whether platform supports Capsule-In-Ram, Capsule On Disk feature 
> is composed of 2 solutions:
> Solution A): Load capsules out of TCB, rely on UpdateCapsule() runtime 
> service to deliver Capsule-On-Disk.
> Solution B): Relocate capsules into a temp file which will be stored in root 
> directory on a platform specific storage device.
> Leverage existing storage stack in PEI to load all capsule on disk images and 
> create capsule hobs for the capsules.
> This solution has bigger TCB, but can work without Capsule-In-RAM support.
>
>
> Cc: Jian J Wang mailto:jian.j.w...@intel.com>>
> Cc: Hao A Wu mailto:hao.a...@intel.com>>
> Cc: Michael D Kinney 
> mailto:michael.d.kin...@intel.com>>
> Cc: Liming Gao mailto:liming@intel.com>>
> Cc: Chao B Zhang mailto:chao.b.zh...@intel.com>>
>
> xuwei6 (7):
>   MdePkg: Add Pei Boot In CapsuleOnDisk Mode Ppi definition.
>   MdeModulePkg: Add Capsule On Disk related definition.
>   MdeModulePkg: Add CapsuleOnDiskLoadPei PEIM.
>   MdeModulePkg/BdsDxe: Support Capsule On Disk.
>   MdeModulePkg/CapsuleRuntimeDxe: Introduce PCD to control this feature.
>   MdeModulePkg/DxeIpl: Support Capsule On Disk.
>   MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.
>
>  MdeModulePkg/Core/DxeIplPeim/DxeIpl.h  |3 +-
>  MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf|   20 +-
>  MdeModulePkg/Core/DxeIplPeim/DxeLoad.c |   37 +-
>  MdeModulePkg/Include/Library/CapsuleLib.h  |   94 +-
>  MdeModulePkg/Include/Ppi/CapsuleOnDisk.h   |   48 +
>  .../Library/DxeCapsuleLibFmp/CapsuleOnDisk.c   | 1984 
> 
>  .../Library/DxeCapsuleLibFmp/CapsuleOnDisk.h   |   63 +
>  .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c   |   51 +-
>  .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf |   20 +-
>  .../DxeCapsuleLibFmp/DxeCapsuleProcessLib.c|  121 +-
>  .../Library/DxeCapsuleLibFmp/DxeCapsuleReportLib.c |   66 +-
>  .../DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf  |3 +-
>  .../Library/DxeCapsuleLibNull/DxeCapsuleLibNull.c  |   85 +-
>  MdeModulePkg/MdeModulePkg.dec  |   43 +
>  MdeModulePkg/MdeModulePkg.dsc  |4 +
>  MdeModulePkg/MdeModulePkg.uni  |   32 +
>  MdeModulePkg/Universal/BdsDxe/BdsDxe.inf   |3 +-
>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c   |6 +-
>  .../CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c|  442 +
>  .../CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.inf  |   64 +
>  .../CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.uni  |   15 +
>  .../CapsuleOnDiskLoadPeiExtra.uni  |   14 +
>  .../CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf|1 +
>  .../Universal/CapsuleRuntimeDxe/CapsuleService.c   |   10 +-
>  MdePkg/Include/Ppi/BootInRecoveryMode.h|9 +-
>  MdePkg/MdePkg.dec  |3 +
>  26 files changed, 3200 insertions(+), 41 deletions(-)
>  create mode 100644 MdeModulePkg/Include/Ppi/CapsuleOnDisk.h
>  create mode 100644 MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c
>  create mode 100644 MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.h
>  create mode 100644 
> MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.c
>  create mode 100644 
> MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.inf
>  create mode 100644 
> MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPei.uni
>  create mode 100644 
> MdeModulePkg/Universal/CapsuleOnDiskLoadPei/CapsuleOnDiskLoadPeiExtra.uni
>
> --
> 2.16.2.windows.1

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41551): https://edk2.groups.io/g/devel/message/41551
Mute This Topic: https://groups.io/mt/31824148/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] Platform/Intel: Add fspapi build parameter

2019-05-28 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: Chiu, Chasel 
Sent: Tuesday, May 28, 2019 12:52 AM
To: devel@edk2.groups.io
Cc: Agyeman, Prince ; Desimone, Nathaniel L 
; Kubacki, Michael A 

Subject: [PATCH] Platform/Intel: Add fspapi build parameter

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1824

Going forward FSP Dispatch mode will be default in KabylakeOpenBoardPkg and 
requires fspapi build parameter to switch back to FSP API mode.
When --fspapi given to build python script it will set 
gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection to 1, otherwise the PCD 
will be the default value defined by each *BoardPkg.

Test: verified the PCD PcdFspModeSelection can be
  overridden by new build parameter.

Cc: Agyeman Prince 
Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 Platform/Intel/build_bios.py | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Platform/Intel/build_bios.py b/Platform/Intel/build_bios.py index 
9effefc0c7..9f8d78f6e8 100644
--- a/Platform/Intel/build_bios.py
+++ b/Platform/Intel/build_bios.py
@@ -359,6 +359,11 @@ def build(config):
 command.append("-D")
 command.append("MAX_SOCKET=" + config["MAX_SOCKET"])
 
+if config.get("API_MODE_FSP_WRAPPER_BUILD", "FALSE") == "TRUE":
+#Override PCD to enable API mode FSP wrapper.
+command.append("--pcd")
+
+ command.append("gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection=1"
+ )
+
 shell = True
 if os.name == "posix":
 shell = False
@@ -840,6 +845,9 @@ def get_cmd_config_arguments(arguments):
 if arguments.fsp is True:
 result["FSP_WRAPPER_BUILD"] = "TRUE"
 
+if arguments.fspapi is True:
+result["API_MODE_FSP_WRAPPER_BUILD"] = "TRUE"
+
 return result
 
 
@@ -910,9 +918,12 @@ def get_cmd_arguments(build_config):
 parser.add_argument("--performance", help="performance build enabled",
 action='store_true', dest="performance")
 
-parser.add_argument("--fsp", help="fsp build enabled",
+parser.add_argument("--fsp", help="fsp wrapper build enabled",
 action='store_true', dest="fsp")
 
+parser.add_argument("--fspapi", help="API mode fsp wrapper build enabled",
+action='store_true', dest="fspapi")
+
 return parser.parse_args()
 
 
--
2.13.3.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41552): https://edk2.groups.io/g/devel/message/41552
Mute This Topic: https://groups.io/mt/31819454/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] MdeModulePkg/CapsulePei: Optimize the CapsulePei

2019-05-28 Thread Gao, Zhichao
From: Bret Barkelew 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853

Sperate the capsule check function from GetCapsuleDescriptors
and name it to AreCapsulesStaged.
Rename GetCapsuleDescriptors to GetScatterGatherHeadEntries.
And optimize its to remove the duplicated code.

Cc: Jian J Wang 
Cc: Hao A Wu 
Cc: Ray Ni 
Cc: Star Zeng 
Cc: Liming Gao 
Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Signed-off-by: Zhichao gao 
---
 MdeModulePkg/Universal/CapsulePei/Capsule.h   |   3 +-
 .../Universal/CapsulePei/CapsulePei.inf   |   3 +-
 .../Universal/CapsulePei/UefiCapsule.c| 357 ++
 3 files changed, 194 insertions(+), 169 deletions(-)

diff --git a/MdeModulePkg/Universal/CapsulePei/Capsule.h 
b/MdeModulePkg/Universal/CapsulePei/Capsule.h
index baf40423af..fc20dd8b92 100644
--- a/MdeModulePkg/Universal/CapsulePei/Capsule.h
+++ b/MdeModulePkg/Universal/CapsulePei/Capsule.h
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +30,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
+#include 
 #include 
 #include "Common/CommonHeader.h"
 
diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf 
b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
index 5d43df3075..9c88b3986f 100644
--- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
+++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
@@ -6,7 +6,7 @@
 #  This external input must be validated carefully to avoid security issue like
 #  buffer overflow, integer overflow.
 #
-# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -43,6 +43,7 @@
   BaseLib
   HobLib
   BaseMemoryLib
+  MemoryAllocationLib
   PeiServicesLib
   PeimEntryPoint
   DebugLib
diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c 
b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
index e967599e96..2d003369ca 100644
--- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
+++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
@@ -1,7 +1,7 @@
 /** @file
   Capsule update PEIM for UEFI2.0
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
 Copyright (c) 2017, AMD Incorporated. All rights reserved.
 
 SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "Capsule.h"
 
+#define DEFAULT_SG_LIST_HEADS   (20)
+
 #ifdef MDE_CPU_IA32
 //
 // Global Descriptor Table (GDT)
@@ -791,30 +793,89 @@ BuildMemoryResourceDescriptor (
 }
 
 /**
-  Checks for the presence of capsule descriptors.
-  Get capsule descriptors from variable CapsuleUpdateData, CapsuleUpdateData1, 
CapsuleUpdateData2...
-  and save to DescriptorBuffer.
+  Check if the capsules are staged.
 
-  @param DescriptorBufferPointer to the capsule descriptors
+  @retval TRUE  The capsules are staged.
+  @retval FALSE The capsules are not staged.
+
+**/
+BOOLEAN
+EFIAPI
+AreCapsulesStaged (
+  VOID
+  )
+{
+  EFI_STATUSStatus;
+  UINTN Size;
+  EFI_PEI_READ_ONLY_VARIABLE2_PPI   *PPIVariableServices;
+  EFI_PHYSICAL_ADDRESS  CapsuleDataPtr64;
+
+  CapsuleDataPtr64 = 0;
+
+  Status = PeiServicesLocatePpi (
+&gEfiPeiReadOnlyVariable2PpiGuid,
+0,
+NULL,
+(VOID **)&PPIVariableServices
+);
+
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "Failed to find ReadOnlyVariable2PPI\n"));
+return FALSE;
+  }
+
+  //
+  // Check for Update capsule
+  //
+  Size = sizeof (CapsuleDataPtr64);
+  Status = PPIVariableServices->GetVariable(
+  PPIVariableServices,
+  EFI_CAPSULE_VARIABLE_NAME,
+  &gEfiCapsuleVendorGuid,
+  NULL,
+  &Size,
+  (VOID *)&CapsuleDataPtr64
+  );
+
+  if (!EFI_ERROR (Status)) {
+return TRUE;
+  }
+
+  return FALSE;
+}
+
+/**
+  Check all the variables for SG list heads and get the count and addresses.
+
+  @param ListLength   A pointer would return the SG list length.
+  @param HeadList A ponter to the capsule SG list.
+
+  @retval EFI_SUCCESS a valid capsule is present
+  @retval EFI_NOT_FOUND   if a valid capsule is not present
+  @retval EFI_INVALID_PARAMETER   the input parameter is invalid
+  @retval EFI_OUT_OF_RESOURCE fail to allocate memory
 
-  @retval EFI_SUCCESS a valid capsule is pr

[edk2-devel] [Patch 0/3] [edk2-platforms] Add DebugFeaturePkg to keep debug related modules.

2019-05-28 Thread Dong, Eric
Add new package in Platform/Intel/ folder to keep debug related
modules.

Eric Dong (3):
  Platform/Intel/DebugFeaturePkg: Add DebugFeaturePkg
  Platform/Intel/DebugFeaturePkg: Add USB3DebugPort related modules.
  Platform/Intel/DebugFeaturePkg/AcpiDebug: Change AcpiDebug module
location.

 Maintainers.txt   |   4 +
 .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |   6 -
 .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |   3 -
 .../AcpiDebug/AcpiDebug.asl   |   0
 .../AcpiDebug/AcpiDebug.c |   0
 .../AcpiDebug/AcpiDebugDxe.inf|   8 +-
 .../AcpiDebug/AcpiDebugSmm.inf|   8 +-
 .../AcpiDebug/Readme.txt  |   0
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dec |  64 ++
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dsc |  98 ++
 .../Include/Library/Usb3DebugPortLib.h|  76 ++
 .../Library/Usb3DebugPortParameterLib.h   |  56 ++
 .../Library/Usb3DebugPortLib/MiscServices.c   | 385 
 .../Usb3DebugPortDataTransfer.c   | 892 ++
 .../Usb3DebugPortInitialize.c | 726 ++
 .../Usb3DebugPortLib/Usb3DebugPortLibDxe.c| 454 +
 .../Usb3DebugPortLib/Usb3DebugPortLibDxe.inf  |  55 ++
 .../Usb3DebugPortLibDxeIoMmu.c| 828 
 .../Usb3DebugPortLibDxeIoMmu.inf  |  63 ++
 .../Usb3DebugPortLibInternal.h| 887 +
 .../Usb3DebugPortLib/Usb3DebugPortLibNull.c   | 103 ++
 .../Usb3DebugPortLib/Usb3DebugPortLibNull.inf |  28 +
 .../Usb3DebugPortLib/Usb3DebugPortLibPei.c| 236 +
 .../Usb3DebugPortLib/Usb3DebugPortLibPei.inf  |  48 +
 .../Usb3DebugPortLibPeiIoMmu.c| 440 +
 .../Usb3DebugPortLibPeiIoMmu.inf  |  51 +
 .../Usb3DebugPortParameterLibPcd.c|  58 ++
 .../Usb3DebugPortParameterLibPcd.inf  |  31 +
 28 files changed, 5591 insertions(+), 17 deletions(-)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebug.asl (100%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebug.c (100%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebugDxe.inf (79%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebugSmm.inf (80%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/Readme.txt (100%)
 create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec
 create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortLib.h
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortParameterLib.h
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/MiscServices.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortDataTransfer.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortInitialize.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxe.inf
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibDxeIoMmu.inf
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibInternal.h
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibNull.inf
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPei.inf
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPortLibPeiIoMmu.inf
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.c
 create mode 100644 
Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortParameterLibPcd/Usb3DebugPortParameterLibPcd.inf

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41554): https://edk2.groups.io/g/devel/message/41554
Mute This Topic: https://groups.io/mt/31828868/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch 1/3] [edk2-platforms] Platform/Intel/DebugFeaturePkg: Add DebugFeaturePkg

2019-05-28 Thread Dong, Eric
Add new package DebugFeaturePkg in Platform/Intel/ folder.
It will keep debug related features in this package.

Signed-off-by: Eric Dong 
---
 Maintainers.txt   |  4 
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dec | 19 +++
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 24 +++
 3 files changed, 47 insertions(+)
 create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec
 create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc

diff --git a/Maintainers.txt b/Maintainers.txt
index 76feecceb7..66782b4b92 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -60,6 +60,10 @@ M: Michael Kubacki 
 M: Sai Chaganty 
 R: Liming Gao 
 
+Platform/Intel/DebugFeaturePkg
+M: Eric Dong 
+R: Liming Gao 
+
 Platform/Intel/ClevoOpenBoardPkg
 M: Michael Kubacki 
 M: Ankit Sinha 
diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec 
b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec
new file mode 100644
index 00..839684183a
--- /dev/null
+++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec
@@ -0,0 +1,19 @@
+## @file
+# This package provides the modules that build for debug feature.
+# This DebugAdvancedFeaturePkg should only depend on EDKII Core packages and 
MinPlatformPkg.
+#
+# 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  = 0x00010005
+  PACKAGE_NAME   = DebugFeaturePkg
+  PACKAGE_GUID   = 58B6F2BB-A94F-4EB9-89DA-2F06ED59CE39
+  PACKAGE_VERSION= 0.1
\ No newline at end of file
diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc 
b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc
new file mode 100644
index 00..351d6583d5
--- /dev/null
+++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc
@@ -0,0 +1,24 @@
+## @file
+# This package provides the modules that build for debug feature.
+# This DebugFeaturePkg should only depend on EDKII Core packages and 
MinPlatformPkg.
+#
+# 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  = DebugFeaturePkg
+  PLATFORM_GUID  = 3A0DBEF4-3C16-4F6B-8B55-BABB260D30B9
+  PLATFORM_VERSION   = 0.1
+  DSC_SPECIFICATION  = 0x00010005
+  OUTPUT_DIRECTORY   = Build/DebugFeaturePkg
+  SUPPORTED_ARCHITECTURES= IA32|X64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41555): https://edk2.groups.io/g/devel/message/41555
Mute This Topic: https://groups.io/mt/31828869/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [Patch 3/3] [edk2-platforms] Platform/Intel/DebugFeaturePkg/AcpiDebug: Change AcpiDebug module location.

2019-05-28 Thread Dong, Eric
Move AcpiDebug module from AdvancedFeaturePkg to DebugFeaturePkg.

Signed-off-by: Eric Dong 
Cc: Liming Gao 
---
 .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |  6 --
 .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |  3 ---
 .../AcpiDebug/AcpiDebug.asl   |  0
 .../AcpiDebug/AcpiDebug.c |  0
 .../AcpiDebug/AcpiDebugDxe.inf|  8 
 .../AcpiDebug/AcpiDebugSmm.inf|  8 
 .../AcpiDebug/Readme.txt  |  0
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dec | 15 +--
 .../Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 12 
 9 files changed, 33 insertions(+), 19 deletions(-)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebug.asl (100%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebug.c (100%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebugDxe.inf (79%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/AcpiDebugSmm.inf (80%)
 rename Platform/Intel/{AdvancedFeaturePkg => 
DebugFeaturePkg}/AcpiDebug/Readme.txt (100%)

diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec 
b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec
index b18f81ba39..44e5de64db 100644
--- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec
+++ b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dec
@@ -140,17 +140,11 @@ gAdvancedFeaturePkgTokenSpaceGuid =  {0xa8514688, 
0x6693, 0x4ab5, {0xaa,
 
 [PcdsFixedAtBuild]
   gAdvancedFeaturePkgTokenSpaceGuid.PcdMaxSOLChannels|0x3|UINT8|0x4009
-  ## This PCD specifies AcpiDebug feature is enable/disable.
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable|FALSE|BOOLEAN|0x0012
-  ## This PCD specifies AcpiDebug buffer size.
-  
gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize|0x1|UINT32|0x0013
 
 [PcdsDynamic, PcdsDynamicEx]
   
gAdvancedFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress|0xCA2|UINT16|0x9022
   gAdvancedFeaturePkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x1030
   gAdvancedFeaturePkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0x1040
-  ## This PCD specifies AcpiDebug buffer address
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress|0|UINT32|0x0014
 
 [PcdsFeatureFlag]
   gAdvancedFeaturePkgTokenSpaceGuid.PcdNetworkEnable  
|FALSE|BOOLEAN|0xF0A1
diff --git a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc 
b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
index 909e566445..ea1a00725d 100644
--- a/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
+++ b/Platform/Intel/AdvancedFeaturePkg/AdvancedFeaturePkg.dsc
@@ -148,6 +148,3 @@
   AdvancedFeaturePkg/Ipmi/IpmiFru/IpmiFru.inf
   AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.inf
   AdvancedFeaturePkg/Ipmi/BmcAcpi/BmcAcpi.inf
-
-  AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
-  AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
\ No newline at end of file
diff --git a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl 
b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl
similarity index 100%
rename from Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.asl
rename to Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.asl
diff --git a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c 
b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c
similarity index 100%
rename from Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebug.c
rename to Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c
diff --git a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf 
b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
similarity index 79%
rename from Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
rename to Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
index fd701df3af..7473126b11 100644
--- a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
+++ b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugDxe.inf
@@ -32,12 +32,12 @@
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
-  AdvancedFeaturePkg/AdvancedFeaturePkg.dec
+  DebugFeaturePkg/DebugFeaturePkg.dec
 
 [Pcd]
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable  ## CONSUMES
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize  ## CONSUMES
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress ## PRODUCES
+  gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugEnable  ## CONSUMES
+  gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugBufferSize  ## CONSUMES
+  gDebugFeaturePkgTokenSpaceGuid.PcdAcpiDebugAddress ## PRODUCES
 
 [Sources]
   AcpiDebug.c
diff --git a/Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf 
b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
similarity index 80%
rename from Platform/Intel/AdvancedFeaturePkg/AcpiDebug/AcpiDebugSmm.inf
rename to Platform/Intel/DebugFeaturePkg

Re: [edk2-devel] [PATCH] BaseTools:Fix the library dependency missing in Binary Cache

2019-05-28 Thread Steven Shi
OK, will solve this issue through the fix patch of BZ 1797.


Thanks

Steven Shi
Intel\SSG\FID\Firmware Infrastructure


> -Original Message-
> From: Rodriguez, Christian
> Sent: Tuesday, May 28, 2019 11:06 PM
> To: devel@edk2.groups.io; Shi, Steven 
> Cc: Gao, Liming ; Feng, Bob C 
> Subject: RE: [edk2-devel] [PATCH] BaseTools:Fix the library dependency
> missing in Binary Cache
> 
> Hi Steven,
> 
> The problem isn't that the library dependency is missing. We are missing
> library artifacts and therefore cannot build the library. This can be fixed 
> with
> a snippet of your next patch that adds the libraries artifacts, but without 
> the
> extra tracking information.
> 
> Thanks,
> Christian
> 
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Steven Shi
> >Sent: Tuesday, May 28, 2019 1:14 AM
> >To: devel@edk2.groups.io
> >Cc: Gao, Liming ; Feng, Bob C
> >; Rodriguez, Christian
> >
> >Subject: [edk2-devel] [PATCH] BaseTools:Fix the library dependency missing
> >in Binary Cache
> >
> >BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1788
> >
> >The library dependency of a module is wrongly filtered out by binary cache
> >implementation which cause all dependent libraries will not been built prior
> to
> >the module in the build scheduler and the module build fails if cache miss
> >happen.
> >
> >Cc: Liming Gao 
> >Cc: Bob Feng 
> >Cc: Christian Rodriguez 
> >Signed-off-by: Steven Shi 
> >---
> > BaseTools/Source/Python/build/build.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/BaseTools/Source/Python/build/build.py
> >b/BaseTools/Source/Python/build/build.py
> >index 80ceb98310..673a9379ba 100644
> >--- a/BaseTools/Source/Python/build/build.py
> >+++ b/BaseTools/Source/Python/build/build.py
> >@@ -593,7 +593,7 @@ class BuildTask:
> > #
> > def AddDependency(self, Dependency):
> > for Dep in Dependency:
> >-if not Dep.BuildObject.IsBinaryModule and not
> >Dep.BuildObject.CanSkipbyHash():
> >+if not Dep.BuildObject.IsBinaryModule:
> > self.DependencyList.append(BuildTask.New(Dep))# 
> > BuildTask list
> >
> > ## The thread wrapper of LaunchCommand function
> >--
> >2.17.1.windows.2
> >
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41558): https://edk2.groups.io/g/devel/message/41558
Mute This Topic: https://groups.io/mt/31819545/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] BaseTools:Extend the binary cache to support library cache

2019-05-28 Thread Steven Shi
OK, will send the new version patch to simplify it.


Thanks

Steven Shi
Intel\SSG\FID\Firmware Infrastructure


> -Original Message-
> From: Rodriguez, Christian
> Sent: Tuesday, May 28, 2019 11:16 PM
> To: devel@edk2.groups.io; Shi, Steven 
> Cc: Gao, Liming ; Feng, Bob C ;
> Fan, ZhijuX 
> Subject: RE: [edk2-devel] [PATCH] BaseTools:Extend the binary cache to
> support library cache
> 
> Hi Steven,
> 
> After testing the bug reported, it seems that the dependency problem isn't
> the root cause. We don't need to change the way it skips having to rebuild
> libraries. The cache is missing the library build artifacts as you mentioned
> before and this is the root cause of the rebuild failure. This patch should 
> fix
> that, but you can simplify it by not adding a new tracking system and keeping
> the dependency reduction as before. That will save the performance because
> it doesn't have to do extra checking.
> 
> Please see attached patch for minimal change needed.
> 
> Thanks,
> Christian
> 
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Steven Shi
> >Sent: Tuesday, May 28, 2019 1:52 AM
> >To: devel@edk2.groups.io
> >Cc: Gao, Liming ; Feng, Bob C
> >; Rodriguez, Christian
> >; Fan, ZhijuX 
> >Subject: [edk2-devel] [PATCH] BaseTools:Extend the binary cache to support
> >library cache
> >
> >https://bugzilla.tianocore.org/show_bug.cgi?id=1797
> >
> >Current binary cache doesn't support to save and restore
> >the library module. If a driver module cache miss happen,
> >all its dependency library modules need rebuild which
> >is very time-consuming. This patch is to entend the binary
> >cache to support library.
> >
> >Cc: Liming Gao 
> >Cc: Bob Feng 
> >Cc: Christian Rodriguez 
> >Signed-off-by: Steven Shi 
> >---
> > BaseTools/Source/Python/AutoGen/AutoGen.py | 17 ++---
> > BaseTools/Source/Python/build/build.py |  3 ++-
> > 2 files changed, 16 insertions(+), 4 deletions(-)
> >
> >diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> >b/BaseTools/Source/Python/AutoGen/AutoGen.py
> >index a5bef4f7c6..aeb63f52c5 100644
> >--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> >+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> >@@ -2578,7 +2578,7 @@ class ModuleAutoGen(AutoGen):
> > self.AutoGenDepSet = set()
> > self.ReferenceModules = []
> > self.ConstPcd  = {}
> >-
> >+self.CacheRestored = False
> >
> > def __repr__(self):
> > return "%s [%s]" % (self.MetaFile, self.Arch)
> >@@ -3906,6 +3906,12 @@ class ModuleAutoGen(AutoGen):
> > ModuleFile = path.join(self.OutputDir, self.Name + '.inf')
> > if os.path.exists(ModuleFile):
> > shutil.copy2(ModuleFile, FileDir)
> >+else:
> >+OutputDir = self.OutputDir.replace('\\', '/').strip('/')
> >+DebugDir = self.DebugDir.replace('\\', '/').strip('/')
> >+for Item in self.CodaTargetList:
> >+File = Item.Target.Path.replace('\\', 
> >'/').strip('/').replace(DebugDir,
> >'').replace(OutputDir, '').strip('/')
> >+self.OutputFile.add(File)
> > if not self.OutputFile:
> > Ma = self.BuildDatabase[self.MetaFile, self.Arch, 
> > self.BuildTarget,
> >self.ToolChain]
> > self.OutputFile = Ma.Binaries
> >@@ -3949,6 +3955,7 @@ class ModuleAutoGen(AutoGen):
> > destination_dir = 
> > os.path.dirname(destination_file)
> > CreateDirectory(destination_dir)
> > shutil.copy2(File, destination_dir)
> >+self.CacheRestored = True
> > if self.Name == "PcdPeim" or self.Name == "PcdDxe":
> > CreatePcdDatabaseCode(self, TemplateString(),
> >TemplateString())
> > return True
> >@@ -3987,7 +3994,9 @@ class ModuleAutoGen(AutoGen):
> > self.GenFfsList = GenFfsList
> > if not self.IsLibrary and CreateLibraryMakeFile:
> > for LibraryAutoGen in self.LibraryAutoGenList:
> >-LibraryAutoGen.CreateMakeFile()
> >+# Only create makefile for libraries which have not been 
> >restored
> >+if not LibraryAutoGen.CacheRestored:
> >+LibraryAutoGen.CreateMakeFile()
> >
> > if self.CanSkip():
> > return
> >@@ -4030,7 +4039,9 @@ class ModuleAutoGen(AutoGen):
> >
> > if not self.IsLibrary and CreateLibraryCodeFile:
> > for LibraryAutoGen in self.LibraryAutoGenList:
> >-LibraryAutoGen.CreateCodeFile()
> >+# Only create autogen code for libraries which have not been
> >restored
> >+if not LibraryAutoGen.CacheRestored:
> >+LibraryAutoGen.CreateCodeFile()
> >
> > if self.CanSkip():
> > return
> >diff --git a/BaseTools/Source/P

Re: [edk2-devel] [PATCH 2/2] KabylakeOpenBoardPkg: Add FSP Dispatch switch.

2019-05-28 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: Chiu, Chasel 
Sent: Wednesday, May 22, 2019 1:35 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Kubacki, Michael A 

Subject: [PATCH 2/2] KabylakeOpenBoardPkg: Add FSP Dispatch switch.

From: "Chasel, Chiu" 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1832

Basing on PcdFspModeSelection setting either KabylakeFspBinPkg or 
AmberLakeFspBinPkg will be used and temporary memory arrangement will be 
different as AmberLakeFspBinPkg will share the same stack with boot loader. 
Also enlarged FSP-T size to support future larger FSP binary.

Test: Booted Kabylake RVP3 to Windows successfully.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 Platform/Intel/KabylakeOpenBoardPkg/Include/Fdf/FlashMapInclude.fdf  |  8 

 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc| 33 
+
 Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc | 29 
+
 3 files changed, 62 insertions(+), 8 deletions(-)

diff --git 
a/Platform/Intel/KabylakeOpenBoardPkg/Include/Fdf/FlashMapInclude.fdf 
b/Platform/Intel/KabylakeOpenBoardPkg/Include/Fdf/FlashMapInclude.fdf
index 3a28bd4109..6cb49c941c 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Include/Fdf/FlashMapInclude.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Include/Fdf/FlashMapInclude.fd
+++ f
@@ -1,7 +1,7 @@
 ## @file
 #  FDF file of Platform.
 #
-# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2019, Intel Corporation. All rights 
+reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #
@@ -41,6 +41,6 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize  
  = 0x0006
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset  = 
0x0060  # Flash addr (0xFFE0)
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize= 
0x000BC000  #
 SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset  = 
0x006BC000  # Flash addr (0xFFEBC000)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize= 
0x4000  #
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 
0x006C  # Flash addr (0xFFEC)
-SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize   = 
0x0014  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize= 
0x00014000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset = 
0x006D  # Flash addr (0xFFED)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize   = 
0x0013  #
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc 
b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index 7f19ad1eed..1dfe49a7ad 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -15,7 +15,7 @@
   DEFINE  PLATFORM_PACKAGE= MinPlatformPkg
   DEFINE  PLATFORM_SI_PACKAGE = KabylakeSiliconPkg
   DEFINE  PLATFORM_SI_BIN_PACKAGE = KabylakeSiliconBinPkg
-  DEFINE  PLATFORM_FSP_BIN_PACKAGE= KabylakeFspBinPkg
+  DEFINE  PLATFORM_FSP_BIN_PACKAGE= AmberLakeFspBinPkg
   DEFINE  PLATFORM_BOARD_PACKAGE  = KabylakeOpenBoardPkg
   DEFINE  BOARD   = KabylakeRvp3
   DEFINE  PROJECT = 
$(PLATFORM_BOARD_PACKAGE)/$(BOARD)
@@ -24,6 +24,21 @@
   # Platform On/Off features are defined here
   #
   !include OpenBoardPkgConfig.dsc
+  !include OpenBoardPkgPcd.dsc
+
+[Defines]
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  #
+  # For backward compatibility API mode will use KabylakeFspBinPkg.
+  # KabylakeFspBinPkg only supports API mode.
+  #
+  DEFINE  PLATFORM_FSP_BIN_PACKAGE= KabylakeFspBinPkg
+!else
+  #
+  # AmberLakeFspBinPkg supports both API and Dispatch modes
+  #
+  DEFINE  PLATFORM_FSP_BIN_PACKAGE= AmberLakeFspBinPkg
+!endif
 
 

 #
@@ -92,8 +107,20 @@
   
FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
 
   
FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
-  
SiliconPolicyInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf
+
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  #
+  # Below library are used by FSP API mode
+  #
   
SiliconPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
+
+SiliconPolicyInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiSiliconPolicyIni
+tLibFsp/PeiSiliconPolicyInitLibFsp.inf
+!else
+  #
+  # Below library are used by FSP Dispatc

Re: [edk2-devel] [PATCH v2 00/10] Duplicate required CSM components for OVMF

2019-05-28 Thread Wu, Hao A
> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Laszlo Ersek
> Sent: Tuesday, May 28, 2019 7:48 PM
> To: devel@edk2.groups.io; Wu, Hao A
> Cc: David Woodhouse; Ni, Ray; Justen, Jordan L; Ard Biesheuvel
> Subject: Re: [edk2-devel] [PATCH v2 00/10] Duplicate required CSM
> components for OVMF
> 
> On 05/27/19 05:03, Wu, Hao A wrote:
> > '''
> > Please note that this series will be hold until the edk2-stable201905 is
> > created.
> > '''
> >
> > The series is also available at:
> > https://github.com/hwu25/edk2/tree/ovmf_csm_v2
> >
> > V2 changes:
> >
> > Discussion with David Woodhouse for him to take the reviewer role for the
> > duplicated CSM components under OvmfPkg:
> > https://edk2.groups.io/g/devel/topic/31682287#40996
> >
> > The (new) first patch will update the Maintainers.txt to reflect such
> > role.
> 
> As noted earlier, I plan to review this series once David is happy with
> it (in particular, with the first patch).

Sure. I will confirm with David.

Hello David,

Does the patch (1st one of the series), which adds you as the reviewer for
CSM components in OvmfPkg in file Maintainer.txt, seem good to you?

> 
> And, the following patch sets all depend on this one, directly or
> indirectly:
> 
> [edk2-devel] [PATCH v1 0/6] Ovmf: Drop IntelFramework[Module]Pkg
> dependency
> [edk2-devel] [RFC][PATCH v1 0/1] PcAtChipsetPkg: Remove framework
> modules
> [edk2-devel] [RFC][PATCH v1 0/3] Remove IntelFramework[Module]Pkg
> 
> Of those, I plan to review at least the OvmfPkg one, once the
> dependencies are all in place. Please ping me, should I forget.
> 
> (Yesterday I made an effort to set up the inter-BZ deps as well.)

Yes. I noticed that.
Thanks a lot for setting up the dependencies among those BZs.
I will ping you for the OVMF patches once their requirements are met.

Also, do you expect such BZ dependencies setup should be done by the
submitters (if they are aware of such dependencies) when they files a BZ
tracker?

Best Regards,
Hao Wu

> 
> Thanks,
> Laszlo
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41560): https://edk2.groups.io/g/devel/message/41560
Mute This Topic: https://groups.io/mt/31805475/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Add FSP Dispatch switch.

2019-05-28 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chiu, Chasel
Sent: Wednesday, May 22, 2019 1:35 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Kubacki, Michael A 

Subject: [edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Add FSP Dispatch switch.

From: "Chasel, Chiu" 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1832

PcdFspModeSelection is used as switch for boot loader to consume FSP in API 
mode or Dispatch mode. For backward compatibility, if boot loader running in 
FSP API mode the KabylakeFspBinPkg will be used which does not have FSP 2.1 
changes. For FSP Dispatch mode AmberLakeFspBinPkg will be used with FSP 2.1 
support.
One INF was duplicate to include different DEC file in each build type.

Test: Booted Kabylake RVP3 to Windows successfully.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 
Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 | 146 
++
 1 file changed, 146 insertions(+)

diff --git 
a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 
b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
new file mode 100644
index 00..aebd3583bc
--- /dev/null
+++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFs
+++ p/PeiSiliconPolicyInitLibFspAml.inf
@@ -0,0 +1,146 @@
+### @file
+# Library functions for Fsp Policy Initialization Library.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved. # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+###
+#
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+###
+#
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiSiliconPolicyInitLibFspAml
+  FILE_GUID  = 930816C4-D182-4A23-BF21-9AED635AF06C
+  MODULE_TYPE= BASE
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = SiliconPolicyInitLib
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32
+#
+
+###
+#
+#
+# Sources Section - list of files that are required for the build to succeed.
+#
+###
+#
+
+[Sources]
+  PeiFspPolicyInitLib.c
+  PeiFspSiPolicyInitLib.c
+  PeiFspPchPolicyInitLib.c
+  PeiFspCpuPolicyInitLib.c
+  PeiFspMePolicyInitLib.c
+  PeiFspSaPolicyInitLib.c
+  PeiFspMiscUpdInitLib.c
+
+  PeiPolicyInitPreMem.c
+  PeiPolicyInit.c
+  PeiPolicyInit.h
+
+###
+#
+#
+# Package Dependency Section - list of Package files that are required for
+#  this module.
+#
+###
+#
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+  KabylakeSiliconPkg/SiPkg.dec
+  AmberLakeFspBinPkg/AmberLakeFspBinPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IoLib
+  PeiServicesLib
+  PcdLib
+  SmbusLib
+  MmPciLib
+  ConfigBlockLib
+  MemoryAllocationLib
+  DebugPrintErrorLevelLib
+  FspWrapperApiLib
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdTsegSize## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdSmbusBaseAddress## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize   ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress## CONSUMES
+
+[Ppis]
+  gSiPolicyPpiGuid  ## CONSUMES
+  gSiPreMemPolicyPpiGuid## CONSUMES
+
+[Guids]
+  gTraceHubPreMemConfigGuid ## CONSUMES
+  gSmbusPreMemConfigGuid## CONSUMES
+  gDciPreMemConfigGuid  ## CONSUMES
+  gHpetPreMemConfigGuid ## CONSUMES
+  gHsioPciePreMemConfigGuid ## CONSUMES
+  gHsioSataPreMemConfigGuid ## CONSUMES
+  gHsioP

Re: [edk2-devel] Adding HTTP and TLS support to Armada80x0McBin (from the MarvellEmbeddedProcessors edk2-open-platforms repo)

2019-05-28 Thread rebecca
On 2019-05-28 02:39, Leif Lindholm wrote:
>
> This was actually enabled in the upstream edk2-platforms repository as
> part of the "use fragment config files for network config" set:
> 205d5621a35eb6251481526039d24b17374efdf0
>
> Since the PCIe updates just went in, that should now be a valid
> replacement for the MarvellEmbededProcessors repo.
>
> And will let you include HTTP with -D NETWORK_HTTP_BOOT_ENABLE=TRUE.


Thanks. I've also just realized that the devel-OpenPlatformPkg branch
(and probably the others, like devel-MinnowBoardMax-UDK2017) in
edk2-platforms is no longer used. 

Should the Readme.md files be updated to suggest people use master
instead, or perhaps the branches deleted (or closed, if that's something
that can be done in git)? I vaguely remember a discussion here about
switching to using the master branch, but other people coming back to it
might need a bit of a reminder!


-- 
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41563): https://edk2.groups.io/g/devel/message/41563
Mute This Topic: https://groups.io/mt/31815275/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v2] BaseTools:Extend the binary cache to support library cache

2019-05-28 Thread Steven Shi
V2 change:
Simplify the library cache implementation and remove
CacheRestored flag based filter. Use the current
CanSkipbyHash() filter in AddDependency() instead.

V1 change:

https://bugzilla.tianocore.org/show_bug.cgi?id=1797

Current binary cache doesn't support to save and restore
the library module. If a driver module cache miss happen,
all its dependency library modules need rebuild which
is very time-consuming. This patch is to entend the binary
cache to support library.

Cc: Liming Gao 
Cc: Bob Feng 
Cc: Christian Rodriguez 
Signed-off-by: Steven Shi 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index a5bef4f7c6..7b35f837f5 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3906,6 +3906,12 @@ class ModuleAutoGen(AutoGen):
 ModuleFile = path.join(self.OutputDir, self.Name + '.inf')
 if os.path.exists(ModuleFile):
 shutil.copy2(ModuleFile, FileDir)
+else:
+OutputDir = self.OutputDir.replace('\\', '/').strip('/')
+DebugDir = self.DebugDir.replace('\\', '/').strip('/')
+for Item in self.CodaTargetList:
+File = Item.Target.Path.replace('\\', 
'/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')
+self.OutputFile.add(File)
 if not self.OutputFile:
 Ma = self.BuildDatabase[self.MetaFile, self.Arch, 
self.BuildTarget, self.ToolChain]
 self.OutputFile = Ma.Binaries
-- 
2.17.1.windows.2


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41564): https://edk2.groups.io/g/devel/message/41564
Mute This Topic: https://groups.io/mt/31829360/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Adding HTTP and TLS support to Armada80x0McBin (from the MarvellEmbeddedProcessors edk2-open-platforms repo)

2019-05-28 Thread rebecca
On 2019-05-28 03:47, Marcin Wojtas wrote:
> Please use the Tianocore repo only. With the latest changes, there is
> no point to use old MarvellEmbededProcessors branch, I do not maintain
> it. I also plan to update MacchiatoBin wiki with the reference to the
> mainline repositories.


I can configure HTTP boot entries now if I build with
-DNETWORK_HTTP_BOOT_ENABLE=TRUE -DNETWORK_ALLOW_HTTP_CONNECTIONS .

However, I get an error if I try and enable HTTPS by building with
-DNETWORK_TLS_ENABLE :


build.py...
/home/bcran/workspace/edk2-platforms/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc(...):
error 4000: Instance of library class [TlsLib] is not found
    in [/home/bcran/workspace/edk2/NetworkPkg/TlsDxe/TlsDxe.inf]
[AARCH64]
    consumed by module
[/home/bcran/workspace/edk2/NetworkPkg/TlsDxe/TlsDxe.inf]


-- 
Rebecca Cran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41565): https://edk2.groups.io/g/devel/message/41565
Mute This Topic: https://groups.io/mt/31815275/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH] Marvell/Armada80x0McBin: Enable usb keyboard, nvme boot

2019-05-28 Thread Marcin Wojtas
Hi Jeremy,

śr., 29 maj 2019 o 01:43 Jeremy Linton  napisał(a):
>
> Add a USB keyboard flag, which is needed when a graphical console
> is enabled. Also add a nvme boot option for users that choose
> that instead of sata or mmc.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeremy Linton 
> ---
>  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc | 3 +++
>  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf | 2 ++
>  2 files changed, 5 insertions(+)
>
> diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> index 27e52f5af5..89d617fde4 100644
> --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
> @@ -90,6 +90,7 @@
>
> UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
>
> UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
>UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
> +  UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>
>PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
>
> @@ -505,6 +506,7 @@
>MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
>MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
>MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
> +  MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
>
># SD/MMC
>MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf
> @@ -516,6 +518,7 @@
>ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
>MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
>
># Console packages
>MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
> b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> index 47e3bc4f82..f59cc1f263 100644
> --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
> @@ -151,6 +151,7 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
>INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
>INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
>INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
> +  INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
>
># SD/MMC
>INF MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf
> @@ -162,6 +163,7 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
>INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf
>INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
>INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
> +  INF MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
>
># Multiple Console IO support
>INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
> --

Reviewed-by: Marcin Wojtas 

Thanks!
Marcin

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41566): https://edk2.groups.io/g/devel/message/41566
Mute This Topic: https://groups.io/mt/31828270/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Adding HTTP and TLS support to Armada80x0McBin (from the MarvellEmbeddedProcessors edk2-open-platforms repo)

2019-05-28 Thread Liming Gao

TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf is required to be added into 
[LibraryClasses] of edk2-platforms\Silicon\Marvell\Armada7k8k\Armada7k8k.dsc.inc

>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>rebe...@bluestop.org
>Sent: Wednesday, May 29, 2019 10:19 AM
>To: Marcin Wojtas 
>Cc: edk2-devel-groups-io ; Leif Lindholm
>; Ard Biesheuvel ;
>Kinney, Michael D 
>Subject: Re: [edk2-devel] Adding HTTP and TLS support to Armada80x0McBin
>(from the MarvellEmbeddedProcessors edk2-open-platforms repo)
>
>On 2019-05-28 03:47, Marcin Wojtas wrote:
>> Please use the Tianocore repo only. With the latest changes, there is
>> no point to use old MarvellEmbededProcessors branch, I do not maintain
>> it. I also plan to update MacchiatoBin wiki with the reference to the
>> mainline repositories.
>
>
>I can configure HTTP boot entries now if I build with
>-DNETWORK_HTTP_BOOT_ENABLE=TRUE -
>DNETWORK_ALLOW_HTTP_CONNECTIONS .
>
>However, I get an error if I try and enable HTTPS by building with
>-DNETWORK_TLS_ENABLE :
>
>
>build.py...
>/home/bcran/workspace/edk2-
>platforms/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc(...):
>error 4000: Instance of library class [TlsLib] is not found
>    in [/home/bcran/workspace/edk2/NetworkPkg/TlsDxe/TlsDxe.inf]
>[AARCH64]
>    consumed by module
>[/home/bcran/workspace/edk2/NetworkPkg/TlsDxe/TlsDxe.inf]
>
>
>--
>Rebecca Cran
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41567): https://edk2.groups.io/g/devel/message/41567
Mute This Topic: https://groups.io/mt/31815275/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v3 0/3] [edk2-platform] Add modules to BoardModulePkg.

2019-05-28 Thread Liming Gao
Eric:
  1. Don't need to include version change message in the commit message. Change 
version is in cover letter only. 
  2. BoardModulePkg DEC/DSC still describe AdvancedFeaturePkg. Please fix them. 

  With those changes, Reviewed-by: Liming Gao 

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Dong, Eric
>Sent: Tuesday, May 28, 2019 4:12 PM
>To: devel@edk2.groups.io
>Subject: [edk2-devel] [Patch v3 0/3] [edk2-platform] Add modules to
>BoardModulePkg.
>
>V3 change:
>1. Fix file path typo.
>
>V2 change:
>1. Add platform DSC file to enable build for this package.
>2. Add BZ link for the related changes.
>
>V1 change:
>Add new package BoardModulePkg in Platform/Intel folder. This folder
>used to keep the board generic modules, such as Cmos, BiosId.
>
>Add Cmos and BiosId related modules to BoardModulePkg.
>
>
>Eric Dong (3):
>  Maintainers.txt: Add BoardModulePkg in Platform/Intel/ folder.
>  Platform/Intel: Add Cmos related modules to BoardModulePkg
>  Platform/Intel/BoardModulePkg: Add BiosId Module.
>
> Maintainers.txt   |   4 +
> .../Intel/BoardModulePkg/BoardModulePkg.dec   |  38 ++
> .../BoardModulePkg/Include/Guid/BiosId.h  |  59 +++
> .../Include/Library/BiosIdLib.h   |  57 ++
> .../Include/Library/CmosAccessLib.h   | 106 
> .../Include/Library/PlatformCmosAccessLib.h   |  68 +++
> .../Library/BiosIdLib/DxeBiosIdLib.c  | 175 +++
> .../Library/BiosIdLib/DxeBiosIdLib.inf|  42 ++
> .../Library/BiosIdLib/PeiBiosIdLib.c  | 191 +++
> .../Library/BiosIdLib/PeiBiosIdLib.inf|  42 ++
> .../Library/CmosAccessLib/CmosAccessLib.c | 486 ++
> .../Library/CmosAccessLib/CmosAccessLib.inf   |  28 +
> .../CmosAccessLib/CmosAccessLibInternal.h |  35 ++
> .../PlatformCmosAccessLibNull.c   |  39 ++
> .../PlatformCmosAccessLibNull.inf |  23 +
> 15 files changed, 1393 insertions(+)
> create mode 100644 Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> 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/Include/Library/CmosAccessLib.h
> create mode 100644
>Platform/Intel/BoardModulePkg/Include/Library/PlatformCmosAccessLib.h
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.c
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLibInter
>nal.h
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platfor
>mCmosAccessLibNull.c
> create mode 100644
>Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platfor
>mCmosAccessLibNull.inf
>
>--
>2.21.0.windows.1
>
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41568): https://edk2.groups.io/g/devel/message/41568
Mute This Topic: https://groups.io/mt/31819524/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch v3 0/3] [edk2-platform] Add modules to BoardModulePkg.

2019-05-28 Thread Dong, Eric
Liming,

Thanks for your comments.  Will update them when I push the changes.

Thanks,
Eric

> -Original Message-
> From: Gao, Liming
> Sent: Wednesday, May 29, 2019 1:23 PM
> To: devel@edk2.groups.io; Dong, Eric 
> Subject: RE: [edk2-devel] [Patch v3 0/3] [edk2-platform] Add modules to
> BoardModulePkg.
> 
> Eric:
>   1. Don't need to include version change message in the commit message.
> Change version is in cover letter only.
>   2. BoardModulePkg DEC/DSC still describe AdvancedFeaturePkg. Please fix
> them.
> 
>   With those changes, Reviewed-by: Liming Gao 
> 
> Thanks
> Liming
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Dong, Eric
> >Sent: Tuesday, May 28, 2019 4:12 PM
> >To: devel@edk2.groups.io
> >Subject: [edk2-devel] [Patch v3 0/3] [edk2-platform] Add modules to
> >BoardModulePkg.
> >
> >V3 change:
> >1. Fix file path typo.
> >
> >V2 change:
> >1. Add platform DSC file to enable build for this package.
> >2. Add BZ link for the related changes.
> >
> >V1 change:
> >Add new package BoardModulePkg in Platform/Intel folder. This folder
> >used to keep the board generic modules, such as Cmos, BiosId.
> >
> >Add Cmos and BiosId related modules to BoardModulePkg.
> >
> >
> >Eric Dong (3):
> >  Maintainers.txt: Add BoardModulePkg in Platform/Intel/ folder.
> >  Platform/Intel: Add Cmos related modules to BoardModulePkg
> >  Platform/Intel/BoardModulePkg: Add BiosId Module.
> >
> > Maintainers.txt   |   4 +
> > .../Intel/BoardModulePkg/BoardModulePkg.dec   |  38 ++
> > .../BoardModulePkg/Include/Guid/BiosId.h  |  59 +++
> > .../Include/Library/BiosIdLib.h   |  57 ++
> > .../Include/Library/CmosAccessLib.h   | 106 
> > .../Include/Library/PlatformCmosAccessLib.h   |  68 +++
> > .../Library/BiosIdLib/DxeBiosIdLib.c  | 175 +++
> > .../Library/BiosIdLib/DxeBiosIdLib.inf|  42 ++
> > .../Library/BiosIdLib/PeiBiosIdLib.c  | 191 +++
> > .../Library/BiosIdLib/PeiBiosIdLib.inf|  42 ++
> > .../Library/CmosAccessLib/CmosAccessLib.c | 486 ++
> > .../Library/CmosAccessLib/CmosAccessLib.inf   |  28 +
> > .../CmosAccessLib/CmosAccessLibInternal.h |  35 ++
> > .../PlatformCmosAccessLibNull.c   |  39 ++
> > .../PlatformCmosAccessLibNull.inf |  23 +
> > 15 files changed, 1393 insertions(+)
> > create mode 100644
> Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> > 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/Include/Library/CmosAccessLib.h
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Include/Library/PlatformCmosAccessLib.h
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.c
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.c
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.c
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLibInt
> er
> >nal.h
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platf
> or
> >mCmosAccessLibNull.c
> > create mode 100644
> >Platform/Intel/BoardModulePkg/Library/PlatformCmosAccessLibNull/Platf
> or
> >mCmosAccessLibNull.inf
> >
> >--
> >2.21.0.windows.1
> >
> >
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41569): https://edk2.groups.io/g/devel/message/41569
Mute This Topic: https://groups.io/mt/31819524/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH] MdeModulePkg: Clarify the lib supported ARCH

2019-05-28 Thread Gao, Zhichao
From: Bret Barkelew 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1856

SmmLockBoxPeiLib only support IA32 and X64 ARCH. So put
this lib to a specific
[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM] section.

Cc: Jian J Wang 
Cc: Hao Wu 
Cc: Ray Ni 
Cc: Star Zeng 
Cc: Liming Gao 
Cc: Sean Brogan 
Cc: Michael Turner 
Cc: Bret Barkelew 
Signed-off-by: Zhichao Gao 
---
 MdeModulePkg/MdeModulePkg.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index ac7111dea1..d2e88d6b65 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -114,6 +114,8 @@
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
   
ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
+
+[LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM]
   LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf
 
 [LibraryClasses.common.DXE_CORE]
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#41570): https://edk2.groups.io/g/devel/message/41570
Mute This Topic: https://groups.io/mt/31830802/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH V5] BaseTools:Make BaseTools support new rules to generate RAW FFS FILE

2019-05-28 Thread Fan, ZhijuX
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1765

If RAW FFS File Rule has no section for its data.For RAW FFS File,
directly call GenFfs tool to generate FFS file.

Ffs Rule:
[Rule.Common.USER_DEFINED.MicroCode]
  FILE RAW = $(NAMED_GUID) {
$(INF_OUTPUT)/$(MODULE_NAME).bin
  }
[Rule.Common.USER_DEFINED.LOGO]
  FILE RAW = $(NAMED_GUID) {
   |.bmp
  }

As shown in the rule above,if SectionType and FileType not defined,
FFS files are generated directly, and no other type of file is
generated.

The patch is to make the BaseTools support these two rules

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Source/Python/Common/DataType.py|  1 +
 BaseTools/Source/Python/GenFds/EfiSection.py  | 22 +-
 BaseTools/Source/Python/GenFds/FdfParser.py   | 14 --
 BaseTools/Source/Python/GenFds/FfsInfStatement.py |  9 ++---
 BaseTools/Source/Python/GenFds/Section.py |  7 ++-
 5 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/BaseTools/Source/Python/Common/DataType.py 
b/BaseTools/Source/Python/Common/DataType.py
index 7cd67bc01a..83ec36c235 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -122,6 +122,7 @@ BINARY_FILE_TYPE_VER = 'VER'
 BINARY_FILE_TYPE_UI = 'UI'
 BINARY_FILE_TYPE_BIN = 'BIN'
 BINARY_FILE_TYPE_FV = 'FV'
+BINARY_FILE_TYPE_RAW = 'RAW_BINARY'
 
 PLATFORM_COMPONENT_TYPE_LIBRARY_CLASS = 'LIBRARY_CLASS'
 PLATFORM_COMPONENT_TYPE_MODULE = 'MODULE'
diff --git a/BaseTools/Source/Python/GenFds/EfiSection.py 
b/BaseTools/Source/Python/GenFds/EfiSection.py
index 302f244faf..74f176cfef 100644
--- a/BaseTools/Source/Python/GenFds/EfiSection.py
+++ b/BaseTools/Source/Python/GenFds/EfiSection.py
@@ -93,7 +93,7 @@ class EfiSection (EfiSectionClassObject):
 if '.depex' in SuffixMap:
 FileList.append(Filename)
 else:
-FileList, IsSect = Section.Section.GetFileList(FfsInf, 
self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile)
+FileList, IsSect = Section.Section.GetFileList(FfsInf, 
self.FileType, self.FileExtension, Dict, IsMakefile=IsMakefile, 
SectionType=SectionType)
 if IsSect :
 return FileList, self.Alignment
 
@@ -217,6 +217,26 @@ class EfiSection (EfiSectionClassObject):
  Ui=StringData, 
IsMakefile=IsMakefile)
 OutputFileList.append(OutputFile)
 
+#
+# If Section Type is BINARY_FILE_TYPE_RAW
+#
+elif SectionType == BINARY_FILE_TYPE_RAW:
+"""If File List is empty"""
+if FileList == []:
+if self.Optional == True:
+GenFdsGlobalVariable.VerboseLogger("Optional Section don't 
exist!")
+return [], None
+else:
+EdkLogger.error("GenFds", GENFDS_ERROR, "Output file for 
%s section could not be found for %s" % (SectionType, InfFileName))
+
+elif len(FileList) > 1:
+EdkLogger.error("GenFds", GENFDS_ERROR,
+"Files suffixed with %s are not allowed to 
have more than one file in %s[Binaries] section" % (
+self.FileExtension, InfFileName))
+else:
+for File in FileList:
+File = GenFdsGlobalVariable.MacroExtend(File, Dict)
+OutputFileList.append(File)
 
 else:
 """If File List is empty"""
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py 
b/BaseTools/Source/Python/GenFds/FdfParser.py
index ea1c3eeb30..fb5fd85e0a 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -3749,8 +3749,19 @@ class FdfParser:
 #
 def _GetEfiSection(self, Obj):
 OldPos = self.GetFileBufferPos()
+EfiSectionObj = EfiSection()
 if not self._GetNextWord():
-return False
+CurrentLine = 
self._CurrentLine()[self.CurrentOffsetWithinLine:].split()[0].strip()
+if self._Token == '{' and Obj.FvFileType == "RAW" and TAB_SPLIT in 
CurrentLine:
+if self._IsToken(TAB_VALUE_SPLIT):
+EfiSectionObj.FileExtension = self._GetFileExtension()
+elif self._GetNextToken():
+EfiSectionObj.FileName = self._Token
+EfiSectionObj.SectionType = BINARY_FILE_TYPE_RAW
+Obj.SectionList.append(EfiSectionObj)
+return True
+else:
+return False
 SectionName = self._Token
 
 if SectionName not in {
@@ -3816,7 +3827,6 @@ class FdfParser:
 Obj.SectionList.append(FvImageSectionObj)
 return True
 
-EfiSectionObj = EfiSection()
 EfiSectionObj.SectionType = SectionName
 
 if not self._GetNe

[edk2-devel] [PATCH] BaseTools:add UniTool.py to Edk2\BaseTools\Scripts

2019-05-28 Thread Fan, ZhijuX
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1855

UniTool is one python script to generate UQI (Universal Question Identifier)
unicode string for HII question PROMPT string. UQI string can be used to
identify each HII question.

This script can be run in both Py2 and Py3.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Scripts/UniTool.py | 490 +++
 1 file changed, 490 insertions(+)
 create mode 100644 BaseTools/Scripts/UniTool.py

diff --git a/BaseTools/Scripts/UniTool.py b/BaseTools/Scripts/UniTool.py
new file mode 100644
index 00..6faecb9e7e
--- /dev/null
+++ b/BaseTools/Scripts/UniTool.py
@@ -0,0 +1,490 @@
+## @file
+#
+# Function will sync up UQI definitions with uni files based on 
vfi/vfr/hfr/sd/sdi in the tree.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+import re, sys, os, getopt, codecs, fnmatch
+
+# global variable declarations
+questionError = False
+uqiList = re.compile('^#string[ \t]+([A-Z_0-9]+)[ \t]+#language[ \t]+uqi[ 
\t\r\n]+"(?:[x\S]{1,2})([0-9a-fA-F]{4,5})"',re.M).findall
+allUqis = {}
+stringDict = {}
+GlobalVarId = {}
+options = {}
+
+#**
+# description: Prints help information
+#
+# arguments:   none
+#
+# returns: none
+#
+
+def usage () :
+  sys.exit("Syntax:  %s [-b] [-u] [-l] [-x] [-h] [-d 'rootDirectory1'] [-d 
'rootDirectory2'] [-d 'rootDirectory3']... [-q e|w] \
+'rootDirectory0' 'uqiFile'|'uqiFileDirectory' ['excludedDirectory1'] 
['excludedDirectory2'] ['excludedDirectory3']...\n%s" %
+(os.path.basename(sys.argv[0]),
+  """\nFunction will sync up UQI definitions with uni files based on 
vfi/vfr/hfr/sd/sdi in the tree.\n
+Required Arguments:
+  'rootdirectory0'   path to root directory
+  'uqiFileDirectory' path to UQI file(UqiList.uni)
+  'uqiFile'  UQI file
+
+Options:
+  -hShow this help
+  -bBuild option returns error if any new UQI needs 
assigning
+based on vfi/vfr/hfr/sd/sdi when no -u option is 
specified
+  -uCreate new UQIs that does not already exist in uqiFile 
for
+any string requiring a UQI based on vfi/vfr/hfr/sd/sdi
+NOTE: 'uqiFile' cannot be readonly!
+  -lLanguage deletion option (keeps only English and uqi)
+moves all UQIs to 'uqiFile'
+NOTE: Uni files cannot be readonly!
+  -xExclude 'rootDirectory'/'excludedDirectory1' &
+'rootDirectory'/'excludedDirectory2'... from UQI list 
build
+NOTE: Cannot be the same as rootDirectory
+  -dAdd multiple root directories to process
+  -qPrint warning(w) or return error(e) if different HII 
questions
+are referring same string token
+
+Return error if any duplicated UQI string or value in UQI list or if no 
definition
+for any string referred by HII question when -b or -u is specified
+
+NOTE: Options must be specified before parameters
+"""))
+
+#**
+# description: Get uni file encoding
+#
+# arguments:   filename - name of uni file
+#
+# returns: utf-8 or utf-16
+#
+def GetUniFileEncoding(filename):
+  #
+  # Detect Byte Order Mark at beginning of file.  Default to UTF-8
+  #
+  Encoding = 'utf-8'
+
+  #
+  # Read file
+  #
+  try:
+UniFile = open(filename, mode='rb')
+FileIn = UniFile.read()
+UniFile.close()
+  except:
+return Encoding
+
+  if (FileIn.startswith(codecs.BOM_UTF16_BE) or 
FileIn.startswith(codecs.BOM_UTF16_LE)):
+Encoding = 'utf-16'
+
+  return Encoding
+
+# rewrite function os.path.walk
+def Walk(top, func, arg):
+  try:
+names = os.listdir(top)
+  except os.error:
+return
+  func(arg, top, names)
+  for name in names:
+name = os.path.join(top, name)
+if os.path.isdir(name):
+  Walk(name, func, arg)
+
+#**
+# description: Parses commandline arguments and options
+#  Calls function processUni to build dictionary of strings
+#  Calls other functions according to user specified options
+#
+# arguments:   argv - contains all input from command line
+#   - must contain path to root directory
+#   - may contain options -h, -u, -l, -b or -x before path
+#
+# returns: none
+#
+def main(argv) :
+# Read input arguments and options
+  global allUqis, uqiList, questionError
+  try:
+opts, args = getopt.getopt(argv[1:], "hulbxd:q:") # each letter is an 
optional argument
+  except getopt.GetoptError:
+usage()
+  try:
+dirNameList = [args[0]]
+QuestionOption = None
+for eachOpt

Re: [edk2-devel] [PATCH] BaseTools:add UniTool.py to Edk2\BaseTools\Scripts

2019-05-28 Thread Bob Feng
Zhiju,

Please use with statement for the open() calling.

Thanks,
Bob

-Original Message-
From: Fan, ZhijuX 
Sent: Wednesday, May 29, 2019 2:09 PM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Feng, Bob C 
Subject: [PATCH] BaseTools:add UniTool.py to Edk2\BaseTools\Scripts

BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1855

UniTool is one python script to generate UQI (Universal Question Identifier) 
unicode string for HII question PROMPT string. UQI string can be used to 
identify each HII question.

This script can be run in both Py2 and Py3.

Cc: Bob Feng 
Cc: Liming Gao 
Signed-off-by: Zhiju.Fan 
---
 BaseTools/Scripts/UniTool.py | 490 +++
 1 file changed, 490 insertions(+)
 create mode 100644 BaseTools/Scripts/UniTool.py

diff --git a/BaseTools/Scripts/UniTool.py b/BaseTools/Scripts/UniTool.py new 
file mode 100644 index 00..6faecb9e7e
--- /dev/null
+++ b/BaseTools/Scripts/UniTool.py
@@ -0,0 +1,490 @@
+## @file
+#
+# Function will sync up UQI definitions with uni files based on 
vfi/vfr/hfr/sd/sdi in the tree.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent #
+
+import re, sys, os, getopt, codecs, fnmatch
+
+# global variable declarations
+questionError = False
+uqiList = re.compile('^#string[ \t]+([A-Z_0-9]+)[ \t]+#language[ 
+\t]+uqi[ \t\r\n]+"(?:[x\S]{1,2})([0-9a-fA-F]{4,5})"',re.M).findall
+allUqis = {}
+stringDict = {}
+GlobalVarId = {}
+options = {}
+
+#**
+# description: Prints help information
+#
+# arguments:   none
+#
+# returns: none
+#
+
+def usage () :
+  sys.exit("Syntax:  %s [-b] [-u] [-l] [-x] [-h] [-d 'rootDirectory1'] 
+[-d 'rootDirectory2'] [-d 'rootDirectory3']... [-q e|w] \ 'rootDirectory0' 
'uqiFile'|'uqiFileDirectory' ['excludedDirectory1'] ['excludedDirectory2'] 
['excludedDirectory3']...\n%s" %
+(os.path.basename(sys.argv[0]),
+  """\nFunction will sync up UQI definitions with uni files based 
+on vfi/vfr/hfr/sd/sdi in the tree.\n Required Arguments:
+  'rootdirectory0'   path to root directory
+  'uqiFileDirectory' path to UQI file(UqiList.uni)
+  'uqiFile'  UQI file
+
+Options:
+  -hShow this help
+  -bBuild option returns error if any new UQI needs 
assigning
+based on vfi/vfr/hfr/sd/sdi when no -u option is 
specified
+  -uCreate new UQIs that does not already exist in uqiFile 
for
+any string requiring a UQI based on vfi/vfr/hfr/sd/sdi
+NOTE: 'uqiFile' cannot be readonly!
+  -lLanguage deletion option (keeps only English and uqi)
+moves all UQIs to 'uqiFile'
+NOTE: Uni files cannot be readonly!
+  -xExclude 'rootDirectory'/'excludedDirectory1' &
+'rootDirectory'/'excludedDirectory2'... from UQI list 
build
+NOTE: Cannot be the same as rootDirectory
+  -dAdd multiple root directories to process
+  -qPrint warning(w) or return error(e) if different HII 
questions
+are referring same string token
+
+Return error if any duplicated UQI string or value in UQI list or if no 
+definition for any string referred by HII question when -b or -u is 
+specified
+
+NOTE: Options must be specified before parameters
+"""))
+
+#**
+# description: Get uni file encoding
+#
+# arguments:   filename - name of uni file
+#
+# returns: utf-8 or utf-16
+#
+def GetUniFileEncoding(filename):
+  #
+  # Detect Byte Order Mark at beginning of file.  Default to UTF-8
+  #
+  Encoding = 'utf-8'
+
+  #
+  # Read file
+  #
+  try:
+UniFile = open(filename, mode='rb')
+FileIn = UniFile.read()
+UniFile.close()
+  except:
+return Encoding
+
+  if (FileIn.startswith(codecs.BOM_UTF16_BE) or 
FileIn.startswith(codecs.BOM_UTF16_LE)):
+Encoding = 'utf-16'
+
+  return Encoding
+
+# rewrite function os.path.walk
+def Walk(top, func, arg):
+  try:
+names = os.listdir(top)
+  except os.error:
+return
+  func(arg, top, names)
+  for name in names:
+name = os.path.join(top, name)
+if os.path.isdir(name):
+  Walk(name, func, arg)
+
+#**
+# description: Parses commandline arguments and options
+#  Calls function processUni to build dictionary of strings
+#  Calls other functions according to user specified options
+#
+# arguments:   argv - contains all input from command line
+#   - must contain path to root directory
+#   - may contain options -h, -u, -l, -b or -x before path
+#
+# returns: none
+#
+def main(argv) :
+# Read input ar

Re: [edk2-devel] [PATCH] BaseTools/Capsule: Tool to Generate Windows Firmware Update Driver

2019-05-28 Thread Bob Feng
Hi Eric,

Please use "with" statement for the open() calls.

For example,

Replace:
Fd = open("file","w")
Do something
Fd.close

To:
With open("file","w") as fd:
 Do something

Thanks,
Bob

-Original Message-
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Eric Jin
Sent: Tuesday, May 28, 2019 3:11 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Gao, Liming ; 
Kinney, Michael D 
Subject: [edk2-devel] [PATCH] BaseTools/Capsule: Tool to Generate Windows 
Firmware Update Driver

https://bugzilla.tianocore.org/show_bug.cgi?id=1837

The tool is designed to generate Windows Firmware Update Drivers, the input is 
one drivername.cap with related parameters, the output Windows Driver package 
are composed by drivername.cap, drivername.inf and drivername.cat to update the 
single payload in device.

usage: GenerateWindowsDriver [-h] [--output-folder OUTPUTFOLDER]
 [--product-fmp-guid PRODUCTFMPGUID]
 [--capsuleversion-dotstring 
CAPSULEVERSION_DOTSTRING]
 [--capsuleversion-hexstring 
CAPSULEVERSION_HEXSTRING]
 [--product-fw-provider PRODUCTFWPROVIDER]
 [--product-fw-mfg-name PRODUCTFWMFGNAME]
 [--product-fw-desc PRODUCTFWDESC]
 [--capsule-file-name CAPSULEFILENAME]
 [--pfx-file PFXFILE] [--arch ARCH]
 [--operating-system-string OPERATINGSYSTEMSTRING]

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Kinney Michael D 
Signed-off-by: Eric Jin 
---
 BaseTools/Source/Python/Capsule/CatGenerator.py| 155 
+++
 BaseTools/Source/Python/Capsule/GenerateWindowsDriver.py   | 115 
+++
 BaseTools/Source/Python/Capsule/InfGenerator.py| 210 
++
 BaseTools/Source/Python/Capsule/WindowsCapsuleSupportHelper.py | 102 
++
 4 files changed, 582 insertions(+)

diff --git a/BaseTools/Source/Python/Capsule/CatGenerator.py 
b/BaseTools/Source/Python/Capsule/CatGenerator.py
new file mode 100644
index 00..737387c296
--- /dev/null
+++ b/BaseTools/Source/Python/Capsule/CatGenerator.py
@@ -0,0 +1,155 @@
+## @file
+ # Script to generate Cat files for capsule update based on supplied 
+inf file  #  # Copyright (c) 2019, Microsoft Corporation  # Copyright 
+(c) 2019, Intel Corporation. All rights reserved.  # 
+SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
+
+import os
+import logging
+import datetime
+import subprocess
+import threading
+
+class PropagatingThread(threading.Thread):
+def run(self):
+self.exc = None
+try:
+if hasattr(self, '_Thread__target'):
+# Thread uses name mangling prior to Python 3.
+self.ret = self._Thread__target(*self._Thread__args, 
**self._Thread__kwargs)
+else:
+self.ret = self._target(*self._args, **self._kwargs)
+except BaseException as e:
+self.exc = e
+def join(self, timeout=None):
+super(PropagatingThread, self).join()
+if self.exc:
+ raise self.exc
+return self.ret
+def reader(filepath, outstream, stream):
+f = None
+# open file if caller provided path
+if(filepath):
+f = open(filepath, "w")
+while True:
+s = stream.readline().decode()
+if not s:
+stream.close()
+break
+if(f is not None):
+# write to file if caller provided file
+f.write(s)
+if(outstream is not None):
+# write to stream object if caller provided object
+outstream.write(s)
+logging.info(s.rstrip())
+if(f is not None):
+f.close()
+def RunCmd(cmd, parameters, capture=True, workingdir=None, outfile=None, 
outstream=None, environ=None):
+cmd = cmd.strip('"\'')
+if " " in cmd:
+cmd = '"' + cmd + '"'
+if parameters is not None:
+parameters = parameters.strip()
+cmd += " " + parameters
+starttime = datetime.datetime.now()
+logging.info("Cmd to run is: " + cmd) 
+logging.info("")
+logging.info("--Cmd Output Starting---")
+logging.info("")
+c = subprocess.Popen(cmd, stdout=subprocess.PIPE, 
std

Re: [edk2-devel] [Patch 0/3] [edk2-platforms] Add DebugFeaturePkg to keep debug related modules.

2019-05-28 Thread Liming Gao
Eric:
  I have some comments. 
1. DebugFeaturePkg DEC/DSC header description should be DebugFeaturePkg instead 
of DebugAdvancedFeaturePkg
2. DebugFeaturePkg can have one gDebugFeaturePkgTokenSpaceGuid for all PCDs . 
You don't need to add another gEfiUsb3DebugPortTokenSpaceGuid. 
3. Please make PCD TokenNumber are continuous. 

Thanks
Liming
>-Original Message-
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Dong, Eric
>Sent: Wednesday, May 29, 2019 8:48 AM
>To: devel@edk2.groups.io
>Subject: [edk2-devel] [Patch 0/3] [edk2-platforms] Add DebugFeaturePkg to
>keep debug related modules.
>
>Add new package in Platform/Intel/ folder to keep debug related
>modules.
>
>Eric Dong (3):
>  Platform/Intel/DebugFeaturePkg: Add DebugFeaturePkg
>  Platform/Intel/DebugFeaturePkg: Add USB3DebugPort related modules.
>  Platform/Intel/DebugFeaturePkg/AcpiDebug: Change AcpiDebug module
>location.
>
> Maintainers.txt   |   4 +
> .../AdvancedFeaturePkg/AdvancedFeaturePkg.dec |   6 -
> .../AdvancedFeaturePkg/AdvancedFeaturePkg.dsc |   3 -
> .../AcpiDebug/AcpiDebug.asl   |   0
> .../AcpiDebug/AcpiDebug.c |   0
> .../AcpiDebug/AcpiDebugDxe.inf|   8 +-
> .../AcpiDebug/AcpiDebugSmm.inf|   8 +-
> .../AcpiDebug/Readme.txt  |   0
> .../Intel/DebugFeaturePkg/DebugFeaturePkg.dec |  64 ++
> .../Intel/DebugFeaturePkg/DebugFeaturePkg.dsc |  98 ++
> .../Include/Library/Usb3DebugPortLib.h|  76 ++
> .../Library/Usb3DebugPortParameterLib.h   |  56 ++
> .../Library/Usb3DebugPortLib/MiscServices.c   | 385 
> .../Usb3DebugPortDataTransfer.c   | 892 ++
> .../Usb3DebugPortInitialize.c | 726 ++
> .../Usb3DebugPortLib/Usb3DebugPortLibDxe.c| 454 +
> .../Usb3DebugPortLib/Usb3DebugPortLibDxe.inf  |  55 ++
> .../Usb3DebugPortLibDxeIoMmu.c| 828 
> .../Usb3DebugPortLibDxeIoMmu.inf  |  63 ++
> .../Usb3DebugPortLibInternal.h| 887 +
> .../Usb3DebugPortLib/Usb3DebugPortLibNull.c   | 103 ++
> .../Usb3DebugPortLib/Usb3DebugPortLibNull.inf |  28 +
> .../Usb3DebugPortLib/Usb3DebugPortLibPei.c| 236 +
> .../Usb3DebugPortLib/Usb3DebugPortLibPei.inf  |  48 +
> .../Usb3DebugPortLibPeiIoMmu.c| 440 +
> .../Usb3DebugPortLibPeiIoMmu.inf  |  51 +
> .../Usb3DebugPortParameterLibPcd.c|  58 ++
> .../Usb3DebugPortParameterLibPcd.inf  |  31 +
> 28 files changed, 5591 insertions(+), 17 deletions(-)
> rename Platform/Intel/{AdvancedFeaturePkg =>
>DebugFeaturePkg}/AcpiDebug/AcpiDebug.asl (100%)
> rename Platform/Intel/{AdvancedFeaturePkg =>
>DebugFeaturePkg}/AcpiDebug/AcpiDebug.c (100%)
> rename Platform/Intel/{AdvancedFeaturePkg =>
>DebugFeaturePkg}/AcpiDebug/AcpiDebugDxe.inf (79%)
> rename Platform/Intel/{AdvancedFeaturePkg =>
>DebugFeaturePkg}/AcpiDebug/AcpiDebugSmm.inf (80%)
> rename Platform/Intel/{AdvancedFeaturePkg =>
>DebugFeaturePkg}/AcpiDebug/Readme.txt (100%)
> create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dec
> create mode 100644 Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortLib.h
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Include/Library/Usb3DebugPortParameterL
>ib.h
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/MiscServices.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>DataTransfer.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>Initialize.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibDxe.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibDxe.inf
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibDxeIoMmu.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibDxeIoMmu.inf
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibInternal.h
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibNull.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibNull.inf
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibPei.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibPei.inf
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibPeiIoMmu.c
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortLib/Usb3DebugPort
>LibPeiIoMmu.inf
> create mode 100644
>Platform/Intel/DebugFeaturePkg/Library/Usb3DebugPortPa

Re: [edk2-devel] [PATCH] MdeModulePkg/CapsulePei: Optimize the CapsulePei

2019-05-28 Thread Wu, Hao A
> -Original Message-
> From: Gao, Zhichao
> Sent: Wednesday, May 29, 2019 8:46 AM
> To: devel@edk2.groups.io
> Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Liming;
> Sean Brogan; Michael Turner; Gao, Zhichao
> Subject: [PATCH] MdeModulePkg/CapsulePei: Optimize the CapsulePei
> 
> From: Bret Barkelew 
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1853
> 
> Sperate the capsule check function from GetCapsuleDescriptors

Sperate -> Separate

> and name it to AreCapsulesStaged.
> Rename GetCapsuleDescriptors to GetScatterGatherHeadEntries.
> And optimize its to remove the duplicated code.
> 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Star Zeng 
> Cc: Liming Gao 
> Cc: Sean Brogan 
> Cc: Michael Turner 
> Cc: Bret Barkelew 
> Signed-off-by: Zhichao gao 
> ---
>  MdeModulePkg/Universal/CapsulePei/Capsule.h   |   3 +-
>  .../Universal/CapsulePei/CapsulePei.inf   |   3 +-
>  .../Universal/CapsulePei/UefiCapsule.c| 357 ++
>  3 files changed, 194 insertions(+), 169 deletions(-)

I am a bit confused for the purpose of this patch.

My understanding is that this patch will refine this driver to remove
duplicated code by abstract common codes into a new function. And there
will be no functional impact.

However, after the change, the line of codes of this driver increased by
20+ lines.

Did I miss something for the purpose of this patch?

Some additional comments below.

> 
> diff --git a/MdeModulePkg/Universal/CapsulePei/Capsule.h
> b/MdeModulePkg/Universal/CapsulePei/Capsule.h
> index baf40423af..fc20dd8b92 100644
> --- a/MdeModulePkg/Universal/CapsulePei/Capsule.h
> +++ b/MdeModulePkg/Universal/CapsulePei/Capsule.h
> @@ -1,6 +1,6 @@
>  /** @file
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -30,6 +30,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "Common/CommonHeader.h"
> 
> diff --git a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> index 5d43df3075..9c88b3986f 100644
> --- a/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> +++ b/MdeModulePkg/Universal/CapsulePei/CapsulePei.inf
> @@ -6,7 +6,7 @@
>  #  This external input must be validated carefully to avoid security issue 
> like
>  #  buffer overflow, integer overflow.
>  #
> -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>  # Copyright (c) 2017, AMD Incorporated. All rights reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -43,6 +43,7 @@
>BaseLib
>HobLib
>BaseMemoryLib
> +  MemoryAllocationLib
>PeiServicesLib
>PeimEntryPoint
>DebugLib
> diff --git a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
> b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
> index e967599e96..2d003369ca 100644
> --- a/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
> +++ b/MdeModulePkg/Universal/CapsulePei/UefiCapsule.c
> @@ -1,7 +1,7 @@
>  /** @file
>Capsule update PEIM for UEFI2.0
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
>  Copyright (c) 2017, AMD Incorporated. All rights reserved.
> 
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #include "Capsule.h"
> 
> +#define DEFAULT_SG_LIST_HEADS   (20)
> +
>  #ifdef MDE_CPU_IA32
>  //
>  // Global Descriptor Table (GDT)
> @@ -791,30 +793,89 @@ BuildMemoryResourceDescriptor (
>  }
> 
>  /**
> -  Checks for the presence of capsule descriptors.
> -  Get capsule descriptors from variable CapsuleUpdateData,
> CapsuleUpdateData1, CapsuleUpdateData2...
> -  and save to DescriptorBuffer.
> +  Check if the capsules are staged.
> 
> -  @param DescriptorBufferPointer to the capsule descriptors
> +  @retval TRUE  The capsules are staged.
> +  @retval FALSE The capsules are not staged.
> +
> +**/
> +BOOLEAN
> +EFIAPI
> +AreCapsulesStaged (

Keyword 'EFIAPI' seems not needed here.
AreCapsulesStaged() is an internal function here.

> +  VOID
> +  )
> +{
> +  EFI_STATUSStatus;
> +  UINTN Size;
> +  EFI_PEI_READ_ONLY_VARIABLE2_PPI   *PPIVariableServices;
> +  EFI_PHYSICAL_ADDRESS  CapsuleDataPtr64;
> +
> +  CapsuleDataPtr64 = 0;
> +
> +  Status = PeiServicesLocatePpi (
> +&gEfiPeiReadOnlyVariable2PpiGuid,
> +0,
> +NULL,
> +(VOID **)&PPIVariableServices
> +);
> +
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "Failed to find ReadOnlyVariable2PPI\n"));
> +return FALSE;
> +  }
> +
> +  //
> +  // Check for Updat

<    1   2