Re: [edk2] [PATCH edk2-platforms 01/27] Platform/Microsoft: Add OpteeClientPkg dec

2018-11-01 Thread Sumit Garg
+ OP-TEE ML.

On Fri, 2 Nov 2018 at 06:11, Chris Co  wrote:
>
> Hi Sumit,
>
> Our full OpteeClientPkg has:
> - Our OpteeClientAPI implementation. I was monitoring the merge progress on 
> OpteeLib and will look into moving over now that it is available.
> - The fTPM and AuthVar TA binaries. In our current design, the TA binaries 
> are loaded at runtime. We could host the binaries themselves elsewhere on the 
> filesystem, but we do not want these binaries as early/pseudo TAs. Is there a 
> plan for OpteeLib to support loading full TAs?

Early TAs [1] are basically full TAs only, running in Secure EL0 mode.
So instead of loading TA from normal world file-system, they are
linked into a special data section in the OP-TEE core blob.

Also I don't think loading TAs dynamically especially during boot
makes much sense due to following reasons:
1. Increased boot time.
2. Fixed TAs like in your case which could be linked as early TAs as well.

And you mentioned filesystem, are you referring to root filesystem?

> - We have two client drivers: a firmware TPM TA driver and an authenticated 
> variable TA driver. These talk through the tee-supplicant to their respective 
> TAs.
>

Here from tee-supplicant apart from loading TAs, what other services
are you expecting? If you are looking for secure storage via RPMB,
that could be an enhancement to OpteeLib adding corresponding RPC
handling here [2].

[1] 
https://github.com/OP-TEE/optee_os/blob/master/documentation/optee_design.md#early-trusted-applications
[2] 
https://github.com/tianocore/edk2/blob/master/ArmPkg/Library/OpteeLib/Optee.c#L147

Regards,
Sumit

> Chris
>
> > -Original Message-
> > From: Sumit Garg 
> > Sent: Thursday, November 1, 2018 3:55 AM
> > To: Chris Co ; Leif Lindholm
> > 
> > Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> > Michael D Kinney 
> > Subject: Re: [PATCH edk2-platforms 01/27] Platform/Microsoft: Add
> > OpteeClientPkg dec
> >
> > Hi Christopher,
> >
> > Optee Client library has recently been merged to edk2 source code. It tries 
> > to
> > provide a generic interface [1] to OP-TEE based trusted applications
> > (pseudo/early).
> >
> > AFAIK, you don't need any platform specific hook in client interface to work
> > with upstream OP-TEE. So instead you should use Optee library.
> >
> > [1]
> > https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c
> > om%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FArmPkg%2FInclude%2FLibrary
> > %2FOpteeLib.hdata=02%7C01%7CChristopher.Co%40microsoft.com%7C
> > c19b84ef7f8f4213424108d63fe88f66%7C72f988bf86f141af91ab2d7cd011db47
> > %7C1%7C0%7C63675404786500sdata=m24akbKtoyCERVN77meoSU
> > H6E%2Bpf8W2P5MF7nvU5y7I%3Dreserved=0
> >
> > Regards,
> > Sumit
> >
> > On Thu, 1 Nov 2018 at 02:13, Leif Lindholm  wrote:
> > >
> > > +Sumit (just to loop you two together). Is there anything Microsoft
> > > platform specific about what will go in here?
> > >
> > > /
> > > Leif
> > >
> > > On Fri, Sep 21, 2018 at 08:25:53AM +, Chris Co wrote:
> > > > On Windows IoT Core devices with ARM TrustZone capabilities,
> > > > EDK2 runs in normal world and we use OP-TEE to execute secure world
> > > > operations. The overall package will contain client-side support to
> > > > invoke EDK2 services implemented as OP-TEE trusted applications that
> > > > run in secure world.
> > > >
> > > > This commit adds the initial dec file to add some PCD settings
> > > > needed by other packages.
> > > >
> > > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > > Signed-off-by: Christopher Co 
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Leif Lindholm 
> > > > Cc: Michael D Kinney 
> > > > ---
> > > >  Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec | 49
> > > > 
> > > >  1 file changed, 49 insertions(+)
> > > >
> > > > diff --git a/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > > b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > > new file mode 100644
> > > > index ..4752eab39ce3
> > > > --- /dev/null
> > > > +++ b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > > @@ -0,0 +1,49 @@
> > > > +## @file
> > > > +#
> > > > +#  OP-TEE client package
> > > > +#
> > > > +#  OP-TEE client package contains the client-side interface to invoke 
> > > > OP-
> > TEE TAs.
> > > > +#  Certain EDKII services are implemented in Trusted Applications
> > > > +running in #  the secure world OP-TEE OS.
> > > > +#
> > > > +#  Copyright (c) 2018 Microsoft 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 #
> > > > +https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fope
> > > > +nsource.org%2Flicenses%2Fbsd-
> > license.phpdata=02%7C01%7CChristo
> > > >
> > 

Re: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module types

2018-11-01 Thread Zeng, Star
Liming,

Will you help push the patch series?


Thanks,
Star

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Gao, 
Liming
Sent: Thursday, November 1, 2018 9:31 PM
To: Jeff Brasen ; Ni, Ruiyu ; 
edk2-devel@lists.01.org
Cc: Kinney, Michael D ; Gao, Liming 

Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types

Jeff:
  Thanks for your case. PrePiMemoryAllocationLib is a MemoryAllocationLib 
implementation that doesn't depend on PEI or DXE service. So, 
MemoryAllocationLib may be used in BASE type. And, I find 
MdeModulePkg\Library\BaseBmpSupportLib\BaseBmpSupportLib.inf is BASE type and 
consumes MemoryAllocationLib. So, I think your change is OK. Reviewed-by: 
Liming Gao 

Thanks
Liming
From: Jeff Brasen [mailto:jbra...@nvidia.com]
Sent: Thursday, November 1, 2018 2:25 PM
To: Ni, Ruiyu ; edk2-devel@lists.01.org
Cc: Gao, Liming ; Kinney, Michael D 

Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types


For defining it as a BASE type i changed that to that as there is a 
MemoryAllocationLib defined for the various phases. For example, SEC uses 
EmbeddedPkg/Library/PrePiMemoryAllocationLib (other patch in this series 
implements the AllocateZeroPool that is needed for this).



I am not opposed to an allocation-less SortLib but was trying to enable this 
capability without impact to other users of this library.



Thanks,

Jeff


From: Ni, Ruiyu mailto:ruiyu...@intel.com>>
Sent: Wednesday, October 31, 2018 2:56:42 AM
To: Jeff Brasen; edk2-devel@lists.01.org
Cc: Gao, Liming; Kinney, Michael D
Subject: RE: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types

SortLib depends on MemoryAllocationLib.
How can it be a BASE type library?

Can we do it in two options?
1. Change the SortLib API to accept a temporary buffer from caller. So the 
MemoryAllocationlIb dependency can be removed.
2. Do not change SortLibAPI but uses a fixed-size temporary buffer internally. 
E.g.: UINT8 Buffer[MAX_ELEMENT_SIZE];


Thanks/Ray

> -Original Message-
> From: edk2-devel 
> mailto:edk2-devel-boun...@lists.01.or
> g>> On Behalf Of Jeff Brasen
> Sent: Wednesday, October 31, 2018 5:31 AM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen mailto:jbra...@nvidia.com>>
> Subject: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all 
> module types
>
> Expose BaseSortLib for use in SEC and PEI phases.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen 
> mailto:jbra...@nvidia.com>>
> ---
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> index f807cd7..5bd1aa1 100644
> --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> @@ -18,9 +18,9 @@
>BASE_NAME  = BaseSortLib
>MODULE_UNI_FILE= BaseSortLib.uni
>FILE_GUID  = 03F3331B-F12D-494f-BF37-E55A657F2497
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = SortLib|DXE_DRIVER DXE_RUNTIME_DRIVER
> UEFI_APPLICATION UEFI_DRIVER
> +  LIBRARY_CLASS  = SortLib
>
>  #
>  #  VALID_ARCHITECTURES   = IA32 X64 EBC
> --
> 2.7.4
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply email and destroy all copies of the original 
message.

___
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


[edk2] [Patch V2] BaseTools: Use common cc flag for building PcdValueInit.

2018-11-01 Thread BobCF
V2:
Support to extract the common cc flag from a
combined cc flag string. For example
MSFT:*_*_IA32_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES /DDEF_IA32
MSFT:*_*_X64_CC_FLAGS  = /DDEF_X64 /D DISABLE_NEW_DEPRECATED_INTERFACES

V1:
Use common cc flags for building pcdinitvalue. The common
cc flags include the cc flag which is under common arch and
under all build arches.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 .../Source/Python/Workspace/DscBuildData.py   | 55 +++
 1 file changed, 31 insertions(+), 24 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 6d596b2b54..0173323b36 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2182,10 +2182,23 @@ class DscBuildData(PlatformBuildClassObject):
 for key in OverrideValues:
 if OverrideValues[key]:
 return False
 return True
 
+def ParseCCFlags(self, ccflag):
+ccflags = set()
+flag = ""
+for ch in ccflag:
+if ch in (r"/", "-"):
+if flag.strip():
+ccflags.add(flag.strip())
+flag = ch
+else:
+flag += ch
+if flag.strip():
+ccflags.add(flag.strip())
+return ccflags
 def GenerateByteArrayValue (self, StructuredPcds):
 #
 # Generate/Compile/Run C application to determine if there are any 
flexible array members
 #
 if not StructuredPcds:
@@ -2298,38 +2311,32 @@ class DscBuildData(PlatformBuildClassObject):
 if Family and Family != self.ToolChainFamily:
 continue
 Target, Tag, Arch, Tool, Attr = Options[1].split("_")
 if Tool != 'CC':
 continue
-
+if Attr != "FLAGS":
+continue
 if Target == "*" or Target == self._Target:
 if Tag == "*" or Tag == self._Toolchain:
+if 'COMMON' not in BuildOptions:
+BuildOptions['COMMON'] = set()
 if Arch == "*":
-if Tool not in BuildOptions:
-BuildOptions[Tool] = OrderedDict()
-if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
or self.BuildOptions[Options].startswith('='):
-BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
-else:
-# append options for the same tool except PATH
-if Attr != 'PATH':
-BuildOptions[Tool][Attr] += " " + 
self.BuildOptions[Options]
-else:
-BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
+BuildOptions['COMMON'].add(self.BuildOptions[Options])
+if Arch in self.SupArchList:
+if Arch not in BuildOptions:
+BuildOptions[Arch] = set()
+BuildOptions[Arch] |= 
self.ParseCCFlags(self.BuildOptions[Options])
+
 if BuildOptions:
-for Tool in BuildOptions:
-for Attr in BuildOptions[Tool]:
-if Attr == "FLAGS":
-Value = BuildOptions[Tool][Attr]
-ValueList = Value.split()
-if ValueList:
-for Id, Item in enumerate(ValueList):
-if Item in ['-D', '/D', '-U', '/U']:
-CC_FLAGS += ' ' + Item
-if Id + 1 < len(ValueList):
-CC_FLAGS += ' ' + ValueList[Id + 1]
-elif Item.startswith(('-D', '/D', '-U', '/U')):
-CC_FLAGS += ' ' + Item
+ArchBuildOptions = {arch:flags for arch,flags in 
BuildOptions.items() if arch != 'COMMON'}
+if len(ArchBuildOptions.keys()) == 1:
+BuildOptions['COMMON'] |= (ArchBuildOptions.values()[0])
+else:
+CommonBuildOptions = reduce(lambda x,y: x, 
ArchBuildOptions.values())
+BuildOptions['COMMON'] |= CommonBuildOptions
+ValueList = list(BuildOptions['COMMON'])
+CC_FLAGS += " ".join([item for item in ValueList if 
item.startswith(('-D', '/D', '-U', '/U'))])
 MakeApp += CC_FLAGS
 
 if sys.platform == "win32":
 MakeApp = MakeApp + PcdMakefileEnd
 MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) 
$(APPFILE) /y """)
-- 
2.18.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org

Re: [edk2] [PATCH] BaseTools/Eot: Remove a duplication code in EotMain class

2018-11-01 Thread Zhu, Yonghong
Reviewed-by: Yonghong Zhu  

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Yonghong 
Zhu
Sent: Wednesday, October 31, 2018 3:49 PM
To: edk2-devel@lists.01.org
Cc: Chen, Hesheng 
Subject: [edk2] [PATCH] BaseTools/Eot: Remove a duplication code in EotMain 
class

From: Hess Chen 

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen 
---
 BaseTools/Source/Python/Eot/EotMain.py | 365 -
 1 file changed, 365 deletions(-)

diff --git a/BaseTools/Source/Python/Eot/EotMain.py 
b/BaseTools/Source/Python/Eot/EotMain.py
index 2ad93cc6b4..7eae4ac672 100644
--- a/BaseTools/Source/Python/Eot/EotMain.py
+++ b/BaseTools/Source/Python/Eot/EotMain.py
@@ -1083,371 +1083,6 @@ class Ffs(Image):
 State = property(_GetState, _SetState)
 
 
-_FfsGuid = "8C8CE578-8A3D-4F1C-9935-896185C32DD3"
-
-_GUID_  = struct.Struct("16x 1I2H8B")
-_LENGTH_= struct.Struct("16x 16x 1Q")
-_SIG_   = struct.Struct("16x 16x 8x 1I")
-_ATTR_  = struct.Struct("16x 16x 8x 4x 1I")
-_HLEN_  = struct.Struct("16x 16x 8x 4x 4x 1H")
-_CHECKSUM_  = struct.Struct("16x 16x 8x 4x 4x 2x 1H")
-
-def __init__(self, Name=''):
-Image.__init__(self)
-self.Name = Name
-self.FfsDict = sdict()
-self.OrderedFfsDict = sdict()
-self.UnDispatchedFfsDict = sdict()
-self.ProtocolList = sdict()
-
-def CheckArchProtocol(self):
-for Item in EotGlobalData.gArchProtocolGuids:
-if Item.lower() not in EotGlobalData.gProtocolList:
-return False
-return True
-
-def ParseDepex(self, Depex, Type):
-List = None
-if Type == 'Ppi':
-List = EotGlobalData.gPpiList
-if Type == 'Protocol':
-List = EotGlobalData.gProtocolList
-DepexStack = []
-DepexList = []
-DepexString = ''
-FileDepex = None
-CouldBeLoaded = True
-for Index in range(0, len(Depex.Expression)):
-Item = Depex.Expression[Index]
-if Item == 0x00:
-Index = Index + 1
-Guid = gGuidStringFormat % Depex.Expression[Index]
-if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] 
== 0x08:
-return (True, 'BEFORE %s' % Guid, [Guid, 'BEFORE'])
-elif Item == 0x01:
-Index = Index + 1
-Guid = gGuidStringFormat % Depex.Expression[Index]
-if Guid in self.OrderedFfsDict and Depex.Expression[Index + 1] 
== 0x08:
-return (True, 'AFTER %s' % Guid, [Guid, 'AFTER'])
-elif Item == 0x02:
-Index = Index + 1
-Guid = gGuidStringFormat % Depex.Expression[Index]
-if Guid.lower() in List:
-DepexStack.append(True)
-DepexList.append(Guid)
-else:
-DepexStack.append(False)
-DepexList.append(Guid)
-continue
-elif Item == 0x03 or Item == 0x04:
-DepexStack.append(eval(str(DepexStack.pop()) + ' ' + 
Depex._OPCODE_STRING_[Item].lower() + ' ' + str(DepexStack.pop(
-DepexList.append(str(DepexList.pop()) + ' ' + 
Depex._OPCODE_STRING_[Item].upper() + ' ' + str(DepexList.pop()))
-elif Item == 0x05:
-DepexStack.append(eval(Depex._OPCODE_STRING_[Item].lower() + ' 
' + str(DepexStack.pop(
-DepexList.append(Depex._OPCODE_STRING_[Item].lower() + ' ' + 
str(DepexList.pop()))
-elif Item == 0x06:
-DepexStack.append(True)
-DepexList.append('TRUE')
-DepexString = DepexString + 'TRUE' + ' '
-elif Item == 0x07:
-DepexStack.append(False)
-DepexList.append('False')
-DepexString = DepexString + 'FALSE' + ' '
-elif Item == 0x08:
-if Index != len(Depex.Expression) - 1:
-CouldBeLoaded = False
-else:
-CouldBeLoaded = DepexStack.pop()
-else:
-CouldBeLoaded = False
-if DepexList != []:
-DepexString = DepexList[0].strip()
-return (CouldBeLoaded, DepexString, FileDepex)
-
-def Dispatch(self, Db = None):
-if Db is None:
-return False
-self.UnDispatchedFfsDict = copy.copy(self.FfsDict)
-# Find PeiCore, DexCore, PeiPriori, DxePriori first
-FfsSecCoreGuid = None
-FfsPeiCoreGuid = None
-FfsDxeCoreGuid = None
-FfsPeiPrioriGuid = None
-FfsDxePrioriGuid = None
-for FfsID in self.UnDispatchedFfsDict:
-Ffs = self.UnDispatchedFfsDict[FfsID]
-if Ffs.Type == 0x03:
-FfsSecCoreGuid = FfsID
-

[edk2] [PATCH v2 3/5] Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port I/O."

2018-11-01 Thread yuchenlin via edk2-devel
From: yuchenlin 

This reverts commit 05a5379458725234de8a05780fcb5da2c12680e4.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we reverted the initialization of VMWare SVGA device,
we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
 OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf |  6 --
 OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c | 70 
 OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c | 80 ---
 OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h| 59 --
 OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c | 78 --
 OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c | 66 ---
 6 files changed, 359 deletions(-)
 delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
 delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
 delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h
 delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c
 delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c

diff --git a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf 
b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
index 895e6b8dbd..e5575622dc 100644
--- a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
+++ b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
@@ -41,15 +41,9 @@
   Qemu.h
 
 [Sources.Ia32, Sources.X64]
-  UnalignedIoGcc.c| GCC
-  UnalignedIoIcc.c| INTEL
-  UnalignedIoMsc.c| MSFT
   VbeShim.c
   VbeShim.h
 
-[Sources.EBC]
-  UnalignedIoUnsupported.c
-
 [Packages]
   MdePkg/MdePkg.dec
   MdeModulePkg/MdeModulePkg.dec
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c 
b/OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
deleted file mode 100644
index 105d55d3b9..00
--- a/OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file
-  Unaligned Port I/O. This file has compiler specifics for GCC as there is no
-  ANSI C standard for doing IO.
-
-  Based on IoLibGcc.c.
-
-  Copyright (c) 2006 - 2010, 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
-  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 "UnalignedIoInternal.h"
-
-/**
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type
-  address.
-
-  Writes the 32-bit I/O port specified by Port with the value specified by
-  Value and returns Value. This function must guarantee that all I/O read and
-  write operations are serialized.
-
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().
-
-  @param[in]  Port   I/O port address
-  @param[in]  Value  32-bit word to write
-
-  @return The value written to the I/O port.
-
-**/
-UINT32
-UnalignedIoWrite32 (
-  IN  UINTN Port,
-  IN  UINT32Value
-  )
-{
-  __asm__ __volatile__ ( "outl %0, %1" : : "a" (Value), "d" ((UINT16)Port) );
-  return Value;
-}
-
-/**
-  Reads a 32-bit word from the specified, possibly unaligned I/O-type address.
-
-  Reads the 32-bit I/O port specified by Port. The 32-bit read value is
-  returned. This function must guarantee that all I/O read and write operations
-  are serialized.
-
-  If 32-bit unaligned I/O port operations are not supported, then ASSERT().
-
-  @param[in]  Port  The I/O port to read.
-
-  @return The value read.
-
-**/
-UINT32
-UnalignedIoRead32 (
-  IN  UINTN Port
-  )
-{
-  UINT32 Data;
-  __asm__ __volatile__ ( "inl %1, %0" : "=a" (Data) : "d" ((UINT16)Port) );
-  return Data;
-}
-
diff --git a/OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c 
b/OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
deleted file mode 100644
index 79f3e446dd..00
--- a/OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/** @file
-  Unaligned port I/O. This file has compiler specifics for ICC as there
-  is no ANSI C standard for doing IO.
-
-  Based on IoLibIcc.c.
-
-  Copyright (c) 2006 - 2008, 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
-  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 "UnalignedIoInternal.h"
-
-/**
-  Performs a 32-bit write to the specified, possibly unaligned I/O-type
-  address.
-
-  

[edk2] [PATCH v2 5/5] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-01 Thread yuchenlin via edk2-devel
From: yuchenlin 

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

Because of the PCI BARs difference between std vga and
vmsvga, we can not simply recognize the "QEMU VMWare SVGA"
as the QEMU_VIDEO_BOCHS_MMIO variant.

Instead, we remain variant QEMU_VIDEO_VMWARE_SVGA, and use
it for:

(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
 OvmfPkg/QemuVideoDxe/Driver.c | 18 --
 OvmfPkg/QemuVideoDxe/Gop.c|  3 ++-
 OvmfPkg/QemuVideoDxe/Qemu.h   |  2 ++
 3 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 2304afd1e6..76d4a2d27e 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -69,6 +69,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
 0x1050,
 QEMU_VIDEO_BOCHS_MMIO,
 L"QEMU VirtIO VGA"
+},{
+PCI_CLASS_DISPLAY_VGA,
+0x15ad,
+0x0405,
+QEMU_VIDEO_VMWARE_SVGA,
+L"QEMU VMWare SVGA"
 },{
 0 /* end of list */
 }
@@ -256,6 +262,12 @@ QemuVideoControllerDriverStart (
 goto ClosePciIo;
   }
   Private->Variant = Card->Variant;
+  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
+Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
+  } else {
+Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
+  }
+
 
   //
   // IsQxl is based on the detected Card->Variant, which at a later point might
@@ -320,7 +332,8 @@ QemuVideoControllerDriverStart (
   // Check if accessing the bochs interface works.
   //
   if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO ||
-  Private->Variant == QEMU_VIDEO_BOCHS) {
+  Private->Variant == QEMU_VIDEO_BOCHS ||
+  Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
 UINT16 BochsId;
 BochsId = BochsRead(Private, VBE_DISPI_INDEX_ID);
 if ((BochsId & 0xFFF0) != VBE_DISPI_ID0) {
@@ -383,6 +396,7 @@ QemuVideoControllerDriverStart (
 break;
   case QEMU_VIDEO_BOCHS_MMIO:
   case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
 Status = QemuVideoBochsModeSetup (Private, IsQxl);
 break;
   default:
@@ -764,7 +778,7 @@ ClearScreen (
   Private->PciIo->Mem.Write (
 Private->PciIo,
 EfiPciIoWidthFillUint32,
-0,
+Private->FrameBufferVramBarIndex,
 0,
 0x40 >> 2,
 
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index d490fa7a2e..3abc5eeb36 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -60,7 +60,7 @@ QemuVideoCompleteModeData (
 
   Private->PciIo->GetBarAttributes (
 Private->PciIo,
-0,
+Private->FrameBufferVramBarIndex,
 NULL,
 (VOID**) 
 );
@@ -177,6 +177,7 @@ Routine Description:
 break;
   case QEMU_VIDEO_BOCHS_MMIO:
   case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
 InitializeBochsGraphicsMode (Private, 
[ModeData->InternalModeIndex]);
 break;
   default:
diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h
index d7da761705..3aac9eeca6 100644
--- a/OvmfPkg/QemuVideoDxe/Qemu.h
+++ b/OvmfPkg/QemuVideoDxe/Qemu.h
@@ -92,6 +92,7 @@ typedef enum {
   QEMU_VIDEO_CIRRUS_5446,
   QEMU_VIDEO_BOCHS,
   QEMU_VIDEO_BOCHS_MMIO,
+  QEMU_VIDEO_VMWARE_SVGA,
 } QEMU_VIDEO_VARIANT;
 
 typedef struct {
@@ -120,6 +121,7 @@ typedef struct {
   QEMU_VIDEO_VARIANTVariant;
   FRAME_BUFFER_CONFIGURE*FrameBufferBltConfigure;
   UINTN FrameBufferBltConfigureSize;
+  UINT8 FrameBufferVramBarIndex;
 } QEMU_VIDEO_PRIVATE_DATA;
 
 ///
-- 
2.18.0

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


[edk2] [PATCH v2 2/5] Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

2018-11-01 Thread yuchenlin via edk2-devel
From: yuchenlin 

This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2.

The VMWare SVGA model now -- since commit 104bd1dc70 in QEMU --
falls back to stdvga (that is, Bochs) if we don't setup VMWare SVGA
FIFO.

To simplify QemuVideoDxe, we don't intend to implement the VMWare SVGA
FIFO setup feature. It means our current VMW SVGA driver code is
basically dead. To simplify the problem, we will replace the old
VMWare SVGA driver to Bochs interface. It should work on all QEMU
version.

The first step for using Bochs interface is to revert old driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
 OvmfPkg/QemuVideoDxe/Driver.c | 135 +
 OvmfPkg/QemuVideoDxe/Gop.c|  65 +
 OvmfPkg/QemuVideoDxe/Initialize.c | 157 --
 OvmfPkg/QemuVideoDxe/Qemu.h   |  29 --
 4 files changed, 7 insertions(+), 379 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 73eb2cad05..2304afd1e6 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -14,10 +14,8 @@
 
 **/
 
-#include 
-#include 
 #include "Qemu.h"
-#include "UnalignedIoInternal.h"
+#include 
 
 EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {
   QemuVideoControllerDriverSupported,
@@ -71,12 +69,6 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
 0x1050,
 QEMU_VIDEO_BOCHS_MMIO,
 L"QEMU VirtIO VGA"
-},{
-PCI_CLASS_DISPLAY_VGA,
-VMWARE_PCI_VENDOR_ID_VMWARE,
-VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
-QEMU_VIDEO_VMWARE_SVGA,
-L"QEMU VMWare SVGA"
 },{
 0 /* end of list */
 }
@@ -264,7 +256,6 @@ QemuVideoControllerDriverStart (
 goto ClosePciIo;
   }
   Private->Variant = Card->Variant;
-  Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
 
   //
   // IsQxl is based on the detected Card->Variant, which at a later point might
@@ -339,58 +330,6 @@ QemuVideoControllerDriverStart (
 }
   }
 
-  //
-  // Check if accessing Vmware SVGA interface works
-  //
-  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
-EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *IoDesc;
-UINT32TargetId;
-UINT32SvgaIdRead;
-
-IoDesc = NULL;
-Status = Private->PciIo->GetBarAttributes (
-   Private->PciIo,
-   PCI_BAR_IDX0,
-   NULL,
-   (VOID**) 
-   );
-if (EFI_ERROR (Status) ||
-IoDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_IO ||
-IoDesc->AddrRangeMin > MAX_UINT16 + 1 - (VMWARE_SVGA_VALUE_PORT + 4)) {
-  if (IoDesc != NULL) {
-FreePool (IoDesc);
-  }
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-Private->VmwareSvgaBasePort = (UINT16) IoDesc->AddrRangeMin;
-FreePool (IoDesc);
-
-TargetId = VMWARE_SVGA_ID_2;
-while (TRUE) {
-  VmwareSvgaWrite (Private, VmwareSvgaRegId, TargetId);
-  SvgaIdRead = VmwareSvgaRead (Private, VmwareSvgaRegId);
-  if ((SvgaIdRead == TargetId) || (TargetId <= VMWARE_SVGA_ID_0)) {
-break;
-  }
-  TargetId--;
-}
-
-if (SvgaIdRead != TargetId) {
-  DEBUG ((
-DEBUG_ERROR,
-"QemuVideo: QEMU_VIDEO_VMWARE_SVGA ID mismatch "
-"(got 0x%x, base address 0x%x)\n",
-SvgaIdRead,
-Private->VmwareSvgaBasePort
-));
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-
-Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
-  }
-
   //
   // Get ParentDevicePath
   //
@@ -446,9 +385,6 @@ QemuVideoControllerDriverStart (
   case QEMU_VIDEO_BOCHS:
 Status = QemuVideoBochsModeSetup (Private, IsQxl);
 break;
-  case QEMU_VIDEO_VMWARE_SVGA:
-Status = QemuVideoVmwareSvgaModeSetup (Private);
-break;
   default:
 ASSERT (FALSE);
 Status = EFI_DEVICE_ERROR;
@@ -510,9 +446,6 @@ DestructQemuVideoGraphics:
 
 FreeModeData:
   FreePool (Private->ModeData);
-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
 
 UninstallGopDevicePath:
   gBS->UninstallProtocolInterface (Private->Handle,
@@ -634,9 +567,6 @@ QemuVideoControllerDriverStop (
 );
 
   FreePool (Private->ModeData);
-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
   gBS->UninstallProtocolInterface (Private->Handle,
  , Private->GopDevicePath);
   FreePool (Private->GopDevicePath);
@@ -834,7 +764,7 @@ ClearScreen (
   Private->PciIo->Mem.Write (
 Private->PciIo,
 EfiPciIoWidthFillUint32,
-Private->FrameBufferVramBarIndex,
+0,
 0,
 0x40 >> 2,
 
@@ -971,38 +901,6 @@ BochsRead (
   return Data;
 }
 

[edk2] [PATCH v2 4/5] Revert "OvmfPkg: VMWare SVGA display device register definitions"

2018-11-01 Thread yuchenlin via edk2-devel
From: yuchenlin 

This reverts commit 9bcca53fe466cdff397578328d9d87d257aba493.

We reverted VMWare SVGA driver. We don't need these definitions too.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
 OvmfPkg/Include/IndustryStandard/VmwareSvga.h | 104 --
 1 file changed, 104 deletions(-)
 delete mode 100644 OvmfPkg/Include/IndustryStandard/VmwareSvga.h

diff --git a/OvmfPkg/Include/IndustryStandard/VmwareSvga.h 
b/OvmfPkg/Include/IndustryStandard/VmwareSvga.h
deleted file mode 100644
index 693d44bab6..00
--- a/OvmfPkg/Include/IndustryStandard/VmwareSvga.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file
-
-  Macro and enum definitions of a subset of port numbers, register identifiers
-  and values required for driving the VMWare SVGA virtual display adapter,
-  also implemented by Qemu.
-
-  This file's contents was extracted from file lib/vmware/svga_reg.h in commit
-  329dd537456f93a806841ec8a8213aed11395def of VMWare's vmware-svga repository:
-  git://git.code.sf.net/p/vmware-svga/git
-
-
-  Copyright 1998-2009 VMware, Inc.  All rights reserved.
-  Portions Copyright 2017 Phil Dennis-Jordan 
-
-  Permission is hereby granted, free of charge, to any person
-  obtaining a copy of this software and associated documentation
-  files (the "Software"), to deal in the Software without
-  restriction, including without limitation the rights to use, copy,
-  modify, merge, publish, distribute, sublicense, and/or sell copies
-  of the Software, and to permit persons to whom the Software is
-  furnished to do so, subject to the following conditions:
-
-  The above copyright notice and this permission notice shall be
-  included in all copies or substantial portions of the Software.
-
-  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
-  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-  SOFTWARE.
-
-**/
-
-#ifndef _VMWARE_SVGA_H_
-#define _VMWARE_SVGA_H_
-
-#include 
-
-//
-// IDs for recognising the device
-//
-#define VMWARE_PCI_VENDOR_ID_VMWARE0x15AD
-#define VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2  0x0405
-
-//
-// I/O port BAR offsets for register selection and read/write.
-//
-// The register index is written to the 32-bit index port, followed by a 32-bit
-// read or write on the value port to read or set that register's contents.
-//
-#define VMWARE_SVGA_INDEX_PORT 0x0
-#define VMWARE_SVGA_VALUE_PORT 0x1
-
-//
-// Some of the device's register indices for basic framebuffer functionality.
-//
-typedef enum {
-  VmwareSvgaRegId = 0,
-  VmwareSvgaRegEnable = 1,
-  VmwareSvgaRegWidth = 2,
-  VmwareSvgaRegHeight = 3,
-  VmwareSvgaRegMaxWidth = 4,
-  VmwareSvgaRegMaxHeight = 5,
-
-  VmwareSvgaRegBitsPerPixel = 7,
-
-  VmwareSvgaRegRedMask = 9,
-  VmwareSvgaRegGreenMask = 10,
-  VmwareSvgaRegBlueMask = 11,
-  VmwareSvgaRegBytesPerLine = 12,
-
-  VmwareSvgaRegFbOffset = 14,
-
-  VmwareSvgaRegFbSize = 16,
-  VmwareSvgaRegCapabilities = 17,
-
-  VmwareSvgaRegHostBitsPerPixel = 28,
-} VMWARE_SVGA_REGISTER;
-
-//
-// Values used with VmwareSvgaRegId for sanity-checking the device and getting
-// its version.
-//
-#define VMWARE_SVGA_MAGIC  0x90U
-#define VMWARE_SVGA_MAKE_ID(ver)   (VMWARE_SVGA_MAGIC << 8 | (ver))
-
-#define VMWARE_SVGA_VERSION_2  2
-#define VMWARE_SVGA_ID_2   VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_2)
-
-#define VMWARE_SVGA_VERSION_1  1
-#define VMWARE_SVGA_ID_1   VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_1)
-
-#define VMWARE_SVGA_VERSION_0  0
-#define VMWARE_SVGA_ID_0   VMWARE_SVGA_MAKE_ID (VMWARE_SVGA_VERSION_0)
-
-//
-// One of the capability bits advertised by VmwareSvgaRegCapabilities.
-//
-#define VMWARE_SVGA_CAP_8BIT_EMULATION BIT8
-
-#endif
-- 
2.18.0

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


[edk2] [PATCH v2 1/5] Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF file"

2018-11-01 Thread yuchenlin via edk2-devel
From: yuchenlin 

This reverts commit b2959e9f1a57279506ca46d56bc424fd7fa6b62a.

The VMWare SVGA display device implemented by Qemu (-vga vmware) uses
an I/O-type BAR which is laid out such that some register offsets are
not aligned to the read/write width with which they are expected to be
accessed. However, we will revert the initialization of VMWare SVGA
device later, we don't need such unaligned I/O.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
 OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf 
b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
index a04ed537dd..895e6b8dbd 100644
--- a/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
+++ b/OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
@@ -39,7 +39,6 @@
   Gop.c
   Initialize.c
   Qemu.h
-  UnalignedIoInternal.h
 
 [Sources.Ia32, Sources.X64]
   UnalignedIoGcc.c| GCC
-- 
2.18.0

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


[edk2] [PATCH] UnixPkg: Remove UnixPkg and update Maintainers.txt

2018-11-01 Thread Shenglei Zhang
UnixPkg is deprecated.
The same functionality is supported using the EmulatorPkg.
Please see EmulatorPkg/README for more information about
EmulatorPkg.
https://bugzilla.tianocore.org/show_bug.cgi?id=1291

Cc: Andrew Fish 
Cc: Laszlo Ersek 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Shenglei Zhang 
---
 Maintainers.txt| 4 
 UnixPkg/Deprecated.txt | 5 -
 2 files changed, 9 deletions(-)
 delete mode 100644 UnixPkg/Deprecated.txt

diff --git a/Maintainers.txt b/Maintainers.txt
index 36c6689afd..b127caf6b6 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -261,10 +261,6 @@ W: 
https://github.com/tianocore/tianocore.github.io/wiki/UefiCpuPkg
 M: Eric Dong 
 R: Laszlo Ersek 
 
-UnixPkg
-W: https://github.com/tianocore/tianocore.github.io/wiki/UnixPkg
-S: Obsolete (Use EmulatorPkg instead)
-
 Vlv2DeviceRefCodePkg
 M: David Wei 
 M: Mang Guo 
diff --git a/UnixPkg/Deprecated.txt b/UnixPkg/Deprecated.txt
deleted file mode 100644
index 5ffad5fd25..00
--- a/UnixPkg/Deprecated.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-UnixPkg is deprecated.
-
-The same functionality is supported using the EmulatorPkg.
-Please see EmulatorPkg/README for more information about EmulatorPkg.
-
-- 
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 v3 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Feng, Bob C
Reviewed-by: Bob C Feng  


Thanks,
Bob

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] 
Sent: Friday, November 2, 2018 10:02 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: [edk2] [PATCH v3 1/1] BaseTools: Explicitly close files after readlines

From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time, which may be 
a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  3 ++-  
BaseTools/Source/Python/Workspace/MetaFileParser.py | 16 
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..69f0bc8ee9 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,8 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+with open(self._FilePath, "r", 0) as File:
+FileLinesList = File.readlines()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..1cbed6e693 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,8 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +918,8 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1431,12 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+try:
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
+except:
+EdkLogger.error("Parser", FILE_READ_FAILURE, 
+ ExtraData=self.MetaFile)
+
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII, @@ -1727,7 +1734,8 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
--
2.18.0.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 0/4] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-01 Thread yuchenlin via edk2-devel

On 2018-11-02 03:02, Philippe Mathieu-Daudé wrote:

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

In this series, replace the original vmsvga driver to Bochs
interface.


This is the 'v2' of your previous patch 'OvmfPkg: initialize bochs
when initializing vmsvga':
https://lists.01.org/pipermail/edk2-devel/2018-October/031235.html

Keeping different versions and referencing previous series helps when 
reviewing.




Sorry for that.
I will add v2 (or v3?) next time.

Thanks,
yuchenlin



Simply revert vmsvga driver implementation. After it, use Bochs
interface for initializing vmsvga.

Because of the PCI BARs difference between std vga and vmsvga.
We can not simply recognize the "QEMU VMWare SVGA" as the
QEMU_VIDEO_BOCHS_MMIO variant.

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

To overcome this problem, we remain variant QEMU_VIDEO_VMWARE_SVGA,
and use it for:

(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO

We have tested on qemu before and after commit 104bd1dc70 and all 
worked.


Did you also test against QEMU v2.9.1?



No, but I tested it in QEMU v2.9.0.

Thanks,
yuchenlin



Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 

yuchenlin (4):
   Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
   Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port
 I/O."
   Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the 
INF

 file"
   OvmfPkg: simply use the Bochs interface for vmsvga

  OvmfPkg/QemuVideoDxe/Driver.c | 137 ++-
  OvmfPkg/QemuVideoDxe/Gop.c|  68 +---
  OvmfPkg/QemuVideoDxe/Initialize.c | 157 
--

  OvmfPkg/QemuVideoDxe/Qemu.h   |  27 ---
  OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf |   7 -
  OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c |  70 
  OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c |  80 -
  OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h|  59 ---
  OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c |  78 -
  OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c |  66 
  10 files changed, 17 insertions(+), 732 deletions(-)
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c



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


Re: [edk2] [PATCH 1/4] Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

2018-11-01 Thread yuchenlin via edk2-devel

On 2018-11-02 02:58, Philippe Mathieu-Daudé wrote:

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2.


Can we have a comment here about why we need to revert this patch?
(same for patches 2 and 3).



Will do

Thanks,
yuchenlin



Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
  OvmfPkg/QemuVideoDxe/Driver.c | 135 +
  OvmfPkg/QemuVideoDxe/Gop.c|  65 +
  OvmfPkg/QemuVideoDxe/Initialize.c | 157 
--

  OvmfPkg/QemuVideoDxe/Qemu.h   |  29 --
  4 files changed, 7 insertions(+), 379 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c 
b/OvmfPkg/QemuVideoDxe/Driver.c

index 73eb2cad05..2304afd1e6 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -14,10 +14,8 @@
**/
  -#include 
-#include 
  #include "Qemu.h"
-#include "UnalignedIoInternal.h"
+#include 
EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {
QemuVideoControllerDriverSupported,
@@ -71,12 +69,6 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
  0x1050,
  QEMU_VIDEO_BOCHS_MMIO,
  L"QEMU VirtIO VGA"
-},{
-PCI_CLASS_DISPLAY_VGA,
-VMWARE_PCI_VENDOR_ID_VMWARE,
-VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
-QEMU_VIDEO_VMWARE_SVGA,
-L"QEMU VMWare SVGA"
  },{
  0 /* end of list */
  }
@@ -264,7 +256,6 @@ QemuVideoControllerDriverStart (
  goto ClosePciIo;
}
Private->Variant = Card->Variant;
-  Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
  //
// IsQxl is based on the detected Card->Variant, which at a later 
point might

@@ -339,58 +330,6 @@ QemuVideoControllerDriverStart (
  }
}
  -  //
-  // Check if accessing Vmware SVGA interface works
-  //
-  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
-EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *IoDesc;
-UINT32TargetId;
-UINT32SvgaIdRead;
-
-IoDesc = NULL;
-Status = Private->PciIo->GetBarAttributes (
-   Private->PciIo,
-   PCI_BAR_IDX0,
-   NULL,
-   (VOID**) 
-   );
-if (EFI_ERROR (Status) ||
-IoDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_IO ||
-IoDesc->AddrRangeMin > MAX_UINT16 + 1 - 
(VMWARE_SVGA_VALUE_PORT + 4)) {

-  if (IoDesc != NULL) {
-FreePool (IoDesc);
-  }
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-Private->VmwareSvgaBasePort = (UINT16) IoDesc->AddrRangeMin;
-FreePool (IoDesc);
-
-TargetId = VMWARE_SVGA_ID_2;
-while (TRUE) {
-  VmwareSvgaWrite (Private, VmwareSvgaRegId, TargetId);
-  SvgaIdRead = VmwareSvgaRead (Private, VmwareSvgaRegId);
-  if ((SvgaIdRead == TargetId) || (TargetId <= VMWARE_SVGA_ID_0)) 
{

-break;
-  }
-  TargetId--;
-}
-
-if (SvgaIdRead != TargetId) {
-  DEBUG ((
-DEBUG_ERROR,
-"QemuVideo: QEMU_VIDEO_VMWARE_SVGA ID mismatch "
-"(got 0x%x, base address 0x%x)\n",
-SvgaIdRead,
-Private->VmwareSvgaBasePort
-));
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-
-Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
-  }
-
//
// Get ParentDevicePath
//
@@ -446,9 +385,6 @@ QemuVideoControllerDriverStart (
case QEMU_VIDEO_BOCHS:
  Status = QemuVideoBochsModeSetup (Private, IsQxl);
  break;
-  case QEMU_VIDEO_VMWARE_SVGA:
-Status = QemuVideoVmwareSvgaModeSetup (Private);
-break;
default:
  ASSERT (FALSE);
  Status = EFI_DEVICE_ERROR;
@@ -510,9 +446,6 @@ DestructQemuVideoGraphics:
FreeModeData:
FreePool (Private->ModeData);
-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
UninstallGopDevicePath:
gBS->UninstallProtocolInterface (Private->Handle,
@@ -634,9 +567,6 @@ QemuVideoControllerDriverStop (
  );
  FreePool (Private->ModeData);
-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
gBS->UninstallProtocolInterface (Private->Handle,
   , Private->GopDevicePath);
FreePool (Private->GopDevicePath);
@@ -834,7 +764,7 @@ ClearScreen (
Private->PciIo->Mem.Write (
  Private->PciIo,
  EfiPciIoWidthFillUint32,
-Private->FrameBufferVramBarIndex,
+0,
  0,
  0x40 >> 2,
  
@@ -971,38 +901,6 @@ BochsRead (
return Data;
  }
  -VOID
-VmwareSvgaWrite (
-  QEMU_VIDEO_PRIVATE_DATA   *Private,
-  UINT16Register,
-  UINT32Value
-  )
-{
-  UnalignedIoWrite32 (
-

Re: [edk2] [PATCH 4/4] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-01 Thread yuchenlin via edk2-devel

On 2018-11-02 02:54, Philippe Mathieu-Daudé wrote:

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

Because of the PCI BARs difference between std vga and
vmsvga, we can not simply recognize the "QEMU VMWare SVGA"
as the QEMU_VIDEO_BOCHS_MMIO variant.

Instead, we remain variant QEMU_VIDEO_VMWARE_SVGA, and use
it for:

(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
  OvmfPkg/QemuVideoDxe/Driver.c | 16 +++-
  OvmfPkg/QemuVideoDxe/Gop.c|  3 ++-
  OvmfPkg/QemuVideoDxe/Qemu.h   |  2 ++
  3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c 
b/OvmfPkg/QemuVideoDxe/Driver.c

index 2304afd1e6..a1785c2285 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -16,6 +16,7 @@
#include "Qemu.h"
  #include 
+#include 
EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {
QemuVideoControllerDriverSupported,
@@ -69,6 +70,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
  0x1050,
  QEMU_VIDEO_BOCHS_MMIO,
  L"QEMU VirtIO VGA"
+},{
+PCI_CLASS_DISPLAY_VGA,
+VMWARE_PCI_VENDOR_ID_VMWARE,
+VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
+QEMU_VIDEO_VMWARE_SVGA,
+L"QEMU VMWare SVGA"


Looks OK.


  },{
  0 /* end of list */
  }
@@ -256,6 +263,11 @@ QemuVideoControllerDriverStart (
  goto ClosePciIo;
}
Private->Variant = Card->Variant;
+  Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
+  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
+Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;


OK, but why not use an 'else' clause?


Will do

Thanks,
yuchenlin




+  }
+
  //
// IsQxl is based on the detected Card->Variant, which at a later 
point might

@@ -320,7 +332,8 @@ QemuVideoControllerDriverStart (
// Check if accessing the bochs interface works.
//
if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO ||
-  Private->Variant == QEMU_VIDEO_BOCHS) {
+  Private->Variant == QEMU_VIDEO_BOCHS ||
+  Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
  UINT16 BochsId;
  BochsId = BochsRead(Private, VBE_DISPI_INDEX_ID);
  if ((BochsId & 0xFFF0) != VBE_DISPI_ID0) {
@@ -383,6 +396,7 @@ QemuVideoControllerDriverStart (
  break;
case QEMU_VIDEO_BOCHS_MMIO:
case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
  Status = QemuVideoBochsModeSetup (Private, IsQxl);
  break;
default:
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index d490fa7a2e..3abc5eeb36 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -60,7 +60,7 @@ QemuVideoCompleteModeData (
  Private->PciIo->GetBarAttributes (
  Private->PciIo,
-0,
+Private->FrameBufferVramBarIndex,


OK


  NULL,
  (VOID**) 
  );
@@ -177,6 +177,7 @@ Routine Description:
  break;
case QEMU_VIDEO_BOCHS_MMIO:
case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
  InitializeBochsGraphicsMode (Private, 
[ModeData->InternalModeIndex]);

  break;
default:
diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h
index d7da761705..3aac9eeca6 100644
--- a/OvmfPkg/QemuVideoDxe/Qemu.h
+++ b/OvmfPkg/QemuVideoDxe/Qemu.h
@@ -92,6 +92,7 @@ typedef enum {
QEMU_VIDEO_CIRRUS_5446,
QEMU_VIDEO_BOCHS,
QEMU_VIDEO_BOCHS_MMIO,
+  QEMU_VIDEO_VMWARE_SVGA,
  } QEMU_VIDEO_VARIANT;
typedef struct {
@@ -120,6 +121,7 @@ typedef struct {
QEMU_VIDEO_VARIANTVariant;
FRAME_BUFFER_CONFIGURE*FrameBufferBltConfigure;
UINTN FrameBufferBltConfigureSize;
+  UINT8 FrameBufferVramBarIndex;
  } QEMU_VIDEO_PRIVATE_DATA;
///



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


[edk2] [PATCH v3 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Michael Johnson
From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time,
which may be a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  3 ++-
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 16 
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..69f0bc8ee9 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,8 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+with open(self._FilePath, "r", 0) as File:
+FileLinesList = File.readlines()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..1cbed6e693 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,8 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +918,8 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1431,12 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+try:
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
+except:
+EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
+
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII,
@@ -1727,7 +1734,8 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
-- 
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] BaseTools: Use common cc flag for building PcdValueInit.

2018-11-01 Thread Gao, Liming
Bob:
  I find this patch can't handle below case to retrieve the common option. 
Please help check it. 

[BuildOptions]
  MSFT:*_*_IA32_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES /DDEF_IA32
  MSFT:*_*_X64_CC_FLAGS  = /DDEF_X64 /D DISABLE_NEW_DEPRECATED_INTERFACES

Thanks
Liming
>-Original Message-
>From: Feng, Bob C
>Sent: Thursday, November 01, 2018 11:18 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Use common cc flag for building PcdValueInit.
>
>Use common cc flags for building PcdValueInit. The common
>cc flags include the cc flag which is under common Arch and
>under all build Arches.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> .../Source/Python/Workspace/DscBuildData.py   | 48 +--
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
>diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py
>b/BaseTools/Source/Python/Workspace/DscBuildData.py
>index 6d596b2b54..4807fff489 100644
>--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
>+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
>@@ -2298,38 +2298,38 @@ class DscBuildData(PlatformBuildClassObject):
> if Family and Family != self.ToolChainFamily:
> continue
> Target, Tag, Arch, Tool, Attr = Options[1].split("_")
> if Tool != 'CC':
> continue
>-
>+if Attr != "FLAGS":
>+continue
> if Target == "*" or Target == self._Target:
> if Tag == "*" or Tag == self._Toolchain:
>+if 'COMMON' not in BuildOptions:
>+BuildOptions['COMMON'] = set()
> if Arch == "*":
>-if Tool not in BuildOptions:
>-BuildOptions[Tool] = OrderedDict()
>-if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
>or
>self.BuildOptions[Options].startswith('='):
>-BuildOptions[Tool][Attr] = 
>self.BuildOptions[Options]
>-else:
>-# append options for the same tool except PATH
>-if Attr != 'PATH':
>-BuildOptions[Tool][Attr] += " " + 
>self.BuildOptions[Options]
>-else:
>-BuildOptions[Tool][Attr] = 
>self.BuildOptions[Options]
>+BuildOptions['COMMON'].add(self.BuildOptions[Options])
>+if Arch in self.SupArchList:
>+if Arch not in BuildOptions:
>+BuildOptions[Arch] = set()
>+BuildOptions[Arch].add(self.BuildOptions[Options])
>+
> if BuildOptions:
>-for Tool in BuildOptions:
>-for Attr in BuildOptions[Tool]:
>-if Attr == "FLAGS":
>-Value = BuildOptions[Tool][Attr]
>-ValueList = Value.split()
>-if ValueList:
>-for Id, Item in enumerate(ValueList):
>-if Item in ['-D', '/D', '-U', '/U']:
>-CC_FLAGS += ' ' + Item
>-if Id + 1 < len(ValueList):
>-CC_FLAGS += ' ' + ValueList[Id + 1]
>-elif Item.startswith(('-D', '/D', '-U', 
>'/U')):
>-CC_FLAGS += ' ' + Item
>+ArchBuildOptions = {arch:flags for arch,flags in 
>BuildOptions.items() if
>arch != 'COMMON'}
>+if len(ArchBuildOptions.keys()) == 1:
>+BuildOptions['COMMON'] |= (ArchBuildOptions.values()[0])
>+else:
>+CommonBuildOptions = reduce(lambda x,y: x,
>ArchBuildOptions.values())
>+BuildOptions['COMMON'] |= CommonBuildOptions
>+ValueList = list(BuildOptions['COMMON'])
>+for Id, Item in enumerate(ValueList):
>+if Item in ['-D', '/D', '-U', '/U']:
>+CC_FLAGS += ' ' + Item
>+if Id + 1 < len(ValueList):
>+CC_FLAGS += ' ' + ValueList[Id + 1]
>+elif Item.startswith(('-D', '/D', '-U', '/U')):
>+CC_FLAGS += ' ' + Item
> MakeApp += CC_FLAGS
>
> if sys.platform == "win32":
> MakeApp = MakeApp + PcdMakefileEnd
> MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION)
>$(APPFILE) /y """)
>--
>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 edk2-platforms 05/27] Silicon/NXP: Add UART library support for i.MX platforms

2018-11-01 Thread Chris Co via edk2-devel
Hi Leif,

> -Original Message-
> From: Leif Lindholm 
> Sent: Thursday, November 1, 2018 2:00 AM
> To: Chris Co 
> Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> Michael D Kinney 
> Subject: Re: [PATCH edk2-platforms 05/27] Silicon/NXP: Add UART library
> support for i.MX platforms
> 
> On Fri, Sep 21, 2018 at 08:25:56AM +, Chris Co wrote:
> > This adds support for interact with the UART controller on NXP i.MX
> > platforms.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Christopher Co 
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > ---
> > +
> > +**/
> > +RETURN_STATUS
> > +EFIAPI
> > +SerialPortInitialize (
> > +  VOID
> > +  )
> > +{
> > +  MX6UART_REGISTERS   *UartBase;
> > +  UINT32  Ucr1;
> 
> ... once we create variables to hold data from those registers, those 
> variables
> should really be FullyCompliantCamelCase.
> But really, something like this could just be "Data" or "Value" or something
> like that. Or if you want a bit more, "ControlRegister".
> 
> Not going to comment on each function, but the pattern repeats throughout
> the file.
> 
Noted. I'll change variable names throughout all of the files.

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


Re: [edk2] [Patch] BaseTools: Add checking to EFI variable attribute.

2018-11-01 Thread Gao, Liming
Reviewed-by: Liming Gao 

>-Original Message-
>From: Feng, Bob C
>Sent: Thursday, November 01, 2018 11:07 PM
>To: edk2-devel@lists.01.org
>Cc: Feng, Bob C ; Gao, Liming 
>Subject: [Patch] BaseTools: Add checking to EFI variable attribute.
>
>This patch is going to add a check that only if the
>attribute of a EFI variable include 'NV', it will be
>added into PcdNvStoreDefaultValueBuffer.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Bob Feng 
>Cc: Liming Gao 
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py | 2 ++
> 1 file changed, 2 insertions(+)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 9c3759c0f5..a1c8dc7efb 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -1163,10 +1163,12 @@ class PlatformAutoGen(AutoGen):
> Sku = Pcd.SkuInfoList[SkuName]
> SkuId = Sku.SkuId
> if SkuId is None or SkuId == '':
> continue
> if len(Sku.VariableName) > 0:
>+if Sku.VariableAttribute and 'NV' not in 
>Sku.VariableAttribute:
>+continue
> VariableGuidStructure = Sku.VariableGuidValue
> VariableGuid =
>GuidStructureStringToGuidString(VariableGuidStructure)
> for StorageName in Sku.DefaultStoreDict:
> VariableInfo.append_variable(var_info(Index, pcdname,
>StorageName, SkuName, StringToArray(Sku.VariableName), VariableGuid,
>Sku.VariableOffset, Sku.VariableAttribute, Sku.HiiDefaultValue,
>Sku.DefaultStoreDict[StorageName] if Pcd.DatumType in
>TAB_PCD_NUMERIC_TYPES else
>StringToArray(Sku.DefaultStoreDict[StorageName]), Pcd.DatumType,
>Pcd.CustomAttribute['DscPosition'], Pcd.CustomAttribute.get('IsStru',False)))
> Index += 1
>--
>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 v2 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Feng, Bob C
Thanks, this patch looks good. 
A minor comment that for the following part, would you please move the with 
block into a try... except block?

def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()


Thanks,
Bob

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] 
Sent: Friday, November 2, 2018 9:13 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: [edk2] [PATCH v2 1/1] BaseTools: Explicitly close files after readlines

From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time, which may be 
a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  3 ++-  
BaseTools/Source/Python/Workspace/MetaFileParser.py | 12 
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..69f0bc8ee9 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,8 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+with open(self._FilePath, "r", 0) as File:
+FileLinesList = File.readlines()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..374886b8b6 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,8 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +918,8 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1431,8 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII, @@ -1727,7 +1730,8 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
--
2.18.0.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 2/6] IntelFrameworkModulePkg: fix build for AARCH64/ARM

2018-11-01 Thread Gao, Liming
Leif:
  There is one mistake in comments  >+  #^M. Could you clean it? With this 
change, Reviewed-by: Liming Gao . 

  Besides, have you verified  AARCH64 GCC build? 

Thanks
Liming
>-Original Message-
>From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
>Sent: Thursday, November 01, 2018 11:37 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming 
>Subject: [PATCH 2/6] IntelFrameworkModulePkg: fix build for AARCH64/ARM
>
>Contrary to what the name suggests, some modules in this package are used
>on other architecture. ARM is already listed in SUPPORTED_ARCHITECTURES
>in the .dsc, but AARCH64 was never added.
>
>Add that, and force inclusion of CompilerIntrinsicsLib and
>BaseStackCheckLib for AARCH64/ARM to make the build successful.
>
>Cc: Liming Gao 
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Leif Lindholm 
>---
> IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 13
>-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
>diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
>b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
>index 894c5340a0..14bef5356e 100644
>--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
>+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
>@@ -25,7 +25,7 @@ [Defines]
>   PLATFORM_VERSION   = 0.96
>   DSC_SPECIFICATION  = 0x00010005
>   OUTPUT_DIRECTORY   = Build/IntelFrameworkModuleAll
>-  SUPPORTED_ARCHITECTURES= IA32|X64|EBC|ARM
>+  SUPPORTED_ARCHITECTURES= IA32|X64|EBC|ARM|AARCH64
>   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
>   SKUID_IDENTIFIER   = DEFAULT
>
>@@ -76,6 +76,17 @@ [LibraryClasses]
>   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
>   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
>
>+[LibraryClasses.ARM, LibraryClasses.AARCH64]
>+  #
>+  # It is not possible to prevent the ARM compiler for generic intrinsic
>functions.
>+  # This library provides the instrinsic functions generate by a given 
>compiler.
>+  # And NULL mean link this library into all ARM images.
>+  #^M
>+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
>+
>+  # Add support for GCC stack protector
>+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
>+
> [LibraryClasses.common.PEIM]
>   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
>   PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>--
>2.11.0

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


Re: [edk2] [edk2-test][Patch v2] uefi-sct/SctPkg:Assign 0 to the tail of HwErrRecVariableName.

2018-11-01 Thread Jin, Eric
Supreeth,

Thank you for the reminder. I correct them in the commit. Thanks.

Best Regards
Eric

-Original Message-
From: Supreeth Venkatesh  
Sent: Friday, November 2, 2018 4:23 AM
To: Jin, Eric ; edk2-devel@lists.01.org
Subject: Re: [edk2-test][Patch v2] uefi-sct/SctPkg:Assign 0 to the tail of 
HwErrRecVariableName.


Reviewed-by: Supreeth Venkatesh 

There are some unintentional indentation changes in "switch" statement.
Please take care of that before (if intentional, ok as well) commit.

On Thu, 2018-11-01 at 10:52 +0800, Eric Jin wrote:
> Add definition of HwErrRecVariableNamePrefixLength, 
> HwErrRecVariableNameIndexLength and HwErrRecVariableNameLength Make 
> the HwErrRecVariableName as the valid string.
> Ensure the HwErrRecVariable could be deleted before the test exit.
> 
> Cc: Supreeth Venkatesh 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin 
> ---
>  .../BlackBoxTest/VariableServicesBBTestFunction.c  | 38
> +-
>  .../BlackBoxTest/VariableServicesBBTestMain.h  | 13 +++-
>  2 files changed, 35 insertions(+), 16 deletions(-)
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c b/uefi- 
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> index d1064ce..defe71a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>Copyright 2006 - 2012 Unified EFI, Inc.
> -  Copyright (c) 2010 - 2012, Intel Corporation. All rights 
> reserved.
> +  Copyright (c) 2010 - 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 @@ -2855,7 +2855,7 @@ HardwareErrorRecordFuncTest (
>UINT64RemainingVariableStorageSize;
>UINT64MaximumVariableSize;
>
> -  CHAR16HwErrRecVariableName[13];
> +  CHAR16HwErrRecVariableName[HwErrRecVariableNameLen
> gth];
>CHAR16HwErrRecVariable[] = L"This is a HwErrRec
> variable!";
>
>CHAR16GetVariableName[MAX_BUFFER_SIZE];
> @@ -2864,7 +2864,7 @@ HardwareErrorRecordFuncTest (
>
>UINTN Num;
>UINTN MaxNum = 0;
> -  CHAR16ErrorNum[5];
> +  CHAR16ErrorNum[HwErrRecVariableNameIndexLength+1];
>
>CHAR16HwErrRecGetVariable[255];
>
> @@ -2908,7 +2908,11 @@ HardwareErrorRecordFuncTest (
>}
>  
>//
> -  // Read reset record
> +  // Try to read reset record from the RecoveryData,  // and the 
> + magic num is saved in the RecoveryData[0].
> +  // When the status is EFI_SUCCESS and magic num is 2,  // it means 
> + useful data has been saved before the reset  // and the date should 
> + be retrived goto particular process
>//
>Status = RecoveryLib->ReadResetRecord (
>RecoveryLib, @@ -2916,12 +2920,12 @@ 
> HardwareErrorRecordFuncTest (
>RecoveryData
>);
>if ( !EFI_ERROR(Status) && (RecoveryDataSize > 0) ) {
> -  switch (RecoveryData[0]) {
> +switch (RecoveryData[0]) {
Is the indentation change intentional? It looked good to me earlier and is ok 
with edk2 C coding standards as well.
>case 2:
>  goto step2;
>default:
>  goto step3;
> -  }
> +}
Is the indentation change intentional? It looked good to me earlier and is ok 
with edk2 C coding standards as well.
>}
>
>//
> @@ -2978,7 +2982,7 @@ HardwareErrorRecordFuncTest (
>// Get a useable variable name
>//
>GetVariableName[0] = L'\0';
> -  ErrorNum[4] = L'\0';
> +  ErrorNum[HwErrRecVariableNameIndexLength] = L'\0';
>
>  
>while (TRUE) {
> @@ -3001,9 +3005,9 @@ HardwareErrorRecordFuncTest (
>break;
>  }
>  
> -if ( (SctStrnCmp (GetVariableName, L"HwErrRec", 8) == 0) &&
> +if ( (SctStrnCmp (GetVariableName, L"HwErrRec",
> HwErrRecVariableNamePrefixLength) == 0) &&
>   (SctCompareGuid (, ) == 0) ) {
> -  SctStrnCpy (ErrorNum, [8], 4);
> +  SctStrnCpy (ErrorNum,
> [HwErrRecVariableNamePrefixLength],
> HwErrRecVariableNameIndexLength);
>Num = SctXtoi (ErrorNum);
>if (MaxNum < Num)
>  MaxNum = Num;
> @@ -3014,7 +3018,8 @@ HardwareErrorRecordFuncTest (
>  
>HwErrRecVariableName[0] = L'\0';
>SctStrCat ( HwErrRecVariableName, L"HwErrRec" );
> -  Myitox( MaxNum, HwErrRecVariableName+8 );
> +  Myitox( MaxNum,
> HwErrRecVariableName+HwErrRecVariableNamePrefixLength );
> +  

Re: [edk2] [PATCH 1/1] MdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().

2018-11-01 Thread Gao, Liming
The change is good. Reviewed-by: Liming Gao 

>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>Marvin H?user
>Sent: Thursday, November 01, 2018 4:09 AM
>To: edk2-devel@lists.01.org
>Cc: Kinney, Michael D ; Gao, Liming
>
>Subject: [edk2] [PATCH 1/1] MdePkg/Base.h: Implement BASE_CR() via
>OFFSET_OF().
>
>Replace the current NULL pointer dereference to retrieve Field's
>offset with a call to OFFSET_OF().  This is implemented via
>__builtin_offsetof for GCC and Clang, which eliminates UB caught by
>Clang UndefinedBehaviorSanitizer.
>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Marvin Haeuser 
>---
> MdePkg/Include/Base.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
>index 523192fd79fc..bc877d8125a5 100644
>--- a/MdePkg/Include/Base.h
>+++ b/MdePkg/Include/Base.h
>@@ -869,7 +869,7 @@ typedef UINTN  *BASE_LIST;
>   @return  A pointer to the structure from one of it's elements.
>
> **/
>-#define BASE_CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) -
>(CHAR8 *) &(((TYPE *) 0)->Field)))
>+#define BASE_CR(Record, TYPE, Field)  ((TYPE *) ((CHAR8 *) (Record) -
>OFFSET_OF (TYPE, Field)))
>
> /**
>   Rounds a value up to the next boundary using a specified alignment.
>--
>2.19.1.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] MdeModulePkg: Remove the trailing space in three source files.

2018-11-01 Thread Zeng, Star
Reviewed-by: Star Zeng 

Thanks,
Star
-Original Message-
From: Gao, Liming 
Sent: Thursday, November 1, 2018 9:38 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [Patch] MdeModulePkg: Remove the trailing space in three source files.

The recent changes in these three source files introduce the trailing space.
This patch removes them to follow edk2 coding style.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c | 2 +-
 MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h| 2 +-
 MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c 
b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
index c31247a..513575d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
@@ -958,7 +958,7 @@ GetExpectedDescriptor (
   UINTN   Offset;
 
   //
-  // Total length is too small that cannot hold the single descriptor header 
plus data. 
+  // Total length is too small that cannot hold the single descriptor header 
plus data.
   //
   if (Length <= sizeof (USB_DESC_HEAD)) {
 DEBUG ((DEBUG_ERROR, "GetExpectedDescriptor: met mal-format descriptor, 
total length = %d!\n", Length)); diff --git 
a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h 
b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
index be2f8af..ad3afa6 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
@@ -129,7 +129,7 @@ struct _MTFTP4_PROTOCOL {
   // Record the total received and saved block number.
   //
   UINT64TotalBlock;
-  
+
   //
   // Record the acked block number.
   //
diff --git 
a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
index 7ccab57..30c955f 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.i
+++ nf
@@ -112,7 +112,7 @@
 
   # Oniguruma: tag_end in parse_callout_of_name
   GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
-  
+
   # Not add -Wno-error=maybe-uninitialized option for XCODE
   # XCODE doesn't know this option
   XCODE:*_*_*_CC_FLAGS =
--
2.10.0.windows.1

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


Re: [edk2] [PATCH 4/6] MdeModulePkg: drop DebugSupportDxe from AARCH64 components

2018-11-01 Thread Zeng, Star
Reviewed-by: Star Zeng 


Thanks,
Star
-Original Message-
From: Leif Lindholm [mailto:leif.lindh...@linaro.org] 
Sent: Thursday, November 1, 2018 11:37 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star ; Wang, Jian J 
Subject: [PATCH 4/6] MdeModulePkg: drop DebugSupportDxe from AARCH64 components

DebugSupportDxe.inf was listed in
[Components.IA32, Components.X64, Components.AARCH64], but the plumbing that 
would be required to actually build it does not exist.

Move the component to [Components.IA32, Components.X64] to permit build of 
MdeModulePkg.dsc on AARCH64.

Cc: Star Zeng 
Cc: Jian J Wang 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 MdeModulePkg/MdeModulePkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc 
index 2465d39fd7..942c70566b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -423,7 +423,6 @@ [Components]
 
 [Components.IA32, Components.X64, Components.AARCH64]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
   MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
   MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf
   MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
@@ -440,6 +439,7 @@ [Components.IA32, Components.X64, Components.Ebc]
   MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
 
 [Components.IA32, Components.X64]
+  MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
   MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.inf
   MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
   MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
--
2.11.0

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


[edk2] [PATCH v2 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Michael Johnson
From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time,
which may be a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  3 ++-
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 12 
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..69f0bc8ee9 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,8 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+with open(self._FilePath, "r", 0) as File:
+FileLinesList = File.readlines()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..374886b8b6 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,8 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +918,8 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1431,8 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII,
@@ -1727,7 +1730,8 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+with open(str(self.MetaFile), 'r') as File:
+Content = File.readlines()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
-- 
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 edk2-platforms 01/27] Platform/Microsoft: Add OpteeClientPkg dec

2018-11-01 Thread Chris Co via edk2-devel
Hi Sumit,

Our full OpteeClientPkg has:
- Our OpteeClientAPI implementation. I was monitoring the merge progress on 
OpteeLib and will look into moving over now that it is available.
- The fTPM and AuthVar TA binaries. In our current design, the TA binaries are 
loaded at runtime. We could host the binaries themselves elsewhere on the 
filesystem, but we do not want these binaries as early/pseudo TAs. Is there a 
plan for OpteeLib to support loading full TAs?
- We have two client drivers: a firmware TPM TA driver and an authenticated 
variable TA driver. These talk through the tee-supplicant to their respective 
TAs.

Chris

> -Original Message-
> From: Sumit Garg 
> Sent: Thursday, November 1, 2018 3:55 AM
> To: Chris Co ; Leif Lindholm
> 
> Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> Michael D Kinney 
> Subject: Re: [PATCH edk2-platforms 01/27] Platform/Microsoft: Add
> OpteeClientPkg dec
> 
> Hi Christopher,
> 
> Optee Client library has recently been merged to edk2 source code. It tries to
> provide a generic interface [1] to OP-TEE based trusted applications
> (pseudo/early).
> 
> AFAIK, you don't need any platform specific hook in client interface to work
> with upstream OP-TEE. So instead you should use Optee library.
> 
> [1]
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.c
> om%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FArmPkg%2FInclude%2FLibrary
> %2FOpteeLib.hdata=02%7C01%7CChristopher.Co%40microsoft.com%7C
> c19b84ef7f8f4213424108d63fe88f66%7C72f988bf86f141af91ab2d7cd011db47
> %7C1%7C0%7C63675404786500sdata=m24akbKtoyCERVN77meoSU
> H6E%2Bpf8W2P5MF7nvU5y7I%3Dreserved=0
> 
> Regards,
> Sumit
> 
> On Thu, 1 Nov 2018 at 02:13, Leif Lindholm  wrote:
> >
> > +Sumit (just to loop you two together). Is there anything Microsoft
> > platform specific about what will go in here?
> >
> > /
> > Leif
> >
> > On Fri, Sep 21, 2018 at 08:25:53AM +, Chris Co wrote:
> > > On Windows IoT Core devices with ARM TrustZone capabilities,
> > > EDK2 runs in normal world and we use OP-TEE to execute secure world
> > > operations. The overall package will contain client-side support to
> > > invoke EDK2 services implemented as OP-TEE trusted applications that
> > > run in secure world.
> > >
> > > This commit adds the initial dec file to add some PCD settings
> > > needed by other packages.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Christopher Co 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Michael D Kinney 
> > > ---
> > >  Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec | 49
> > > 
> > >  1 file changed, 49 insertions(+)
> > >
> > > diff --git a/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > new file mode 100644
> > > index ..4752eab39ce3
> > > --- /dev/null
> > > +++ b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > > @@ -0,0 +1,49 @@
> > > +## @file
> > > +#
> > > +#  OP-TEE client package
> > > +#
> > > +#  OP-TEE client package contains the client-side interface to invoke OP-
> TEE TAs.
> > > +#  Certain EDKII services are implemented in Trusted Applications
> > > +running in #  the secure world OP-TEE OS.
> > > +#
> > > +#  Copyright (c) 2018 Microsoft 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 #
> > > +https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fope
> > > +nsource.org%2Flicenses%2Fbsd-
> license.phpdata=02%7C01%7CChristo
> > >
> +pher.Co%40microsoft.com%7Cc19b84ef7f8f4213424108d63fe88f66%7C72f988
> > >
> +bf86f141af91ab2d7cd011db47%7C1%7C0%7C63675404786500sda
> ta=1
> > > +MxFvlsMPhk19grEexBXo5VqRd0jZaCSRjxZCi87A2w%3Dreserved=0
> > > +#
> > > +#  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  = 0x0001001A
> > > +  PACKAGE_NAME   = OpteeClientPkg
> > > +  PACKAGE_GUID   = 77416fcb-10ec-4693-bdc0-1bdd74ec9595
> > > +  PACKAGE_VERSION= 0.01
> > > +
> > > +[Includes]
> > > +
> > > +[LibraryClasses]
> > > +
> > > +[Guids]
> > > +  gOpteeClientPkgTokenSpaceGuid   = { 0x04ad34ca, 0xdd25, 0x4156, {
> 0x90, 0xf5, 0x16, 0xf9, 0x40, 0xd0, 0x49, 0xe3 }}
> > > +
> > > +[PcdsFixedAtBuild]
> > > +
> > >
> +gOpteeClientPkgTokenSpaceGuid.PcdTpm2AcpiBufferBase|0|UINT64|0x
> > > +0005
> > > +
> > >
> +gOpteeClientPkgTokenSpaceGuid.PcdTpm2AcpiBufferSize|0|UINT32|0x
> > > +0006
> > > +
> > > +  ## The base address of the Trust Zone OpTEE OS private memory
> > > + region  # This memory is manager 

Re: [edk2] [PATCH v1 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Feng, Bob C
Hi Michael,

For the file operation, I would suggest to use with statement. with statement 
will automatically close the file after the nested block of code. The advantage 
of using a with statement is that it is guaranteed to close the file no matter 
how the nested block exits.

For example
 try:
with open(self._FilePath, "r", 0) as File
   FileLinesList = File.readlines()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)

Thanks,
Bob

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] 
Sent: Friday, November 2, 2018 7:35 AM
To: edk2-devel@lists.01.org
Cc: Gao, Liming 
Subject: [edk2] [PATCH v1 1/1] BaseTools: Explicitly close files after readlines

From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time, which may be 
a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  4 +++-  
BaseTools/Source/Python/Workspace/MetaFileParser.py | 16 
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..b186984101 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,9 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+File = open(self._FilePath, "r", 0)
+FileLinesList = File.readlines()
+File.close()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..9a795315d1 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,9 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close ()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +919,9 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1433,9 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII, @@ -1727,7 +1733,9 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
--
2.18.0.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] MdeModulePkg: Remove the trailing space in three source files.

2018-11-01 Thread Ni, Ruiyu
My fault! Thanks!
Reviewed-by: Ruiyu Ni 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Liming Gao
> Sent: Thursday, November 1, 2018 9:38 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: [edk2] [Patch] MdeModulePkg: Remove the trailing space in three
> source files.
> 
> The recent changes in these three source files introduce the trailing space.
> This patch removes them to follow edk2 coding style.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Liming Gao 
> Cc: Star Zeng 
> ---
>  MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c | 2 +-
>  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h| 2 +-
>  MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf | 2
> +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
> b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
> index c31247a..513575d 100644
> --- a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
> +++ b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
> @@ -958,7 +958,7 @@ GetExpectedDescriptor (
>UINTN   Offset;
> 
>//
> -  // Total length is too small that cannot hold the single descriptor header 
> plus
> data.
> +  // Total length is too small that cannot hold the single descriptor header 
> plus
> data.
>//
>if (Length <= sizeof (USB_DESC_HEAD)) {
>  DEBUG ((DEBUG_ERROR, "GetExpectedDescriptor: met mal-format
> descriptor, total length = %d!\n", Length)); diff --git
> a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
> b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
> index be2f8af..ad3afa6 100644
> --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
> +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
> @@ -129,7 +129,7 @@ struct _MTFTP4_PROTOCOL {
>// Record the total received and saved block number.
>//
>UINT64TotalBlock;
> -
> +
>//
>// Record the acked block number.
>//
> diff --git
> a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> index 7ccab57..30c955f 100644
> ---
> a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
> +++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.i
> +++ nf
> @@ -112,7 +112,7 @@
> 
># Oniguruma: tag_end in parse_callout_of_name
>GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
> -
> +
># Not add -Wno-error=maybe-uninitialized option for XCODE
># XCODE doesn't know this option
>XCODE:*_*_*_CC_FLAGS =
> --
> 2.10.0.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 5/6] SecurityPkg: fix package build on ARM

2018-11-01 Thread Yao, Jiewen
Reviewed-by: jiewen@intel.com

thank you!
Yao, Jiewen


> 在 2018年11月1日,下午11:36,Leif Lindholm  写道:
> 
> The CompilerIntrinsicsLib and BaseStackCheckLib need to be included in
> order for an ARM build of the package .dsc to succeed - so add them.
> 
> Cc: Chao Zhang 
> Cc: Jiewen Yao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 
> ---
> SecurityPkg/SecurityPkg.dsc | 11 +++
> 1 file changed, 11 insertions(+)
> 
> diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
> index 68a2953162..eaccbd9354 100644
> --- a/SecurityPkg/SecurityPkg.dsc
> +++ b/SecurityPkg/SecurityPkg.dsc
> @@ -73,6 +73,17 @@ [LibraryClasses]
>   
> TcgStorageOpalLib|SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLib.inf
>   
> ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
> 
> +[LibraryClasses.ARM]
> +  #
> +  # It is not possible to prevent the ARM compiler for generic intrinsic 
> functions.
> +  # This library provides the instrinsic functions generate by a given 
> compiler.
> +  # And NULL mean link this library into all ARM images.
> +  #
> +  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
> +
> +  # Add support for GCC stack protector
> +  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> +
> [LibraryClasses.common.PEIM]
>   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
>   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
> -- 
> 2.11.0
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v1 1/1] BaseTools: Explicitly close files after readlines

2018-11-01 Thread Michael Johnson
From: mjohn4 

Rework some file open().readlines to open, readlines, close.
This prevents excessive file handles being open at the same time,
which may be a problem with alternative python environments.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael Johnson 
---
 BaseTools/Source/Python/AutoGen/InfSectionParser.py |  4 +++-
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 16 
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/InfSectionParser.py 
b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
index d985089738..b186984101 100644
--- a/BaseTools/Source/Python/AutoGen/InfSectionParser.py
+++ b/BaseTools/Source/Python/AutoGen/InfSectionParser.py
@@ -34,7 +34,9 @@ class InfSectionParser():
 SectionData = []
 
 try:
-FileLinesList = open(self._FilePath, "r", 0).readlines()
+File = open(self._FilePath, "r", 0)
+FileLinesList = File.readlines()
+File.close()
 except BaseException:
 EdkLogger.error("build", AUTOGEN_ERROR, 'File %s is opened 
failed.' % self._FilePath)
 
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py 
b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 804a4aa5cb..9a795315d1 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -537,7 +537,9 @@ class InfParser(MetaFileParser):
 NmakeLine = ''
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close ()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -917,7 +919,9 @@ class DscParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
@@ -1429,7 +1433,9 @@ class DscParser(MetaFileParser):
 self._SubsectionType = MODEL_UNKNOWN
 
 def __RetrievePcdValue(self):
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 GlobalData.gPlatformOtherPcds['DSCFILE'] = str(self.MetaFile)
 for PcdType in (MODEL_PCD_PATCHABLE_IN_MODULE, 
MODEL_PCD_DYNAMIC_DEFAULT, MODEL_PCD_DYNAMIC_HII,
 MODEL_PCD_DYNAMIC_VPD, MODEL_PCD_DYNAMIC_EX_DEFAULT, 
MODEL_PCD_DYNAMIC_EX_HII,
@@ -1727,7 +1733,9 @@ class DecParser(MetaFileParser):
 def Start(self):
 Content = ''
 try:
-Content = open(str(self.MetaFile), 'r').readlines()
+File = open(str(self.MetaFile), 'r')
+Content = File.readlines()
+File.close()
 except:
 EdkLogger.error("Parser", FILE_READ_FAILURE, 
ExtraData=self.MetaFile)
 
-- 
2.18.0.windows.1

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


Re: [edk2] [edk2-test][Patch v2] uefi-sct/SctPkg:Assign 0 to the tail of HwErrRecVariableName.

2018-11-01 Thread Supreeth Venkatesh


Reviewed-by: Supreeth Venkatesh 

There are some unintentional indentation changes in "switch" statement.
Please take care of that before (if intentional, ok as well) commit.

On Thu, 2018-11-01 at 10:52 +0800, Eric Jin wrote:
> Add definition of HwErrRecVariableNamePrefixLength,
> HwErrRecVariableNameIndexLength and HwErrRecVariableNameLength
> Make the HwErrRecVariableName as the valid string.
> Ensure the HwErrRecVariable could be deleted before the test exit.
> 
> Cc: Supreeth Venkatesh 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Jin 
> ---
>  .../BlackBoxTest/VariableServicesBBTestFunction.c  | 38
> +-
>  .../BlackBoxTest/VariableServicesBBTestMain.h  | 13 +++-
>  2 files changed, 35 insertions(+), 16 deletions(-)
> 
> diff --git a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> index d1064ce..defe71a 100644
> --- a/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> +++ b/uefi-
> sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/BlackBo
> xTest/VariableServicesBBTestFunction.c
> @@ -1,7 +1,7 @@
>  /** @file
>  
>Copyright 2006 - 2012 Unified EFI, Inc.
> -  Copyright (c) 2010 - 2012, Intel Corporation. All rights
> reserved.
> +  Copyright (c) 2010 - 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
> @@ -2855,7 +2855,7 @@ HardwareErrorRecordFuncTest (
>UINT64RemainingVariableStorageSize;
>UINT64MaximumVariableSize;
>
> -  CHAR16HwErrRecVariableName[13];
> +  CHAR16HwErrRecVariableName[HwErrRecVariableNameLen
> gth];
>CHAR16HwErrRecVariable[] = L"This is a HwErrRec
> variable!";
>
>CHAR16GetVariableName[MAX_BUFFER_SIZE];
> @@ -2864,7 +2864,7 @@ HardwareErrorRecordFuncTest (
>
>UINTN Num;
>UINTN MaxNum = 0;
> -  CHAR16ErrorNum[5];
> +  CHAR16ErrorNum[HwErrRecVariableNameIndexLength+1];
>
>CHAR16HwErrRecGetVariable[255];
>
> @@ -2908,7 +2908,11 @@ HardwareErrorRecordFuncTest (
>}
>  
>//
> -  // Read reset record
> +  // Try to read reset record from the RecoveryData,
> +  // and the magic num is saved in the RecoveryData[0]. 
> +  // When the status is EFI_SUCCESS and magic num is 2,
> +  // it means useful data has been saved before the reset
> +  // and the date should be retrived goto particular process
>//
>Status = RecoveryLib->ReadResetRecord (
>RecoveryLib,
> @@ -2916,12 +2920,12 @@ HardwareErrorRecordFuncTest (
>RecoveryData
>);
>if ( !EFI_ERROR(Status) && (RecoveryDataSize > 0) ) {
> -  switch (RecoveryData[0]) {
> +switch (RecoveryData[0]) {
Is the indentation change intentional? It looked good to me earlier and
is ok with edk2 C coding standards as well.
>case 2:
>  goto step2;
>default:
>  goto step3;
> -  }
> +}
Is the indentation change intentional? It looked good to me earlier and
is ok with edk2 C coding standards as well.
>}
>
>//
> @@ -2978,7 +2982,7 @@ HardwareErrorRecordFuncTest (
>// Get a useable variable name
>//
>GetVariableName[0] = L'\0';
> -  ErrorNum[4] = L'\0';
> +  ErrorNum[HwErrRecVariableNameIndexLength] = L'\0';
>
>  
>while (TRUE) {
> @@ -3001,9 +3005,9 @@ HardwareErrorRecordFuncTest (
>break;
>  }
>  
> -if ( (SctStrnCmp (GetVariableName, L"HwErrRec", 8) == 0) &&
> +if ( (SctStrnCmp (GetVariableName, L"HwErrRec",
> HwErrRecVariableNamePrefixLength) == 0) &&
>   (SctCompareGuid (, ) == 0) ) {
> -  SctStrnCpy (ErrorNum, [8], 4);
> +  SctStrnCpy (ErrorNum,
> [HwErrRecVariableNamePrefixLength],
> HwErrRecVariableNameIndexLength);
>Num = SctXtoi (ErrorNum);
>if (MaxNum < Num)
>  MaxNum = Num;
> @@ -3014,7 +3018,8 @@ HardwareErrorRecordFuncTest (
>  
>HwErrRecVariableName[0] = L'\0';
>SctStrCat ( HwErrRecVariableName, L"HwErrRec" );
> -  Myitox( MaxNum, HwErrRecVariableName+8 );
> +  Myitox( MaxNum,
> HwErrRecVariableName+HwErrRecVariableNamePrefixLength );
> +  HwErrRecVariableName[HwErrRecVariableNameLength-1] = L'\0';
>
>//
>// Set the new HwErrRec variable to the global variable
> @@ -3033,11 +3038,12 @@ HardwareErrorRecordFuncTest (
>}
>
>//
> -  // Write reset record
> +  // Before the reset, test writes magic num 2 in RecoveryData[0]
> +  // and writes the useful data - HwErrRecVariableName - to

Re: [edk2] [edk2-test][Patch] uefi-sct/SctPkg:Assign 0 to the tail of the HwErrRecVariableName

2018-11-01 Thread Supreeth Venkatesh
Hi Eric,

I could not find any reference regarding "magic numbers" in edk2 C coding 
standards document.
So, I guess I am fine with documenting "magic numbers" with comments.

Thanks,
Supreeth

-Original Message-
From: Jin, Eric 
Sent: Wednesday, October 31, 2018 9:09 PM
To: Supreeth Venkatesh ; edk2-devel@lists.01.org
Cc: Wu, Jiaxin 
Subject: RE: [edk2-test][Patch] uefi-sct/SctPkg:Assign 0 to the tail of the 
HwErrRecVariableName

Hi Supreeth,

Got your worry. It is difficult to define the clear/meaningful macro to express 
the implication and avoid the ambiguity in my eye.
How about to document the clear comments in the key process?  It is more help 
for reading by someone new and sustaining.


Best Regards
Eric

-Original Message-
From: Supreeth Venkatesh 
Sent: Thursday, November 1, 2018 12:24 AM
To: Jin, Eric ; edk2-devel@lists.01.org
Cc: Wu, Jiaxin 
Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg:Assign 0 to the tail of the 
HwErrRecVariableName

On Wed, 2018-10-31 at 02:29 +, Jin, Eric wrote:
> Hi Supreeth,
Hi Eric,
>
> Thank for the comments.
> I will re-create the patch to add the definition of the
> HwErrRecVariableNamePrefixLength(8) and
> HwErrRecVariableNameIndexLength(4).
Thank you.

>
> There are two meanings to 2. To record the step number(2) used  by the
> recoverylib or address (byte[2]) to save the recovery data
> (HwErrRecVariableName)
> It is not applicable macro definition and just code logic here. What
> is your opinion?
Array Index [2] - In general one iterates over an array, performing some 
operation on each element, because one doesn't know how long the array is and 
you can't just access it in a hardcoded manner.
Does index "2" have special meaning, since this index is chosen rather than 0?

RecoveryData[0] = 2;
Does only "2" have special meaning?

Looks like we can define (or similar)
#define SecondResetRecord 2 (or something more meaningful)

and for array
#define HwErrRecIndex 2 (or something more meaningful)

No strong opinion - but someone new who starts developing test on top of this 
file will have a proper context and documentation to get going.

>
>
> Best Regards
> Eric
>
> -Original Message-
> From: Supreeth Venkatesh 
> Sent: Wednesday, October 31, 2018 1:00 AM
> To: Jin, Eric ; edk2-devel@lists.01.org
> Cc: Wu, Jiaxin ; supreeth.venkat...@arm.com
> Subject: Re: [edk2-test][Patch] uefi-sct/SctPkg:Assign 0 to the tail
> of the HwErrRecVariableName
>
> Reviewed-by: Supreeth Venkatesh  If the
> below magic number comments(inline) are fixed before commit.
>
> On Tue, 2018-10-30 at 16:38 +0800, Eric Jin wrote:
> > Make the HwErrRecVariableName as valid the string.
> > Ensure the HwErrRecVariable could be deleted before the test exit.
> >
> > Cc: Supreeth Venkatesh 
> > Cc: Jiaxin Wu 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Eric Jin 
> > ---
> >  .../BlackBoxTest/VariableServicesBBTestFunction.c| 12
> > +++-
> >  .../BlackBoxTest/VariableServicesBBTestMain.h| 10
> > +-
> >  2 files changed, 16 insertions(+), 6 deletions(-)
> >
> > diff --git a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/Black
> > Bo
> > xTest/VariableServicesBBTestFunction.c b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/Black
> > Bo
> > xTest/VariableServicesBBTestFunction.c
> > index d1064ce..df1bbe7 100644
> > --- a/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/Black
> > Bo
> > xTest/VariableServicesBBTestFunction.c
> > +++ b/uefi-
> > sct/SctPkg/TestCase/UEFI/EFI/RuntimeServices/VariableServices/Black
> > Bo
> > xTest/VariableServicesBBTestFunction.c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >
> >Copyright 2006 - 2012 Unified EFI, Inc.
> > -  Copyright (c) 2010 - 2012, Intel Corporation. All rights
> > reserved.
> > +  Copyright (c) 2010 - 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 @@ -2855,7 +2855,7 @@ HardwareErrorRecordFuncTest (
> >UINT64RemainingVariableStorageSize;
> >UINT64MaximumVariableSize;
> >
> > -  CHAR16HwErrRecVariableName[13];
> > +  CHAR16HwErrRecVariableName[HwErrRecVariableNameL
> > en
> > gth];
> >CHAR16HwErrRecVariable[] = L"This is a HwErrRec
> > variable!";
> >
> >CHAR16GetVariableName[MAX_BUFFER_SIZE];
> > @@ -3015,6 +3015,7 @@ HardwareErrorRecordFuncTest (
> >HwErrRecVariableName[0] = L'\0';
> >SctStrCat ( HwErrRecVariableName, L"HwErrRec" );
> >Myitox( MaxNum, HwErrRecVariableName+8 );
>
> I understand this line is not part of this patch, but however can we
> define "#define" for magic number 8, while we are touching this file.
>
> > +  HwErrRecVariableName[HwErrRecVariableNameLength-1] = L'\0';
> >
> >//
> >   

Re: [edk2] [PATCH 0/4] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-01 Thread Philippe Mathieu-Daudé

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

In this series, replace the original vmsvga driver to Bochs
interface.


This is the 'v2' of your previous patch 'OvmfPkg: initialize bochs when 
initializing vmsvga':

https://lists.01.org/pipermail/edk2-devel/2018-October/031235.html

Keeping different versions and referencing previous series helps when 
reviewing.




Simply revert vmsvga driver implementation. After it, use Bochs
interface for initializing vmsvga.

Because of the PCI BARs difference between std vga and vmsvga.
We can not simply recognize the "QEMU VMWare SVGA" as the
QEMU_VIDEO_BOCHS_MMIO variant.

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

To overcome this problem, we remain variant QEMU_VIDEO_VMWARE_SVGA,
and use it for:

(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO

We have tested on qemu before and after commit 104bd1dc70 and all worked.


Did you also test against QEMU v2.9.1?



Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 

yuchenlin (4):
   Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"
   Revert "OvmfPkg/QemuVideoDxe: Helper functions for unaligned port
 I/O."
   Revert "OvmfPkg/QemuVideoDxe: list "UnalignedIoInternal.h" in the INF
 file"
   OvmfPkg: simply use the Bochs interface for vmsvga

  OvmfPkg/QemuVideoDxe/Driver.c | 137 ++-
  OvmfPkg/QemuVideoDxe/Gop.c|  68 +---
  OvmfPkg/QemuVideoDxe/Initialize.c | 157 --
  OvmfPkg/QemuVideoDxe/Qemu.h   |  27 ---
  OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf |   7 -
  OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c |  70 
  OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c |  80 -
  OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h|  59 ---
  OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c |  78 -
  OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c |  66 
  10 files changed, 17 insertions(+), 732 deletions(-)
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoGcc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoIcc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoInternal.h
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoMsc.c
  delete mode 100644 OvmfPkg/QemuVideoDxe/UnalignedIoUnsupported.c


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


Re: [edk2] [PATCH 1/4] Revert "OvmfPkg/QemuVideoDxe: VMWare SVGA device support"

2018-11-01 Thread Philippe Mathieu-Daudé

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

This reverts commit c137d95081690d4877fbeb5f1856972e84ac32f2.


Can we have a comment here about why we need to revert this patch?
(same for patches 2 and 3).



Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
  OvmfPkg/QemuVideoDxe/Driver.c | 135 +
  OvmfPkg/QemuVideoDxe/Gop.c|  65 +
  OvmfPkg/QemuVideoDxe/Initialize.c | 157 --
  OvmfPkg/QemuVideoDxe/Qemu.h   |  29 --
  4 files changed, 7 insertions(+), 379 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 73eb2cad05..2304afd1e6 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -14,10 +14,8 @@
  
  **/
  
-#include 

-#include 
  #include "Qemu.h"
-#include "UnalignedIoInternal.h"
+#include 
  
  EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {

QemuVideoControllerDriverSupported,
@@ -71,12 +69,6 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
  0x1050,
  QEMU_VIDEO_BOCHS_MMIO,
  L"QEMU VirtIO VGA"
-},{
-PCI_CLASS_DISPLAY_VGA,
-VMWARE_PCI_VENDOR_ID_VMWARE,
-VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
-QEMU_VIDEO_VMWARE_SVGA,
-L"QEMU VMWare SVGA"
  },{
  0 /* end of list */
  }
@@ -264,7 +256,6 @@ QemuVideoControllerDriverStart (
  goto ClosePciIo;
}
Private->Variant = Card->Variant;
-  Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
  
//

// IsQxl is based on the detected Card->Variant, which at a later point 
might
@@ -339,58 +330,6 @@ QemuVideoControllerDriverStart (
  }
}
  
-  //

-  // Check if accessing Vmware SVGA interface works
-  //
-  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
-EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *IoDesc;
-UINT32TargetId;
-UINT32SvgaIdRead;
-
-IoDesc = NULL;
-Status = Private->PciIo->GetBarAttributes (
-   Private->PciIo,
-   PCI_BAR_IDX0,
-   NULL,
-   (VOID**) 
-   );
-if (EFI_ERROR (Status) ||
-IoDesc->ResType != ACPI_ADDRESS_SPACE_TYPE_IO ||
-IoDesc->AddrRangeMin > MAX_UINT16 + 1 - (VMWARE_SVGA_VALUE_PORT + 4)) {
-  if (IoDesc != NULL) {
-FreePool (IoDesc);
-  }
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-Private->VmwareSvgaBasePort = (UINT16) IoDesc->AddrRangeMin;
-FreePool (IoDesc);
-
-TargetId = VMWARE_SVGA_ID_2;
-while (TRUE) {
-  VmwareSvgaWrite (Private, VmwareSvgaRegId, TargetId);
-  SvgaIdRead = VmwareSvgaRead (Private, VmwareSvgaRegId);
-  if ((SvgaIdRead == TargetId) || (TargetId <= VMWARE_SVGA_ID_0)) {
-break;
-  }
-  TargetId--;
-}
-
-if (SvgaIdRead != TargetId) {
-  DEBUG ((
-DEBUG_ERROR,
-"QemuVideo: QEMU_VIDEO_VMWARE_SVGA ID mismatch "
-"(got 0x%x, base address 0x%x)\n",
-SvgaIdRead,
-Private->VmwareSvgaBasePort
-));
-  Status = EFI_DEVICE_ERROR;
-  goto RestoreAttributes;
-}
-
-Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;
-  }
-
//
// Get ParentDevicePath
//
@@ -446,9 +385,6 @@ QemuVideoControllerDriverStart (
case QEMU_VIDEO_BOCHS:
  Status = QemuVideoBochsModeSetup (Private, IsQxl);
  break;
-  case QEMU_VIDEO_VMWARE_SVGA:
-Status = QemuVideoVmwareSvgaModeSetup (Private);
-break;
default:
  ASSERT (FALSE);
  Status = EFI_DEVICE_ERROR;
@@ -510,9 +446,6 @@ DestructQemuVideoGraphics:
  
  FreeModeData:

FreePool (Private->ModeData);
-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
  
  UninstallGopDevicePath:

gBS->UninstallProtocolInterface (Private->Handle,
@@ -634,9 +567,6 @@ QemuVideoControllerDriverStop (
  );
  
FreePool (Private->ModeData);

-  if (Private->VmwareSvgaModeInfo != NULL) {
-FreePool (Private->VmwareSvgaModeInfo);
-  }
gBS->UninstallProtocolInterface (Private->Handle,
   , Private->GopDevicePath);
FreePool (Private->GopDevicePath);
@@ -834,7 +764,7 @@ ClearScreen (
Private->PciIo->Mem.Write (
  Private->PciIo,
  EfiPciIoWidthFillUint32,
-Private->FrameBufferVramBarIndex,
+0,
  0,
  0x40 >> 2,
  
@@ -971,38 +901,6 @@ BochsRead (
return Data;
  }
  
-VOID

-VmwareSvgaWrite (
-  QEMU_VIDEO_PRIVATE_DATA   *Private,
-  UINT16Register,
-  UINT32Value
-  )
-{
-  UnalignedIoWrite32 (
-Private->VmwareSvgaBasePort + VMWARE_SVGA_INDEX_PORT,
-Register
-

Re: [edk2] [PATCH 4/4] OvmfPkg: simply use the Bochs interface for vmsvga

2018-11-01 Thread Philippe Mathieu-Daudé

Hi Yu-chen Lin,

On 24/10/18 8:40, yuchen...@synology.com wrote:

From: yuchenlin 

BAR  |std vga |  vmsvga
-
0|   Framebuffer  | I/O space
1|   Reserved | Framebuffer
2|   MMIO | FIFO

Because of the PCI BARs difference between std vga and
vmsvga, we can not simply recognize the "QEMU VMWare SVGA"
as the QEMU_VIDEO_BOCHS_MMIO variant.

Instead, we remain variant QEMU_VIDEO_VMWARE_SVGA, and use
it for:

(1) Get framebuffer from correct PCI BAR
(2) Prevent using BAR2 for MMIO

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: yuchenlin 
---
  OvmfPkg/QemuVideoDxe/Driver.c | 16 +++-
  OvmfPkg/QemuVideoDxe/Gop.c|  3 ++-
  OvmfPkg/QemuVideoDxe/Qemu.h   |  2 ++
  3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 2304afd1e6..a1785c2285 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -16,6 +16,7 @@
  
  #include "Qemu.h"

  #include 
+#include 
  
  EFI_DRIVER_BINDING_PROTOCOL gQemuVideoDriverBinding = {

QemuVideoControllerDriverSupported,
@@ -69,6 +70,12 @@ QEMU_VIDEO_CARD gQemuVideoCardList[] = {
  0x1050,
  QEMU_VIDEO_BOCHS_MMIO,
  L"QEMU VirtIO VGA"
+},{
+PCI_CLASS_DISPLAY_VGA,
+VMWARE_PCI_VENDOR_ID_VMWARE,
+VMWARE_PCI_DEVICE_ID_VMWARE_SVGA2,
+QEMU_VIDEO_VMWARE_SVGA,
+L"QEMU VMWare SVGA"


Looks OK.


  },{
  0 /* end of list */
  }
@@ -256,6 +263,11 @@ QemuVideoControllerDriverStart (
  goto ClosePciIo;
}
Private->Variant = Card->Variant;
+  Private->FrameBufferVramBarIndex = PCI_BAR_IDX0;
+  if (Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
+Private->FrameBufferVramBarIndex = PCI_BAR_IDX1;


OK, but why not use an 'else' clause?


+  }
+
  
//

// IsQxl is based on the detected Card->Variant, which at a later point 
might
@@ -320,7 +332,8 @@ QemuVideoControllerDriverStart (
// Check if accessing the bochs interface works.
//
if (Private->Variant == QEMU_VIDEO_BOCHS_MMIO ||
-  Private->Variant == QEMU_VIDEO_BOCHS) {
+  Private->Variant == QEMU_VIDEO_BOCHS ||
+  Private->Variant == QEMU_VIDEO_VMWARE_SVGA) {
  UINT16 BochsId;
  BochsId = BochsRead(Private, VBE_DISPI_INDEX_ID);
  if ((BochsId & 0xFFF0) != VBE_DISPI_ID0) {
@@ -383,6 +396,7 @@ QemuVideoControllerDriverStart (
  break;
case QEMU_VIDEO_BOCHS_MMIO:
case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
  Status = QemuVideoBochsModeSetup (Private, IsQxl);
  break;
default:
diff --git a/OvmfPkg/QemuVideoDxe/Gop.c b/OvmfPkg/QemuVideoDxe/Gop.c
index d490fa7a2e..3abc5eeb36 100644
--- a/OvmfPkg/QemuVideoDxe/Gop.c
+++ b/OvmfPkg/QemuVideoDxe/Gop.c
@@ -60,7 +60,7 @@ QemuVideoCompleteModeData (
  
Private->PciIo->GetBarAttributes (

  Private->PciIo,
-0,
+Private->FrameBufferVramBarIndex,


OK


  NULL,
  (VOID**) 
  );
@@ -177,6 +177,7 @@ Routine Description:
  break;
case QEMU_VIDEO_BOCHS_MMIO:
case QEMU_VIDEO_BOCHS:
+  case QEMU_VIDEO_VMWARE_SVGA:
  InitializeBochsGraphicsMode (Private, 
[ModeData->InternalModeIndex]);
  break;
default:
diff --git a/OvmfPkg/QemuVideoDxe/Qemu.h b/OvmfPkg/QemuVideoDxe/Qemu.h
index d7da761705..3aac9eeca6 100644
--- a/OvmfPkg/QemuVideoDxe/Qemu.h
+++ b/OvmfPkg/QemuVideoDxe/Qemu.h
@@ -92,6 +92,7 @@ typedef enum {
QEMU_VIDEO_CIRRUS_5446,
QEMU_VIDEO_BOCHS,
QEMU_VIDEO_BOCHS_MMIO,
+  QEMU_VIDEO_VMWARE_SVGA,
  } QEMU_VIDEO_VARIANT;
  
  typedef struct {

@@ -120,6 +121,7 @@ typedef struct {
QEMU_VIDEO_VARIANTVariant;
FRAME_BUFFER_CONFIGURE*FrameBufferBltConfigure;
UINTN FrameBufferBltConfigureSize;
+  UINT8 FrameBufferVramBarIndex;
  } QEMU_VIDEO_PRIVATE_DATA;
  
  ///



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


Re: [edk2] [PATCH edk2-platforms 10/27] Silicon/NXP: Add iMX6Pkg dec

2018-11-01 Thread Leif Lindholm
On Fri, Sep 21, 2018 at 08:26:00AM +, Chris Co wrote:
> This adds PCD declarations common across NXP i.MX6 SoCs
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Christopher Co 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> ---
>  Silicon/NXP/iMX6Pkg/iMX6Pkg.dec | 143 
>  1 file changed, 143 insertions(+)
> 
> diff --git a/Silicon/NXP/iMX6Pkg/iMX6Pkg.dec b/Silicon/NXP/iMX6Pkg/iMX6Pkg.dec
> new file mode 100644
> index ..99e1c7e6a4b8
> --- /dev/null
> +++ b/Silicon/NXP/iMX6Pkg/iMX6Pkg.dec
> @@ -0,0 +1,143 @@
> +#
> +#  Copyright (c) 2018 Microsoft 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
> +#  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  = 0x0001001A
> +  PACKAGE_NAME   = iMX6Pkg
> +  PACKAGE_GUID   = 6eba6648-d853-4eb3-9761-528b82d5ab04
> +  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
> +#
> +
> +[Includes.common]
> +  Include# Root include for the package
> +  Silicon/NXP/iMXPlatformPkg/Include  # Root include for the iMXPlatform 
> package
> +
> +[LibraryClasses]
> +  iMXIoMuxLib|Silicon/NXP/iMX6Pkg/Include/iMX6IoMux.h
> +  iMX6ClkPwrLib|Silicon/NXP/iMX6Pkg/Include/iMX6ClkPwr.h
> +  iMX6UsbPhyLib|Silicon/NXP/iMX6Pkg/Include/iMX6UsbPhy.h
> +
> +[Protocols.common]
> +  gEfiSdhcProtocolGuid = { 0x46055b0f, 0x992a, 0x4ad7, { 0x8f, 0x81, 0x14, 
> 0x81, 0x86, 0xff, 0xdf, 0x72 } }

This is too generic a name to belong to a protocol GUID defined in a
platform-specific package. (But the Sdhc implementation is a bit up in
the air, so...)

> +
> +[Guids.common]
> +  giMX6TokenSpaceGuid = { 0x24b09abe, 0x4e47, 0x481c, { 0xa9, 0xad, 0xce, 
> 0xf1, 0x2c, 0x39, 0x23, 0x27} }
> +
> +[PcdsFixedAtBuild.common]
> +  #
> +  # Frame buffer is set to the first addressable memory on the i.MX6
> +  # Sabre board for convenience.
> +  # Keep in mind that this chunk of memory is the only one that remains fixed
> +  # through the various boot stages (primary boot->UEFI->Windows.
> +  #
> +  giMX6TokenSpaceGuid.PcdFrameBufferBase|0x1000|UINT32|0x000A
> +  giMX6TokenSpaceGuid.PcdFrameBufferSize|0x0080|UINT32|0x000B
> +
> +  #
> +  # Performance counter
> +  #
> +  
> gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterFrequencyInHz|100|UINT32
>  |0xC
> +  
> gEmbeddedTokenSpaceGuid.PcdEmbeddedFdPerformanceCounterPeriodInNanoseconds|1000|UINT32
>  |0xD

These would need to be defined in EmbeddedPkg.dec.
Can't hijack other packages' namespace.

/
Leif

> +
> +  #
> +  # USB EHCI Controller
> +  #
> +  giMX6TokenSpaceGuid.PcdEHCIBase|0x02184000|UINT32|0xE
> +  giMX6TokenSpaceGuid.PcdEHCILength|0x4000|UINT32|0xF
> +  giMX6TokenSpaceGuid.PcdIsUsbPortOTG|TRUE|BOOLEAN|0x10
> +  giMX6TokenSpaceGuid.PcdUSBOTGBase|0x02184000|UINT32|0x11
> +
> +  #
> +  # ARM System Reset Controller (SRC)
> +  #
> +  giMX6TokenSpaceGuid.PcdSrcBase|0x020D8000|UINT32|0x2B
> +
> +  #
> +  # PCIE
> +  #
> +  # PCI Host config space is fixed at 0x01FFC000. The memory range from
> +  # 0x0100 - 0x01FFBFFF is assigned for PCIe. The memory layout defined
> +  # by the boot loader is as below
> +  #
> +  # PCIe Device Config Space : 0x01F0 - 0x01F8
> +  # PCIe IO (unsupported) : 0x0110 - 0x011F
> +  # PCIe Memory : 0x0120 - 0x012F
> +  #
> +  giMX6TokenSpaceGuid.PcdPcieDeviceConfigBase|0x01F0|UINT32|0x2C
> +  giMX6TokenSpaceGuid.PcdPcieDeviceConfigSize|0x0008|UINT32|0x2D
> +  giMX6TokenSpaceGuid.PcdPcieHostConfigBase|0x01FFC000|UINT32|0x2E
> +  giMX6TokenSpaceGuid.PcdPcieIOBase|0x|UINT32|0x2F
> +  giMX6TokenSpaceGuid.PcdPcieIOSize|0x|UINT32|0x30
> +  giMX6TokenSpaceGuid.PcdPciMemoryBase|0x0110|UINT32|0x31
> +  giMX6TokenSpaceGuid.PcdPciMemorySize|0x00D0|UINT32|0x32
> +  giMX6TokenSpaceGuid.PcdPciPrefetchMemoryBase|0x|UINT32|0x33
> +  giMX6TokenSpaceGuid.PcdPciPrefetchMemorySize|0x|UINT32|0x34
> +  giMX6TokenSpaceGuid.PcdPcieResetGpio|FALSE|BOOLEAN|0x35
> +  

Re: [edk2] [PATCH edk2-platforms 09/27] Silicon/NXP: Add headers for SoC-specific i.MX packages to use

2018-11-01 Thread Leif Lindholm
On Fri, Sep 21, 2018 at 08:26:00AM +, Chris Co wrote:
> This adds common headers for other NXP i.MX SoC packages.
> More specifically, this adds i.MX-generic GPIO, IoMux, and
> Platform definitions.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Christopher Co 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> ---
>  Silicon/NXP/iMXPlatformPkg/Include/Platform.h | 67 ++
>  Silicon/NXP/iMXPlatformPkg/Include/iMXGpio.h  | 92 
>  Silicon/NXP/iMXPlatformPkg/Include/iMXIoMux.h | 24 +
>  3 files changed, 183 insertions(+)
> 
> diff --git a/Silicon/NXP/iMXPlatformPkg/Include/Platform.h 
> b/Silicon/NXP/iMXPlatformPkg/Include/Platform.h
> new file mode 100644
> index ..8a1e828f68ea
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Include/Platform.h
> @@ -0,0 +1,67 @@
> +/** @file
> +*
> +*  i.MX Platform specific defines for constructing ACPI tables
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#ifndef _PLATFORM_IMX_H_
> +#define _PLATFORM_IMX_H_
> +
> +#include 
> +
> +#define EFI_ACPI_OEM_ID   {'M','C','R','S','F','T'} // OEMID 6 
> bytes
> +#define EFI_ACPI_VENDOR_IDSIGNATURE_32('N','X','P','I')
> +#define EFI_ACPI_CSRT_REVISION0x0005
> +#define EFI_ACPI_5_0_CSRT_REVISION0x
> +
> +// Resource Descriptor Types
> +#define EFI_ACPI_CSRT_RD_TYPE_INTERRUPT 1
> +#define EFI_ACPI_CSRT_RD_TYPE_TIMER 2
> +#define EFI_ACPI_CSRT_RD_TYPE_DMA 3
> +#define EFI_ACPI_CSRT_RD_TYPE_CACHE 4
> +
> +// Resource Descriptor Subtypes
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_INTERRUPT_LINES 0
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_INTERRUPT_CONTROLLER 1
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_TIMER 0
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_DMA_CHANNEL 0
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_DMA_CONTROLLER 1
> +#define EFI_ACPI_CSRT_RD_SUBTYPE_CACHE 0

If using EFI_ACPI prefix, these #defines really should be in edk2
MdePkg. And CSRT itself is, so that might not be a bad idea.

> +
> +#pragma pack(push, 1)

I don't see this #pragma making any difference to the structs below,
can it be dropped?

> +//
> +// CSRT Resource Group header 24 bytes long
> +//
> +typedef struct {
> +  UINT32 Length;
> +  UINT32 VendorID;
> +  UINT32 SubVendorId;
> +  UINT16 DeviceId;
> +  UINT16 SubdeviceId;
> +  UINT16 Revision;
> +  UINT16 Reserved;
> +  UINT32 SharedInfoLength;
> +} EFI_ACPI_5_0_CSRT_RESOURCE_GROUP_HEADER;
> +
> +//
> +// CSRT Resource Descriptor 12 bytes total
> +//
> +typedef struct {
> +  UINT32 Length;
> +  UINT16 ResourceType;
> +  UINT16 ResourceSubType;
> +  UINT32 UID;
> +} EFI_ACPI_5_0_CSRT_RESOURCE_DESCRIPTOR_HEADER;
> +#pragma pack (pop)
> +
> +#endif // !_PLATFORM_IMX_H_
> diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXGpio.h 
> b/Silicon/NXP/iMXPlatformPkg/Include/iMXGpio.h
> new file mode 100644
> index ..dce01f789058
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXGpio.h
> @@ -0,0 +1,92 @@
> +/** @file
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#ifndef _IMX_GPIO_H_
> +#define _IMX_GPIO_H_
> +
> +#include 
> +
> +typedef enum {
> +  IMX_GPIO_LOW = 0,
> +  IMX_GPIO_HIGH = 1
> +} IMX_GPIO_VALUE;
> +
> +typedef enum {
> +  IMX_GPIO_DIR_INPUT,
> +  IMX_GPIO_DIR_OUTPUT
> +} IMX_GPIO_DIR;
> +
> +typedef enum {
> +  IMX_GPIO_BANK1 = 1,
> +  IMX_GPIO_BANK2,
> +  IMX_GPIO_BANK3,
> +  IMX_GPIO_BANK4,
> +  IMX_GPIO_BANK5,
> +  IMX_GPIO_BANK6,
> +  IMX_GPIO_BANK7,
> +} IMX_GPIO_BANK;
> +
> +#pragma pack(push, 1)

I don't see what effect this is supposed to have, can it be dropped?

> +
> +#define GPIO_RESERVED_SIZE \
> +((FixedPcdGet32(PcdGpioBankMemoryRange) / 4) - 8)
> +
> +typedef struct {
> + 

Re: [edk2] [PATCH edk2-platforms 07/27] Silicon/NXP: Add i.MX display library support

2018-11-01 Thread Leif Lindholm
On Fri, Sep 21, 2018 at 08:25:58AM +, Chris Co wrote:
> This adds support for processing EDID data on NXP i.MX platforms.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Christopher Co 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> ---
>  Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h| 114 
> +++
>  Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c   | 152 
> 
>  Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.inf |  31 
>  3 files changed, 297 insertions(+)
> 
> diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h 
> b/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h
> new file mode 100644
> index ..70ef8d0af97f
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXDisplay.h
> @@ -0,0 +1,114 @@
> +/** @file
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#ifndef __IMX_DISPLAY_H__
> +#define __IMX_DISPLAY_H__
> +
> +#define EDID_MIN_SIZE   128
> +#define EDID_I2C_ADDRESS0x50

Are all of these #defines and functions called only from within iMX
platform code?

> +
> +// The first DTD is the preferred timing, refer to 3.1 VESA EDID spec.
> +#define EDID_DTD_1_OFFSET   0x36
> +#define EDID_DTD_2_OFFSET   0x48
> +#define EDID_DTD_3_OFFSET   0x5A
> +#define EDID_DTD_4_OFFSET   0x6C
> +
> +typedef enum {
> +  PIXEL_FORMAT_ARGB32,
> +  PIXEL_FORMAT_BGRA32,
> +} PIXEL_FORMAT;
> +
> +typedef struct _DISPLAY_TIMING {
> +  UINT32 PixelClock;
> +  UINT32 HActive;
> +  UINT32 HBlank;
> +  UINT32 VActive;
> +  UINT32 VBlank;
> +  UINT32 HSync;
> +  UINT32 VSync;
> +  UINT32 HSyncOffset;
> +  UINT32 VSyncOffset;
> +  UINT32 HImageSize;
> +  UINT32 VImageSize;
> +  UINT32 HBorder;
> +  UINT32 VBorder;
> +  UINT32 EdidFlags;
> +  UINT32 Flags;
> +  UINT32 PixelRepetition;
> +  UINT32 Bpp;
> +  PIXEL_FORMAT PixelFormat;
> +} DISPLAY_TIMING, *PDISPLAY_TIMING, DTD;
> +
> +typedef struct _DETAILED_TIMING_DESCRIPTOR {
> +  UINT8 PixelClock[2];
> +  UINT8 HActive;
> +  UINT8 HBlank;
> +  UINT8 HActiveBlank;
> +  UINT8 VActive;
> +  UINT8 VBlank;
> +  UINT8 VActiveBlank;
> +  UINT8 HSyncOffset;
> +  UINT8 HSyncWidth;
> +  UINT8 VSyncOffsetWidth;
> +  UINT8 HVOffsetWidth;
> +  UINT8 HImageSize;
> +  UINT8 VImageSize;
> +  UINT8 HVImageSize;
> +  UINT8 HBorder;
> +  UINT8 VBorder;
> +  UINT8 EdidFlags;
> +} DETAILED_TIMING_DESCRIPTOR, *PDETAILED_TIMING_DESCRIPTOR;
> +
> +/**
> +  Convert detailed timing descriptor to display timing format
> +
> +  @param[in]DTDPtrPointer to detailed timing descriptor.
> +  @param[out]   DisplayTimingPtr  Pointer to display timing structure.
> +
> +  @retval   EFI_SUCCESS   Detailed timing descriptor data was converted.
> +
> +**/
> +EFI_STATUS
> +ConvertDTDToDisplayTiming (
> +  IN DETAILED_TIMING_DESCRIPTOR   *DTDPtr,
> +  OUT DISPLAY_TIMING  *DisplayTimingPtr
> +  );
> +
> +/**
> +  Debug dump of Display Timing structure
> +
> +  @param[in]DisplayTimingNamePtr  Name of display timing structure.
> +  @param[in]DisplayTimingPtr  Pointer to display timing structure.
> +**/
> +VOID
> +PrintDisplayTiming (
> +  IN CHAR8*DisplayTimingNamePtr,
> +  IN DISPLAY_TIMING   *DisplayTimingPtr
> +  );
> +
> +/**
> +  Check if EDID is valid
> +
> +  @param[in]EdidDataPtr  Pointer to EDID data.
> +
> +  @retval   EFI_SUCCESS EDID data is a valid EDID.
> +  @retval   EFI_INVALID_PARAMETER   EDID data is invalid.
> +
> +**/
> +EFI_STATUS
> +ValidateEdidData (
> +  IN UINT8 *EdidDataPtr
> +  );
> +
> +#endif // __IMX_DISPLAY_H__
> diff --git a/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c 
> b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c
> new file mode 100644
> index ..9e90ece96260
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Library/iMXDisplayLib/iMXDisplayLib.c
> @@ -0,0 +1,152 @@
> +/** @file
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  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.
> +*

Re: [edk2] [PATCH 1/6] AppPkg: fix webserver build for !Ia32/X64

2018-11-01 Thread Leif Lindholm
On 1 November 2018 at 17:19, Kinney, Michael D 
wrote:
>
> Leif,
>
> The MSR definitions are only used by Mtrr.c, and Mtrr.c is only
> used for IA32 and X64 builds in the INF file.

Ah, yes, that actually means the rest of the application may be completely
valid on ARM.

> It would be simpler to move the #include 
> into Mtrr.c.  That would avoid the use of #if.

Yeah, that sounds like the better fix. I was being lazy :)

Thanks, will do that for v2.

Regards,

Leif

> Mike
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-
> > boun...@lists.01.org] On Behalf Of Leif Lindholm
> > Sent: Thursday, November 1, 2018 8:37 AM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben ; Daryl
> > McDaniel 
> > Subject: [edk2] [PATCH 1/6] AppPkg: fix webserver build
> > for !Ia32/X64
> >
> > The WebServer application is really quite Ia32/X64
> > specific, but fundamentally
> > it builds for other architectures as long as the
> > architecture-specific
> >   #include 
> > header file is filtered out.
> > So add an architecture-based filter on that to enable
> > AppPkg.dsc to build for
> > AARCH64/ARM (both listed in SUPPORTED_ARCHITECTURES).
> >
> > Cc: Daryl McDaniel 
> > Cc: Jaben Carsey 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Leif Lindholm 
> > ---
> >
> > Note: there is definitely a case here for just
> > disabling this component
> >   for !Ia32/X64, but the _interesting_ bits of this
> > application are
> >   completely architecture independent, so my
> > preference would be to
> >   do this for now, and worry about remaining issues
> > (like MTRR dump)
> >   at some point in the future.
> >
> >  AppPkg/Applications/Sockets/WebServer/WebServer.h | 2
> > ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git
> > a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > index 21b07b63df..610abdcf9e 100644
> > --- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > +++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> > @@ -20,7 +20,9 @@
> >
> >  #include 
> >
> > +#if defined(__x86_64__) || defined(__i386__)
> >  #include 
> > +#endif
> >  #include 
> >  #include 
> >  #include 
> > --
> > 2.11.0
> >
> > ___
> > 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 edk2-platforms 06/27] Silicon/NXP: Add I2C library support for i.MX platforms

2018-11-01 Thread Leif Lindholm
On Fri, Sep 21, 2018 at 08:25:57AM +, Chris Co wrote:
> This adds support for I2C controller on NXP i.MX platforms.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Christopher Co 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> ---
>  Silicon/NXP/iMXPlatformPkg/Include/iMXI2cLib.h | 162 +++
>  Silicon/NXP/iMXPlatformPkg/Library/iMXI2cLib/iMXI2cLib.c   | 487 
> 
>  Silicon/NXP/iMXPlatformPkg/Library/iMXI2cLib/iMXI2cLib.inf |  35 ++
>  3 files changed, 684 insertions(+)
> 
> diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXI2cLib.h 
> b/Silicon/NXP/iMXPlatformPkg/Include/iMXI2cLib.h
> new file mode 100644
> index ..de8a1616fe1b
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXI2cLib.h
> @@ -0,0 +1,162 @@
> +/** @file
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#ifndef _IMX_I2C_H_
> +#define _IMX_I2C_H_
> +
> +#pragma pack(push, 1)

I don't see where below this has any effect.
If not required, please drop.

> +
> +typedef union {
> +  UINT16 AsUint16;

Not super happy with this name.
Could it be just "Raw"? (That pattern is used frequently in EDK2.)
Same applies to similar situations below.

> +  struct {
> +UINT16 Reserved0 : 1;
> +UINT16 ADR : 7;
> +UINT16 Reserved1 : 8;
> +  };
> +} IMX_I2C_IADR_REG;

IADR is the name I guess, but REG should ideally be fully written out
as REGISTER.

> +
> +typedef union {
> +  UINT16 AsUint16;
> +  struct {
> +UINT16 IC : 6;
> +UINT16 Reserved0 : 10;
> +  };
> +} IMX_I2C_IFDR_REG;
> +
> +typedef union {
> +  UINT16 AsUint16;
> +  struct {
> +UINT16 Reserved0 : 2;
> +UINT16 RSTA : 1;
> +UINT16 TXAK : 1;
> +UINT16 MTX : 1;
> +UINT16 MSTA : 1;
> +UINT16 IIEN : 1;
> +UINT16 IEN : 1;
> +UINT16 Reserved1 : 8;
> +  };
> +} IMX_I2C_I2CR_REG;
> +
> +#define IMX_I2C_I2SR_RXAK0x0001
> +#define IMX_I2C_I2SR_IIF 0x0002
> +#define IMX_I2C_I2SR_SRW 0x0004
> +#define IMX_I2C_I2SR_IAL 0x0010
> +#define IMX_I2C_I2SR_IBB 0x0020
> +#define IMX_I2C_I2SR_IAAS0x0040
> +#define IMX_I2C_I2SR_ICF 0x0080
> +
> +typedef union {
> +  UINT16 AsUint16;
> +  struct {
> +UINT16 RXAK : 1;
> +UINT16 IIF : 1;
> +UINT16 SRW : 1;
> +UINT16 Reserved0 : 1;
> +UINT16 IAL : 1;
> +UINT16 IBB : 1;
> +UINT16 IAAS : 1;
> +UINT16 ICF : 1;
> +UINT16 Reserved1 : 8;
> +  };
> +} IMX_I2C_I2SR_REG;
> +
> +typedef union {
> +  UINT16 AsUint16;
> +  struct {
> +UINT16 DATA : 8;
> +UINT16 Reserved0 : 8;
> +  };
> +} IMX_I2C_I2DR_REG;
> +
> +typedef struct {
> +  IMX_I2C_IADR_REG IADR;
> +  UINT16 Pad0;
> +  IMX_I2C_IFDR_REG IFDR;
> +  UINT16 Pad1;
> +  IMX_I2C_I2CR_REG I2CR;
> +  UINT16 Pad2;
> +  IMX_I2C_I2DR_REG I2SR;
> +  UINT16 Pad3;
> +  IMX_I2C_I2DR_REG I2DR;
> +  UINT16 Pad4;
> +} IMX_I2C_REGS;

And here, REGISTERS.

> +
> +#pragma pack(pop)
> +
> +typedef struct {
> +  UINT32 ControllerAddress;
> +  UINT32 ControllerSlaveAddress;
> +  UINT32 ReferenceFreq;
> +  UINT32 TargetFreq;
> +  UINT32 SlaveAddress;
> +  UINT32 TimeoutInUs;
> +} IMX_I2C_CONFIG;
> +
> +typedef struct {
> +  UINT32 Divider;
> +  UINT32 IC;

Please expand to CamelCase.
It's not obvious what IC stands for.

> +} IMX_I2C_DIVIDER;
> +
> +/**
> +  Perform I2C read operation.
> +
> +  The iMXI2cRead perform I2C read operation by programming the I2C 
> controller.
> +  The caller is responsible to provide I2C controller configuration.
> +
> +  @param[in]IMX_I2C_CONFIGPointer to structure containing the 
> targeted
> +  I2C controller to be used for I2C 
> operation.
> +  @param[in]RegisterAddress   Targeted device register address to start 
> read.
> +  @param[out]   ReadBufferPtr Caller supplied buffer that would be 
> written
> +  into with data from the read operation.
> +  @param[in]ReadBufferSizeSize of caller supplied buffer.
> +
> +  @retval   RETURN_SUCCESSI2C Read operation succeeded.
> +  @retval   RETURN_DEVICE_ERROR   The I2C device is not functioning 
> correctly.
> +
> +**/
> +RETURN_STATUS
> +iMXI2cRead (
> +  IN IMX_I2C_CONFIG  *I2cConfigPtr,
> +  IN UINT8RegisterAddress,
> +  OUT UINT8  *ReadBufferPtr,
> +  IN UINT32   ReadBufferSize
> +  );
> +
> +/**
> +  Perform I2C write operation.
> +
> +  The iMXI2cWrite perform I2C write operation by programming 

Re: [edk2] [PATCH 3/6] IntelFrameworkPkg: fix build for AARCH64/ARM

2018-11-01 Thread Kinney, Michael D
Reviewed-by: Michael D Kinney 

Mike


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Thursday, November 1, 2018 8:37 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ;
> Gao, Liming 
> Subject: [PATCH 3/6] IntelFrameworkPkg: fix build for
> AARCH64/ARM
> 
> Contrary to what the name suggests, some modules in
> this package are used
> on other architecture. ARM is already listed in
> SUPPORTED_ARCHITECTURES
> in the .dsc, but AARCH64 was never added - so do that.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 
> ---
>  IntelFrameworkPkg/IntelFrameworkPkg.dsc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
> b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
> index bd5df8c5d9..f957af78fb 100644
> --- a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
> +++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
> @@ -26,7 +26,7 @@ [Defines]
>PLATFORM_VERSION   = 0.96
>DSC_SPECIFICATION  = 0x00010005
>OUTPUT_DIRECTORY   =
> Build/IntelFramework
> -  SUPPORTED_ARCHITECTURES= IA32|X64|EBC|ARM
> +  SUPPORTED_ARCHITECTURES=
> IA32|X64|EBC|ARM|AARCH64
>BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
>SKUID_IDENTIFIER   = DEFAULT
> 
> --
> 2.11.0

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


Re: [edk2] [PATCH 1/6] AppPkg: fix webserver build for !Ia32/X64

2018-11-01 Thread Kinney, Michael D
Leif,

The MSR definitions are only used by Mtrr.c, and Mtrr.c is only
used for IA32 and X64 builds in the INF file.

It would be simpler to move the #include 
into Mtrr.c.  That would avoid the use of #if.

Mike

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of Leif Lindholm
> Sent: Thursday, November 1, 2018 8:37 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Daryl
> McDaniel 
> Subject: [edk2] [PATCH 1/6] AppPkg: fix webserver build
> for !Ia32/X64
> 
> The WebServer application is really quite Ia32/X64
> specific, but fundamentally
> it builds for other architectures as long as the
> architecture-specific
>   #include 
> header file is filtered out.
> So add an architecture-based filter on that to enable
> AppPkg.dsc to build for
> AARCH64/ARM (both listed in SUPPORTED_ARCHITECTURES).
> 
> Cc: Daryl McDaniel 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 
> ---
> 
> Note: there is definitely a case here for just
> disabling this component
>   for !Ia32/X64, but the _interesting_ bits of this
> application are
>   completely architecture independent, so my
> preference would be to
>   do this for now, and worry about remaining issues
> (like MTRR dump)
>   at some point in the future.
> 
>  AppPkg/Applications/Sockets/WebServer/WebServer.h | 2
> ++
>  1 file changed, 2 insertions(+)
> 
> diff --git
> a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> index 21b07b63df..610abdcf9e 100644
> --- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
> +++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
> @@ -20,7 +20,9 @@
> 
>  #include 
> 
> +#if defined(__x86_64__) || defined(__i386__)
>  #include 
> +#endif
>  #include 
>  #include 
>  #include 
> --
> 2.11.0
> 
> ___
> 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] Capsules and versions

2018-11-01 Thread Sean Brogan via edk2-devel
Tom,

Short answer:  It is tool dependent. 

On Windows where the ESRT and FMP have been used for years there is another 
file that contains that information (Capsules are just driver packages so there 
is an INF and CAT file along with the BIN).  
Once the firmware gets to processing the actual payload (after stripping all 
the standard headers/structures) our firmware implementation makes use of a 
EDK2 defined header that contains this information as well as lowest supported 
version.   See here.  
https://github.com/tianocore/edk2/blob/master/FmpDevicePkg/Include/Library/FmpPayloadHeaderLib.h
  

Hope that helps. 

Thanks
Sean



-Original Message-
From: edk2-devel  On Behalf Of Tomas Pilar 
(tpilar)
Sent: Thursday, November 1, 2018 7:22 AM
To: edk2-devel@lists.01.org
Subject: [edk2] Capsules and versions

Hi,

I am trying to implement FMP in our IHV UEFI driver so that we can update 
firmware and the driver using capsules. I get the ESRT populated by the 
platform EsrtFmpDxe, that's all great.

However, it seems that EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER does not 
contain any version information about the firmware blob (neither Version nor 
ImageId). How is the OS tool that stages capsules supposed to know whether the 
capsule contains firmware that has been in fact already applied?

Cheers,
Tom
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fmailman%2Flistinfo%2Fedk2-develdata=02%7C01%7Csean.brogan%40microsoft.com%7Cdbe4babaafe84ee0a01c08d6400699cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636766794429049806sdata=CaAhG3UhI2%2BqSA6ml7USrFpGjuENBMNS4HK5xKuUGec%3Dreserved=0
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH 5/6] SecurityPkg: fix package build on ARM

2018-11-01 Thread Leif Lindholm
The CompilerIntrinsicsLib and BaseStackCheckLib need to be included in
order for an ARM build of the package .dsc to succeed - so add them.

Cc: Chao Zhang 
Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 SecurityPkg/SecurityPkg.dsc | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 68a2953162..eaccbd9354 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -73,6 +73,17 @@ [LibraryClasses]
   TcgStorageOpalLib|SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalLib.inf
   
ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf
 
+[LibraryClasses.ARM]
+  #
+  # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
+  # This library provides the instrinsic functions generate by a given 
compiler.
+  # And NULL mean link this library into all ARM images.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
+  # Add support for GCC stack protector
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
 [LibraryClasses.common.PEIM]
   PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
   PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
-- 
2.11.0

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


[edk2] [PATCH 6/6] SignedCapsulePkg: enable package build for AARCH64/ARM

2018-11-01 Thread Leif Lindholm
This package is used by several platforms in edk2-platforms, so ensure it
can be built directly by adding AARCH64/ARM to SUPPORTED_ARCHITECTURES.

Also force-include CompilerIntrinsicsLib, BaseStackCheckLib and create a
resolution for ArmSoftFloatLib for ARM.

Cc: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 SignedCapsulePkg/SignedCapsulePkg.dsc | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc 
b/SignedCapsulePkg/SignedCapsulePkg.dsc
index db7f176166..3d9c4afb91 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -19,7 +19,7 @@ [Defines]
   PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/SignedCapsulePkg
-  SUPPORTED_ARCHITECTURES= IA32|X64
+  SUPPORTED_ARCHITECTURES= AARCH64|ARM|IA32|X64
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
 
@@ -105,6 +105,19 @@ [LibraryClasses]
   IniParsingLib|SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.inf
   
PlatformFlashAccessLib|SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf
 
+[LibraryClasses.ARM]
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
+  #
+  # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
+  # This library provides the instrinsic functions generate by a given 
compiler.
+  # And NULL mean link this library into all ARM images.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
+  # Add support for GCC stack protector
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
 [LibraryClasses.common.PEI_CORE]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
-- 
2.11.0

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


[edk2] [PATCH 1/6] AppPkg: fix webserver build for !Ia32/X64

2018-11-01 Thread Leif Lindholm
The WebServer application is really quite Ia32/X64 specific, but fundamentally
it builds for other architectures as long as the architecture-specific
  #include 
header file is filtered out.
So add an architecture-based filter on that to enable AppPkg.dsc to build for
AARCH64/ARM (both listed in SUPPORTED_ARCHITECTURES).

Cc: Daryl McDaniel 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---

Note: there is definitely a case here for just disabling this component
  for !Ia32/X64, but the _interesting_ bits of this application are
  completely architecture independent, so my preference would be to
  do this for now, and worry about remaining issues (like MTRR dump)
  at some point in the future.

 AppPkg/Applications/Sockets/WebServer/WebServer.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/AppPkg/Applications/Sockets/WebServer/WebServer.h 
b/AppPkg/Applications/Sockets/WebServer/WebServer.h
index 21b07b63df..610abdcf9e 100644
--- a/AppPkg/Applications/Sockets/WebServer/WebServer.h
+++ b/AppPkg/Applications/Sockets/WebServer/WebServer.h
@@ -20,7 +20,9 @@
 
 #include 
 
+#if defined(__x86_64__) || defined(__i386__)
 #include 
+#endif
 #include 
 #include 
 #include 
-- 
2.11.0

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


[edk2] [PATCH 4/6] MdeModulePkg: drop DebugSupportDxe from AARCH64 components

2018-11-01 Thread Leif Lindholm
DebugSupportDxe.inf was listed in
[Components.IA32, Components.X64, Components.AARCH64], but the plumbing
that would be required to actually build it does not exist.

Move the component to [Components.IA32, Components.X64] to permit build
of MdeModulePkg.dsc on AARCH64.

Cc: Star Zeng 
Cc: Jian J Wang 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 MdeModulePkg/MdeModulePkg.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 2465d39fd7..942c70566b 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -423,7 +423,6 @@ [Components]
 
 [Components.IA32, Components.X64, Components.AARCH64]
   MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
   MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
   MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf
   MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf
@@ -440,6 +439,7 @@ [Components.IA32, Components.X64, Components.Ebc]
   MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
 
 [Components.IA32, Components.X64]
+  MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
   MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.inf
   MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
   MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
-- 
2.11.0

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


[edk2] [PATCH 0/6] fix top-level package builds for AARCH64/ARM

2018-11-01 Thread Leif Lindholm
Most of the top-level packages should be buildable for all architectures
Here is a fairly trivial set that makes that happen.

Leif Lindholm (6):
  AppPkg: fix webserver build for !Ia32/X64
  IntelFrameworkModulePkg: fix build for AARCH64/ARM
  IntelFrameworkPkg: fix build for AARCH64/ARM
  MdeModulePkg: drop DebugSupportDxe from AARCH64 components
  SecurityPkg: fix package build on ARM
  SignedCapsulePkg: enable package build for AARCH64/ARM

Cc: Daryl McDaniel 
Cc: Jaben Carsey 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Chao Zhang 
Cc: Jiewen Yao 

 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 13 -
 IntelFrameworkPkg/IntelFrameworkPkg.dsc |  2 +-
 MdeModulePkg/MdeModulePkg.dsc   |  2 +-
 SecurityPkg/SecurityPkg.dsc | 11 +++
 SignedCapsulePkg/SignedCapsulePkg.dsc   | 15 ++-
 AppPkg/Applications/Sockets/WebServer/WebServer.h   |  2 ++
 6 files changed, 41 insertions(+), 4 deletions(-)

-- 
2.11.0

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


[edk2] [PATCH 2/6] IntelFrameworkModulePkg: fix build for AARCH64/ARM

2018-11-01 Thread Leif Lindholm
Contrary to what the name suggests, some modules in this package are used
on other architecture. ARM is already listed in SUPPORTED_ARCHITECTURES
in the .dsc, but AARCH64 was never added.

Add that, and force inclusion of CompilerIntrinsicsLib and
BaseStackCheckLib for AARCH64/ARM to make the build successful.

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---
 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc 
b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index 894c5340a0..14bef5356e 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -25,7 +25,7 @@ [Defines]
   PLATFORM_VERSION   = 0.96
   DSC_SPECIFICATION  = 0x00010005
   OUTPUT_DIRECTORY   = Build/IntelFrameworkModuleAll
-  SUPPORTED_ARCHITECTURES= IA32|X64|EBC|ARM
+  SUPPORTED_ARCHITECTURES= IA32|X64|EBC|ARM|AARCH64
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
 
@@ -76,6 +76,17 @@ [LibraryClasses]
   UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
 
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
+  # This library provides the instrinsic functions generate by a given 
compiler.
+  # And NULL mean link this library into all ARM images.
+  #^M
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+
+  # Add support for GCC stack protector
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
 [LibraryClasses.common.PEIM]
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
   PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
-- 
2.11.0

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


[edk2] [Patch] BaseTools: Use common cc flag for building PcdValueInit.

2018-11-01 Thread BobCF
Use common cc flags for building PcdValueInit. The common
cc flags include the cc flag which is under common Arch and
under all build Arches.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 .../Source/Python/Workspace/DscBuildData.py   | 48 +--
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 6d596b2b54..4807fff489 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2298,38 +2298,38 @@ class DscBuildData(PlatformBuildClassObject):
 if Family and Family != self.ToolChainFamily:
 continue
 Target, Tag, Arch, Tool, Attr = Options[1].split("_")
 if Tool != 'CC':
 continue
-
+if Attr != "FLAGS":
+continue
 if Target == "*" or Target == self._Target:
 if Tag == "*" or Tag == self._Toolchain:
+if 'COMMON' not in BuildOptions:
+BuildOptions['COMMON'] = set()
 if Arch == "*":
-if Tool not in BuildOptions:
-BuildOptions[Tool] = OrderedDict()
-if Attr != "FLAGS" or Attr not in BuildOptions[Tool] 
or self.BuildOptions[Options].startswith('='):
-BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
-else:
-# append options for the same tool except PATH
-if Attr != 'PATH':
-BuildOptions[Tool][Attr] += " " + 
self.BuildOptions[Options]
-else:
-BuildOptions[Tool][Attr] = 
self.BuildOptions[Options]
+BuildOptions['COMMON'].add(self.BuildOptions[Options])
+if Arch in self.SupArchList:
+if Arch not in BuildOptions:
+BuildOptions[Arch] = set()
+BuildOptions[Arch].add(self.BuildOptions[Options])
+
 if BuildOptions:
-for Tool in BuildOptions:
-for Attr in BuildOptions[Tool]:
-if Attr == "FLAGS":
-Value = BuildOptions[Tool][Attr]
-ValueList = Value.split()
-if ValueList:
-for Id, Item in enumerate(ValueList):
-if Item in ['-D', '/D', '-U', '/U']:
-CC_FLAGS += ' ' + Item
-if Id + 1 < len(ValueList):
-CC_FLAGS += ' ' + ValueList[Id + 1]
-elif Item.startswith(('-D', '/D', '-U', '/U')):
-CC_FLAGS += ' ' + Item
+ArchBuildOptions = {arch:flags for arch,flags in 
BuildOptions.items() if arch != 'COMMON'}
+if len(ArchBuildOptions.keys()) == 1:
+BuildOptions['COMMON'] |= (ArchBuildOptions.values()[0])
+else:
+CommonBuildOptions = reduce(lambda x,y: x, 
ArchBuildOptions.values())
+BuildOptions['COMMON'] |= CommonBuildOptions
+ValueList = list(BuildOptions['COMMON'])
+for Id, Item in enumerate(ValueList):
+if Item in ['-D', '/D', '-U', '/U']:
+CC_FLAGS += ' ' + Item
+if Id + 1 < len(ValueList):
+CC_FLAGS += ' ' + ValueList[Id + 1]
+elif Item.startswith(('-D', '/D', '-U', '/U')):
+CC_FLAGS += ' ' + Item
 MakeApp += CC_FLAGS
 
 if sys.platform == "win32":
 MakeApp = MakeApp + PcdMakefileEnd
 MakeApp = MakeApp + AppTarget % ("""\tcopy $(APPLICATION) 
$(APPFILE) /y """)
-- 
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 v5 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-11-01 Thread Sumit Garg
On Thu, 1 Nov 2018 at 17:13, Leif Lindholm  wrote:
>
> Hi Sumit,
>
> Actually, this module does not compile for ARM (32-bit).
> ---
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
> ‘OpteeOpenSession’:
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:216:25: error: cast from 
> pointer to integer of different size [-Werror=pointer-to-int-cast]
>if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) {
>  ^
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
> ‘OpteeCloseSession’:
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:249:21: error: cast from 
> pointer to integer of different size [-Werror=pointer-to-int-cast]
>OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg);
>  ^
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
> ‘OpteeToMessageParam’:
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:307:9: error: cast to pointer 
> from integer of different size [-Werror=int-to-pointer-cast]
>   (VOID *)InParam->Union.Memory.BufferAddress,
>   ^
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
> ‘OpteeFromMessageParam’:
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:371:9: error: cast to pointer 
> from integer of different size [-Werror=int-to-pointer-cast]
>   (VOID *)OutParam->Union.Memory.BufferAddress,
>   ^
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:372:9: error: cast to pointer 
> from integer of different size [-Werror=int-to-pointer-cast]
>   (VOID *)MessageParam->Union.Memory.BufferAddress,
>   ^
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
> ‘OpteeInvokeFunction’:
> /work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:420:25: error: cast from 
> pointer to integer of different size [-Werror=pointer-to-int-cast]
>if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) {
>  ^
> ---
>
> Is it intended to be for 64-bit only?
> If so, can you pleace send a patch to move 
> ArmPkg/Library/OpteeLib/OpteeLib.inf
> to the [Components.AARCH64] section of ArmPkg/ArmPkg.dsc.
>
> If not, please rework the use of EFI_PHYSICAL_ADDRESS (always 64-bit)
> vs. pointers (depending on architecture).
>

Thanks Leif for reporting this. Optee library should work for ARM
(32-bit) architecture too. Will try to fix compilation issue for ARM
(32-bit) and send corresponding patch.

Regards,
Sumit

> Regards,
>
> Leif
>
> On Mon, Oct 22, 2018 at 11:59:36AM +0530, Sumit Garg wrote:
> > Add following APIs to communicate with OP-TEE pseudo/early TAs:
> > 1. OpteeInit
> > 2. OpteeOpenSession
> > 3. OpteeCloseSession
> > 4. OpteeInvokeFunc
> >
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Sumit Garg 
> > ---
> >  ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
> >  ArmPkg/Include/Library/OpteeLib.h|  88 +
> >  ArmPkg/Library/OpteeLib/OpteeSmc.h   |  53 +++
> >  ArmPkg/Library/OpteeLib/Optee.c  | 392 
> >  4 files changed, 535 insertions(+)
> >
> > diff --git a/ArmPkg/Library/OpteeLib/OpteeLib.inf 
> > b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> > index 5abd427379cc..e03054a7167d 100644
> > --- a/ArmPkg/Library/OpteeLib/OpteeLib.inf
> > +++ b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> > @@ -23,11 +23,13 @@ [Defines]
> >
> >  [Sources]
> >Optee.c
> > +  OpteeSmc.h
> >
> >  [Packages]
> >ArmPkg/ArmPkg.dec
> >MdePkg/MdePkg.dec
> >
> >  [LibraryClasses]
> > +  ArmMmuLib
> >ArmSmcLib
> >BaseLib
> > diff --git a/ArmPkg/Include/Library/OpteeLib.h 
> > b/ArmPkg/Include/Library/OpteeLib.h
> > index f65d8674d9b8..6884d5681831 100644
> > --- a/ArmPkg/Include/Library/OpteeLib.h
> > +++ b/ArmPkg/Include/Library/OpteeLib.h
> > @@ -25,10 +25,98 @@
> >  #define OPTEE_OS_UID2  0xaf630002
> >  #define OPTEE_OS_UID3  0xa5d5c51b
> >
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE0x0
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT0x2
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT0x9
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT   0xa
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT0xb
> > +
> > +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK0xff
> > +
> > +#define OPTEE_ORIGIN_COMMUNICATION  0x0002
> > +#define OPTEE_ERROR_COMMUNICATION   0x000E
> > +
> > +typedef struct {
> > +  UINT64BufferAddress;
> > +  UINT64Size;
> > +  UINT64SharedMemoryReference;
> > +} OPTEE_MESSAGE_PARAM_MEMORY;
> > +
> > +typedef struct {
> > +  UINT64A;
> > +  UINT64B;
> > +  UINT64C;
> > +} OPTEE_MESSAGE_PARAM_VALUE;
> > +
> > +typedef struct {
> > +  UINT64 Attribute;
> > +  union {
> > +OPTEE_MESSAGE_PARAM_MEMORY   Memory;
> > +

[edk2] [Patch] BaseTools: Add checking to EFI variable attribute.

2018-11-01 Thread BobCF
This patch is going to add a check that only if the
attribute of a EFI variable include 'NV', it will be
added into PcdNvStoreDefaultValueBuffer.

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

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 9c3759c0f5..a1c8dc7efb 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1163,10 +1163,12 @@ class PlatformAutoGen(AutoGen):
 Sku = Pcd.SkuInfoList[SkuName]
 SkuId = Sku.SkuId
 if SkuId is None or SkuId == '':
 continue
 if len(Sku.VariableName) > 0:
+if Sku.VariableAttribute and 'NV' not in 
Sku.VariableAttribute:
+continue
 VariableGuidStructure = Sku.VariableGuidValue
 VariableGuid = 
GuidStructureStringToGuidString(VariableGuidStructure)
 for StorageName in Sku.DefaultStoreDict:
 VariableInfo.append_variable(var_info(Index, pcdname, 
StorageName, SkuName, StringToArray(Sku.VariableName), VariableGuid, 
Sku.VariableOffset, Sku.VariableAttribute, Sku.HiiDefaultValue, 
Sku.DefaultStoreDict[StorageName] if Pcd.DatumType in TAB_PCD_NUMERIC_TYPES 
else StringToArray(Sku.DefaultStoreDict[StorageName]), Pcd.DatumType, 
Pcd.CustomAttribute['DscPosition'], Pcd.CustomAttribute.get('IsStru',False)))
 Index += 1
-- 
2.18.0.windows.1

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


[edk2] [Patch] BaseTool: Filter out unused structure pcds

2018-11-01 Thread BobCF
V2:
Fixed the issue that V1 adds new check
to the Pcds in the platform unused library INF files.
It breaks the existing platform.

V1:
The current code handle all the structure pcds
even if there is no module or library use them.
This patch is going to filter out the unused structure pcds.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng 
Cc: Liming Gao 
---
 .../Source/Python/Workspace/DscBuildData.py   | 22 +++
 .../Source/Python/Workspace/InfBuildData.py   |  9 
 .../Python/Workspace/WorkspaceDatabase.py |  5 -
 3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 6d596b2b54..5d25d20639 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -1467,10 +1467,11 @@ class DscBuildData(PlatformBuildClassObject):
 if str_pcd_obj.Type in 
[self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_HII], 
self._PCD_TYPE_STRING_[MODEL_PCD_DYNAMIC_EX_HII]]:
 str_pcd_obj_str.DefaultFromDSC = 
{skuname:{defaultstore: 
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, 
str_pcd_obj.SkuInfoList[skuname].HiiDefaultValue) for defaultstore in 
DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
 else:
 str_pcd_obj_str.DefaultFromDSC = 
{skuname:{defaultstore: 
str_pcd_obj.SkuInfoList[skuname].DefaultStoreDict.get(defaultstore, 
str_pcd_obj.SkuInfoList[skuname].DefaultValue) for defaultstore in 
DefaultStores} for skuname in str_pcd_obj.SkuInfoList}
 S_pcd_set[Pcd] = str_pcd_obj_str
+self.FilterStrcturePcd(S_pcd_set)
 if S_pcd_set:
 GlobalData.gStructurePcd[self.Arch] = S_pcd_set
 for stru_pcd in S_pcd_set.values():
 for skuid in SkuIds:
 if skuid in stru_pcd.SkuOverrideValues:
@@ -1562,10 +1563,31 @@ class DscBuildData(PlatformBuildClassObject):
 elif TAB_DEFAULT in pcd.SkuInfoList and TAB_COMMON in 
pcd.SkuInfoList:
 del pcd.SkuInfoList[TAB_COMMON]
 
 map(self.FilterSkuSettings, [Pcds[pcdkey] for pcdkey in Pcds if 
Pcds[pcdkey].Type in DynamicPcdType])
 return Pcds
+@cached_property
+def PlatformUsedPcds(self):
+FdfInfList = []
+if GlobalData.gFdfParser:
+FdfInfList = GlobalData.gFdfParser.Profile.InfList
+FdfModuleList = [PathClass(NormPath(Inf), GlobalData.gWorkspace, 
Arch=self._Arch) for Inf in FdfInfList]
+AllModulePcds = set()
+ModuleSet = set(self._Modules.keys() + FdfModuleList)
+for ModuleFile in ModuleSet:
+ModuleData = self._Bdb[ModuleFile, self._Arch, self._Target, 
self._Toolchain]
+AllModulePcds = AllModulePcds | ModuleData.PcdsName
+for ModuleFile in self.LibraryInstances:
+ModuleData = self._Bdb.CreateBuildObject(ModuleFile, self._Arch, 
self._Target, self._Toolchain)
+AllModulePcds = AllModulePcds | ModuleData.PcdsName
+return AllModulePcds
+
+#Filter the StrucutrePcd that is not used by any module in dsc file and 
fdf file.
+def FilterStrcturePcd(self, S_pcd_set):
+UnusedStruPcds = set(S_pcd_set.keys()) - self.PlatformUsedPcds
+for (Token, TokenSpaceGuid) in UnusedStruPcds:
+del S_pcd_set[(Token, TokenSpaceGuid)]
 
 ## Retrieve non-dynamic PCD settings
 #
 #   @param  TypePCD type
 #
diff --git a/BaseTools/Source/Python/Workspace/InfBuildData.py 
b/BaseTools/Source/Python/Workspace/InfBuildData.py
index d615cccdf7..99bbecfd1f 100644
--- a/BaseTools/Source/Python/Workspace/InfBuildData.py
+++ b/BaseTools/Source/Python/Workspace/InfBuildData.py
@@ -792,10 +792,19 @@ class InfBuildData(ModuleBuildClassObject):
 RetVal.update(self._GetPcd(MODEL_PCD_FEATURE_FLAG))
 RetVal.update(self._GetPcd(MODEL_PCD_DYNAMIC))
 RetVal.update(self._GetPcd(MODEL_PCD_DYNAMIC_EX))
 return RetVal
 
+@cached_property
+def PcdsName(self):
+PcdsName = set()
+for Type in 
(MODEL_PCD_FIXED_AT_BUILD,MODEL_PCD_PATCHABLE_IN_MODULE,MODEL_PCD_FEATURE_FLAG,MODEL_PCD_DYNAMIC,MODEL_PCD_DYNAMIC_EX):
+RecordList = self._RawData[Type, self._Arch, self._Platform]
+for TokenSpaceGuid, PcdCName, _, _, _, _, _ in RecordList:
+PcdsName.add((PcdCName, TokenSpaceGuid))
+return PcdsName
+
 ## Retrieve build options specific to this module
 @cached_property
 def BuildOptions(self):
 if self._BuildOptions is None:
 self._BuildOptions = OrderedDict()
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py 
b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index 3bb287b8b2..c41922f6f9 100644
--- 

[edk2] [Patch 1/1] BaseTools tools_def.template: Add GCC link script in X86 ASLDLINK_FLAGS

2018-11-01 Thread Liming Gao
This fix refers to commit 14ca435fb6c059eaeb7fe6eedbe4738ffaf336d0.
GCC link script is used to discard the unused section data from ELF image.
ASLDLINK_FLAGS requires it to remove the unnecessary section data, then
GenFw can be used to retrieve the correct data section from ELF image.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
---
 BaseTools/Conf/tools_def.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template 
b/BaseTools/Conf/tools_def.template
index a22b96c0b8..e0e68fd7fb 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4253,7 +4253,7 @@ DEFINE GCC48_AARCH64_ASLDLINK_FLAGS  = 
DEF(GCC47_AARCH64_ASLDLINK_FLAGS)
 DEFINE GCC49_IA32_CC_FLAGS   = DEF(GCC48_IA32_CC_FLAGS)
 DEFINE GCC49_X64_CC_FLAGS= DEF(GCC48_X64_CC_FLAGS)
 DEFINE GCC49_IA32_X64_DLINK_COMMON   = -nostdlib -Wl,-n,-q,--gc-sections -z 
common-page-size=0x40
-DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) 
-Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
+DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) 
-Wl,--defsym=PECOFF_HEADER_SIZE=0 DEF(GCC_DLINK2_FLAGS_COMMON) 
-Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable
 DEFINE GCC49_IA32_X64_DLINK_FLAGS= DEF(GCC49_IA32_X64_DLINK_COMMON) 
-Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) 
-Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive
 DEFINE GCC49_IA32_DLINK2_FLAGS   = DEF(GCC48_IA32_DLINK2_FLAGS)
 DEFINE GCC49_X64_DLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_FLAGS) 
-Wl,-melf_x86_64,--oformat=elf64-x86-64,-pie
-- 
2.16.2.windows.1

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


[edk2] Capsules and versions

2018-11-01 Thread Tomas Pilar (tpilar)
Hi,

I am trying to implement FMP in our IHV UEFI driver so that we can update 
firmware and the driver using capsules. I get the ESRT populated by the 
platform EsrtFmpDxe, that's all great.

However, it seems that EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER does not 
contain any version information about the firmware blob (neither Version nor 
ImageId). How is the OS tool that stages capsules supposed to know whether the 
capsule contains firmware that has been in fact already applied?

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


[edk2] [Patch] MdeModulePkg: Remove the trailing space in three source files.

2018-11-01 Thread Liming Gao
The recent changes in these three source files introduce the trailing space.
This patch removes them to follow edk2 coding style.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Star Zeng 
---
 MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c | 2 +-
 MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h| 2 +-
 MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c 
b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
index c31247a..513575d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusPei/UsbPeim.c
@@ -958,7 +958,7 @@ GetExpectedDescriptor (
   UINTN   Offset;
 
   //
-  // Total length is too small that cannot hold the single descriptor header 
plus data. 
+  // Total length is too small that cannot hold the single descriptor header 
plus data.
   //
   if (Length <= sizeof (USB_DESC_HEAD)) {
 DEBUG ((DEBUG_ERROR, "GetExpectedDescriptor: met mal-format descriptor, 
total length = %d!\n", Length));
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h 
b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
index be2f8af..ad3afa6 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h
@@ -129,7 +129,7 @@ struct _MTFTP4_PROTOCOL {
   // Record the total received and saved block number.
   //
   UINT64TotalBlock;
-  
+
   //
   // Record the acked block number.
   //
diff --git 
a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf 
b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
index 7ccab57..30c955f 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/RegularExpressionDxe.inf
@@ -112,7 +112,7 @@
 
   # Oniguruma: tag_end in parse_callout_of_name
   GCC:*_*_*_CC_FLAGS = -Wno-error=maybe-uninitialized
-  
+
   # Not add -Wno-error=maybe-uninitialized option for XCODE
   # XCODE doesn't know this option
   XCODE:*_*_*_CC_FLAGS =
-- 
2.10.0.windows.1

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


Re: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module types

2018-11-01 Thread Gao, Liming
Jeff:
  Thanks for your case. PrePiMemoryAllocationLib is a MemoryAllocationLib 
implementation that doesn't depend on PEI or DXE service. So, 
MemoryAllocationLib may be used in BASE type. And, I find 
MdeModulePkg\Library\BaseBmpSupportLib\BaseBmpSupportLib.inf is BASE type and 
consumes MemoryAllocationLib. So, I think your change is OK. Reviewed-by: 
Liming Gao 

Thanks
Liming
From: Jeff Brasen [mailto:jbra...@nvidia.com]
Sent: Thursday, November 1, 2018 2:25 PM
To: Ni, Ruiyu ; edk2-devel@lists.01.org
Cc: Gao, Liming ; Kinney, Michael D 

Subject: Re: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types


For defining it as a BASE type i changed that to that as there is a 
MemoryAllocationLib defined for the various phases. For example, SEC uses 
EmbeddedPkg/Library/PrePiMemoryAllocationLib (other patch in this series 
implements the AllocateZeroPool that is needed for this).



I am not opposed to an allocation-less SortLib but was trying to enable this 
capability without impact to other users of this library.



Thanks,

Jeff


From: Ni, Ruiyu mailto:ruiyu...@intel.com>>
Sent: Wednesday, October 31, 2018 2:56:42 AM
To: Jeff Brasen; edk2-devel@lists.01.org
Cc: Gao, Liming; Kinney, Michael D
Subject: RE: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types

SortLib depends on MemoryAllocationLib.
How can it be a BASE type library?

Can we do it in two options?
1. Change the SortLib API to accept a temporary buffer from caller. So the 
MemoryAllocationlIb dependency can be removed.
2. Do not change SortLibAPI but uses a fixed-size temporary buffer internally. 
E.g.: UINT8 Buffer[MAX_ELEMENT_SIZE];


Thanks/Ray

> -Original Message-
> From: edk2-devel 
> mailto:edk2-devel-boun...@lists.01.org>> On 
> Behalf Of Jeff
> Brasen
> Sent: Wednesday, October 31, 2018 5:31 AM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen mailto:jbra...@nvidia.com>>
> Subject: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all
> module types
>
> Expose BaseSortLib for use in SEC and PEI phases.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen mailto:jbra...@nvidia.com>>
> ---
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> index f807cd7..5bd1aa1 100644
> --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> @@ -18,9 +18,9 @@
>BASE_NAME  = BaseSortLib
>MODULE_UNI_FILE= BaseSortLib.uni
>FILE_GUID  = 03F3331B-F12D-494f-BF37-E55A657F2497
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = SortLib|DXE_DRIVER DXE_RUNTIME_DRIVER
> UEFI_APPLICATION UEFI_DRIVER
> +  LIBRARY_CLASS  = SortLib
>
>  #
>  #  VALID_ARCHITECTURES   = IA32 X64 EBC
> --
> 2.7.4
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

This email message is for the sole use of the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply email and destroy all copies of the original 
message.

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


Re: [edk2] [PATCH] Platform/ARM: Fix FVP broken build with "-D DT_SUPPORT"

2018-11-01 Thread Thomas Abraham
On Thu, Nov 1, 2018 at 5:18 PM Leif Lindholm  wrote:
>
> Thanks Andrew,
>
> Thomas, Nariman - can I have a review from one of you guys before I
> push?
>
> Regards,
>
> Leif
>
> On Thu, Nov 01, 2018 at 11:35:42AM +, Andrew Turner wrote:
> > The UEFI build fails for ArmVExpress-FVP-AArch64 when using the
> > "-D DT_SUPPORT" buildoption.
> >
> > ArmVExpressDtPlatformDtbLoaderLib is missing the ArmVExpressPkg.dec package
> > and fails with:
> > .../Platform/ARM/VExpressPkg/Include/Platform/RTSM/ArmPlatform.h:19:33:
> > fatal error: VExpressMotherBoard.h: No such file or directory
> >
> > Cc: Leif Lindholm 
> > Cc: Ard Biesheuvel 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Andrew Turner 
> > ---
> >  .../ArmVExpressDtPlatformDtbLoaderLib.inf| 
> > 1 +
> >  1 file changed, 1 insertion(+)

Tested with -D DT_SUPPORT as additional build option and the below
change does fix the build issue reported in this commit message.

Tested-by: Thomas Abraham 

> >
> > diff --git 
> > a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> >  
> > b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > index 5012101..eb821c7 100644
> > --- 
> > a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > +++ 
> > b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > @@ -26,6 +26,7 @@
> >  [Packages]
> >ArmPkg/ArmPkg.dec
> >MdePkg/MdePkg.dec
> > ++  Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
> >EmbeddedPkg/EmbeddedPkg.dec
> >
> >  [LibraryClasses]
> > --
> > 2.7.4
> >
> ___
> 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] Platform/ARM: Fix FVP broken build with "-D DT_SUPPORT"

2018-11-01 Thread Thomas Abraham
On Thu, Nov 1, 2018 at 5:18 PM Leif Lindholm  wrote:
>
> Thanks Andrew,
>
> Thomas, Nariman - can I have a review from one of you guys before I
> push?
>
> Regards,
>
> Leif
>
> On Thu, Nov 01, 2018 at 11:35:42AM +, Andrew Turner wrote:
> > The UEFI build fails for ArmVExpress-FVP-AArch64 when using the
> > "-D DT_SUPPORT" buildoption.
> >
> > ArmVExpressDtPlatformDtbLoaderLib is missing the ArmVExpressPkg.dec package
> > and fails with:
> > .../Platform/ARM/VExpressPkg/Include/Platform/RTSM/ArmPlatform.h:19:33:
> > fatal error: VExpressMotherBoard.h: No such file or directory
> >
> > Cc: Leif Lindholm 
> > Cc: Ard Biesheuvel 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Andrew Turner 
> > ---
> >  .../ArmVExpressDtPlatformDtbLoaderLib.inf| 
> > 1 +
> >  1 file changed, 1 insertion(+)

Tested with -D DT_SUPPORT as additional build option and the below
change does fix the build issue reported in this commit message.

Tested-by: Thomas Abraham 

> >
> > diff --git 
> > a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> >  
> > b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > index 5012101..eb821c7 100644
> > --- 
> > a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > +++ 
> > b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> > @@ -26,6 +26,7 @@
> >  [Packages]
> >ArmPkg/ArmPkg.dec
> >MdePkg/MdePkg.dec
> > ++  Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
> >EmbeddedPkg/EmbeddedPkg.dec
> >
> >  [LibraryClasses]
> > --
> > 2.7.4
> >
> ___
> 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] Platform/ARM: Fix FVP broken build with "-D DT_SUPPORT"

2018-11-01 Thread Leif Lindholm
Thanks Andrew,

Thomas, Nariman - can I have a review from one of you guys before I
push?

Regards,

Leif

On Thu, Nov 01, 2018 at 11:35:42AM +, Andrew Turner wrote:
> The UEFI build fails for ArmVExpress-FVP-AArch64 when using the
> "-D DT_SUPPORT" buildoption.
> 
> ArmVExpressDtPlatformDtbLoaderLib is missing the ArmVExpressPkg.dec package
> and fails with:
> .../Platform/ARM/VExpressPkg/Include/Platform/RTSM/ArmPlatform.h:19:33:
> fatal error: VExpressMotherBoard.h: No such file or directory
> 
> Cc: Leif Lindholm 
> Cc: Ard Biesheuvel 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Andrew Turner 
> ---
>  .../ArmVExpressDtPlatformDtbLoaderLib.inf| 1 
> +
>  1 file changed, 1 insertion(+)
> 
> diff --git 
> a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
>  
> b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> index 5012101..eb821c7 100644
> --- 
> a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> +++ 
> b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
> @@ -26,6 +26,7 @@
>  [Packages]
>ArmPkg/ArmPkg.dec
>MdePkg/MdePkg.dec
> ++  Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
>EmbeddedPkg/EmbeddedPkg.dec
>  
>  [LibraryClasses]
> -- 
> 2.7.4
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] Platform/ARM: Fix FVP broken build with "-D DT_SUPPORT"

2018-11-01 Thread Andrew Turner
The UEFI build fails for ArmVExpress-FVP-AArch64 when using the
"-D DT_SUPPORT" buildoption.

ArmVExpressDtPlatformDtbLoaderLib is missing the ArmVExpressPkg.dec package
and fails with:
.../Platform/ARM/VExpressPkg/Include/Platform/RTSM/ArmPlatform.h:19:33:
fatal error: VExpressMotherBoard.h: No such file or directory

Cc: Leif Lindholm 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Andrew Turner 
---
 .../ArmVExpressDtPlatformDtbLoaderLib.inf| 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
index 5012101..eb821c7 100644
--- 
a/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
+++ 
b/Platform/ARM/VExpressPkg/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
@@ -26,6 +26,7 @@
 [Packages]
   ArmPkg/ArmPkg.dec
   MdePkg/MdePkg.dec
++  Platform/ARM/VExpressPkg/ArmVExpressPkg.dec
   EmbeddedPkg/EmbeddedPkg.dec
 
 [LibraryClasses]
-- 
2.7.4

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


Re: [edk2] [PATCH v5 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE

2018-11-01 Thread Leif Lindholm
Hi Sumit,

Actually, this module does not compile for ARM (32-bit).
---
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function ‘OpteeOpenSession’:
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:216:25: error: cast from pointer 
to integer of different size [-Werror=pointer-to-int-cast]
   if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) {
 ^
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function ‘OpteeCloseSession’:
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:249:21: error: cast from pointer 
to integer of different size [-Werror=pointer-to-int-cast]
   OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg);
 ^
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
‘OpteeToMessageParam’:
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:307:9: error: cast to pointer 
from integer of different size [-Werror=int-to-pointer-cast]
  (VOID *)InParam->Union.Memory.BufferAddress,
  ^
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
‘OpteeFromMessageParam’:
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:371:9: error: cast to pointer 
from integer of different size [-Werror=int-to-pointer-cast]
  (VOID *)OutParam->Union.Memory.BufferAddress,
  ^
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:372:9: error: cast to pointer 
from integer of different size [-Werror=int-to-pointer-cast]
  (VOID *)MessageParam->Union.Memory.BufferAddress,
  ^
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c: In function 
‘OpteeInvokeFunction’:
/work/git/edk2/ArmPkg/Library/OpteeLib/Optee.c:420:25: error: cast from pointer 
to integer of different size [-Werror=pointer-to-int-cast]
   if (OpteeCallWithArg ((EFI_PHYSICAL_ADDRESS)MessageArg)) {
 ^
---

Is it intended to be for 64-bit only?
If so, can you pleace send a patch to move ArmPkg/Library/OpteeLib/OpteeLib.inf
to the [Components.AARCH64] section of ArmPkg/ArmPkg.dsc.

If not, please rework the use of EFI_PHYSICAL_ADDRESS (always 64-bit)
vs. pointers (depending on architecture).

Regards,

Leif

On Mon, Oct 22, 2018 at 11:59:36AM +0530, Sumit Garg wrote:
> Add following APIs to communicate with OP-TEE pseudo/early TAs:
> 1. OpteeInit
> 2. OpteeOpenSession
> 3. OpteeCloseSession
> 4. OpteeInvokeFunc
> 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Sumit Garg 
> ---
>  ArmPkg/Library/OpteeLib/OpteeLib.inf |   2 +
>  ArmPkg/Include/Library/OpteeLib.h|  88 +
>  ArmPkg/Library/OpteeLib/OpteeSmc.h   |  53 +++
>  ArmPkg/Library/OpteeLib/Optee.c  | 392 
>  4 files changed, 535 insertions(+)
> 
> diff --git a/ArmPkg/Library/OpteeLib/OpteeLib.inf 
> b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> index 5abd427379cc..e03054a7167d 100644
> --- a/ArmPkg/Library/OpteeLib/OpteeLib.inf
> +++ b/ArmPkg/Library/OpteeLib/OpteeLib.inf
> @@ -23,11 +23,13 @@ [Defines]
>  
>  [Sources]
>Optee.c
> +  OpteeSmc.h
>  
>  [Packages]
>ArmPkg/ArmPkg.dec
>MdePkg/MdePkg.dec
>  
>  [LibraryClasses]
> +  ArmMmuLib
>ArmSmcLib
>BaseLib
> diff --git a/ArmPkg/Include/Library/OpteeLib.h 
> b/ArmPkg/Include/Library/OpteeLib.h
> index f65d8674d9b8..6884d5681831 100644
> --- a/ArmPkg/Include/Library/OpteeLib.h
> +++ b/ArmPkg/Include/Library/OpteeLib.h
> @@ -25,10 +25,98 @@
>  #define OPTEE_OS_UID2  0xaf630002
>  #define OPTEE_OS_UID3  0xa5d5c51b
>  
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_NONE0x0
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INPUT 0x1
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_OUTPUT0x2
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_VALUE_INOUT 0x3
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INPUT0x9
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_OUTPUT   0xa
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MEMORY_INOUT0xb
> +
> +#define OPTEE_MESSAGE_ATTRIBUTE_TYPE_MASK0xff
> +
> +#define OPTEE_ORIGIN_COMMUNICATION  0x0002
> +#define OPTEE_ERROR_COMMUNICATION   0x000E
> +
> +typedef struct {
> +  UINT64BufferAddress;
> +  UINT64Size;
> +  UINT64SharedMemoryReference;
> +} OPTEE_MESSAGE_PARAM_MEMORY;
> +
> +typedef struct {
> +  UINT64A;
> +  UINT64B;
> +  UINT64C;
> +} OPTEE_MESSAGE_PARAM_VALUE;
> +
> +typedef struct {
> +  UINT64 Attribute;
> +  union {
> +OPTEE_MESSAGE_PARAM_MEMORY   Memory;
> +OPTEE_MESSAGE_PARAM_VALUEValue;
> +  } Union;
> +} OPTEE_MESSAGE_PARAM;
> +
> +#define OPTEE_MAX_CALL_PARAMS   4
> +
> +typedef struct {
> +  UINT32Command;
> +  UINT32Function;
> +  UINT32Session;
> +  UINT32CancelId;
> +  UINT32Pad;
> +  UINT32Return;
> +  UINT32ReturnOrigin;
> +  UINT32NumParams;
> +
> +  // NumParams tells the actual number of element in Params
> +  OPTEE_MESSAGE_PARAM  Params[OPTEE_MAX_CALL_PARAMS];
> +} OPTEE_MESSAGE_ARG;
> +
> 

Re: [edk2] [PATCH 1/3] Maintainers.txt: Remove EdkShellPkg and EkdShellBinPkg

2018-11-01 Thread Leif Lindholm
On Thu, Nov 01, 2018 at 06:03:22AM +, Zhang, Shenglei wrote:
> Hi Leif,
> 
> Thanks for your comments. Actually there is a cover letter. 
> https://lists.01.org/pipermail/edk2-devel/2018-October/031666.html

Ah, I missed that one since I was on cc on the rest of the set, but
not the cover letter.

> It may not be needed to rework but I 'll push the patches in order according 
> to
> the comments you mentioned.

If you do that:
Reviewed-by: Leif Lindholm 

(After the November stable tag has been made.)

Regards,

Leif

> Thanks,
> Shenglei
> 
> > -Original Message-
> > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > Sent: Wednesday, October 31, 2018 7:02 PM
> > To: Zhang, Shenglei 
> > Cc: edk2-devel@lists.01.org; Andrew Fish ; Laszlo Ersek
> > ; Kinney, Michael D 
> > Subject: Re: [PATCH 1/3] Maintainers.txt: Remove EdkShellPkg and
> > EkdShellBinPkg
> > 
> > Hi Shenglei,
> > 
> > I am happy with this change, but I think the deletion from
> > Maintainers.txt should come last (as 3/3).
> > Could you rework and resubmit, and add a cover letter (0/3)?
> > 
> > Best Regards,
> > 
> > Leif
> > 
> > On Wed, Oct 31, 2018 at 02:05:23PM +0800, shenglei wrote:
> > > Given that EdkShellPkg and EkdShellBinPkg will be removed,
> > > information about them in Maintainers.txt should also be
> > > deleted.
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=1107
> > > https://bugzilla.tianocore.org/show_bug.cgi?id=1108
> > >
> > > Cc: Andrew Fish 
> > > Cc: Laszlo Ersek 
> > > Cc: Leif Lindholm 
> > > Cc: Michael D Kinney 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: shenglei 
> > > ---
> > >  Maintainers.txt | 6 --
> > >  1 file changed, 6 deletions(-)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt
> > > index 36c6689afd..98f104b674 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -114,12 +114,6 @@ EdkCompatibilityPkg
> > >  W:
> > https://github.com/tianocore/tianocore.github.io/wiki/EdkCompatibilityPkg
> > >  M: Liming Gao 
> > >
> > > -EdkShellPkg, EdkShellBinPkg
> > > -W: https://github.com/tianocore/tianocore.github.io/wiki/EdkShellPkg
> > > -M: Ruiyu Ni 
> > > -T: svn - https://svn.code.sf.net/p/efi-shell/code/trunk/Shell/
> > > -S: Obsolete (Use ShellPkg & ShellBinPkg instead)
> > > -
> > >  EmbeddedPkg
> > >  W: https://github.com/tianocore/tianocore.github.io/wiki/EmbeddedPkg
> > >  M: Leif Lindholm 
> > > --
> > > 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 edk2-platforms 01/27] Platform/Microsoft: Add OpteeClientPkg dec

2018-11-01 Thread Sumit Garg
Hi Christopher,

Optee Client library has recently been merged to edk2 source code. It
tries to provide a generic interface [1] to OP-TEE based trusted
applications (pseudo/early).

AFAIK, you don't need any platform specific hook in client interface
to work with upstream OP-TEE. So instead you should use Optee library.

[1] 
https://github.com/tianocore/edk2/blob/master/ArmPkg/Include/Library/OpteeLib.h

Regards,
Sumit

On Thu, 1 Nov 2018 at 02:13, Leif Lindholm  wrote:
>
> +Sumit (just to loop you two together). Is there anything Microsoft
> platform specific about what will go in here?
>
> /
> Leif
>
> On Fri, Sep 21, 2018 at 08:25:53AM +, Chris Co wrote:
> > On Windows IoT Core devices with ARM TrustZone capabilities,
> > EDK2 runs in normal world and we use OP-TEE to execute
> > secure world operations. The overall package will contain
> > client-side support to invoke EDK2 services implemented as
> > OP-TEE trusted applications that run in secure world.
> >
> > This commit adds the initial dec file to add some PCD settings
> > needed by other packages.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Christopher Co 
> > Cc: Ard Biesheuvel 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > ---
> >  Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec | 49 
> > 
> >  1 file changed, 49 insertions(+)
> >
> > diff --git a/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec 
> > b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > new file mode 100644
> > index ..4752eab39ce3
> > --- /dev/null
> > +++ b/Platform/Microsoft/OpteeClientPkg/OpteeClientPkg.dec
> > @@ -0,0 +1,49 @@
> > +## @file
> > +#
> > +#  OP-TEE client package
> > +#
> > +#  OP-TEE client package contains the client-side interface to invoke 
> > OP-TEE TAs.
> > +#  Certain EDKII services are implemented in Trusted Applications running 
> > in
> > +#  the secure world OP-TEE OS.
> > +#
> > +#  Copyright (c) 2018 Microsoft 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
> > +#  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  = 0x0001001A
> > +  PACKAGE_NAME   = OpteeClientPkg
> > +  PACKAGE_GUID   = 77416fcb-10ec-4693-bdc0-1bdd74ec9595
> > +  PACKAGE_VERSION= 0.01
> > +
> > +[Includes]
> > +
> > +[LibraryClasses]
> > +
> > +[Guids]
> > +  gOpteeClientPkgTokenSpaceGuid   = { 0x04ad34ca, 0xdd25, 0x4156, { 0x90, 
> > 0xf5, 0x16, 0xf9, 0x40, 0xd0, 0x49, 0xe3 }}
> > +
> > +[PcdsFixedAtBuild]
> > +  gOpteeClientPkgTokenSpaceGuid.PcdTpm2AcpiBufferBase|0|UINT64|0x0005
> > +  gOpteeClientPkgTokenSpaceGuid.PcdTpm2AcpiBufferSize|0|UINT32|0x0006
> > +
> > +  ## The base address of the Trust Zone OpTEE OS private memory region
> > +  # This memory is manager privately by the OpTEE OS.
> > +  
> > gOpteeClientPkgTokenSpaceGuid.PcdTrustZonePrivateMemoryBase|0xDEAD1|UINT64|0x0001
> > +
> > +  ## The size of the Trust Zone OpTEE OS private memory region
> > +  
> > gOpteeClientPkgTokenSpaceGuid.PcdTrustZonePrivateMemorySize|55|UINT64|0x0002
> > +
> > +  ## The base address of the Trust Zone OpTEE OS shared memory region
> > +  
> > gOpteeClientPkgTokenSpaceGuid.PcdTrustZoneSharedMemoryBase|0xDEAD2|UINT64|0x0003
> > +
> > +  ## The size of the Trust Zone OpTEE OS shared memory region
> > +  
> > gOpteeClientPkgTokenSpaceGuid.PcdTrustZoneSharedMemorySize|0xAA|UINT64|0x0004
> > --
> > 2.16.2.gvfs.1.33.gf5370f1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH V3 4/4] MdeModulePkg EhciDxe: Use common buffer for AsyncInterruptTransfer

2018-11-01 Thread Leif Lindholm
On Thu, Nov 01, 2018 at 09:12:04AM +0800, Zeng, Star wrote:
> > > I believe the performance data really depends on
> > > 1. How many AsyncInterruptTransfer handlers (the number of USB keyboard
> > > and/or USB bluetooth keyboard?)
> > > 2. Data size (for flushing data from PCI controller specific address to
> > > mapped system memory address *in original code*)
> > > 3. The performance of IoMmu->SetAttribute (for example, the SetAttribute
> > > operation on Intel VTd engine caused by the unmap and map for flushing 
> > > data
> > > *in original code*, the SetAttribute operation on IntelVTd engine will
> > > involve FlushPageTableMemory, InvalidatePageEntry and etc)
> > > 
> > > > On an unrelated note to the concerns above:
> > > > Why has a fundamental change to the behaviour of one of the industry
> > > > standard drivers been pushed at the very end of the stable cycle?
> > > 
> > > We thought it was a simple improvement but not fundamental change before
> > > Eugene and Ard raised the concern.
> > 
> > Understood.
> 
> Thanks. :)
> 
> > 
> > However, as it is changing the memory management behaviour of a core
> > driver, I think it automatically qualifies as something that should
> > only go in the week after a stable tag.
> > 
> > We will need to have a closer look at the non-coherent case when Ard
> > gets back (Monday).
> 
> You mean Ard is on vacation and will be back next Monday.

Yes.

> > If this version causes issues with non-coherent systems, we will need
> > to revert it before the stable tag. We would then need to look into
> > the best way to deal with the performance issues quoted above.
> 
> I am glad to revert it if it has side effect. Is it possible someone could
> have a quick check?

Ard could. It would take me much longer :)
Which is why I would prefer to wait until next week.

Regards,

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


Re: [edk2] [PATCH v1] Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with NetworkPkg drivers.

2018-11-01 Thread Leif Lindholm
On Thu, Nov 01, 2018 at 12:43:32AM +, Fu, Siyuan wrote:
> Hi, Leif
> 
> So you have tested all the platform build? That's great, thanks a lot.

Build test only, no runtime tests.

> Do you want me to merge these 3 patches to a combo v2 patch, or can
> you help to commit the patch set to edk2-platform repo?

Could you merge the functional change with yours and send out the line
ending change separately (preceding the merged functional patch)?

Best Regards,

Leif

> > -Original Message-
> > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > Sent: Thursday, November 1, 2018 12:53 AM
> > To: Fu, Siyuan 
> > Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> > Kinney, Michael D 
> > Subject: Re: [PATCH v1] Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP
> > with NetworkPkg drivers.
> > 
> > On Wed, Oct 31, 2018 at 11:38:51AM +0800, Fu Siyuan wrote:
> > > The PXE/iSCSI/TCP drivers in MdeModulePkg are going to be deprecated.
> > All
> > > platform DSC/FDF files should be updated to use the dual-stack drivers
> > in
> > > NetworkPkg.
> > >
> > > The NetworkPkg driver have all the functionality compared with
> > MdeModulePkg
> > > one, with more bug fixes and new feature added. While its image size
> > will
> > > be a little bigger because it contains both IPv4 and IPv6 stack support,
> > > so it may cause build error in a platform if the flash space is very
> > tight.
> > > Basically, this patch won't cause any other problem if build could pass.
> > >
> > > I haven't built all the updated platform because the repo ReadMe doesn't
> > > provide a method to build them on Windows Environment, so I would very
> > > appreciate if anybody can help to test the build or tell me how to build
> > > it on Windows.
> > 
> > There are still some changes required to core ARM code to permit
> > building full platform ports with Visual Studio. And I wouldn't ask
> > you to set up a GCC windows development environment if you don't
> > already have one.
> > 
> > I have added some additional modifications required to permit all of
> > the platforms on master to build correctly after applying your
> > patch. You can find them in the top commit of
> > https://git.linaro.org/people/leif.lindholm/edk2-
> > platforms.git/log/?h=networkpkg-fixups
> > (plus a line ending fixup required to make that patch apply cleanly).
> > 
> > Regards,
> > 
> > Leif
> > 
> > > Cc: Ard Biesheuvel 
> > > Cc: Leif Lindholm 
> > > Cc: Michael D Kinney 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Fu Siyuan 
> > > ---
> > >  Platform/AMD/OverdriveBoard/OverdriveBoard.dsc  |  6 +++---
> > >  Platform/AMD/OverdriveBoard/OverdriveBoard.fdf  |  6 +++---
> > >  Platform/ARM/SgiPkg/SgiPlatform.fdf |  6 +++---
> > >  Platform/ARM/VExpressPkg/ArmVExpress-networking.fdf.inc |  6 +++---
> > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc|  6 +++---
> > >  Platform/Comcast/RDKQemu/RDKQemu.dsc| 10 +++---
> > 
> > >  Platform/Hisilicon/D03/D03.dsc  |  4 ++--
> > >  Platform/Hisilicon/D03/D03.fdf  |  4 ++--
> > >  Platform/Hisilicon/D05/D05.dsc  |  9 +++---
> > ---
> > >  Platform/Hisilicon/D05/D05.fdf  |  9 +++---
> > ---
> > >  Platform/Hisilicon/D06/D06.dsc  |  9 +++---
> > ---
> > >  Platform/Hisilicon/D06/D06.fdf  |  9 +++---
> > ---
> > >  Platform/Hisilicon/HiKey/HiKey.dsc  |  4 ++--
> > >  Platform/Hisilicon/HiKey/HiKey.fdf  |  4 ++--
> > >  Platform/Hisilicon/HiKey960/HiKey960.dsc|  4 ++--
> > >  Platform/Hisilicon/HiKey960/HiKey960.fdf|  4 ++--
> > >  Platform/LeMaker/CelloBoard/CelloBoard.dsc  |  6 +++---
> > >  Platform/LeMaker/CelloBoard/CelloBoard.fdf  |  6 +++---
> > >  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.dsc |  6 +++---
> > >  Platform/SoftIron/Overdrive1000Board/Overdrive1000Board.fdf |  6 +++---
> > >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc   |  4 ++--
> > >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf   |  4 ++--
> > >  22 files changed, 58 insertions(+), 74 deletions(-)
> > >
> > > diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > > index 9f9885fda8..51327a67df 100644
> > > --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > > +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
> > > @@ -669,11 +669,11 @@ DEFINE DO_CAPSULE   = FALSE
> > >}
> > >MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
> > >MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
> > > -  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> > >MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
> 

Re: [edk2] D06 ACPI

2018-11-01 Thread Ming Huang
Hi Leif & Al Stone,

Some questions about this fixes:
1 Is need modify [0001] to [0004] in proximmity Domain?
+[0001]   Proximity Domain : 0001

2 Is need modify Revision to 1 for type 2 node?

3 Is need add [0001] and [0003] for this two line?
+Memory Size Limit : 00
+ Reserved : 

4 Acpica 20181003 can compile ERP D03/D05 without modify IORT, because D03/D05
IORT don't enable SMMU. For plinth project with enable SMMU IORT, D05
will compile failed with 20181003 regardless modify IORT like blow or not.

plinth source IORT:
IORT: OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/D05IortSmmu.asl
https://github.com/hisilicon/OpenPlatformPkg.git (master)

Compile fail info:
--
"iasl"  
-p/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.aml
 
/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
make: Nothing to be done for 'tbuild'.
Error6126 -  Could not compile input file

/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
141: [0004] ID Count : 0800

Error6303 - 
  
Integer too large for target ^  (0800 - max 1 bytes)
Intel ACPI Component Architecture

ASL+ Optimizing Compiler/Disassembler version 20181003
Copyright (c) 2000 - 2018 Intel Corporation
Building ... 
/home/huangming/source/plinth/MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf
 [AARCH64]
/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
156: [0008] Base Address : 700a004

Error6303 - 
  
Integer too large for target ^  (0700A004 - max 4 bytes)

Table Input:   
/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
 - 987 lines, 29849 bytes, 166 fields
/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
177: [0004] Input base : 00013000

Error6303 - 

Integer too large for target ^  (00013000 - max 1 bytes)
Compilation complete. 5 Errors, 0 Warnings, 0 Remarks

/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/./D05IortSmmu.
192: [098h 0152 8] Base Address : C004
GNUmakefile:358: recipe for target 
'/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/D05IortSmmu.aml'
 failed
Error6303 - 

 Integer too large for target ^  (C004 - max 1 bytes)

make: *** 
[/home/huangming/source/plinth/Build/D05/RELEASE_GCC49/AARCH64/OpenPlatformPkg/Chips/Hisilicon/Hi1616/D05AcpiTables/AcpiTablesHi1616/OUTPUT/D05IortSmmu.aml]
 Error 255
--

IORT changes:
--
--- a/Chips/Hisilicon/Hi1616/D05AcpiTables/D05IortSmmu.asl
+++ b/Chips/Hisilicon/Hi1616/D05AcpiTables/D05IortSmmu.asl
@@ -133,9 +133,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0001]Proximity domain: 00
-[0001]   Reserved1: 00
-[0002]   Reserved2: 
+[0001]Proximity domain: ^M
 /* this is the map for PCIe2 in 1P NA */
 [0004] Input base : 0002f800
 [0004]   ID Count : 0800
@@ -165,9 +163,7 @@
 [0004]  PRI Interrupt : 
 [0004] GERR Interrupt : 
 [0004] Sync Interrupt : 
-[0001]Proximity domain: 03
-[0001]   Reserved1: 00
-[0002]   Reserved2: 
+[0001]Proximity domain: 0003^M
 /* this is the map for pcie0 in 2p nb */
 [0004] 

Re: [edk2] Reminder for deleting 3 network drivers in MdeModulePkg

2018-11-01 Thread Leif Lindholm
On Thu, Nov 01, 2018 at 06:01:31AM +, Gao, Liming wrote:
> Leif:
>   If all Stewards agree this change to remove MdeModulePkg
>   Tcp4Dxe/UefiPxeBcDxe/IScsiDxe, we will try to include it in
>   edk2-stable201811 stable tag.
> 
> Andrew and Mike:
>   Do you agree this change to happen in near edk2-stable201811
>   stable tag?

No no no. I was suggesting deleting them immediately _after_ the
stable tag (if review is complete by then).

Regards,

Leif

> 
> Thanks
> Liming
> >-Original Message-
> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
> >Lindholm
> >Sent: Wednesday, October 31, 2018 6:50 PM
> >To: Fu, Siyuan 
> >Cc: edk2-devel@lists.01.org
> >Subject: Re: [edk2] Reminder for deleting 3 network drivers in
> >MdeModulePkg
> >
> >Hi Fu Siyuan,
> >
> >That is fine too.
> >But I expect the change to be one to go in the week after a stable tag
> >has been made.
> >
> >(My own philosophy is that one can be quite aggressive with removals,
> >because if it turns out to have been a bad idea, git revert can
> >quickly restore the tree to the state it was.)
> >
> >Best Regards,
> >
> >Leif
> >
> >On Wed, Oct 31, 2018 at 02:58:47AM +, Fu, Siyuan wrote:
> >> Hi, Leif
> >>
> >> Just notice that you are saying edk2-stable201811 tag.
> >>
> >> We need more time to collect community/marketing feedback on
> >> deleting these driver, so it may won't be able to catch the stable
> >> tag in next month.
> >>
> >> BestRegards
> >> Fu Siyuan
> >>
> >>
> >> > -Original Message-
> >> > From: Fu, Siyuan
> >> > Sent: Wednesday, October 31, 2018 8:49 AM
> >> > To: Leif Lindholm 
> >> > Cc: edk2-devel@lists.01.org
> >> > Subject: RE: [edk2] Reminder for deleting 3 network drivers in
> >> > MdeModulePkg
> >> >
> >> > Hi, Leif
> >> >
> >> > I think checking the branch is a little better than the tag, because we
> >> > may still have critical bug fixes after the official release.
> >> >
> >> > While any of them are not recommended, always using the NetworkPkg
> >version
> >> > driver is the best choice.
> >> >
> >> > I will modify the edk2 network wiki page for an updated sample DSC/FDF
> >> > section, if this patch could pass review w/o objection.
> >> > https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg-
> >Getting-
> >> > Started-Guide
> >> >
> >> >
> >> > BestRegards
> >> > Fu Siyuan
> >> >
> >> >
> >> > > -Original Message-
> >> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> >Of
> >> > > Leif Lindholm
> >> > > Sent: Tuesday, October 30, 2018 6:47 PM
> >> > > To: Fu, Siyuan 
> >> > > Cc: edk2-devel@lists.01.org
> >> > > Subject: Re: [edk2] Reminder for deleting 3 network drivers in
> >> > > MdeModulePkg
> >> > >
> >> > > Hi Fu Siyan,
> >> > >
> >> > > On Tue, Oct 30, 2018 at 08:11:52AM +, Fu, Siyuan wrote:
> >> > > > People who want to continue use these deleted drivers could go to
> >> > > > edk2/UDK2018 branch to get them, but it's *highly not recommended*.
> >> > >
> >> > > They should also be able to use edk2-stable201811, right?
> >> > >
> >> > > > *If you have any opposition on deleting these drivers, please let me
> >> > > > know before this weekend, thanks.*
> >> > >
> >> > > I am all for this change. The diffstat is very nice :)
> >> > >
> >> > > Best Regards,
> >> > >
> >> > > Leif
> >> > > ___
> >> > > 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
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms 05/27] Silicon/NXP: Add UART library support for i.MX platforms

2018-11-01 Thread Leif Lindholm
On Fri, Sep 21, 2018 at 08:25:56AM +, Chris Co wrote:
> This adds support for interact with the UART controller on
> NXP i.MX platforms.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Christopher Co 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> ---
>  Silicon/NXP/iMXPlatformPkg/Include/iMXUart.h   | 
> 207 +
>  Silicon/NXP/iMXPlatformPkg/Library/UartSerialPortLib/UartSerialPortLib.c   | 
> 243 
>  Silicon/NXP/iMXPlatformPkg/Library/UartSerialPortLib/UartSerialPortLib.inf | 
>  41 
>  3 files changed, 491 insertions(+)
> 
> diff --git a/Silicon/NXP/iMXPlatformPkg/Include/iMXUart.h 
> b/Silicon/NXP/iMXPlatformPkg/Include/iMXUart.h
> new file mode 100644
> index ..ddb61f59c656
> --- /dev/null
> +++ b/Silicon/NXP/iMXPlatformPkg/Include/iMXUart.h
> @@ -0,0 +1,207 @@
> +/** @file
> +*
> +*  Copyright (c) 2018 Microsoft 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
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#ifndef _IMXUART_H_
> +#define _IMXUART_H_
> +
> +// UART Receiver Register bit definitions
> +enum MX6UART_RXD {
> +  MX6UART_RXD_RX_DATA_MASK =  (0xff << 0),
> +  MX6UART_RXD_PRERR = (1 << 10),
> +  MX6UART_RXD_BRK =   (1 << 11),
> +  MX6UART_RXD_FRMERR =(1 << 12),
> +  MX6UART_RXD_OVRRUN =(1 << 13),
> +  MX6UART_RXD_ERR =   (1 << 14),
> +  MX6UART_RXD_CHARRDY =   (1 << 15),
> +};
> +
> +// UART Control Register 1 bit definitions
> +enum MX6UART_UCR1 {
> +  MX6UART_UCR1_UARTEN =   (1 << 0),
> +  MX6UART_UCR1_DOZE = (1 << 1),
> +  MX6UART_UCR1_ATDMAEN =  (1 << 2),
> +  MX6UART_UCR1_TXDMAEN =  (1 << 3),
> +  MX6UART_UCR1_SNDBRK =   (1 << 4),
> +  MX6UART_UCR1_RTSDEN =   (1 << 5),
> +  MX6UART_UCR1_TXMPTYEN = (1 << 6),
> +  MX6UART_UCR1_IREN = (1 << 7),
> +  MX6UART_UCR1_RXDMAEN =  (1 << 8),
> +  MX6UART_UCR1_RRDYEN =   (1 << 9),
> +  MX6UART_UCR1_ICD_MASK = (3 << 10),
> +  MX6UART_UCR1_ICD_4 =(0 << 10),
> +  MX6UART_UCR1_ICD_8 =(1 << 10),
> +  MX6UART_UCR1_ICD_16 =   (2 << 10),
> +  MX6UART_UCR1_ICD_32 =   (3 << 10),
> +  MX6UART_UCR1_IDEN = (1 << 12),
> +  MX6UART_UCR1_TRDYEN =   (1 << 13),
> +  MX6UART_UCR1_ADBR = (1 << 14),
> +  MX6UART_UCR1_ADEN = (1 << 15),
> +};
> +
> +// UART Control Register 2 bit definitions
> +enum MX6UART_UCR2 {
> +  MX6UART_UCR2_SRST = (1 << 0),
> +  MX6UART_UCR2_RXEN = (1 << 1),
> +  MX6UART_UCR2_TXEN = (1 << 2),
> +  MX6UART_UCR2_ATEN = (1 << 3),
> +  MX6UART_UCR2_RTSEN =(1 << 4),
> +  MX6UART_UCR2_WS =   (1 << 5),
> +  MX6UART_UCR2_STPB = (1 << 6),
> +  MX6UART_UCR2_PROE = (1 << 7),
> +  MX6UART_UCR2_PREN = (1 << 8),
> +  MX6UART_UCR2_RTEC_MASK =(3 << 9),
> +  MX6UART_UCR2_RTEC_RISING =  (0 << 9),
> +  MX6UART_UCR2_RTEC_FALLING = (1 << 9),
> +  MX6UART_UCR2_RTEC_BOTH =(2 << 9),
> +  MX6UART_UCR2_ESCEN =(1 << 11),
> +  MX6UART_UCR2_CTS =  (1 << 12),
> +  MX6UART_UCR2_CTSC = (1 << 13),
> +  MX6UART_UCR2_IRTS = (1 << 14),
> +  MX6UART_UCR2_ESCI = (1 << 15),
> +};
> +
> +// UART Control Register 3 bit definitions
> +enum MX6UART_UCR3 {
> +  MX6UART_UCR3_ACIEN =(1 << 0),
> +  MX6UART_UCR3_INVT = (1 << 1),
> +  MX6UART_UCR3_RXDMUXSEL =(1 << 2),
> +  MX6UART_UCR3_DTRDEN =   (1 << 3),
> +  MX6UART_UCR3_AWAKEN =   (1 << 4),
> +  MX6UART_UCR3_AIRINTEN = (1 << 5),
> +  MX6UART_UCR3_RXDSEN =   (1 << 6),
> +  MX6UART_UCR3_ADNIMP =   (1 << 7),
> +  MX6UART_UCR3_RI =   (1 << 8),
> +  MX6UART_UCR3_DCD =  (1 << 9),
> +  MX6UART_UCR3_DSR =  (1 << 10),
> +  MX6UART_UCR3_FRAERREN = (1 << 11),
> +  MX6UART_UCR3_PARERREN = (1 << 12),
> +  MX6UART_UCR3_DTREN =(1 << 13),
> +  MX6UART_UCR3_DPEC_MASK =(3 << 14),
> +  MX6UART_UCR3_DPEC_RISING =  (0 << 14),
> +  MX6UART_UCR3_DPEC_FALLING = (1 << 14),
> +  MX6UART_UCR3_DPEC_BOTH =(2 << 14),
> +};
> +
> +// UART Control Register 4 bit definitions
> +enum MX6UART_UCR4 {
> +  MX6UART_UCR4_DREN = (1 << 0),
> +  MX6UART_UCR4_OREN = (1 << 1),
> +  MX6UART_UCR4_BKEN = (1 << 2),
> +  

Re: [edk2] [PATCH v2 4/5] EmulatorPkg: Remove EdkShellBinPkg in FDF and DEC

2018-11-01 Thread Jordan Justen
On 2018-10-31 23:26:38, shenglei wrote:
> Remove EdkShellBinPkg in EmulatorPkg.dec and
> EmulatorPkg.fdf.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1108
> 
> v2: Remove USE_OLD_SHELL in DSC because it will be
> unnecessary to use it.
> 
> Cc: Jordan Justen 
> Cc: Ruiyu Ni 
> Cc: Andrew Fish 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 

I'm not sure if this matches the requirement in Contributions.txt,
which says:

  "Signed-off-by" is the contributor's signature identifying them by
  their real/legal name and their email address.

You can easily fix this by running git config. For example, in my case
I run:

  $ git config --global user.name "Jordan Justen"

After this in the future "git commit -s" will add the correct
Signed-off-by automatically.

If you want to use "git commit --amend" to fix the author after the
user.name setting is fixed, then you'll also need --reset-author.

Anyway, with the Signed-off-by fixed, the EmulatorPkg and OvmfPkg
patches are: Reviewed-by: Jordan Justen 

-Jordan

> ---
>  EmulatorPkg/EmulatorPkg.dec | 2 +-
>  EmulatorPkg/EmulatorPkg.dsc | 4 
>  EmulatorPkg/EmulatorPkg.fdf | 4 
>  3 files changed, 1 insertion(+), 9 deletions(-)
> 
> diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec
> index 25f79c92c9..9be8a90e5b 100644
> --- a/EmulatorPkg/EmulatorPkg.dec
> +++ b/EmulatorPkg/EmulatorPkg.dec
> @@ -96,7 +96,7 @@
>
> gEmulatorPkgTokenSpaceGuid.PcdEmuVirtualDisk|L"disk.dmg:FW"|VOID*|0x1001
>  
>gEmulatorPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window"|VOID*|0x1018
> -  
> gEmulatorPkgTokenSpaceGuid.PcdEmuFileSystem|L".!../../../../../EdkShellBinPkg/bin/ia32/Apps"|VOID*|0x1004
> +  gEmulatorPkgTokenSpaceGuid.PcdEmuFileSystem|L"."|VOID*|0x1004
>gEmulatorPkgTokenSpaceGuid.PcdEmuSerialPort|L"/dev/ttyS0"|VOID*|0x1002
>gEmulatorPkgTokenSpaceGuid.PcdEmuNetworkInterface|L"en0"|VOID*|0x100d
>  
> diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
> index c8c444fe1c..445777c0f3 100644
> --- a/EmulatorPkg/EmulatorPkg.dsc
> +++ b/EmulatorPkg/EmulatorPkg.dsc
> @@ -196,9 +196,7 @@
># Change PcdBootManagerMenuFile to UiApp
>gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 
> 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
>  
> -!ifndef $(USE_OLD_SHELL)
>gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
> 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
> -!endif
>  
>  #define BOOT_WITH_FULL_CONFIGURATION  0x00
>  #define BOOT_WITH_MINIMAL_CONFIGURATION   0x01
> @@ -393,7 +391,6 @@
>  
>FatPkg/EnhancedFatDxe/Fat.inf
>  
> -!ifndef $(USE_OLD_SHELL)
>ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
>  
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> @@ -421,7 +418,6 @@
>gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
>}
> -!endif
>  
>  !endif
>  
> diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
> index 5b5f81443d..915321eb7a 100644
> --- a/EmulatorPkg/EmulatorPkg.fdf
> +++ b/EmulatorPkg/EmulatorPkg.fdf
> @@ -208,12 +208,8 @@ INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
>  
>  INF FatPkg/EnhancedFatDxe/Fat.inf
>  
> -!ifndef $(USE_OLD_SHELL)
>  INF  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>  INF  ShellPkg/Application/Shell/Shell.inf
> -!else
> -INF  RuleOverride = BINARY EdkShellBinPkg/FullShell/FullShell.inf
> -!endif
>  
>  [Rule.Common.SEC]
>FILE SEC = $(NAMED_GUID)  {
> -- 
> 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 v2 0/4] SdMmcOverride extension

2018-11-01 Thread Wu, Hao A
Hi Marcin and Ard,

> -Original Message-
> From: Marcin Wojtas [mailto:m...@semihalf.com]
> Sent: Friday, October 05, 2018 9:25 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; Kinney, Michael D; Gao, Liming; leif.lindh...@linaro.org; Wu,
> Hao A; ard.biesheu...@linaro.org; nad...@marvell.com;
> m...@semihalf.com; j...@semihalf.com; t...@semihalf.com
> Subject: [PATCH v2 0/4] SdMmcOverride extension
> 
> Hi,
> 
> This is the second version of the patchset. Initial one was
> interleaved with the fixes, which after split got already merged.
> The biggest change is - resigning from the new callbacks
> and extending parameter lists of both NotifyPhase and Capability
> routines.
> 
> Patches are available in the github:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-
> platform/commits/sdmmc-override-upstream-r20181005
> 
> Please note that extending SdMmcOverride protocol was impacting
> so far the only user of it (Synquacer controller). In paralel
> edk2-platforms patchset, a patch can be found:
> ("Silicon/SynQuacer/PlatformDxe: adjust to updated SdMmcOverride")
> which immunizes for above and future extensions of the protocol:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-
> platform/commits/xenon-upstream-r20181005
> 
> I'm looking forward to the comments and remarks.

Since there are protocol service interface changes, maybe a version change
(macro EDKII_SD_MMC_OVERRIDE_PROTOCOL_VERSION) for the SdMmc Override Protocol
is needed.

Please share your thoughts on this one. Thanks.

Best Regards,
Hao Wu

> 
> Best regards,
> Marcin
> 
> Changelog:
> v1 -> v2
> * Rebase onto newest master
> * 1/4 [new patch] - preparation for extending NotifyPhase
> * 2/4 - UhsSignaling as a part of NotifyPhase
> * 3/4 - SwitchClockFreqPost as a part of NotifyPhase
> * 4/4 - Allow updating BaseClkFreq via Capability instead of the
> independent callback.
> 
> Marcin Wojtas (2):
>   MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in
> NotifyPhase
>   MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency
> 
> Tomasz Michalec (2):
>   MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride
> protocol
>   MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to
> SdMmcOverride
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |   6 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   |  62 +-
>  MdeModulePkg/Include/Protocol/SdMmcOverride.h  |  12 +-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c| 215
> ++--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  |  57 +-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c |  18 +-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 108 -
> -
>  7 files changed, 383 insertions(+), 95 deletions(-)
> 
> --
> 2.7.4

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


Re: [edk2] [PATCH v2 4/4] MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequency

2018-11-01 Thread Wu, Hao A
Hi Marcin,

> -Original Message-
> From: Marcin Wojtas [mailto:m...@semihalf.com]
> Sent: Friday, October 05, 2018 9:25 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; Kinney, Michael D; Gao, Liming; leif.lindh...@linaro.org; Wu,
> Hao A; ard.biesheu...@linaro.org; nad...@marvell.com;
> m...@semihalf.com; j...@semihalf.com; t...@semihalf.com
> Subject: [PATCH v2 4/4] MdeModulePkg/SdMmcPciHcDxe: Allow overriding
> base clock frequency
> 
> Some SdMmc host controllers are run by clocks with different
> frequency than it is reflected in Capabilities Register 1.
> It is allowed by SDHCI specification ver. 4.2 - if BaseClkFreq
> field value of the Capability Register 1 is zero, the clock
> frequency must be obtained via another method.
> 
> Because the bitfield is only 8 bits wide, a maximum value
> that could be obtained from hardware is 255MHz.
> In case the actual frequency exceeds 255MHz, the 8-bit BaseClkFreq
> member of SD_MMC_HC_SLOT_CAP structure occurs to be not sufficient
> to be used for setting the clock speed in SdMmcHcClockSupply
> function.
> 
> This patch adds new UINT32 array ('BaseClkFreq[]') to
> SD_MMC_HC_PRIVATE_DATA structure for specifying
> the input clock speed for each slot of the host controller.
> All routines that are used for clock configuration are
> updated accordingly.
> 
> This patch also adds new IN OUT BaseClockFreq field
> in the Capability callback of the SdMmcOverride,
> protocol which allows to update BaseClkFreq value.
> 
> The patch reuses original commit from edk2-platforms:
> 20f6f144d3a8 ("Marvell/Drivers: XenonDxe: Allow overriding base clock
> frequency")
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas 
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h |  6 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h   | 12 +
>  MdeModulePkg/Include/Protocol/SdMmcOverride.h  |  5 +++-
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c|  4 +--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c  |  4 +--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.c | 18
> +++--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c   | 27
> +++-
>  7 files changed, 52 insertions(+), 24 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> index c683600..8c1a589 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.h
> @@ -118,6 +118,12 @@ typedef struct {
>UINT64  MaxCurrent[SD_MMC_HC_MAX_SLOT];
> 
>UINT32  ControllerVersion;
> +
> +  //
> +  // Some controllers may require to override base clock frequency
> +  // value stored in Capabilities Register 1.
> +  //
> +  UINT32  BaseClkFreq[SD_MMC_HC_MAX_SLOT];
>  } SD_MMC_HC_PRIVATE_DATA;
> 
>  #define SD_MMC_HC_TRB_SIG SIGNATURE_32 ('T', 'R', 'B', 'T')
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> index a03160d..f01ba21 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> @@ -173,12 +173,14 @@ typedef struct {
> 
>@param[in]  SlotThe slot number of the SD card to send the
> command to.
>@param[in]  Capability  The buffer to store the capability data.
> +  @param[in]  BaseClkFreq The base clock frequency of host controller in
> MHz.
> 
>  **/
>  VOID
>  DumpCapabilityReg (
>IN UINT8Slot,
> -  IN SD_MMC_HC_SLOT_CAP   *Capability
> +  IN SD_MMC_HC_SLOT_CAP   *Capability,
> +  IN UINT32   BaseClkFreq
>);
> 
>  /**
> @@ -431,7 +433,7 @@ SdMmcHcStopClock (
>@param[in] PciIo  The PCI IO protocol instance.
>@param[in] Slot   The slot number of the SD card to send the
> command to.
>@param[in] ClockFreq  The max clock frequency to be set. The unit is 
> KHz.
> -  @param[in] Capability The capability of the slot.
> +  @param[in] BaseClkFreqThe base clock frequency of host controller in
> MHz.
> 
>@retval EFI_SUCCESS   The clock is supplied successfully.
>@retval OthersThe clock isn't supplied successfully.
> @@ -442,7 +444,7 @@ SdMmcHcClockSupply (
>IN EFI_PCI_IO_PROTOCOL*PciIo,
>IN UINT8  Slot,
>IN UINT64 ClockFreq,
> -  IN SD_MMC_HC_SLOT_CAP Capability
> +  IN UINT32 BaseClkFreq
>);
> 
>  /**
> @@ -490,7 +492,7 @@ SdMmcHcSetBusWidth (
> 
>@param[in] PciIo  The PCI IO protocol instance.
>@param[in] Slot   The slot number of the SD card to send the
> command to.
> -  @param[in] Capability The capability of the slot.
> +  @param[in] BaseClkFreqThe base clock frequency of host controller in
> MHz.
> 
>@retval 

Re: [edk2] [PATCH v2 3/4] MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverride

2018-11-01 Thread Wu, Hao A
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Marcin Wojtas
> Sent: Friday, October 05, 2018 9:25 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; t...@semihalf.com; Wu, Hao A; nad...@marvell.com; Gao,
> Liming; Kinney, Michael D
> Subject: [edk2] [PATCH v2 3/4] MdeModulePkg/SdMmcPciHcDxe: Add
> SwitchClockFreqPost to SdMmcOverride
> 
> From: Tomasz Michalec 
> 
> Some SD Host Controlers need to do additional opperations after clock
> frequency switch.
> 
> This patch add new callback type to NotifyPhase of the SdMmcOverride
> protocol. It is called after EmmcSwitchClockFreq and SdMmcHcClockSupply.

Hi Marcin,

Just curious, I had a quick glance at the implementation of the
XenonSwitchClockFreqPost() in your platform part changes. Are those operations
within the function mandatory during the HC initialization? Are they mainly for
performance or stability consideration?

I am wondering if this kind of customization is common among the SD & eMMC
devices.

Best Regards,
Hao Wu

> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas 
> ---
>  MdeModulePkg/Include/Protocol/SdMmcOverride.h   |  1 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c | 60
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c   | 18 ++
>  3 files changed, 79 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> index 25db98a..d9daada 100644
> --- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> +++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> @@ -33,6 +33,7 @@ typedef enum {
>EdkiiSdMmcInitHostPre,
>EdkiiSdMmcInitHostPost,
>EdkiiSdMmcUhsSignaling,
> +  EdkiiSdMmcSwitchClockFreqPost,
>  } EDKII_SD_MMC_PHASE_TYPE;
> 
>  /**
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> index 05bd4a0..7e75283 100755
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c
> @@ -796,6 +796,27 @@ EmmcSwitchToHighSpeed (
> 
>HsTiming = 1;
>Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming,
> ClockFreq);
> +  if (EFI_ERROR (Status)) {
> +return Status;
> +  }
> +
> +  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
> +Status = mOverride->NotifyPhase (
> +  Private->ControllerHandle,
> +  Slot,
> +  EdkiiSdMmcSwitchClockFreqPost,
> +  
> +  );
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((
> +DEBUG_ERROR,
> +"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
> +__FUNCTION__,
> +Status
> +));
> +  return Status;
> +}
> +  }
> 
>return Status;
>  }
> @@ -905,6 +926,24 @@ EmmcSwitchToHS200 (
>  return Status;
>}
> 
> +  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
> +Status = mOverride->NotifyPhase (
> +  Private->ControllerHandle,
> +  Slot,
> +  EdkiiSdMmcSwitchClockFreqPost,
> +  
> +  );
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((
> +DEBUG_ERROR,
> +"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
> +__FUNCTION__,
> +Status
> +));
> +  return Status;
> +}
> +  }
> +
>Status = EmmcTuningClkForHs200 (PciIo, PassThru, Slot, BusWidth);
> 
>return Status;
> @@ -989,6 +1028,27 @@ EmmcSwitchToHS400 (
> 
>HsTiming = 3;
>Status = EmmcSwitchClockFreq (PciIo, PassThru, Slot, Rca, HsTiming,
> ClockFreq);
> +  if (EFI_ERROR (Status)) {
> +return Status;
> +  }
> +
> +  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
> +Status = mOverride->NotifyPhase (
> +  Private->ControllerHandle,
> +  Slot,
> +  EdkiiSdMmcSwitchClockFreqPost,
> +  
> +  );
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((
> +DEBUG_ERROR,
> +"%a: SD/MMC switch clock freq post notifier callback failed - %r\n",
> +__FUNCTION__,
> +Status
> +));
> +  return Status;
> +}
> +  }
> 
>return Status;
>  }
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> index 5645a71..057a4e2 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c
> @@ -887,6 +887,24 @@ SdCardSetBusMode (
>  return Status;
>}
> 
> +  if (mOverride != NULL && mOverride->NotifyPhase != NULL) {
> +Status = mOverride->NotifyPhase (
> +  Private->ControllerHandle,
> +  Slot,
> 

Re: [edk2] [PATCH v2 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocol

2018-11-01 Thread Wu, Hao A
Hi Marcin,

> -Original Message-
> From: Marcin Wojtas [mailto:m...@semihalf.com]
> Sent: Friday, October 05, 2018 9:25 PM
> To: edk2-devel@lists.01.org
> Cc: Tian, Feng; Kinney, Michael D; Gao, Liming; leif.lindh...@linaro.org; Wu,
> Hao A; ard.biesheu...@linaro.org; nad...@marvell.com;
> m...@semihalf.com; j...@semihalf.com; t...@semihalf.com
> Subject: [PATCH v2 2/4] MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling
> to SdMmcOverride protocol
> 
> From: Tomasz Michalec 
> 
> Some SD Host Controlers use different values in Host Control 2 Register
> to select UHS Mode. This patch adds a new UhsSignaling type routine to
> the NotifyPhase of the SdMmcOverride protocol.
> 
> UHS signaling configuration is moved to a common, default routine
> (SdMmcHcUhsSignaling), which is called when SdMmcOverride does not
> cover this functionality.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Marcin Wojtas 
> ---
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h |  50 +++
>  MdeModulePkg/Include/Protocol/SdMmcOverride.h|   2 +
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/EmmcDevice.c  | 153
> 
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdDevice.c|  37 +++--
>  MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.c |  69 +
>  5 files changed, 243 insertions(+), 68 deletions(-)
> 
> diff --git a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> index e389d52..a03160d 100644
> --- a/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> +++ b/MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHci.h
> @@ -63,6 +63,39 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF
> ANY KIND, EITHER EXPRESS OR IMPLIED.
>  #define SD_MMC_HC_CTRL_VER0xFE
> 
>  //
> +// SD Host Controler bits to HOST_CTRL2 register
> +//
> +#define SD_MMC_HC_CTRL_UHS_MASK   0x0007
> +#define SD_MMC_HC_CTRL_UHS_SDR12  0x
> +#define SD_MMC_HC_CTRL_UHS_SDR25  0x0001
> +#define SD_MMC_HC_CTRL_UHS_SDR50  0x0002
> +#define SD_MMC_HC_CTRL_UHS_SDR104 0x0003
> +#define SD_MMC_HC_CTRL_UHS_DDR50  0x0004
> +#define SD_MMC_HC_CTRL_MMC_DDR52  0x0004
> +#define SD_MMC_HC_CTRL_MMC_SDR50  0x0002

I think SD_MMC_HC_CTRL_MMC_SDR50 is not needed here.

Since according to the SD Physical Layer Simplified Specification, max clock
frequency for SD bus mode SDR50 is 100MHz. And there is no eMMC bus mode whose
max clock frequency is at 100MHz in Embedded Multi-Media Card Electrical
Standard (5.1).

> +#define SD_MMC_HC_CTRL_MMC_SDR25  0x0001
> +#define SD_MMC_HC_CTRL_MMC_SDR12  0x
> +#define SD_MMC_HC_CTRL_HS200  0x0003
> +#define SD_MMC_HC_CTRL_HS400  0x0005

How about the below renames & reorder?

SD_MMC_HC_CTRL_MMC_LEGACY  0x
SD_MMC_HC_CTRL_MMC_HS_SDR  0x0001
SD_MMC_HC_CTRL_MMC_HS_DDR  0x0004
SD_MMC_HC_CTRL_MMC_HS200  0x0003
SD_MMC_HC_CTRL_MMC_HS400  0x0005

> +
> +//
> +// Timing modes for uhs
> +//
> +typedef enum {
> +  SdMmcUhsSdr12,
> +  SdMmcUhsSdr25,
> +  SdMmcUhsSdr50,
> +  SdMmcUhsSdr104,
> +  SdMmcUhsDdr50,
> +  SdMmcMmcDdr52,
> +  SdMmcMmcSdr50,
> +  SdMmcMmcSdr25,
> +  SdMmcMmcSdr12,
> +  SdMmcMmcHs200,
> +  SdMmcMmcHs400,
> +} SD_MMC_UHS_TIMING;

Suggest a similar drop of 'SdMmcMmcSdr50' and rename according to the above
comments upon HOST_CTRL2 register value definitions. Also, how about a rename
for enum to SD_MMC_BUS_MODE?

> +
> +//
>  // The transfer modes supported by SD Host Controller
>  // Simplified Spec 3.0 Table 1-2
>  //
> @@ -508,4 +541,21 @@ SdMmcHcInitTimeoutCtrl (
>IN UINT8  Slot
>);
> 
> +/**
> +  Set SD Host Controler control 2 registry according to selected speed.
> +
> +  @param[in] PciIo  The PCI IO protocol instance.
> +  @param[in] Slot   The slot number of the SD card to send the
> command to.
> +  @param[in] Timing The timing to select.
> +
> +  @retval EFI_SUCCESS   The timing is set successfully.
> +  @retval OthersThe timing isn't set successfully.
> +**/
> +EFI_STATUS
> +SdMmcHcUhsSignaling (
> +  IN EFI_PCI_IO_PROTOCOL*PciIo,
> +  IN UINT8  Slot,
> +  IN SD_MMC_UHS_TIMING  Timing
> +  );
> +
>  #endif
> diff --git a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> index 178945f..25db98a 100644
> --- a/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> +++ b/MdeModulePkg/Include/Protocol/SdMmcOverride.h
> @@ -17,6 +17,7 @@
>  #ifndef __SD_MMC_OVERRIDE_H__
>  #define __SD_MMC_OVERRIDE_H__
> 
> +#include 

Please do not expose a module private header file here.

One approach comes to me is to keep the SD/MMC bus mode enumeration structure
in this protocol header file. SdMmcPciHcDxe driver and producers of the
Override protocol keep a version of the HOST_CTRL2 register value macros of
their own.

>  #include 
> 
>  #define EDKII_SD_MMC_OVERRIDE_PROTOCOL_GUID \
> @@ -31,6 +32,7 @@ typedef enum {
>

[edk2] [PATCH v2 5/5] OvmfPkg: Remove EdkShellBinPkg in FDF

2018-11-01 Thread shenglei
Remove EdkShellBinPkg in OvmfPkgIa32.fdf,
OvmfPkg/OvmfPkgIa32X64.fdf amd OvmfPkg/OvmfPkgX64.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL in DSC because it will be
unnecessary to use it.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 OvmfPkg/OvmfPkgIa32.dsc| 4 
 OvmfPkg/OvmfPkgIa32.fdf| 4 
 OvmfPkg/OvmfPkgIa32X64.dsc | 4 
 OvmfPkg/OvmfPkgIa32X64.fdf | 4 
 OvmfPkg/OvmfPkgX64.dsc | 4 
 OvmfPkg/OvmfPkgX64.fdf | 4 
 6 files changed, 24 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 9f07e75050..617e51350f 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -510,9 +510,7 @@
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-!endif
 
 !if $(SMM_REQUIRE) == TRUE
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000
@@ -837,7 +835,6 @@
   OvmfPkg/Csm/Csm16/Csm16.inf
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
 
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
@@ -864,7 +861,6 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
-!endif
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 52b8b1fea1..1646281299 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -288,12 +288,8 @@ INF  
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResour
 INF  FatPkg/EnhancedFatDxe/Fat.inf
 INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
-!ifndef $(USE_OLD_SHELL)
 INF  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 INF  ShellPkg/Application/Shell/Shell.inf
-!else
-INF  RuleOverride = BINARY EdkShellBinPkg/FullShell/FullShell.inf
-!endif
 
 INF MdeModulePkg/Logo/LogoDxe.inf
 
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a4eaeb808c..7e2c71d4e6 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -516,9 +516,7 @@
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-!endif
 
 !if $(SMM_REQUIRE) == TRUE
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000
@@ -846,7 +844,6 @@
   OvmfPkg/Csm/Csm16/Csm16.inf
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
 
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
@@ -873,7 +870,6 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
-!endif
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
   SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 70845d6972..2a5663abcb 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -289,12 +289,8 @@ INF  
MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResour
 INF  FatPkg/EnhancedFatDxe/Fat.inf
 INF  MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
 
-!ifndef $(USE_OLD_SHELL)
 INF  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 INF  ShellPkg/Application/Shell/Shell.inf
-!else
-INF  RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf
-!endif
 
 INF MdeModulePkg/Logo/LogoDxe.inf
 
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index aa3efc5e73..2fcd293235 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -515,9 +515,7 @@
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-!endif
 
 !if $(SMM_REQUIRE) == TRUE
   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x4000
@@ -844,7 +842,6 @@
   OvmfPkg/Csm/Csm16/Csm16.inf
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
 
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
@@ -871,7 +868,6 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
-!endif
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
   

[edk2] [PATCH v2 0/5] Remove EdkShellBinPkg in FDF, DSC and DEC

2018-11-01 Thread shenglei
Remove EdkShellBinPkg in CorebootPayloadPkg, EmulatorPkg, Nt32Pkg
and OvmfPkg. Replace EdkShellBinPkg with EdkShellPkg in
Vlv2TbltDevicePkg.

v2: Remove 'USE_OLD_SHELL' in dsc files.

shenglei (5):
  CorebootPayloadPkg: Remove EdkShellBinPkg in FDF
  Nt32Pkg: Remove EdkShellBinPkg in FDF,DSC and DEC
  Vlv2TbltDevicePkg: Remove EdkShellBinPkg with ShellPkg
  EmulatorPkg: Remove EdkShellBinPkg in FDF and DEC
  OvmfPkg: Remove EdkShellBinPkg in FDF

 CorebootPayloadPkg/CorebootPayloadPkg.fdf | 8 
 EmulatorPkg/EmulatorPkg.dec   | 2 +-
 EmulatorPkg/EmulatorPkg.dsc   | 4 
 EmulatorPkg/EmulatorPkg.fdf   | 4 
 Nt32Pkg/Nt32Pkg.dec   | 2 +-
 Nt32Pkg/Nt32Pkg.dsc   | 6 ++
 Nt32Pkg/Nt32Pkg.fdf   | 4 
 OvmfPkg/OvmfPkgIa32.dsc   | 4 
 OvmfPkg/OvmfPkgIa32.fdf   | 4 
 OvmfPkg/OvmfPkgIa32X64.dsc| 4 
 OvmfPkg/OvmfPkgIa32X64.fdf| 4 
 OvmfPkg/OvmfPkgX64.dsc| 4 
 OvmfPkg/OvmfPkgX64.fdf| 4 
 Vlv2TbltDevicePkg/PlatformPkg.fdf | 5 +
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf  | 5 +
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc   | 1 +
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 1 +
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc  | 1 +
 18 files changed, 9 insertions(+), 58 deletions(-)

-- 
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 4/5] EmulatorPkg: Remove EdkShellBinPkg in FDF and DEC

2018-11-01 Thread shenglei
Remove EdkShellBinPkg in EmulatorPkg.dec and
EmulatorPkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL in DSC because it will be
unnecessary to use it.

Cc: Jordan Justen 
Cc: Ruiyu Ni 
Cc: Andrew Fish 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 EmulatorPkg/EmulatorPkg.dec | 2 +-
 EmulatorPkg/EmulatorPkg.dsc | 4 
 EmulatorPkg/EmulatorPkg.fdf | 4 
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec
index 25f79c92c9..9be8a90e5b 100644
--- a/EmulatorPkg/EmulatorPkg.dec
+++ b/EmulatorPkg/EmulatorPkg.dec
@@ -96,7 +96,7 @@
   gEmulatorPkgTokenSpaceGuid.PcdEmuVirtualDisk|L"disk.dmg:FW"|VOID*|0x1001
 
   gEmulatorPkgTokenSpaceGuid.PcdEmuGop|L"GOP Window"|VOID*|0x1018
-  
gEmulatorPkgTokenSpaceGuid.PcdEmuFileSystem|L".!../../../../../EdkShellBinPkg/bin/ia32/Apps"|VOID*|0x1004
+  gEmulatorPkgTokenSpaceGuid.PcdEmuFileSystem|L"."|VOID*|0x1004
   gEmulatorPkgTokenSpaceGuid.PcdEmuSerialPort|L"/dev/ttyS0"|VOID*|0x1002
   gEmulatorPkgTokenSpaceGuid.PcdEmuNetworkInterface|L"en0"|VOID*|0x100d
 
diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index c8c444fe1c..445777c0f3 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -196,9 +196,7 @@
   # Change PcdBootManagerMenuFile to UiApp
   gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 
0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 }
 
-!ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-!endif
 
 #define BOOT_WITH_FULL_CONFIGURATION  0x00
 #define BOOT_WITH_MINIMAL_CONFIGURATION   0x01
@@ -393,7 +391,6 @@
 
   FatPkg/EnhancedFatDxe/Fat.inf
 
-!ifndef $(USE_OLD_SHELL)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
 
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
@@ -421,7 +418,6 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
-!endif
 
 !endif
 
diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
index 5b5f81443d..915321eb7a 100644
--- a/EmulatorPkg/EmulatorPkg.fdf
+++ b/EmulatorPkg/EmulatorPkg.fdf
@@ -208,12 +208,8 @@ INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 
-!ifndef $(USE_OLD_SHELL)
 INF  ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 INF  ShellPkg/Application/Shell/Shell.inf
-!else
-INF  RuleOverride = BINARY EdkShellBinPkg/FullShell/FullShell.inf
-!endif
 
 [Rule.Common.SEC]
   FILE SEC = $(NAMED_GUID)  {
-- 
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/5] Vlv2TbltDevicePkg: Remove EdkShellBinPkg with ShellPkg

2018-11-01 Thread shenglei
Replace EdkShellBinPkg with ShellPkg in PlatformPkg.fdf,
PlatformPkgGcc.fdf, PlatformPkgGccX64.dsc,
PlatformPkgIA32.dsc and PlatformPkgX64.dsc.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

Cc: David Wei 
Cc: zailiang sun 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 Vlv2TbltDevicePkg/PlatformPkg.fdf   | 5 +
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf| 5 +
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 1 +
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 1 +
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 1 +
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf 
b/Vlv2TbltDevicePkg/PlatformPkg.fdf
index b7a0e584de..89c488372d 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
@@ -709,10 +709,7 @@ INF FatPkg/EnhancedFatDxe/Fat.inf
 #
 # UEFI Shell
 #
-FILE APPLICATION = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile) 
{
-#SECTION PE32 = 
EdkShellBinPkg/FullShell/$(EDK_DXE_ARCHITECTURE)/Shell_Full.efi
-SECTION PE32 = ShellBinPkg/UefiShell/$(EDK_DXE_ARCHITECTURE)/Shell.efi
-  }
+INF  ShellPkg/Application/Shell/Shell.inf
 
 #
 # dp command
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf 
b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
index eca273e33f..e7bbda1a56 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
@@ -665,10 +665,7 @@ INF FatPkg/EnhancedFatDxe/Fat.inf
 #
 # UEFI Shell
 #
-FILE APPLICATION = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile) 
{
-#SECTION PE32 = 
EdkShellBinPkg/FullShell/$(EDK_DXE_ARCHITECTURE)/Shell_Full.efi
-SECTION PE32 = ShellBinPkg/UefiShell/$(EDK_DXE_ARCHITECTURE)/Shell.efi
-  }
+INF  ShellPkg/Application/Shell/Shell.inf
 
 #
 # dp command
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index 3e3522aee9..af2e701372 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1462,6 +1462,7 @@ 
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   FatPkg/EnhancedFatDxe/Fat.inf
+  ShellPkg/Application/Shell/Shell.inf
 !if $(SATA_ENABLE) == TRUE
   
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTURE)/SataController.inf
 !endif
diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
index 55c873d565..38403f8f20 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc
@@ -1450,6 +1450,7 @@ 
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   FatPkg/EnhancedFatDxe/Fat.inf
+  ShellPkg/Application/Shell/Shell.inf
 !if $(SATA_ENABLE) == TRUE
   
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTURE)/SataController.inf
 !endif
diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
index fa6aa63491..13499b7c9e 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc
@@ -1462,6 +1462,7 @@ 
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/IA32/fTPMInitPeim.inf
   MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
   MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
   FatPkg/EnhancedFatDxe/Fat.inf
+  ShellPkg/Application/Shell/Shell.inf
 !if $(SATA_ENABLE) == TRUE
   
$(PLATFORM_BINARY_PACKAGE)/$(DXE_ARCHITECTURE)$(TARGET)/$(DXE_ARCHITECTURE)/SataController.inf
 !endif
-- 
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/5] Nt32Pkg: Remove EdkShellBinPkg in FDF, DSC and DEC

2018-11-01 Thread shenglei
Remove EdkShellBinPkg in Nt32Pkg.dec, Nt32Pkg.dsc
and Nt32Pkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

v2: Remove USE_OLD_SHELL in DSC because it will be
unnecessary to use it.

Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 Nt32Pkg/Nt32Pkg.dec | 2 +-
 Nt32Pkg/Nt32Pkg.dsc | 6 ++
 Nt32Pkg/Nt32Pkg.fdf | 4 
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/Nt32Pkg/Nt32Pkg.dec b/Nt32Pkg/Nt32Pkg.dec
index 06da067bc1..7b2cb8e8d0 100644
--- a/Nt32Pkg/Nt32Pkg.dec
+++ b/Nt32Pkg/Nt32Pkg.dec
@@ -89,7 +89,7 @@
   
gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk|L"FW;40960;512"|VOID*|0x1001
   gEfiNt32PkgTokenSpaceGuid.PcdWinNtSerialPort|L"COM1!COM2"|VOID*|0x1002
   gEfiNt32PkgTokenSpaceGuid.PcdWinNtUga|L"UGA Window 1!UGA Window 
2"|VOID*|0x1003
-  
gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\\..\\..\\..\\EdkShellBinPkg\\bin\\ia32\\Apps"|VOID*|0x1004
+  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|0x1004
   gEfiNt32PkgTokenSpaceGuid.PcdWinNtMemorySize|L"64!64"|VOID*|0x1005
   gEfiNt32PkgTokenSpaceGuid.PcdWinNtConsole|L"Bus Driver Console 
Window"|VOID*|0x100a
   gEfiNt32PkgTokenSpaceGuid.PcdWinNtGop|L"UGA Window 1!UGA Window 
2"|VOID*|0x100d
diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 58d9f8787d..727349d6cd 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -280,9 +280,7 @@
   gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
 !endif
 
-!ifndef $(USE_OLD_SHELL)
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
-!endif
 
 !if $(SECURE_BOOT_ENABLE) == TRUE
   # override the default values from SecurityPkg to ensure images from all 
sources are verified in secure boot
@@ -316,10 +314,10 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
 
 [PcdsDynamicDefault.Ia32]
-  
gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\Ia32\Apps"|VOID*|106
+  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106
 
 [PcdsDynamicDefault.x64]
-  
gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L".!..\..\..\..\EdkShellBinPkg\Bin\X64\Apps"|VOID*|106
+  gEfiNt32PkgTokenSpaceGuid.PcdWinNtFileSystem|L"."|VOID*|106
 
 [PcdsDynamicHii.common.DEFAULT]
   
gEfiMdeModulePkgTokenSpaceGuid.PcdSetupConOutColumn|L"SetupConsoleConfig"|gEfiNt32PkgTokenSpaceGuid|0x0|80
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
index db2719fd99..d1b856b5a3 100644
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ b/Nt32Pkg/Nt32Pkg.fdf
@@ -288,11 +288,7 @@ INF  
MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
 # for binary shell, binary fat and logo module.
 #
 

-!ifndef $(USE_OLD_SHELL)
 INF  ShellPkg/Application/Shell/Shell.inf
-!else
-INF  EdkShellBinPkg/FullShell/FullShell.inf
-!endif
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf
-- 
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 1/5] CorebootPayloadPkg: Remove EdkShellBinPkg in FDF

2018-11-01 Thread shenglei
Remove EdkShellBinPkg in CorebootPayloadPkg.fdf.
https://bugzilla.tianocore.org/show_bug.cgi?id=1108

Cc: Maurice Ma 
Cc: Prince Agyeman 
Cc: Benjamin You 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 CorebootPayloadPkg/CorebootPayloadPkg.fdf | 8 
 1 file changed, 8 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf 
b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index 7994f0c949..741a5c232e 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
@@ -185,14 +185,6 @@ INF 
ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf
 INF ShellPkg/Application/Shell/Shell.inf
 !endif
 
-!if $(SHELL_TYPE) == FULL_BIN
-!if $(ARCH) == IA32
-INF  RuleOverride = BINARY USE = IA32 EdkShellBinPkg/FullShell/FullShell.inf
-!else
-INF  RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf
-!endif
-!endif
-
 !if $(SHELL_TYPE) == MIN_BIN
 !if $(ARCH) == IA32
 INF  RuleOverride = BINARY USE = IA32 ShellBinPkg/MinUefiShell/MinUefiShell.inf
-- 
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 2/2] MdeModulePkg/BaseSortLib: Enable for all module types

2018-11-01 Thread Jeff Brasen
For defining it as a BASE type i changed that to that as there is a 
MemoryAllocationLib defined for the various phases. For example, SEC uses 
EmbeddedPkg/Library/PrePiMemoryAllocationLib (other patch in this series 
implements the AllocateZeroPool that is needed for this).


I am not opposed to an allocation-less SortLib but was trying to enable this 
capability without impact to other users of this library.


Thanks,

Jeff


From: Ni, Ruiyu 
Sent: Wednesday, October 31, 2018 2:56:42 AM
To: Jeff Brasen; edk2-devel@lists.01.org
Cc: Gao, Liming; Kinney, Michael D
Subject: RE: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all module 
types

SortLib depends on MemoryAllocationLib.
How can it be a BASE type library?

Can we do it in two options?
1. Change the SortLib API to accept a temporary buffer from caller. So the 
MemoryAllocationlIb dependency can be removed.
2. Do not change SortLibAPI but uses a fixed-size temporary buffer internally. 
E.g.: UINT8 Buffer[MAX_ELEMENT_SIZE];


Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of Jeff
> Brasen
> Sent: Wednesday, October 31, 2018 5:31 AM
> To: edk2-devel@lists.01.org
> Cc: Jeff Brasen 
> Subject: [edk2] [PATCH 2/2] MdeModulePkg/BaseSortLib: Enable for all
> module types
>
> Expose BaseSortLib for use in SEC and PEI phases.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jeff Brasen 
> ---
>  MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> index f807cd7..5bd1aa1 100644
> --- a/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> +++ b/MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf
> @@ -18,9 +18,9 @@
>BASE_NAME  = BaseSortLib
>MODULE_UNI_FILE= BaseSortLib.uni
>FILE_GUID  = 03F3331B-F12D-494f-BF37-E55A657F2497
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= BASE
>VERSION_STRING = 1.0
> -  LIBRARY_CLASS  = SortLib|DXE_DRIVER DXE_RUNTIME_DRIVER
> UEFI_APPLICATION UEFI_DRIVER
> +  LIBRARY_CLASS  = SortLib
>
>  #
>  #  VALID_ARCHITECTURES   = IA32 X64 EBC
> --
> 2.7.4
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/3] Maintainers.txt: Remove EdkShellPkg and EkdShellBinPkg

2018-11-01 Thread Zhang, Shenglei
Hi Leif,

Thanks for your comments. Actually there is a cover letter. 
https://lists.01.org/pipermail/edk2-devel/2018-October/031666.html
It may not be needed to rework but I 'll push the patches in order according to
the comments you mentioned.

Thanks,
Shenglei

> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Wednesday, October 31, 2018 7:02 PM
> To: Zhang, Shenglei 
> Cc: edk2-devel@lists.01.org; Andrew Fish ; Laszlo Ersek
> ; Kinney, Michael D 
> Subject: Re: [PATCH 1/3] Maintainers.txt: Remove EdkShellPkg and
> EkdShellBinPkg
> 
> Hi Shenglei,
> 
> I am happy with this change, but I think the deletion from
> Maintainers.txt should come last (as 3/3).
> Could you rework and resubmit, and add a cover letter (0/3)?
> 
> Best Regards,
> 
> Leif
> 
> On Wed, Oct 31, 2018 at 02:05:23PM +0800, shenglei wrote:
> > Given that EdkShellPkg and EkdShellBinPkg will be removed,
> > information about them in Maintainers.txt should also be
> > deleted.
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1107
> > https://bugzilla.tianocore.org/show_bug.cgi?id=1108
> >
> > Cc: Andrew Fish 
> > Cc: Laszlo Ersek 
> > Cc: Leif Lindholm 
> > Cc: Michael D Kinney 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: shenglei 
> > ---
> >  Maintainers.txt | 6 --
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/Maintainers.txt b/Maintainers.txt
> > index 36c6689afd..98f104b674 100644
> > --- a/Maintainers.txt
> > +++ b/Maintainers.txt
> > @@ -114,12 +114,6 @@ EdkCompatibilityPkg
> >  W:
> https://github.com/tianocore/tianocore.github.io/wiki/EdkCompatibilityPkg
> >  M: Liming Gao 
> >
> > -EdkShellPkg, EdkShellBinPkg
> > -W: https://github.com/tianocore/tianocore.github.io/wiki/EdkShellPkg
> > -M: Ruiyu Ni 
> > -T: svn - https://svn.code.sf.net/p/efi-shell/code/trunk/Shell/
> > -S: Obsolete (Use ShellPkg & ShellBinPkg instead)
> > -
> >  EmbeddedPkg
> >  W: https://github.com/tianocore/tianocore.github.io/wiki/EmbeddedPkg
> >  M: Leif Lindholm 
> > --
> > 2.18.0.windows.1
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Reminder for deleting 3 network drivers in MdeModulePkg

2018-11-01 Thread Gao, Liming
Leif:
  If all Stewards agree this change to remove MdeModulePkg 
Tcp4Dxe/UefiPxeBcDxe/IScsiDxe, we will try to include it in edk2-stable201811 
stable tag. 

Andrew and Mike:
  Do you agree this change to happen in near edk2-stable201811 stable tag?

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
>Lindholm
>Sent: Wednesday, October 31, 2018 6:50 PM
>To: Fu, Siyuan 
>Cc: edk2-devel@lists.01.org
>Subject: Re: [edk2] Reminder for deleting 3 network drivers in
>MdeModulePkg
>
>Hi Fu Siyuan,
>
>That is fine too.
>But I expect the change to be one to go in the week after a stable tag
>has been made.
>
>(My own philosophy is that one can be quite aggressive with removals,
>because if it turns out to have been a bad idea, git revert can
>quickly restore the tree to the state it was.)
>
>Best Regards,
>
>Leif
>
>On Wed, Oct 31, 2018 at 02:58:47AM +, Fu, Siyuan wrote:
>> Hi, Leif
>>
>> Just notice that you are saying edk2-stable201811 tag.
>>
>> We need more time to collect community/marketing feedback on
>> deleting these driver, so it may won't be able to catch the stable
>> tag in next month.
>>
>> BestRegards
>> Fu Siyuan
>>
>>
>> > -Original Message-
>> > From: Fu, Siyuan
>> > Sent: Wednesday, October 31, 2018 8:49 AM
>> > To: Leif Lindholm 
>> > Cc: edk2-devel@lists.01.org
>> > Subject: RE: [edk2] Reminder for deleting 3 network drivers in
>> > MdeModulePkg
>> >
>> > Hi, Leif
>> >
>> > I think checking the branch is a little better than the tag, because we
>> > may still have critical bug fixes after the official release.
>> >
>> > While any of them are not recommended, always using the NetworkPkg
>version
>> > driver is the best choice.
>> >
>> > I will modify the edk2 network wiki page for an updated sample DSC/FDF
>> > section, if this patch could pass review w/o objection.
>> > https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg-
>Getting-
>> > Started-Guide
>> >
>> >
>> > BestRegards
>> > Fu Siyuan
>> >
>> >
>> > > -Original Message-
>> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>Of
>> > > Leif Lindholm
>> > > Sent: Tuesday, October 30, 2018 6:47 PM
>> > > To: Fu, Siyuan 
>> > > Cc: edk2-devel@lists.01.org
>> > > Subject: Re: [edk2] Reminder for deleting 3 network drivers in
>> > > MdeModulePkg
>> > >
>> > > Hi Fu Siyan,
>> > >
>> > > On Tue, Oct 30, 2018 at 08:11:52AM +, Fu, Siyuan wrote:
>> > > > People who want to continue use these deleted drivers could go to
>> > > > edk2/UDK2018 branch to get them, but it's *highly not recommended*.
>> > >
>> > > They should also be able to use edk2-stable201811, right?
>> > >
>> > > > *If you have any opposition on deleting these drivers, please let me
>> > > > know before this weekend, thanks.*
>> > >
>> > > I am all for this change. The diffstat is very nice :)
>> > >
>> > > Best Regards,
>> > >
>> > > Leif
>> > > ___
>> > > 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
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel