Re: [edk2] [PATCH v2 7/7] ArmPkg: Extra action to update permissions for S-ELO MM Image

2018-08-20 Thread Sughosh Ganu
hi Ard,

On Tue July 23, 2018 at 11:03PM +0530, Supreeth Venkatesh wrote:
> 
> On Sat, 2018-07-21 at 20:06 +0900, Ard Biesheuvel wrote:
> > On 20 July 2018 at 21:38, Sughosh Ganu  wrote:
> > >
> > > From: Achin Gupta 
> > >
> > > The Standalone MM drivers runs in S-EL0 in AArch64 on ARM Standard
> > > Platforms and is deployed during SEC phase. The memory allocated to
> > > the Standalone MM drivers should be marked as RO+X.
> > >
> > > During PE/COFF Image section parsing, this patch implements extra
> > > action "UpdatePeCoffPermissions" to request the privileged firmware
> > > in
> > > EL3 to update the permissions.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Sughosh Ganu 
> > Apologies for bringing this up only now, but I don't think I was ever
> > cc'ed on these patches.
> >
> Apologies if you have missed it. But I am pretty sure it was part of
> earlier large patch-set on which you and leif were copied, as it was
> part of ArmPkg.
> >
> > We are relying on a debug hook in the PE/COFF loader to ensure that
> > we
> > don't end up with memory that is both writable and executable in the
> > secure world. Do we really think that is a good idea?
> >
> > (I know this code was derived from a proof of concept that I did
> > years
> > ago, but that was just a PoC)
> I think we need a little bit more details on what is your suggestion?
> 
> A little bit background here: This code runs in S-EL0 and Request gets
> sent to secure world SPM to ensure that the region permissions are
> updated correctly via the "ArmMmuStandaloneMmCoreLib" SVC -
> ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64.
> 
> DebugPeCoffExtraActionLib is just used to extract image region
> information, but the region permission
> update request is sent to secure world for validation.
> 
> With the above explanation, can you provide an insight into what was
> your thinking?
> Do you want us to create a separate library and call it
> as PeCoffExtraActionLib to avoid the "Debug" word though it is a hook
> to PeCoffExtraActionLib in MdePkg or do we want to create this library
> in a separate package (may be in MdePkg?) or something totally
> different.

Supreeth had replied to your comments on the patch. Can you please
check this. If you feel that this needs to be implemented differently,
can you please suggest it to us. Thanks.

-sughosh

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] MdeModulePkg/PiSmmCore: Check valid memory range.

2018-08-20 Thread Eric Dong
Call BS.AllocatePages in DXE driver and call SMM FreePages with the address of 
the buffer allocated in the DXE driver. SMM FreePages success and add a 
non-SMRAM range into SMM heap list. This is not an expected behavior. SMM 
FreePages should return error for this case and not free the pages.

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

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong 
---
 MdeModulePkg/Core/PiSmmCore/Page.c | 39 ++
 1 file changed, 39 insertions(+)

diff --git a/MdeModulePkg/Core/PiSmmCore/Page.c 
b/MdeModulePkg/Core/PiSmmCore/Page.c
index 3699af7424..630678ccc3 100644
--- a/MdeModulePkg/Core/PiSmmCore/Page.c
+++ b/MdeModulePkg/Core/PiSmmCore/Page.c
@@ -983,6 +983,41 @@ SmmInternalFreePages (
   return SmmInternalFreePagesEx (Memory, NumberOfPages, FALSE);
 }
 
+/**
+  Check whether the input range is in smram.
+
+  @param  Memory Base address of memory being inputed.
+  @param  NumberOfPages  The number of pages.
+
+  @retval TRUE   In the smram.
+  @retval FALSE  Not in the smram.
+
+**/
+BOOLEAN
+InSmmRange (
+  IN EFI_PHYSICAL_ADDRESS  Memory,
+  IN UINTN NumberOfPages
+  )
+{
+  LIST_ENTRY   *Link;
+  MEMORY_MAP   *Entry;
+  EFI_PHYSICAL_ADDRESS Last;
+
+  Last = Memory + EFI_PAGES_TO_SIZE (NumberOfPages);
+
+  Link = gMemoryMap.ForwardLink;
+  while (Link != &gMemoryMap) {
+Entry = CR (Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
+Link  = Link->ForwardLink;
+
+if ((Entry->Start <= Memory) && (Entry->End >= Last)) {
+  return TRUE;
+}
+  }
+
+  return FALSE;
+}
+
 /**
   Frees previous allocated pages.
 
@@ -1004,6 +1039,10 @@ SmmFreePages (
   EFI_STATUS  Status;
   BOOLEAN IsGuarded;
 
+  if (!InSmmRange(Memory, NumberOfPages)) {
+return EFI_NOT_FOUND;
+  }
+
   IsGuarded = IsHeapGuardEnabled () && IsMemoryGuarded (Memory);
   Status = SmmInternalFreePages (Memory, NumberOfPages, IsGuarded);
   if (!EFI_ERROR (Status)) {
-- 
2.15.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V2] BaseTools: Fix regression issue by b23414f6540d

2018-08-20 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Tuesday, August 21, 2018 8:49 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming ; 
Carsey, Jaben 
Subject: [PATCH V2] BaseTools: Fix regression issue by b23414f6540d

V2: Renaming function DepexExpressionTokenList to  DepexExpressionDict instead 
of changing the callers

Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04
AttributeError: 'ModuleAutoGen' object has no attribute 'DepexExpressionDict'

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 3b1ddc74e8..d30a9be6ee 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -2899,11 +2899,11 @@ class ModuleAutoGen(AutoGen):
 ## Merge dependency expression
 #
 #   @retval listThe token list of the dependency expression after 
parsed
 #
 @cached_property
-def DepexExpressionTokenList(self):
+def DepexExpressionDict(self):
 if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in 
self.FileTypes:
 return {}
 
 RetVal = {self.ModuleType:''}
 
--
2.12.2.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 0/4] Support non-stop mode in heap guard and null detection

2018-08-20 Thread Jian J Wang
> v2 changes:
>fix GCC build error

Background:
Heap Guard and NULL Pointer Detection are very useful features to detect
code flaw in EDK II. If an issue is detected, #PF exception will be
triggered and the BIOS will enter into dead loop, which is the default
behavior of exception handling. From QA perspective, this default behavior
will block them to collect all tests result in reasonable time.

Solution:
This patch series update CpuDxe, PiSmmCpuDxeSmm and CpuExceptionHandlerLib
to allow the code to continue execution after #PF. The mechanism behind it
is the same as SMM Profile feature, in which a special #PF handler is
registered to set the page causing #PF to be 'present' and setup single
steop trap, then return the control back to the instruction accessing that
page. Once the instruction is re-executed, a #DB is triggered and a special
handler for it will be called to reset the page back to 'not-present'.

Usage:
The non-stop mode is enabled/disabled by BIT6 of following PCDs

  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask
  gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask

The default setting is 'disable'.

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

OS Boot Validation:
  Platform: OVMF
  OS (x64): Fedora 26, Ubuntu 18.04, Windows 10, Windows 7

Jian J Wang (4):
  MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs
  UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler
  UefiCpuPkg/CpuDxe: implement non-stop mode for uefi
  UefiCpuPkg/PiSmmCpuDxeSmm: implement non-stop mode for SMM

 MdeModulePkg/MdeModulePkg.dec  |   4 +-
 UefiCpuPkg/CpuDxe/CpuDxe.h |  39 +++
 UefiCpuPkg/CpuDxe/CpuDxe.inf   |   3 +
 UefiCpuPkg/CpuDxe/CpuMp.c  |  34 ++-
 UefiCpuPkg/CpuDxe/CpuPageTable.c   | 271 +
 .../Ia32/ExceptionHandlerAsm.nasm  |   7 +
 .../Ia32/ExceptionTssEntryAsm.nasm |   4 +-
 .../X64/ExceptionHandlerAsm.nasm   |   4 +
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c   |  43 ++--
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiException.nasm   |   3 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c |  58 -
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.h |  15 ++
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfileInternal.h |   6 +
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c|  43 ++--
 14 files changed, 493 insertions(+), 41 deletions(-)

-- 
2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 1/4] MdeModulePkg/MdeModulePkg.dec: add new settings for PCDs

2018-08-20 Thread Jian J Wang
> v2 changes:
>n/a

BIT6 of PcdHeapGuardPropertyMask is used to enable/disable non-stop mode
of Heap Guard feature. It applies to both UEFI and SMM heap guard, if
any of them is enabled.

BIT6 of PcdNullPointerDetectionPropertyMask is used to enable/disable
non-stop mode of NULL Pointer Detection feature. It applies to both
UEFI and SMM NULL Pointer Detection, if any of them is enabled.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 MdeModulePkg/MdeModulePkg.dec | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 6a6d9660ed..451115030c 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -932,7 +932,8 @@
   #  If enabled, accessing NULL address in UEFI or SMM code can be 
caught.
   #BIT0- Enable NULL pointer detection for UEFI.
   #BIT1- Enable NULL pointer detection for SMM.
-  #BIT2..6 - Reserved for future uses.
+  #BIT2..5 - Reserved for future uses.
+  #BIT6- Enable non-stop mode.
   #BIT7- Disable NULL pointer detection just after EndOfDxe. 
   #  This is a workaround for those unsolvable NULL access issues 
in
   #  OptionROM, boot loader, etc. It can also help to avoid 
unnecessary
@@ -1014,6 +1015,7 @@
   #   BIT1 - Enable UEFI pool guard.
   #   BIT2 - Enable SMM page guard.
   #   BIT3 - Enable SMM pool guard.
+  #   BIT6 - Enable non-stop mode.
   #   BIT7 - The direction of Guard Page for Pool Guard.
   #  0 - The returned pool is near the tail guard page.
   #  1 - The returned pool is near the head guard page.
-- 
2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 3/4] UefiCpuPkg/CpuDxe: implement non-stop mode for uefi

2018-08-20 Thread Jian J Wang
> v2 changes:
>n/a

Same as SMM profile feature, a special #PF is used to set page attribute
to 'present' and a special #DB handler to reset it back to 'not-present',
right after the instruction causing #PF got executed.

Since the new #PF handler won't enter into dead-loop, the instruction
which caused the #PF will get chance to re-execute with accessible pages.

The exception message will still be printed out on debug console so that
the developer/QA can find that there's potential heap overflow or null
pointer access occurred.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 UefiCpuPkg/CpuDxe/CpuDxe.h   |  39 ++
 UefiCpuPkg/CpuDxe/CpuDxe.inf |   3 +
 UefiCpuPkg/CpuDxe/CpuMp.c|  34 -
 UefiCpuPkg/CpuDxe/CpuPageTable.c | 271 +++
 4 files changed, 341 insertions(+), 6 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.h b/UefiCpuPkg/CpuDxe/CpuDxe.h
index 540f5f2dbf..7d65e39e90 100644
--- a/UefiCpuPkg/CpuDxe/CpuDxe.h
+++ b/UefiCpuPkg/CpuDxe/CpuDxe.h
@@ -57,6 +57,12 @@
EFI_MEMORY_RO\
)
 
+#define HEAP_GUARD_NONSTOP_MODE   \
+((PcdGet8 (PcdHeapGuardPropertyMask) & (BIT6|BIT1|BIT0)) > BIT6)
+
+#define NULL_DETECTION_NONSTOP_MODE   \
+((PcdGet8 (PcdNullPointerDetectionPropertyMask) & (BIT6|BIT0)) > BIT6)
+
 /**
   Flush CPU data cache. If the instruction cache is fully coherent
   with all DMA operations then function can just return EFI_SUCCESS.
@@ -273,7 +279,40 @@ RefreshGcdMemoryAttributesFromPaging (
   VOID
   );
 
+/**
+  Special handler for #DB exception, which will restore the page attributes
+  (not-present). It should work with #PF handler which will set pages to
+  'present'.
+
+  @param ExceptionType  Exception type.
+  @param SystemContext  Pointer to EFI_SYSTEM_CONTEXT.
+
+**/
+VOID
+EFIAPI
+DebugExceptionHandler (
+  IN EFI_EXCEPTION_TYPE   InterruptType,
+  IN EFI_SYSTEM_CONTEXT   SystemContext
+  );
+
+/**
+  Special handler for #PF exception, which will set the pages which caused
+  #PF to be 'present'. The attribute of those pages should be restored in
+  the subsequent #DB handler.
+
+  @param ExceptionType  Exception type.
+  @param SystemContext  Pointer to EFI_SYSTEM_CONTEXT.
+
+**/
+VOID
+EFIAPI
+PageFaultExceptionHandler (
+  IN EFI_EXCEPTION_TYPE   InterruptType,
+  IN EFI_SYSTEM_CONTEXT   SystemContext
+  );
+
 extern BOOLEAN mIsAllocatingPageTable;
+extern UINTN   mNumberOfProcessors;
 
 #endif
 
diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/CpuDxe.inf
index 6a199b72f7..97a381b046 100644
--- a/UefiCpuPkg/CpuDxe/CpuDxe.inf
+++ b/UefiCpuPkg/CpuDxe/CpuDxe.inf
@@ -46,6 +46,7 @@
   ReportStatusCodeLib
   MpInitLib
   TimerLib
+  PeCoffGetEntryPointLib
 
 [Sources]
   CpuDxe.c
@@ -79,6 +80,8 @@
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask## 
CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard   ## 
CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHeapGuardPropertyMask   ## 
CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask## 
CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList  ## 
CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize## 
CONSUMES
 
diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c
index 82145e7624..f8489eb1c3 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -673,10 +673,6 @@ InitializeMpExceptionStackSwitchHandlers (
   UINT8   *GdtBuffer;
   UINT8   *StackTop;
 
-  if (!PcdGetBool (PcdCpuStackGuard)) {
-return;
-  }
-
   ExceptionNumber = FixedPcdGetSize (PcdCpuStackSwitchExceptionList);
   NewStackSize = FixedPcdGet32 (PcdCpuKnownGoodStackSize) * ExceptionNumber;
 
@@ -790,6 +786,32 @@ InitializeMpExceptionStackSwitchHandlers (
   }
 }
 
+/**
+  Initializes MP exceptions handlers for special features, such as Heap Guard
+  and Stack Guard.
+**/
+VOID
+InitializeMpExceptionHandlers (
+  VOID
+  )
+{
+  //
+  // Enable non-stop mode for #PF triggered by Heap Guard or NULL Pointer
+  // Detection.
+  //
+  if (HEAP_GUARD_NONSTOP_MODE || NULL_DETECTION_NONSTOP_MODE) {
+RegisterCpuInterruptHandler(EXCEPT_IA32_DEBUG, DebugExceptionHandler);
+RegisterCpuInterruptHandler(EXCEPT_IA32_PAGE_FAULT, 
PageFaultExceptionHandler);
+  }
+
+  //
+  // Setup stack switch for Stack Guard feature.
+  //
+  if (PcdGetBool (PcdCpuStackGuard)) {
+InitializeMpExceptionStackSwitchHandlers();
+  }
+}
+
 /**
   Initialize Multi-processor support.
 
@@ -814,9 +836,9 @@ InitializeMpSupport (
   DEBUG ((DEBUG_INFO, "Detect CPU count: %d\n", mNumberOfProcessors));
 
   //
-  // Initialize exception stack switch handlers for each logic processor.
+  // Initialize special

[edk2] [PATCH v2 2/4] UefiCpuPkg/CpuExceptionHandlerLib: Setup single step in #PF handler

2018-08-20 Thread Jian J Wang
> v2 changes:
>n/a

Once the #PF handler has set the page to be 'present', there should
be a way to reset it to 'not-present'. 'TF' bit in EFLAGS can be used
for this purpose. 'TF' bit will be set in interrupted function context
so that it can be triggered once the cpu control returns back to the
instruction causing #PF and re-execute it.

This is an necessary step to implement non-stop mode for Heap Guard
and NULL Pointer Detection feature.

Cc: Eric Dong 
Cc: Laszlo Ersek 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 .../Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm   | 7 +++
 .../Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm  | 4 +---
 .../Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm| 4 
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm
index 45d6474091..6fcf5fb23f 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionHandlerAsm.nasm
@@ -383,6 +383,13 @@ ErrorCodeAndVectorOnStack:
 pop dword [ebp - 4]
 mov esp, ebp
 pop ebp
+
+; Enable TF bit after page fault handler runs
+cmp dword [esp], 14   ; #PF?
+jne .5
+bts dword [esp + 16], 8   ; EFLAGS
+
+.5:
 add esp, 8
 cmp dword [esp - 16], 0   ; check 
EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
 jz  DoReturn
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm
index 62bcedea1a..7aac29c7e7 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ExceptionTssEntryAsm.nasm
@@ -355,10 +355,8 @@ o16 mov [ecx + IA32_TSS._SS], ax
 movzx  ebx, word [ecx + IA32_TSS._CS]
 mov[eax - 0x8], ebx  ; create CS in old stack
 movebx, dword [ecx + IA32_TSS.EFLAGS]
-btsebx, 8
+btsebx, 8; Set TF
 mov[eax - 0x4], ebx  ; create eflags in old stack
-movdword [ecx + IA32_TSS.EFLAGS], ebx; update eflags in old TSS
-moveax, dword [ecx + IA32_TSS._ESP]  ; Get old stack pointer
 subeax, 0xc  ; minus 12 byte
 movdword [ecx + IA32_TSS._ESP], eax  ; Set new stack pointer
 
diff --git 
a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm 
b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
index 7b97810d10..f842af2336 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
@@ -336,6 +336,10 @@ HasErrorCode:
 pop r15
 
 mov rsp, rbp
+cmp qword [rbp + 8], 14 ; #PF?
+jne .1
+bts qword [rsp + 40], 8 ; RFLAGS.TF
+.1:
 pop rbp
 add rsp, 16
 cmp qword [rsp - 32], 0  ; check 
EXCEPTION_HANDLER_CONTEXT.OldIdtHandler
-- 
2.16.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 3/7] MdeModulePkg: Remove unused PCDs

2018-08-20 Thread Zeng, Star
Shenglei,

I think "#include " can be removed from DxeCapsuleLib.c as it 
does not touch any PCD.
Please help evaluate it. If it can be removed indeed, then Reviewed-by: Star 
Zeng  with it removed.




Thanks,
Star
-Original Message-
From: Zhang, Shenglei 
Sent: Tuesday, August 21, 2018 9:36 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star ; Dong, Eric ; Laszlo 
Ersek 
Subject: [PATCH v2 3/7] MdeModulePkg: Remove unused PCDs

The PCDs below are unused, so they have been removed from inf.
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem
gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize

Cc: Star Zeng 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf | 11 ---
 .../FirmwarePerformanceDxe.inf|  1 -
 2 files changed, 12 deletions(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
index 342df9e99c..d5e87cb97b 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
@@ -56,17 +56,6 @@
   HobLib
   BmpSupportLib
 
-[Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag  
## CONSUMES
-
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd  
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem 
## CONSUMES
 
 [Protocols]
   gEsrtManagementProtocolGuid   ## CONSUMES
diff --git 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
index 983ce41b48..023ab00c7c 100644
--- 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
+++ 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
@@ -73,7 +73,6 @@
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart   ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId   ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision  ## CONSUMES
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode

2018-08-20 Thread Zeng, Star
Reviewed-by: Star Zeng 

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Chasel, 
Chiu
Sent: Tuesday, August 21, 2018 9:44 AM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen 
Subject: [edk2] [PATCH] IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode

AsmExecute32BitCode is assembly code and needs EFIAPI

Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chasel Chiu 
---
 IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
index 061d381c1b..8f66c72698 100644
--- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
+++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecu
+++ te.c
@@ -3,7 +3,7 @@
   Provide a thunk function to transition from long mode to compatibility mode 
to execute 32-bit code and then transit
   back to long mode.
 
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights 
+ reserved.
   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 @@ -67,6 +67,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR mGdt = 
{
   @return status.
 **/
 UINT32
+EFIAPI
 AsmExecute32BitCode (
   IN UINT64   Function,
   IN UINT64   Param1,
--
2.13.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode

2018-08-20 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com

> -Original Message-
> From: Chiu, Chasel
> Sent: Tuesday, August 21, 2018 9:44 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen ; Chiu, Chasel 
> Subject: [PATCH] IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode
> 
> AsmExecute32BitCode is assembly code and needs EFIAPI
> 
> Cc: Jiewen Yao 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Chasel Chiu 
> ---
>  IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
> | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.
> c
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.
> c
> index 061d381c1b..8f66c72698 100644
> ---
> a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.
> c
> +++
> b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.
> c
> @@ -3,7 +3,7 @@
>Provide a thunk function to transition from long mode to compatibility
> mode to execute 32-bit code and then transit
>back to long mode.
> 
> -  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
>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
> @@ -67,6 +67,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR
> mGdt = {
>@return status.
>  **/
>  UINT32
> +EFIAPI
>  AsmExecute32BitCode (
>IN UINT64   Function,
>IN UINT64   Param1,
> --
> 2.13.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] IntelFsp2WrapperPkg: Add EFIAPI to AsmExecute32BitCode

2018-08-20 Thread Chasel, Chiu
AsmExecute32BitCode is assembly code and needs EFIAPI

Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chasel Chiu 
---
 IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
index 061d381c1b..8f66c72698 100644
--- a/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
+++ b/IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/X64/DispatchExecute.c
@@ -3,7 +3,7 @@
   Provide a thunk function to transition from long mode to compatibility mode 
to execute 32-bit code and then transit
   back to long mode.
 
-  Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
   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
@@ -67,6 +67,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR mGdt = {
   @return status.
 **/
 UINT32
+EFIAPI
 AsmExecute32BitCode (
   IN UINT64   Function,
   IN UINT64   Param1,
-- 
2.13.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 4/7] MdePkg: Remove an unused PCD

2018-08-20 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 MdePkg/Library/BaseLib/BaseLib.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MdePkg/Library/BaseLib/BaseLib.inf 
b/MdePkg/Library/BaseLib/BaseLib.inf
index a1b5ec4b75..4ae8a0b05a 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -643,7 +643,6 @@
   gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength  ## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## 
SOMETIMES_CONSUMES
   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength   ## 
SOMETIMES_CONSUMES
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask## 
SOMETIMES_CONSUMES
 
 [FeaturePcd]
   gEfiMdePkgTokenSpaceGuid.PcdVerifyNodeInList  ## CONSUMES
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 2/7] IntelFsp2WrapperPkg: Remove unused PCDs

2018-08-20 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase
gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize

Cc: Jiewen Yao 
Cc: Chasel Chiu 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf| 1 -
 .../BaseFspWrapperPlatformLibSample.inf| 3 ---
 2 files changed, 4 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf 
b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
index ce3bfa0c75..011cf89d3f 100644
--- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
@@ -61,7 +61,6 @@
   gFspHobGuid   ## CONSUMES ## HOB
 
 [Pcd]
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi   ## CONSUMES
 
 [Depex]
diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
index f9581e8456..3bc024459f 100644
--- 
a/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
+++ 
b/IntelFsp2WrapperPkg/Library/BaseFspWrapperPlatformLibSample/BaseFspWrapperPlatformLibSample.inf
@@ -55,6 +55,3 @@
 
 [LibraryClasses]
 
-[Pcd]
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
-  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize  ## CONSUMES
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 3/7] MdeModulePkg: Remove unused PCDs

2018-08-20 Thread shenglei
The PCDs below are unused, so they have been removed from inf.
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax
gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag
gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem
gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize

Cc: Star Zeng 
Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf | 11 ---
 .../FirmwarePerformanceDxe.inf|  1 -
 2 files changed, 12 deletions(-)

diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf 
b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
index 342df9e99c..d5e87cb97b 100644
--- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
+++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
@@ -56,17 +56,6 @@
   HobLib
   BmpSupportLib
 
-[Pcd]
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSystemRebootAfterCapsuleProcessFlag  
## CONSUMES
-
-  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd  
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess   
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed
## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem 
## CONSUMES
 
 [Protocols]
   gEsrtManagementProtocolGuid   ## CONSUMES
diff --git 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
index 983ce41b48..023ab00c7c 100644
--- 
a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
+++ 
b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTableDxe/FirmwarePerformanceDxe.inf
@@ -73,7 +73,6 @@
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeOsLoaderStart   ## CONSUMES
-  gEfiMdeModulePkgTokenSpaceGuid.PcdExtFpdtBootRecordPadSize## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId   ## CONSUMES
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision  ## CONSUMES
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 7/7] UefiCpuPkg: Remove an unused PCD

2018-08-20 Thread shenglei
The PCD below is unused, so it has been removed from inf.
gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport

Cc: Eric Dong 
Cc: Laszlo Ersek 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
Reviewed-by: Eric Dong 
---
 UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf 
b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
index 8bc8979de0..cb7f227f6c 100644
--- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
+++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/CpuCommonFeaturesLib.inf
@@ -64,7 +64,6 @@
   LocalApicLib
 
 [Pcd]
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesSupport## CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuClockModulationDutyCycle   ## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdIsPowerOnReset## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuProcTraceOutputScheme  ## 
SOMETIMES_CONSUMES
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH V2] BaseTools: Fix regression issue by b23414f6540d

2018-08-20 Thread Feng, YunhuaX
V2: Renaming function DepexExpressionTokenList to  DepexExpressionDict
instead of changing the callers

Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04
AttributeError: 'ModuleAutoGen' object has no attribute
'DepexExpressionDict'

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 3b1ddc74e8..d30a9be6ee 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -2899,11 +2899,11 @@ class ModuleAutoGen(AutoGen):
 ## Merge dependency expression
 #
 #   @retval listThe token list of the dependency expression after 
parsed
 #
 @cached_property
-def DepexExpressionTokenList(self):
+def DepexExpressionDict(self):
 if self.DxsFile or self.IsLibrary or TAB_DEPENDENCY_EXPRESSION_FILE in 
self.FileTypes:
 return {}
 
 RetVal = {self.ModuleType:''}
 
-- 
2.12.2.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk-platforms v1 4/4] Platform/HiKey960: enable usb device driver

2018-08-20 Thread Haojian Zhuang
Enable Designware USB 3.0 device driver on HiKey960 platform.
Android Fastboot application is based on the USB driver.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
---
 Platform/Hisilicon/HiKey960/HiKey960.dec |  3 +++
 Platform/Hisilicon/HiKey960/HiKey960.dsc | 13 +
 Platform/Hisilicon/HiKey960/HiKey960.fdf |  3 +++
 3 files changed, 19 insertions(+)

diff --git a/Platform/Hisilicon/HiKey960/HiKey960.dec 
b/Platform/Hisilicon/HiKey960/HiKey960.dec
index aa5a0caf52e5..c925ae6c5eb5 100644
--- a/Platform/Hisilicon/HiKey960/HiKey960.dec
+++ b/Platform/Hisilicon/HiKey960/HiKey960.dec
@@ -33,3 +33,6 @@ [PcdsFixedAtBuild.common]
   gHiKey960TokenSpaceGuid.PcdAndroidBootFile|{ 0x36, 0x8b, 0x73, 0x3a, 0xc5, 
0xb9, 0x63, 0x47, 0xab, 0xbd, 0x6c, 0xbd, 0x4b, 0x25, 0xf9, 0xff 
}|VOID*|0x0002
   gHiKey960TokenSpaceGuid.PcdAndroidFastbootFile|{ 0x2a, 0x50, 0x88, 0x95, 
0x70, 0x53, 0xe3, 0x11, 0x86, 0x31, 0xd7, 0xc5, 0x95, 0x13, 0x64, 0xc8 
}|VOID*|0x0003
   gHiKey960TokenSpaceGuid.PcdSdBootDevicePath|L""|VOID*|0x0004
+  gHiKey960TokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|L""|VOID*|0x0005
+  gHiKey960TokenSpaceGuid.PcdArmFastbootFlashLimit|L""|VOID*|0x0006
+  gHiKey960TokenSpaceGuid.PcdXloaderDevicePath|L""|VOID*|0x0007
diff --git a/Platform/Hisilicon/HiKey960/HiKey960.dsc 
b/Platform/Hisilicon/HiKey960/HiKey960.dsc
index 1ce306da5b50..2b65254ba255 100644
--- a/Platform/Hisilicon/HiKey960/HiKey960.dsc
+++ b/Platform/Hisilicon/HiKey960/HiKey960.dsc
@@ -52,6 +52,8 @@ [LibraryClasses.common]
   # USB Requirements
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
 
+  
UsbSerialNumberLib|Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf
+
   # Network Libraries
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
   NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
@@ -59,6 +61,8 @@ [LibraryClasses.common]
   IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
   UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
 
+  DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
+
 [LibraryClasses.common.SEC]
   PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
   
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
@@ -82,6 +86,7 @@ [PcdsFeatureFlag.common]
 [PcdsFixedAtBuild.common]
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
 
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor|"hikey960"
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Alpha"
 
   # System Memory (3GB)
@@ -123,6 +128,11 @@ [PcdsFixedAtBuild.common]
   gEmbeddedTokenSpaceGuid.PcdMetronomeTickPeriod|1000
 
   #
+  # DW USB3 controller
+  #
+  gDwUsb3DxeTokenSpaceGuid.PcdDwUsb3DxeBaseAddress|0xFF10
+
+  #
   #
   # Fastboot
   #
@@ -216,6 +226,9 @@ [Components.common]
   #
   # USB Peripheral Support
   #
+  Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
+  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
+  Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
   
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
 
   #
diff --git a/Platform/Hisilicon/HiKey960/HiKey960.fdf 
b/Platform/Hisilicon/HiKey960/HiKey960.fdf
index d4fe4c46b818..8addf49d1647 100644
--- a/Platform/Hisilicon/HiKey960/HiKey960.fdf
+++ b/Platform/Hisilicon/HiKey960/HiKey960.fdf
@@ -151,6 +151,9 @@ [FV.FvMain]
   #
   # USB Peripheral Support
   #
+  INF Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
+  INF EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
+  INF Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
   INF 
EmbeddedPkg/Drivers/AndroidFastbootTransportUsbDxe/FastbootTransportUsbDxe.inf
 
   #
-- 
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk-platforms v1 2/4] Platform/HiKey960: add platform usb driver

2018-08-20 Thread Haojian Zhuang
Register the callbacks of Designware USB 3.0 driver on HiKey960
platform.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
---
 Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf |  52 +++
 Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c   | 382 

 2 files changed, 434 insertions(+)

diff --git a/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf 
b/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
new file mode 100644
index ..121a76da57a2
--- /dev/null
+++ b/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
@@ -0,0 +1,52 @@
+#/** @file
+#
+#  Copyright (c) 2018, Linaro. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = HiKey960UsbDxe
+  FILE_GUID  = 9998be97-6fb6-40f6-a98d-d797dc7b9d32
+  MODULE_TYPE= UEFI_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= HiKey960UsbEntryPoint
+
+[Sources.common]
+  HiKey960UsbDxe.c
+
+[LibraryClasses]
+  DebugLib
+  IoLib
+  TimerLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UsbSerialNumberLib
+
+[Protocols]
+  gDwUsbProtocolGuid
+  gEfiBlockIoProtocolGuid
+  gEfiDriverBindingProtocolGuid
+
+[Packages]
+  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  Platform/Hisilicon/HiKey960/HiKey960.dec
+  Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec
+  Silicon/Hisilicon/Hi3660/Hi3660.dec
+
+[Pcd]
+  gHiKey960TokenSpaceGuid.PcdAndroidFastbootNvmDevicePath
+
+[Depex]
+  TRUE
diff --git a/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c 
b/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c
new file mode 100644
index ..d8b7997b7382
--- /dev/null
+++ b/Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c
@@ -0,0 +1,382 @@
+/** @file
+*
+*  Copyright (c) 2018, Linaro. All rights reserved.
+*
+*  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 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+#define USB_EYE_PARAM  0x01c466e3
+#define USB_PHY_TX_VBOOST_LVL  5
+
+#define DWC3_PHY_RX_OVRD_IN_HI 0x1006
+#define DWC3_PHY_RX_SCOPE_VDCC 0x1026
+
+#define RX_SCOPE_LFPS_EN   (1 << 0)
+
+#define TX_VBOOST_LVL_MASK 7
+#define TX_VBOOST_LVL(x)   ((x) & TX_VBOOST_LVL_MASK)
+
+#define SERIAL_NUMBER_LBA  20
+
+STATIC EFI_HANDLE mFlashHandle;
+
+UINTN
+HiKey960GetUsbMode (
+  IN VOID
+  )
+{
+  return USB_DEVICE_MODE;
+}
+
+VOID
+HiKey960UsbPhyCrWaitAck (
+  VOID
+  )
+{
+  INT32Timeout = 1000;
+  UINT32   Data;
+
+  while (TRUE) {
+Data = MmioRead32 (USB3OTG_PHY_CR_STS);
+if ((Data & USB3OTG_PHY_CR_ACK) == USB3OTG_PHY_CR_ACK) {
+  return;
+}
+MicroSecondDelay (50);
+if (Timeout-- <= 0) {
+  DEBUG ((DEBUG_ERROR, "Wait PHY_CR_ACK timeout!\n"));
+  return;
+}
+  }
+}
+
+VOID
+HiKey960UsbPhyCrSetAddr (
+  IN UINT32Addr
+  )
+{
+  //
+  // set addr
+  //
+  MmioWrite32 (
+USB3OTG_PHY_CR_CTRL,
+USB3OTG_PHY_CR_DATA_IN (Addr)
+);
+  MicroSecondDelay (100);
+  //
+  // cap addr
+  //
+  MmioOr32 (USB3OTG_PHY_CR_CTRL, USB3OTG_PHY_CR_CAP_ADDR);
+  HiKey960UsbPhyCrWaitAck ();
+  MmioWrite32 (USB3OTG_PHY_CR_CTRL, 0);
+}
+
+UINT16
+HiKey960UsbPhyCrRead (
+  IN UINT32Addr
+  )
+{
+  INT32Timeout = 1000;
+  UINT32   Data;
+
+  HiKey960UsbPhyCrSetAddr (Addr);
+  MmioWrite32 (USB3OTG_PHY_CR_CTRL, USB3OTG_PHY_CR_READ);
+  MicroSecondDelay (100);
+
+  while (TRUE) {
+Data = MmioRead32 (USB3OTG_PHY_CR_STS);
+if ((Data & USB3OTG_PHY_CR_ACK) == USB3OTG_PHY_CR_ACK) {
+  DEBUG ((
+DEBUG_INFO,
+"Addr 0x%x, Data Out:0x%x\n",
+Addr,
+USB3OTG_PHY_CR_DATA_OUT(Data)
+));
+  break;
+}
+Micro

[edk2] [PATCH edk-platforms v1 0/4] enable USB on HiKey960

2018-08-20 Thread Haojian Zhuang
Changelog:
v1:
  * Add UsbSerialNumberLib.
  * Enable USB device driver on HiKey960 platform.

Haojian Zhuang (4):
  Platform/Hisilicon: add UsbSerialNumberLib
  Platform/HiKey960: add platform usb driver
  Platform/HiKey960: add fastboot platform driver
  Platform/HiKey960: enable usb device driver

 Platform/Hisilicon/HiKey960/HiKey960.dec   |   3 +
 Platform/Hisilicon/HiKey960/HiKey960.dsc   |  13 +
 Platform/Hisilicon/HiKey960/HiKey960.fdf   |   3 +
 .../HiKey960FastbootDxe/HiKey960FastbootDxe.c  | 758 +
 .../HiKey960FastbootDxe/HiKey960FastbootDxe.inf|  63 ++
 .../HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c   | 382 +++
 .../HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf |  52 ++
 .../Include/Library/UsbSerialNumberLib.h   |  59 ++
 .../UsbSerialNumberLib/UsbSerialNumberLib.c| 341 +
 .../UsbSerialNumberLib/UsbSerialNumberLib.dec  |  32 +
 .../UsbSerialNumberLib/UsbSerialNumberLib.inf  |  45 ++
 11 files changed, 1751 insertions(+)
 create mode 100644 
Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.c
 create mode 100644 
Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
 create mode 100644 Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.c
 create mode 100644 
Platform/Hisilicon/HiKey960/HiKey960UsbDxe/HiKey960UsbDxe.inf
 create mode 100644 
Platform/Hisilicon/Library/UsbSerialNumberLib/Include/Library/UsbSerialNumberLib.h
 create mode 100644 
Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.c
 create mode 100644 
Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec
 create mode 100644 
Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.inf

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
-- 
2.7.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk-platforms v1 3/4] Platform/HiKey960: add fastboot platform driver

2018-08-20 Thread Haojian Zhuang
Implement the Android Fastboot protocol in HiKey960 platform.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
---
 Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf |  63 
++
 Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.c   | 758 

 2 files changed, 821 insertions(+)

diff --git 
a/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf 
b/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
new file mode 100644
index ..1771d41828d4
--- /dev/null
+++ b/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.inf
@@ -0,0 +1,63 @@
+#/** @file
+#
+#  Copyright (c) 2014, ARM Ltd. All rights reserved.
+#  Copyright (c) 2018, Linaro. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = HiKey960FastbootDxe
+  FILE_GUID  = 80f046c6-d5ba-4916-a656-2e2b28d32304
+  MODULE_TYPE= UEFI_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= HiKey960FastbootPlatformEntryPoint
+
+[Sources.common]
+  HiKey960FastbootDxe.c
+
+[LibraryClasses]
+  BaseLib
+  BaseMemoryLib
+  CacheMaintenanceLib
+  DebugLib
+  DevicePathLib
+  IoLib
+  MemoryAllocationLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiRuntimeServicesTableLib
+  UefiDriverEntryPoint
+  UsbSerialNumberLib
+  TimerLib
+
+[Protocols]
+  gAndroidFastbootPlatformProtocolGuid
+  gEfiBlockIoProtocolGuid
+  gEfiDevicePathToTextProtocolGuid
+  gEfiDiskIoProtocolGuid
+  gEfiEraseBlockProtocolGuid
+  gEfiSimpleTextOutProtocolGuid
+
+[Packages]
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  ArmPkg/ArmPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  Platform/Hisilicon/HiKey960/HiKey960.dec
+  Platform/Hisilicon/Library/UsbSerialNumberLib/UsbSerialNumberLib.dec
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVendor
+  gHiKey960TokenSpaceGuid.PcdAndroidFastbootNvmDevicePath
+  gHiKey960TokenSpaceGuid.PcdArmFastbootFlashLimit
+  gHiKey960TokenSpaceGuid.PcdXloaderDevicePath
diff --git 
a/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.c 
b/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.c
new file mode 100644
index ..5e99a9f93ca4
--- /dev/null
+++ b/Platform/Hisilicon/HiKey960/HiKey960FastbootDxe/HiKey960FastbootDxe.c
@@ -0,0 +1,758 @@
+/** @file
+
+  Copyright (c) 2014, ARM Ltd. All rights reserved.
+  Copyright (c) 2018, Linaro. All rights reserved.
+
+  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.
+
+**/
+
+/*
+  Implementation of the Android Fastboot Platform protocol, to be used by the
+  Fastboot UEFI application, for Hisilicon HiKey960 platform.
+*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define PARTITION_NAME_MAX_LENGTH(72/2)
+
+#define SERIAL_NUMBER_LBA20
+
+#define RANDOM_MAX   0x7FFF
+#define RANDOM_MAGIC 0x9A4DBEAF
+
+#define ADB_REBOOT_ADDRESS   0x3210
+#define ADB_REBOOT_BOOTLOADER0x77665500
+
+#define UFS_BLOCK_SIZE   4096
+
+typedef struct _FASTBOOT_PARTITION_LIST {
+  LIST_ENTRY  Link;
+  CHAR16  PartitionName[PARTITION_NAME_MAX_LENGTH];
+  EFI_LBA StartingLBA;
+  EFI_LBA EndingLBA;
+} FASTBOOT_PARTITION_LIST;
+
+STATIC LIST_ENTRY   mPartitionListHead;
+STATIC EFI_HANDLE   mFlashHandle;
+STATIC EFI_BLOCK_IO_PROTOCOL   *mFlashBlockIo;
+STATIC EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *mTextOut;
+
+/*
+  Helper to free the partition list
+*/
+STATIC
+VOID
+FreePartitionList (
+  VOID
+  )
+{
+  FASTBOOT_PARTITION_LIST *Entry;
+  FASTBOOT_PARTITION_LIST *NextEntry;
+
+  Entry = (FASTBOOT_PARTITION_LIST *) GetFirstNode (&mPartitionListHead);
+  while (!IsNull (&mPartitionListHead, &Entry->Link)) {
+NextEn

[edk2] [PATCH v1 2/2] EmbeddedPkg/Drivers: add DwUsb3Dxe driver

2018-08-20 Thread Haojian Zhuang
Add Designware USB 3.0 device driver. It's focus on USB device
functionality, not USB Host functionality. The USB driver is
mainly used for Android Fastboot application.

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Haojian Zhuang 
---
 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec |   44 +
 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf |   52 +
 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h   |  632 +
 EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.c   | 2434 
 4 files changed, 3162 insertions(+)

diff --git a/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec 
b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
new file mode 100644
index ..038e4881a948
--- /dev/null
+++ b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
@@ -0,0 +1,44 @@
+#/** @file
+# Framework Module Development Environment Industry Standards
+#
+# This Package provides headers and libraries that conform to EFI/PI Industry 
standards.
+# Copyright (c) 2007, Intel Corporation. All rights reserved.
+# Copyright (c) 2012-2014, ARM Ltd. All rights reserved.
+# Copyright (c) 2018, Linaro. All rights reserved.
+#
+#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]
+  DEC_SPECIFICATION  = 0x00010019
+  PACKAGE_NAME   = DwUsb3DxePkg
+  PACKAGE_GUID   = 9b7aa6fe-405b-4955-af1f-5faf183aedec
+  PACKAGE_VERSION= 0.1
+
+
+
+#
+# Include Section - list of Include Paths that are provided by this package.
+#   Comments are used for Keywords and Module Types.
+#
+# Supported Module Types:
+#  BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER 
DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
+#
+
+
+[Guids.common]
+  gDwUsb3DxeTokenSpaceGuid  = { 0x098a50d3, 0x92e2, 0x461a, { 0xb6, 0xba, 
0xf8, 0x5d, 0x9d, 0x89, 0x49, 0xf5 }}
+
+[Protocols.common]
+  gDwUsbProtocolGuid= { 0x109fa264, 0x7811, 0x4862, { 0xa9, 0x73, 
0x4a, 0xb2, 0xef, 0x2e, 0xe2, 0xff }}
+
+[PcdsFixedAtBuild.common]
+  # DwUsb Driver PCDs
+  gDwUsb3DxeTokenSpaceGuid.PcdDwUsb3DxeBaseAddress|0x0|UINT32|0x0001
diff --git a/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf 
b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
new file mode 100644
index ..510b51a34de7
--- /dev/null
+++ b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.inf
@@ -0,0 +1,52 @@
+#/** @file
+#
+#  Copyright (c) 2018, Linaro Limited. All rights reserved.
+#
+#  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= 0x00010019
+  BASE_NAME  = DwUsb3Dxe
+  FILE_GUID  = 0879cd34-c399-4315-9891-56024072e711
+  MODULE_TYPE= UEFI_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= DwUsb3EntryPoint
+
+[Sources.common]
+  DwUsb3Dxe.c
+
+[LibraryClasses]
+  CacheMaintenanceLib
+  DebugLib
+  DmaLib
+  IoLib
+  MemoryAllocationLib
+  TimerLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UsbSerialNumberLib
+
+[Protocols]
+  gEfiDriverBindingProtocolGuid
+  gUsbDeviceProtocolGuid
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[Pcd]
+  gDwUsb3DxeTokenSpaceGuid.PcdDwUsb3DxeBaseAddress
+
+[Depex]
+  TRUE
diff --git a/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h 
b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h
new file mode 100644
index ..92b610553169
--- /dev/null
+++ b/EmbeddedPkg/Drivers/DwUsb3Dxe/DwUsb3Dxe.h
@@ -0,0 +1,632 @@
+/** @file
+
+  Copyright (c) 2017, Linaro Limited. All rights reserved.
+
+  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,
+  WITHO

[edk2] [PATCH] BaseTools: Fix regression issue by b23414f6540d

2018-08-20 Thread Feng, YunhuaX
Fix regression issue by b23414f6540d4f336b6f00b44681911d469f9a04
AttributeError: 'ModuleAutoGen' object has no attribute
'DepexExpressionDict'

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/build/BuildReport.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/build/BuildReport.py 
b/BaseTools/Source/Python/build/BuildReport.py
index deb88a7817..63c040ec07 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -423,11 +423,11 @@ class DepexReport(object):
 if Match:
 self.Depex = Match.group(1).strip()
 self.Source = "DXS"
 break
 else:
-self.Depex = M.DepexExpressionDict.get(M.ModuleType, "")
+self.Depex = M.DepexExpressionTokenList.get(M.ModuleType, "")
 self.ModuleDepex = " ".join(M.Module.DepexExpression[M.Arch, 
M.ModuleType])
 if not self.ModuleDepex:
 self.ModuleDepex = "(None)"
 
 LibDepexList = []
-- 
2.12.2.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel