Re: [edk2] [PATCH edk2-platforms 0/3] drop GUIDs from NOR flash bank descriptors

2018-11-21 Thread Ard Biesheuvel
On Thu, 22 Nov 2018 at 05:01, Thomas Abraham  wrote:
>
> Hi Ard,
>
> On Thu, Nov 22, 2018 at 3:46 AM Ard Biesheuvel
>  wrote:
> >
> > On Wed, 21 Nov 2018 at 14:48, Thomas Abraham  wrote:
> > >
> > > Hi Ard,
> > >
> > > On Wed, Nov 21, 2018 at 5:31 PM Ard Biesheuvel
> > >  wrote:
> > > >
> > > > Align edk2-platform with upcoming changes to EDK2 to get rid of per-bank
> > > > NOR flash GUIDs.
> > > >
> > > > Ard Biesheuvel (3):
> > > >   Platform/ARM: replace hardcoded VenHW() device paths referring to NOR
> > > > flash
> > > >   Silicon/SynQuacer: drop per-bank NOR flash GUIDs
> > > >   Platform/ARM: drop per-bank NOR flash GUIDs
> > > >
> > > >  Platform/ARM/JunoPkg/ArmJuno.dec   |  2 +-
> > > >  Platform/ARM/JunoPkg/ArmJuno.dsc   |  2 +-
> > > >  .../JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c |  2 --
> > > >  .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c   |  2 --
> > > >  Platform/ARM/SgiPkg/SgiPlatform.dsc|  2 +-
> > > >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc  |  2 +-
> > > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc   |  2 +-
> > > >  .../NorFlashArmVExpressLib/NorFlashArmVExpress.c   |  4 
> > > >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 14 +++---
> > > >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  |  3 +++
> > > >  .../NorFlashSynQuacerLib/NorFlashSynQuacer.c   |  6 --
> > > >  11 files changed, 15 insertions(+), 26 deletions(-)
> > >
> > > Tested this patch series and "[PATCH v2 0/5] ArmPlatformPkg,
> > > ArmVirtPkg: discover NOR flash banks from DTB" patch series on the
> > > Juno board. With these patches applied, the boot fails on Juno board
> > > with the following messages. I have not yet tried to debug the issue
> > > but wanted to let you know this.
> > >
> > > [...]
> > > Loading driver at 0x000F830C000 EntryPoint=0x000F831B2AC IScsiDxe.efi
> > > add-symbol-file
> > > /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
> > > 0xF830
> > > Loading driver at 0x000F82FF000 EntryPoint=0x000F8306DF0 Udp4Dxe.efi
> > > add-symbol-file
> > > /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
> > > 0xF82EE000
> > > Loading driver at 0x000F82ED000 EntryPoint=0x000F82F76EC 
> > > FdtPlatformDxe.efi
> > > Found image: fip in block 5.
> > > Found image: norkern in block 20.
> > > Found image: ramdisk.img in block 116.
> > > Found image: hdlcdclk in block 151.
> > > Found image: selftest in block 152.
> > > Found image: board.dtb in block 156.
> > > Found image: scp_bl1 in block 249.
> > > Found image: bl1 in block 251.
> > > Found image: startup.nsh in block 252.
> > > ASSERT [BootMonFs]
> > > /home/thopan01/devel/juno/uefi/uefi/edk2/MdePkg/Library/BaseLib/String.c(173):
> > > ((UINTN) String & 0x0001) == 0
> > >
> >
> > Hi Thomas,
> >
> > Thanks for testing.
> >
> > Could you please apply this patch and re-test:
> >
> > --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> > +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> > @@ -299,7 +299,7 @@
> >  !if $(TARGET) == RELEASE
> >gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x21
> >  !else
> > -  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
> > +  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x3f
> >  !endif
> >
> >#  DEBUG_INIT  0x0001  // Initialization
> >
> > This will produce a backtrace when an ASSERT() is triggered, and from
> > this we can figure out what the call stack looks like exactly (The
> > ASSERT() occurs in StrLen (), which is called with a misaligned
> > unicode string, but I cannot figure out where the call is made)
> >
> > Please share the backtrace and all the .dlls listed in it if you can please.
>
> The following is the log with the above diff applied on top of your
> patch series.
>

Thanks!

Could you please share the output of

nm -n 
/home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/BootMonFs/BootMonFs/DEBUG/BootMonFs.dll

as well so I can cross reference the addresses with the functions? Thanks.


> Loading driver at 0x000F8309000 EntryPoint=0x000F83182A4 IScsiDxe.efi
> add-symbol-file
> /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
> 0xF82FD000
> Loading driver at 0x000F82FC000 EntryPoint=0x000F8303DE8 Udp4Dxe.efi
> add-symbol-file
> /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
> 0xF82EA000
> Loading driver at 0x000F82E9000 EntryPoint=0x000F82F46E4 FdtPlatformDxe.efi
> Found image: fip in block 5.
> Found image: norkern in block 20.
> Found image: ramdisk.img in block 116.
> Found image: hdlcdclk in block 151.
> Found image: selftest in block 152.
> Found 

[edk2] [PATCH 0/2] Remove DuetPkg and unused tools

2018-11-21 Thread Shenglei Zhang
DuetPkg depends on Legacy BIOS to provide a UEFI environment.
It was invented in the era when UEFI environment is hard to find.
Since now UEFI is very popular in PC area, we could stop the
official support of this package and remove it from the master.
And moreover, the tools only used by DuetPkg can also be removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1322

The changes are placed in
https://github.com/shenglei10/edk2/tree/duet

Shenglei Zhang (2):
  DuetPkg: Remove DuetPkg
  BaseTools: Remove tools only used by DuetPkg

 BaseTools/Source/BinaryFiles.txt  |4 -
 BaseTools/Source/C/BootSectImage/GNUmakefile  |   21 -
 BaseTools/Source/C/BootSectImage/Makefile |   22 -
 .../Source/C/BootSectImage/bootsectimage.c|  955 --
 BaseTools/Source/C/BootSectImage/fat.h|  152 -
 BaseTools/Source/C/BootSectImage/mbr.h|   58 -
 BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c  |  319 --
 BaseTools/Source/C/EfiLdrImage/GNUmakefile|   21 -
 BaseTools/Source/C/EfiLdrImage/Makefile   |   22 -
 BaseTools/Source/C/GenBootSector/FatFormat.h  |  152 -
 .../Source/C/GenBootSector/GenBootSector.c|  823 -
 .../Source/C/GenBootSector/GetDrvNumOffset.c  |   73 -
 BaseTools/Source/C/GenBootSector/Makefile |   22 -
 BaseTools/Source/C/GenPage/GNUmakefile|   21 -
 BaseTools/Source/C/GenPage/GenPage.c  |  441 ---
 BaseTools/Source/C/GenPage/Makefile   |   22 -
 BaseTools/Source/C/GenPage/VirtualMemory.h|  122 -
 .../Source/C/GnuGenBootSector/FatFormat.h |  152 -
 .../Source/C/GnuGenBootSector/GNUmakefile |   21 -
 .../C/GnuGenBootSector/GnuGenBootSector.c |  455 ---
 BaseTools/toolsetup.bat   |4 -
 DuetPkg/AcpiResetDxe/Reset.c  |  212 --
 DuetPkg/AcpiResetDxe/Reset.inf|   47 -
 DuetPkg/BiosVideoThunkDxe/BiosVideo.c | 2822 -
 DuetPkg/BiosVideoThunkDxe/BiosVideo.h |  504 ---
 DuetPkg/BiosVideoThunkDxe/BiosVideo.inf   |   50 -
 DuetPkg/BiosVideoThunkDxe/ComponentName.c |  166 -
 DuetPkg/BiosVideoThunkDxe/LegacyBiosThunk.c   |  220 --
 .../BiosVideoThunkDxe/VesaBiosExtensions.h|  457 ---
 DuetPkg/BootSector/BootSector.inf |   79 -
 DuetPkg/BootSector/FILE.LST   |   39 -
 DuetPkg/BootSector/GNUmakefile|  140 -
 DuetPkg/BootSector/Gpt.S  |  297 --
 DuetPkg/BootSector/Gpt.asm|  294 --
 DuetPkg/BootSector/Makefile   |  173 -
 DuetPkg/BootSector/Mbr.S  |  262 --
 DuetPkg/BootSector/Mbr.asm|  261 --
 DuetPkg/BootSector/bin/Gpt.com|  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/Mbr.com|  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/Readme.txt |8 -
 DuetPkg/BootSector/bin/St16_64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/St32_64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start.com  |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start16.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start32.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/Start64.com|  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/bootsect.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/bs16.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/bs32.com   |  Bin 512 -> 0 bytes
 DuetPkg/BootSector/bin/efi32.com  |  Bin 139264 -> 0 bytes
 DuetPkg/BootSector/bin/efi32.com2 |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bin/efi64.com  |  Bin 139264 -> 0 bytes
 DuetPkg/BootSector/bin/efi64.com2 |  Bin 4096 -> 0 bytes
 DuetPkg/BootSector/bootsect.S |  303 --
 DuetPkg/BootSector/bootsect.asm   |  301 --
 DuetPkg/BootSector/bs16.S |  291 --
 DuetPkg/BootSector/bs16.asm   |  288 --
 DuetPkg/BootSector/bs32.S |  312 --
 DuetPkg/BootSector/bs32.asm   |  310 --
 DuetPkg/BootSector/efi32.S| 1176 ---
 DuetPkg/BootSector/efi32.asm  |  582 
 DuetPkg/BootSector/efi64.S| 1385 
 DuetPkg/BootSector/efi64.asm  |  787 -
 DuetPkg/BootSector/st16_64.S  | 1142 ---
 DuetPkg/BootSector/st16_64.asm| 1140 ---
 DuetPkg/BootSector/st32_64.S  | 1157 ---
 DuetPkg/BootSector/st32_64.asm| 1156 ---
 DuetPkg/BootSector/start.S|  919 --
 DuetPkg/BootSector/start.asm  |  916 --
 DuetPkg/BootSector/start16.S  |  910 --
 DuetPkg/BootSector/start16.asm|  909 --
 DuetPkg/BootSector/start32.S  |  927 --
 DuetPkg/BootSector/start32.asm|  924 --
 DuetPkg/BootSector/start64.S   

Re: [edk2] [PATCH v2 0/6] Add DSC/FDF include segment files for network stack

2018-11-21 Thread Gao, Liming
Siyuan:
  Thanks for your contribution. I really like this idea to share the common 
DSC/FDF between all platform DSC/FDFs.  Now, FixedAtBuild PCD can also be used 
in the conditional statement. Its value can be specified by build command with 
--pcd option. So, I suggest to use FixedAtBuild PCD for network feature instead 
of MACRO. I would like to recommend to use PCD both for the build and firmware 
configuration. For this case, one UINT16 FixedAtBuildPcd can be introduced in 
NetworkPkg.dec.  Its different bit will be for the different network features. 
Below is the example. Besides, I think *.dsc.inc files need to include section 
header. If so, *.dsc.inc is the standalone dsc file. It can easily be included 
in platform DSC file. Especially for library instance, the different library 
instance may be for the different module type. Without section header, they can 
be placed into one *Libs.dsc.inc file. 

[Defines]
   DEFINE NETWORK_ENABLE = 0x1
   DEFINE NETWORK_SNP_ENABLE = 0x2
   DEFINE NETWORK_IP4_ENABLE = 0x4
   DEFINE NETWORK_IP6_ENABLE = 0x8
   DEFINE NETWORK_TLS_ENABLE = 0x10
   DEFINE NETWORK_HTTP_BOOT_ENABLE   = 0x20
   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = 0x40
   DEFINE NETWORK_IPSEC_ENABLE   = 0x80
   DEFINE NETWORK_ISCSI_ENABLE   = 0x100
   DEFINE NETWORK_VLAN_ENABLE= 0x200

[PcdsFixedAtBuild]
   gEfiNetworkPkgTokenSpaceGuid.PcdNetworkFeatureMask|0x

[PcdsFixedAtBuild]
!if gEfiNetworkPkgTokenSpaceGuid.PcdNetworkFeatureMask & 
NETWORK_ALLOW_HTTP_CONNECTIONS == NETWORK_ALLOW_HTTP_CONNECTIONS
  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
!endif

Thanks
Liming
>-Original Message-
>From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Fu
>Siyuan
>Sent: Thursday, November 22, 2018 1:22 PM
>To: edk2-devel@lists.01.org
>Cc: Ni, Ruiyu ; Ye, Ting ; Justen,
>Jordan L ; Wu, Hao A ; Wu,
>Jiaxin ; Anthony Perard ;
>Laszlo Ersek ; Wei, David 
>Subject: [edk2] [PATCH v2 0/6] Add DSC/FDF include segment files for
>network stack
>
>There is a patch to remove the redudant IP4 only iSCSI/PXE/TCP drivers
>from MdeModulePkg, which has been reviewed before edk2-stable201811
>tag.
>And we also have plan to move all network related libraries/modules to
>NetworkPkg. In order to make these change more smoothly, a set of
>fragment
>files (2 for DSC and 1 for FDF) are provided for platform to enable the
>network stack support, without directly reference the INF module path.
>
>Patch 1/6 adds centralized dsc/fdf include files to NetworkPkg, with
>a set of flags for feature set enable/disable.
>Patch 2~6 updates edk2 platform dsc/fdf files to use the new include
>files, instead of reference the module INF.
>
>v2:
>  1. Split the "Network.dsc.inc" in to 4 files for different sections in DSC
>  file. This could provide more flexibility to platform owner to use the
>  include files.
>  2. Clarify the OpenSSL dependency of TLS, iSCSI and IPsec enable flag.
>  3. Use "!error" statement for incorrect flag value check.
>  4. Update platform DSC/FDF to use the new include files.
>  5. Other decoration work according to Laszlo's comments.
>
>
>
>Fu Siyuan (6):
>  NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
>  Nt32Pkg: Update DSC/FDF to use NetworkPkg's include fragment file.
>  ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
>  EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
>  OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
>  Vlv2TbltDevicePkg: Update DSC/FDF to use NetworkPkg's include fragment
>file.
>
> ArmVirtPkg/ArmVirt.dsc.inc  |  11 +-
> ArmVirtPkg/ArmVirtQemu.dsc  |  46 ++-
> ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc|  28 +---
> ArmVirtPkg/ArmVirtQemuKernel.dsc|  46 ++-
> EmulatorPkg/EmulatorPkg.dsc |  39 --
> EmulatorPkg/EmulatorPkg.fdf |  10 +-
> NetworkPkg/Network.fdf.inc  |  69 ++
> NetworkPkg/NetworkComponents.dsc.inc|  71 ++
> NetworkPkg/NetworkDefines.dsc.inc   | 138 
> NetworkPkg/NetworkLibs.dsc.inc  |  25 
> NetworkPkg/NetworkPcds.dsc.inc  |  22 
> NetworkPkg/NetworkPkg.dsc   |  28 +---
> Nt32Pkg/Nt32Pkg.dsc | 104 ---
> Nt32Pkg/Nt32Pkg.fdf |  27 +---
> OvmfPkg/OvmfPkgIa32.dsc |  75 +--
> OvmfPkg/OvmfPkgIa32.fdf |  27 +---
> OvmfPkg/OvmfPkgIa32X64.dsc  |  76 +--
> OvmfPkg/OvmfPkgIa32X64.fdf  |  27 +---
> OvmfPkg/OvmfPkgX64.dsc  |  75 +--
> OvmfPkg/OvmfPkgX64.fdf  |  27 +---
> Vlv2TbltDevicePkg/PlatformPkg.fdf   |  25 +---
> Vlv2TbltDevicePkg/PlatformPkgConfig.dsc |  11 +-
> Vlv2TbltDevicePkg/PlatformPkgGcc.fdf|  25 +---
> Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc 

[edk2] [PATCH v2 5/6] OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

This patch also rename the TLS_ENABLE flag to PLATFORM_TLS_ENABLE for the
platform specific configuration for TLS support.

Cc: Jordan Justen 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Anthony Perard 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---

Notes:
v2:
Rename TLS_ENABLE flag to PLATFORM_TLS_ENABLE flag for platform specific 
configuration for TLS support.

 OvmfPkg/OvmfPkgIa32.dsc| 75 +--
 OvmfPkg/OvmfPkgIa32.fdf| 27 +--
 OvmfPkg/OvmfPkgIa32X64.dsc | 76 +---
 OvmfPkg/OvmfPkgIa32X64.fdf | 27 +--
 OvmfPkg/OvmfPkgX64.dsc | 75 +--
 OvmfPkg/OvmfPkgX64.fdf | 27 +--
 6 files changed, 102 insertions(+), 205 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index eccf34d3d1cb..adedd2240a8a 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -35,12 +35,25 @@ [Defines]
   # -D FLAG=VALUE
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
-  DEFINE NETWORK_IP6_ENABLE  = FALSE
-  DEFINE HTTP_BOOT_ENABLE= FALSE
   DEFINE SMM_REQUIRE = FALSE
-  DEFINE TLS_ENABLE  = FALSE
   DEFINE TPM2_ENABLE = FALSE
 
+  #
+  # PLATFORM_TLS_ENABLE flag is used to control platform specific 
configuration for TLS support,
+  # which add a NULL class library instance to TlsAuthConfigDxe.inf for 
downloading the necessary
+  # data from QEMU via fw_cfg.
+  #
+  DEFINE PLATFORM_TLS_ENABLE= FALSE
+  #
+  # The NETWORK_TLS_ENABLE should always be set to FALSE since 
PLATFORM_TLS_ENABLE is used.
+  #
+  DEFINE NETWORK_TLS_ENABLE = FALSE
+  DEFINE NETWORK_IP6_ENABLE = FALSE
+  DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+  DEFINE NETWORK_IPSEC_ENABLE   = FALSE
+!include NetworkPkg/NetworkDefines.dsc.inc
+
   #
   # Flash size selection. Setting FD_SIZE_IN_KB on the command line directly to
   # one of the supported values, in place of any of the convenience macros, is
@@ -144,10 +157,6 @@ [LibraryClasses]
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
   UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf
   
SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   
SerializeVariablesLib|OvmfPkg/Library/SerializeVariablesLib/SerializeVariablesLib.inf
   QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgDxeLib.inf
@@ -173,7 +182,7 @@ [LibraryClasses]
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
-!if $(TLS_ENABLE) == TRUE
+!if $(PLATFORM_TLS_ENABLE) == TRUE
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
 !else
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
@@ -191,11 +200,12 @@ [LibraryClasses]
 
   TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
 
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-!endif
+  #
+  # Network libraries
+  #
+!include NetworkPkg/NetworkLibs.dsc.inc
 
-!if $(TLS_ENABLE) == TRUE
+!if $(PLATFORM_TLS_ENABLE) == TRUE
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
 !endif
 
@@ -442,7 +452,7 @@ [PcdsFixedAtBuild]
 !if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800
-!if $(TLS_ENABLE) == FALSE
+!if $(PLATFORM_TLS_ENABLE) == FALSE
   # match PcdFlashNvStorageVariableSize purely for convenience
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000
 !endif
@@ -450,12 +460,12 @@ [PcdsFixedAtBuild]
 !if $(FD_SIZE_IN_KB) == 4096
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x8400
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x8400
-!if $(TLS_ENABLE) == FALSE
+!if $(PLATFORM_TLS_ENABLE) == FALSE
   # match PcdFlashNvStorageVariableSize purely for convenience
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x4
 !endif
 !endif
-!if $(TLS_ENABLE) == TRUE
+!if $(PLATFORM_TLS_ENABLE) == TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x8
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize|0x4
 !endif
@@ -504,9 +514,10 @@ [PcdsFixedAtBuild]
   

[edk2] [PATCH v2 6/6] Vlv2TbltDevicePkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: David Wei 
Cc: Mang Guo 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 Vlv2TbltDevicePkg/PlatformPkg.fdf   | 25 +-
 Vlv2TbltDevicePkg/PlatformPkgConfig.dsc | 11 +++--
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf| 25 +-
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 52 ++--
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   | 52 ++--
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc| 52 ++--
 6 files changed, 54 insertions(+), 163 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkg.fdf 
b/Vlv2TbltDevicePkg/PlatformPkg.fdf
index f976b9fa4057..e281d1407fc2 100644
--- a/Vlv2TbltDevicePkg/PlatformPkg.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkg.fdf
@@ -728,35 +728,12 @@ [FV.FVMAIN]
 #
 # Network Modules
 #
+!include NetworkPkg/Network.fdf.inc
 !if $(NETWORK_ENABLE) == TRUE
   FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
 SECTION PE32 = 
Vlv2MiscBinariesPkg/UNDI/RtkUndiDxe/$(DXE_ARCHITECTURE)/RtkUndiDxe.efi
 SECTION UI = "UNDI"
   }
-  INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  INF  NetworkPkg/IpSecDxe/IpSecDxe.inf
-  INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  !endif
-  !if $(NETWORK_VLAN_ENABLE) == TRUE
-  INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  !endif
-  !if $(NETWORK_ISCSI_ENABLE) == TRUE
-INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !endif
 !endif
 
 !if $(CAPSULE_ENABLE)
diff --git a/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
index 672853dda6a6..a065e7e8e6a7 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgConfig.dsc
@@ -81,10 +81,13 @@
 
 DEFINE LZMA_ENABLE = TRUE
 DEFINE S4_ENABLE = TRUE
-DEFINE NETWORK_ENABLE = TRUE
-DEFINE NETWORK_IP6_ENABLE = TRUE
-DEFINE NETWORK_ISCSI_ENABLE = FALSE
-DEFINE NETWORK_VLAN_ENABLE = FALSE
+DEFINE NETWORK_ENABLE = TRUE
+DEFINE NETWORK_IP6_ENABLE = TRUE
+DEFINE NETWORK_ISCSI_ENABLE   = FALSE
+DEFINE NETWORK_VLAN_ENABLE= FALSE
+DEFINE NETWORK_TLS_ENABLE = FALSE
+DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
+DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
 
 DEFINE SATA_ENABLE   = TRUE
 DEFINE PCIESC_ENABLE = TRUE
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf 
b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
index 50032f7d5f19..6ea0ec92d4ae 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
+++ b/Vlv2TbltDevicePkg/PlatformPkgGcc.fdf
@@ -684,35 +684,12 @@ [FV.FVMAIN]
 #
 # Network Modules
 #
+!include NetworkPkg/Network.fdf.inc
 !if $(NETWORK_ENABLE) == TRUE
   FILE DRIVER = 22DE1691-D65D-456a-993E-A253DD1F308C {
 SECTION PE32 = 
Vlv2MiscBinariesPkg/UNDI/RtkUndiDxe/$(DXE_ARCHITECTURE)/RtkUndiDxe.efi
 SECTION UI = "UNDI"
   }
-  INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  INF  NetworkPkg/TcpDxe/TcpDxe.inf
-  INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !if $(NETWORK_IP6_ENABLE) == TRUE
-  INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  INF  NetworkPkg/IpSecDxe/IpSecDxe.inf
-  INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  !endif
-  !if $(NETWORK_VLAN_ENABLE) == TRUE
-  INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  !endif
-  !if $(NETWORK_ISCSI_ENABLE) == TRUE
-INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
-  !endif
 !endif
 
 !if $(CAPSULE_ENABLE)
diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc 
b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index f8ad29df5986..4a5417c61fcf 100644

[edk2] [PATCH v2 0/6] Add DSC/FDF include segment files for network stack

2018-11-21 Thread Fu Siyuan
There is a patch to remove the redudant IP4 only iSCSI/PXE/TCP drivers
from MdeModulePkg, which has been reviewed before edk2-stable201811 tag.
And we also have plan to move all network related libraries/modules to
NetworkPkg. In order to make these change more smoothly, a set of fragment
files (2 for DSC and 1 for FDF) are provided for platform to enable the 
network stack support, without directly reference the INF module path.

Patch 1/6 adds centralized dsc/fdf include files to NetworkPkg, with
a set of flags for feature set enable/disable.
Patch 2~6 updates edk2 platform dsc/fdf files to use the new include
files, instead of reference the module INF.

v2:
  1. Split the "Network.dsc.inc" in to 4 files for different sections in DSC
  file. This could provide more flexibility to platform owner to use the
  include files.
  2. Clarify the OpenSSL dependency of TLS, iSCSI and IPsec enable flag.
  3. Use "!error" statement for incorrect flag value check.
  4. Update platform DSC/FDF to use the new include files.
  5. Other decoration work according to Laszlo's comments.



Fu Siyuan (6):
  NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.
  Nt32Pkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.
  Vlv2TbltDevicePkg: Update DSC/FDF to use NetworkPkg's include fragment
file.

 ArmVirtPkg/ArmVirt.dsc.inc  |  11 +-
 ArmVirtPkg/ArmVirtQemu.dsc  |  46 ++-
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc|  28 +---
 ArmVirtPkg/ArmVirtQemuKernel.dsc|  46 ++-
 EmulatorPkg/EmulatorPkg.dsc |  39 --
 EmulatorPkg/EmulatorPkg.fdf |  10 +-
 NetworkPkg/Network.fdf.inc  |  69 ++
 NetworkPkg/NetworkComponents.dsc.inc|  71 ++
 NetworkPkg/NetworkDefines.dsc.inc   | 138 
 NetworkPkg/NetworkLibs.dsc.inc  |  25 
 NetworkPkg/NetworkPcds.dsc.inc  |  22 
 NetworkPkg/NetworkPkg.dsc   |  28 +---
 Nt32Pkg/Nt32Pkg.dsc | 104 ---
 Nt32Pkg/Nt32Pkg.fdf |  27 +---
 OvmfPkg/OvmfPkgIa32.dsc |  75 +--
 OvmfPkg/OvmfPkgIa32.fdf |  27 +---
 OvmfPkg/OvmfPkgIa32X64.dsc  |  76 +--
 OvmfPkg/OvmfPkgIa32X64.fdf  |  27 +---
 OvmfPkg/OvmfPkgX64.dsc  |  75 +--
 OvmfPkg/OvmfPkgX64.fdf  |  27 +---
 Vlv2TbltDevicePkg/PlatformPkg.fdf   |  25 +---
 Vlv2TbltDevicePkg/PlatformPkgConfig.dsc |  11 +-
 Vlv2TbltDevicePkg/PlatformPkgGcc.fdf|  25 +---
 Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc |  52 +++-
 Vlv2TbltDevicePkg/PlatformPkgIA32.dsc   |  52 +++-
 Vlv2TbltDevicePkg/PlatformPkgX64.dsc|  52 +++-
 26 files changed, 573 insertions(+), 615 deletions(-)
 create mode 100644 NetworkPkg/Network.fdf.inc
 create mode 100644 NetworkPkg/NetworkComponents.dsc.inc
 create mode 100644 NetworkPkg/NetworkDefines.dsc.inc
 create mode 100644 NetworkPkg/NetworkLibs.dsc.inc
 create mode 100644 NetworkPkg/NetworkPcds.dsc.inc

Cc: Jiaxin Wu 
Cc: Ting Ye 
Cc: Ruiyu Ni 
Cc: Hao Wu 
Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Julien Grall 
Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ruiyu Ni 
Cc: Anthony Perard 
Cc: David Wei 
Cc: Mang Guo 

-- 
2.19.1.windows.1

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


[edk2] [PATCH v2 3/6] ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: Laszlo Ersek 
Cc: Ard Biesheuvel 
Cc: Julien Grall 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 ArmVirtPkg/ArmVirt.dsc.inc   | 11 +
 ArmVirtPkg/ArmVirtQemu.dsc   | 46 ++--
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 28 +---
 ArmVirtPkg/ArmVirtQemuKernel.dsc | 46 ++--
 4 files changed, 28 insertions(+), 103 deletions(-)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 70a0ac4d786c..d7de73a88eff 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -76,16 +76,7 @@ [LibraryClasses.common]
   BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
 
   # Networking Requirements
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
-!endif
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-!endif
+!include NetworkPkg/NetworkLibs.dsc.inc
 
   #
   # It is not possible to prevent the ARM compiler from inserting calls to 
intrinsic functions.
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index 885c6b14b844..1414b6a5ccf8 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -33,9 +33,14 @@ [Defines]
   # Defines for default states.  These can be changed on the command line.
   # -D FLAG=VALUE
   #
-  DEFINE SECURE_BOOT_ENABLE  = FALSE
-  DEFINE NETWORK_IP6_ENABLE  = FALSE
-  DEFINE HTTP_BOOT_ENABLE= FALSE
+  DEFINE SECURE_BOOT_ENABLE  = FALSE
+  DEFINE NETWORK_IP6_ENABLE  = FALSE
+  DEFINE NETWORK_HTTP_BOOT_ENABLE= FALSE
+  DEFINE NETWORK_SNP_ENABLE  = FALSE
+  DEFINE NETWORK_TLS_ENABLE  = FALSE
+  DEFINE NETWORK_IPSEC_ENABLE= FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS  = TRUE
+!include NetworkPkg/NetworkDefines.dsc.inc
 
 !include ArmVirtPkg/ArmVirt.dsc.inc
 
@@ -123,9 +128,10 @@ [PcdsFixedAtBuild.common]
   #
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0
 
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
-!endif
+  #
+  # Network Pcds
+  #
+!include NetworkPkg/NetworkPcds.dsc.inc
 
   # System Memory Base -- fixed at 0x4000_
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x4000
@@ -338,33 +344,7 @@ [Components.common]
   #
   # Networking stack
   #
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
-  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
-  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
-  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
-  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  NetworkPkg/IScsiDxe/IScsiDxe.inf
-!else
-  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
-  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
-  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
-!endif
-!if $(HTTP_BOOT_ENABLE) == TRUE
-  NetworkPkg/DnsDxe/DnsDxe.inf
-  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
-  NetworkPkg/HttpDxe/HttpDxe.inf
-  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
-!endif
+!include NetworkPkg/NetworkComponents.dsc.inc
 
   #
   # SCSI Bus and Disk Driver
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc 
b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index a6390bd4b841..560651e49e0b 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -118,33 +118,7 @@ [FV.FvMain]
   #
   # Networking stack
   #
-  INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  INF MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  INF MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  INF MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  INF MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-!if $(NETWORK_IP6_ENABLE) == TRUE
-  INF NetworkPkg/Ip6Dxe/Ip6Dxe.inf
-  INF NetworkPkg/TcpDxe/TcpDxe.inf
-  

[edk2] [PATCH v2 4/6] EmulatorPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have been updated to use
the NetworkPkg's terms, and the value has been overridden with the original
default value on this platform.

Cc: Jordan Justen 
Cc: Andrew Fish 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---
 EmulatorPkg/EmulatorPkg.dsc | 39 +---
 EmulatorPkg/EmulatorPkg.fdf | 10 +
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 4097e1192ebc..b819f438c407 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -29,6 +29,21 @@ [Defines]
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = EmulatorPkg/EmulatorPkg.fdf
 
+  #
+  # Network stack drivers
+  #
+  
+  #
+  # EmuSnpDxe.inf will be used.
+  #
+  DEFINE NETWORK_SNP_ENABLE   = FALSE
+  DEFINE NETWORK_IP6_ENABLE   = FALSE
+  DEFINE NETWORK_TLS_ENABLE   = FALSE
+  DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
+  DEFINE NETWORK_IPSEC_ENABLE = FALSE
+  DEFINE NETWORK_ISCSI_ENABLE = FALSE
+!include NetworkPkg/NetworkDefines.dsc.inc
+
 [SkuIds]
   0|DEFAULT
 
@@ -74,10 +89,6 @@ [LibraryClasses]
   # Generic Modules
   #
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
@@ -89,6 +100,11 @@ [LibraryClasses]
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
+  #
+  # Network libraries
+  #
+!include NetworkPkg/NetworkLibs.dsc.inc
+
   #
   # Platform
   #
@@ -225,6 +241,11 @@ [PcdsFixedAtBuild]
   #  0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
 
+  #
+  # Network Pcds
+  #
+!include NetworkPkg/NetworkPcds.dsc.inc
+
 [PcdsDynamicDefault.common.DEFAULT]
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0
@@ -368,15 +389,7 @@ [Components]
   #
   # Network stack drivers
   #
-  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
-  NetworkPkg/TcpDxe/TcpDxe.inf
+!include NetworkPkg/NetworkComponents.dsc.inc
 
   MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf
index 45697da25860..a8b46be66083 100644
--- a/EmulatorPkg/EmulatorPkg.fdf
+++ b/EmulatorPkg/EmulatorPkg.fdf
@@ -196,15 +196,7 @@ [FV.FvRecovery]
 !if $(NETWORK_SUPPORT)
 INF  EmulatorPkg/EmuSnpDxe/EmuSnpDxe.inf
 !endif
-INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
-INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
-INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
-INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
-INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
-INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
-INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
-INF  NetworkPkg/TcpDxe/TcpDxe.inf
-INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+!include NetworkPkg/Network.fdf.inc
 
 INF FatPkg/EnhancedFatDxe/Fat.inf
 
-- 
2.19.1.windows.1

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


[edk2] [PATCH v2 2/6] Nt32Pkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Fu Siyuan
This patch updates the platform DSC/FDF files to use the include fragment
files provided by NetworkPkg.
The feature enabling flags in [Defines] section have be updated to use the
NetworkPkg's terms, and the value have been overridden with the original
default value on this platform.

Cc: Ruiyu Ni 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---

Notes:
v2:
Change the !if reference of TLS_ENABLE to NETWORK_TLS_ENABLE for OpensslLib.

 Nt32Pkg/Nt32Pkg.dsc | 104 ++--
 Nt32Pkg/Nt32Pkg.fdf |  27 +
 2 files changed, 31 insertions(+), 100 deletions(-)

diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 4dbde0cc45b6..06d6407d593c 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -44,39 +44,20 @@ [Defines]
   # Defines for default states.  These can be changed on the command line.
   # -D FLAG=VALUE
   #
-  # Note: Secure Boot feature highly depends on the OpenSSL building. To 
enable this 
-  #   feature, please follow the instructions found in the file 
"Patch-HOWTO.txt" 
+  # Note: Secure Boot feature highly depends on the OpenSSL building. To 
enable this
+  #   feature, please follow the instructions found in the file 
"Patch-HOWTO.txt"
   #   located in CryptoPkg\Library\OpensslLib to enable the OpenSSL 
building first.
   #
   DEFINE SECURE_BOOT_ENABLE  = FALSE
-  
-  #
-  # This flag is to enable or disable TLS feature.  
-  # These can be changed on the command line.
-  # -D FLAG=VALUE
-  #
-  # Note: TLS feature highly depends on the OpenSSL building. To enable this 
-  #   feature, please follow the instructions found in the file 
"Patch-HOWTO.txt" 
-  #   located in CryptoPkg\Library\OpensslLib to enable the OpenSSL 
building first.
-  #
-  DEFINE TLS_ENABLE = FALSE
-  
-  #
-  # Indicates whether HTTP connections (i.e., unsecured) are permitted or not.
-  # -D FLAG=VALUE
-  #
-  # Note: If ALLOW_HTTP_CONNECTIONS is TRUE, HTTP connections are allowed. 
Both 
-  #   the "https://; and "http://; URI schemes are permitted. Otherwise, 
HTTP 
-  #   connections are denied. Only the "https://; URI scheme is permitted.
-  #
-  DEFINE ALLOW_HTTP_CONNECTIONS = TRUE
 
   #
-  # This flag is to enable or disable IPv6 network stack.
-  # These can be changed on the command line.
-  # -D FLAG=VALUE
+  # SnpNt32Dxe.inf will be used.
   #
-  DEFINE NETWORK_IP6_ENABLE = FALSE
+  DEFINE NETWORK_SNP_ENABLE = FALSE
+  DEFINE NETWORK_IP6_ENABLE = FALSE
+  DEFINE NETWORK_TLS_ENABLE = FALSE
+  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+!include NetworkPkg/NetworkDefines.dsc.inc
 
 

 #
@@ -133,18 +114,12 @@ [LibraryClasses]
   
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
   
UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf
   FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
-  
+
   #
   # Generic Modules
   #
   UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
-  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
-  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
-  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
-  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
-  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
-  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
   
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
@@ -153,6 +128,12 @@ [LibraryClasses]
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+
+  #
+  # Network libraries
+  #
+!include NetworkPkg/NetworkLibs.dsc.inc
+
   #
   # Platform
   #
@@ -168,12 +149,12 @@ [LibraryClasses]
   LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   ResetSystemLib|Nt32Pkg/Library/ResetSystemLib/ResetSystemLib.inf
-!if $(TLS_ENABLE) == TRUE
+!if $(NETWORK_TLS_ENABLE) == TRUE
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
 !else
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf
 !endif
-  
+
 !if $(SECURE_BOOT_ENABLE) == TRUE
   PlatformSecureLib|Nt32Pkg/Library/PlatformSecureLib/PlatformSecureLib.inf
   
TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf
@@ -245,7 +226,7 @@ [LibraryClasses.common.UEFI_DRIVER]
 [LibraryClasses.common.UEFI_APPLICATION]
   PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
   

[edk2] [PATCH v2 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-21 Thread Fu Siyuan
This patch provides a set of include segment files for platform owner to
easily enable/disable network stack support on their platform.

For DSC, there are:
- a "NetworkDefines.dsc.inc" for the [Defines] section(s),
- a "NetworkLibs.dsc.inc" for the [LibraryClasses*] section(s),
- a "NetworkPcds.dsc.inc" for the [Pcds*] section(s),
- a "NetworkComponents.dsc.inc" for the [Components*] section(s).
For FDF, there is:
- a "Network.fdf.inc" for the [Fv*] section(s).

These files can be added to the platform DSC/FDF file by using
  !include NetworkPkg/xxx
where "xxx" is the *.inc file name.

A set of flags can be changed before the include line or in build command
line ("-D FLAG=VALUE") to enable or disable related feature set, please
check "NetworkDefines.dsc.inc" for a detail description of each flag.

The default value of these flags are:
  DEFINE NETWORK_ENABLE = TRUE
  DEFINE NETWORK_SNP_ENABLE = TRUE
  DEFINE NETWORK_IP4_ENABLE = TRUE
  DEFINE NETWORK_IP6_ENABLE = TRUE
  DEFINE NETWORK_TLS_ENABLE = TRUE
  DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
  DEFINE NETWORK_IPSEC_ENABLE   = TRUE
  DEFINE NETWORK_ISCSI_ENABLE   = TRUE
  DEFINE NETWORK_VLAN_ENABLE= TRUE

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

Cc: Jiaxin Wu 
Cc: Ting Ye 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Fu Siyuan 
---

Notes:
v2:
1. Split the "Network.dsc.inc" in to 4 files for different sections in DSC
file. This could provide more flexibility to platform owner to use the
include files.
2. Clarify the OpenSSL dependency of TLS, iSCSI and IPsec enable flag.
3. Use "!error" statement for incorrect flag value check.
4. Other decoration work according to Laszlo's comments.

 NetworkPkg/Network.fdf.inc   |  69 ++
 NetworkPkg/NetworkComponents.dsc.inc |  71 ++
 NetworkPkg/NetworkDefines.dsc.inc| 138 
 NetworkPkg/NetworkLibs.dsc.inc   |  25 
 NetworkPkg/NetworkPcds.dsc.inc   |  22 
 NetworkPkg/NetworkPkg.dsc|  28 +---
 6 files changed, 331 insertions(+), 22 deletions(-)

diff --git a/NetworkPkg/Network.fdf.inc b/NetworkPkg/Network.fdf.inc
new file mode 100644
index ..abd4c6c363d5
--- /dev/null
+++ b/NetworkPkg/Network.fdf.inc
@@ -0,0 +1,69 @@
+## @file
+# Network FDF include file for All Architectures.
+#
+# This file can be included to a platform FDF by using "!include 
NetworkPkg/Network.fdf.inc"
+# to add EDKII network stack drivers according to the value of flags described 
in
+# "NetworkDefines.dsc.inc".
+#
+# Copyright (c) 2018, Intel Corporation. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#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.
+#
+
+!if $(NETWORK_ENABLE) == TRUE
+  INF  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
+
+  !if $(NETWORK_SNP_ENABLE) == TRUE
+INF  MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
+  !endif
+
+  !if $(NETWORK_VLAN_ENABLE) == TRUE
+INF  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
+  !endif
+
+  INF  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
+
+  !if $(NETWORK_IP4_ENABLE) == TRUE
+INF  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
+INF  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
+INF  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
+INF  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
+INF  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
+  !endif
+
+  !if $(NETWORK_IP6_ENABLE) == TRUE
+INF  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
+INF  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
+INF  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
+INF  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
+  !endif
+
+  INF  NetworkPkg/TcpDxe/TcpDxe.inf
+  INF  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+
+  !if $(NETWORK_TLS_ENABLE) == TRUE
+INF  NetworkPkg/TlsDxe/TlsDxe.inf
+INF  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
+  !endif
+
+  !if $(NETWORK_HTTP_BOOT_ENABLE) == TRUE
+INF  NetworkPkg/DnsDxe/DnsDxe.inf
+INF  NetworkPkg/HttpDxe/HttpDxe.inf
+INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+  !endif
+
+  !if $(NETWORK_ISCSI_ENABLE) == TRUE
+INF  NetworkPkg/IScsiDxe/IScsiDxe.inf
+  !endif
+
+  !if $(NETWORK_IPSEC_ENABLE) == TRUE
+INF  NetworkPkg/IpSecDxe/IpSecDxe.inf
+  !endif
+!endif
diff --git a/NetworkPkg/NetworkComponents.dsc.inc 
b/NetworkPkg/NetworkComponents.dsc.inc
new file mode 100644
index 

Re: [edk2] [PATCH v2 2/2] IntelFsp2WrapperPkg: Fix constant if statements issue

2018-11-21 Thread Wu, Hao A
> -Original Message-
> From: Chiu, Chasel
> Sent: Thursday, November 22, 2018 11:51 AM
> To: edk2-devel@lists.01.org
> Cc: Yao, Jiewen; Desimone, Nathaniel L; Wu, Hao A; Chiu, Chasel
> Subject: [PATCH v2 2/2] IntelFsp2WrapperPkg: Fix constant if statements
> issue
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1351
> 
> Internal code quality scanning found 2 constant if
> statements related to FixedPcdGet8 () usage.
> Since the PCD can be PatchableInModule too, it should be
> changed to PcdGet8 () to fix this issue.
> 
> Test: Verified on internal platform and booted successfully.

Reviewed-by: Hao Wu 

Best Regards,
Hao Wu

> 
> Cc: Jiewen Yao 
> Cc: Desimone Nathaniel L 
> Cc: Wu Hao A 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chasel Chiu 
> ---
>  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c | 2 +-
>  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> index fa0441ce6c..18f04b541a 100644
> --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
> @@ -157,7 +157,7 @@ FspmWrapperInit (
> 
>Status = EFI_SUCCESS;
> 
> -  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
> +  if (PcdGet8 (PcdFspModeSelection) == 1) {
>  Status = PeiFspMemoryInit ();
>  ASSERT_EFI_ERROR (Status);
>} else {
> diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> index 87dd61e5c5..d748b21f7c 100644
> --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
> @@ -349,7 +349,7 @@ FspsWrapperPeimEntryPoint (
>  {
>DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
> 
> -  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
> +  if (PcdGet8 (PcdFspModeSelection) == 1) {
>  FspsWrapperInit ();
>} else {
>  PeiServicesInstallFvInfoPpi (
> --
> 2.13.3.windows.1

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


Re: [edk2] [PATCH edk2-platforms 0/3] drop GUIDs from NOR flash bank descriptors

2018-11-21 Thread Thomas Abraham
Hi Ard,

On Thu, Nov 22, 2018 at 3:46 AM Ard Biesheuvel
 wrote:
>
> On Wed, 21 Nov 2018 at 14:48, Thomas Abraham  wrote:
> >
> > Hi Ard,
> >
> > On Wed, Nov 21, 2018 at 5:31 PM Ard Biesheuvel
> >  wrote:
> > >
> > > Align edk2-platform with upcoming changes to EDK2 to get rid of per-bank
> > > NOR flash GUIDs.
> > >
> > > Ard Biesheuvel (3):
> > >   Platform/ARM: replace hardcoded VenHW() device paths referring to NOR
> > > flash
> > >   Silicon/SynQuacer: drop per-bank NOR flash GUIDs
> > >   Platform/ARM: drop per-bank NOR flash GUIDs
> > >
> > >  Platform/ARM/JunoPkg/ArmJuno.dec   |  2 +-
> > >  Platform/ARM/JunoPkg/ArmJuno.dsc   |  2 +-
> > >  .../JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c |  2 --
> > >  .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c   |  2 --
> > >  Platform/ARM/SgiPkg/SgiPlatform.dsc|  2 +-
> > >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc  |  2 +-
> > >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc   |  2 +-
> > >  .../NorFlashArmVExpressLib/NorFlashArmVExpress.c   |  4 
> > >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 14 +++---
> > >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  |  3 +++
> > >  .../NorFlashSynQuacerLib/NorFlashSynQuacer.c   |  6 --
> > >  11 files changed, 15 insertions(+), 26 deletions(-)
> >
> > Tested this patch series and "[PATCH v2 0/5] ArmPlatformPkg,
> > ArmVirtPkg: discover NOR flash banks from DTB" patch series on the
> > Juno board. With these patches applied, the boot fails on Juno board
> > with the following messages. I have not yet tried to debug the issue
> > but wanted to let you know this.
> >
> > [...]
> > Loading driver at 0x000F830C000 EntryPoint=0x000F831B2AC IScsiDxe.efi
> > add-symbol-file
> > /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
> > 0xF830
> > Loading driver at 0x000F82FF000 EntryPoint=0x000F8306DF0 Udp4Dxe.efi
> > add-symbol-file
> > /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
> > 0xF82EE000
> > Loading driver at 0x000F82ED000 EntryPoint=0x000F82F76EC FdtPlatformDxe.efi
> > Found image: fip in block 5.
> > Found image: norkern in block 20.
> > Found image: ramdisk.img in block 116.
> > Found image: hdlcdclk in block 151.
> > Found image: selftest in block 152.
> > Found image: board.dtb in block 156.
> > Found image: scp_bl1 in block 249.
> > Found image: bl1 in block 251.
> > Found image: startup.nsh in block 252.
> > ASSERT [BootMonFs]
> > /home/thopan01/devel/juno/uefi/uefi/edk2/MdePkg/Library/BaseLib/String.c(173):
> > ((UINTN) String & 0x0001) == 0
> >
>
> Hi Thomas,
>
> Thanks for testing.
>
> Could you please apply this patch and re-test:
>
> --- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> +++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
> @@ -299,7 +299,7 @@
>  !if $(TARGET) == RELEASE
>gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x21
>  !else
> -  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
> +  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x3f
>  !endif
>
>#  DEBUG_INIT  0x0001  // Initialization
>
> This will produce a backtrace when an ASSERT() is triggered, and from
> this we can figure out what the call stack looks like exactly (The
> ASSERT() occurs in StrLen (), which is called with a misaligned
> unicode string, but I cannot figure out where the call is made)
>
> Please share the backtrace and all the .dlls listed in it if you can please.

The following is the log with the above diff applied on top of your
patch series.

Loading driver at 0x000F8309000 EntryPoint=0x000F83182A4 IScsiDxe.efi
add-symbol-file
/home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
0xF82FD000
Loading driver at 0x000F82FC000 EntryPoint=0x000F8303DE8 Udp4Dxe.efi
add-symbol-file
/home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
0xF82EA000
Loading driver at 0x000F82E9000 EntryPoint=0x000F82F46E4 FdtPlatformDxe.efi
Found image: fip in block 5.
Found image: norkern in block 20.
Found image: ramdisk.img in block 116.
Found image: hdlcdclk in block 151.
Found image: selftest in block 152.
Found image: board.dtb in block 156.
Found image: scp_bl1 in block 249.
Found image: bl1 in block 251.
Found image: startup.nsh in block 252.
ASSERT [BootMonFs]
/home/thopan01/devel/juno/uefi/uefi/edk2/MdePkg/Library/BaseLib/String.c(173):
((UINTN) String & 0x0001) == 0


Synchronous Exception at 0xFD8F5584
PC 0xFD8F5584 (0xFD8EF000+0x6584) [ 0] BootMonFs.dll
PC 0xFD8F01A8 (0xFD8EF000+0x11A8) [ 0] BootMonFs.dll
PC 0xFD8F09AC (0xFD8EF000+0x19AC) [ 0] BootMonFs.dll
PC 0xFD8F0A18 

[edk2] [PATCH v2 1/2] IntelFsp2WrapperPkg: Fix line ending format issue

2018-11-21 Thread Chasel, Chiu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1352

Fixed line ending format wrong issues on some files.

Test: Verified building successfully.

Cc: Jiewen Yao 
Cc: Desimone Nathaniel L 
Cc: Wu Hao A 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu 
---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 32 

 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c   | 24 

 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |  4 ++--
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  4 ++--
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 22 
+++---
 5 files changed, 43 insertions(+), 43 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index e25854c080..fa0441ce6c 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -65,7 +65,7 @@ PeiFspMemoryInit (
   FspHobListPtr = NULL;
   FspmUpdDataPtr = NULL;
 
-  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
+  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
   if (FspmHeaderPtr == NULL) {
 return EFI_DEVICE_ERROR;
@@ -155,20 +155,20 @@ FspmWrapperInit (
 {
   EFI_STATUS   Status;
 
-  Status = EFI_SUCCESS;
-
-  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
-Status = PeiFspMemoryInit ();
-ASSERT_EFI_ERROR (Status);
-  } else {
-PeiServicesInstallFvInfoPpi (
-  NULL,
-  (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
-  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspmBaseAddress))->FvLength,
-  NULL,
-  NULL
-  );
-  }
+  Status = EFI_SUCCESS;
+
+  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
+Status = PeiFspMemoryInit ();
+ASSERT_EFI_ERROR (Status);
+  } else {
+PeiServicesInstallFvInfoPpi (
+  NULL,
+  (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspmBaseAddress))->FvLength,
+  NULL,
+  NULL
+  );
+  }
 
   return Status;
 }
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index 69cf568380..87dd61e5c5 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -349,17 +349,17 @@ FspsWrapperPeimEntryPoint (
 {
   DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
 
-  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
-FspsWrapperInit ();
-  } else {
-PeiServicesInstallFvInfoPpi (
-  NULL,
-  (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
-  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspsBaseAddress))->FvLength,
-  NULL,
-  NULL
-  );
-  }
+  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
+FspsWrapperInit ();
+  } else {
+PeiServicesInstallFvInfoPpi (
+  NULL,
+  (VOID *)(UINTN) PcdGet32 (PcdFspsBaseAddress),
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspsBaseAddress))->FvLength,
+  NULL,
+  NULL
+  );
+  }
 
   return EFI_SUCCESS;
 }
diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
index f4b7ef8db6..b3776a80f3 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
 #
 #  This 

[edk2] [PATCH v2 2/2] IntelFsp2WrapperPkg: Fix constant if statements issue

2018-11-21 Thread Chasel, Chiu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1351

Internal code quality scanning found 2 constant if
statements related to FixedPcdGet8 () usage.
Since the PCD can be PatchableInModule too, it should be
changed to PcdGet8 () to fix this issue.

Test: Verified on internal platform and booted successfully.

Cc: Jiewen Yao 
Cc: Desimone Nathaniel L 
Cc: Wu Hao A 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu 
---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c | 2 +-
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index fa0441ce6c..18f04b541a 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -157,7 +157,7 @@ FspmWrapperInit (
 
   Status = EFI_SUCCESS;
 
-  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
+  if (PcdGet8 (PcdFspModeSelection) == 1) {
 Status = PeiFspMemoryInit ();
 ASSERT_EFI_ERROR (Status);
   } else {
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
index 87dd61e5c5..d748b21f7c 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c
@@ -349,7 +349,7 @@ FspsWrapperPeimEntryPoint (
 {
   DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n"));
 
-  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
+  if (PcdGet8 (PcdFspModeSelection) == 1) {
 FspsWrapperInit ();
   } else {
 PeiServicesInstallFvInfoPpi (
-- 
2.13.3.windows.1

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


[edk2] [PATCH v2 0/2] Fix constant if statement issue

2018-11-21 Thread Chasel, Chiu
Internal code quality scanning found 2 constant if
statements related to FixedPcdGet8 () usage.
Since the PCD can be PatchableInModule too, it should be
changed to PcdGet8 () to fix this issue.
Also fixed the line ending format issue from previous
patch.

Patch1 fixed line ending format issue on some files
Patch2 fixed constant if statement issue.

Cc: Jiewen Yao 
Cc: Desimone Nathaniel L 
Cc: Wu Hao A 

Chasel, Chiu (2):
  IntelFsp2WrapperPkg: Fix line ending format issue
  IntelFsp2WrapperPkg: Fix constant if statements issue

 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 32 

 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c   | 24 

 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf |  4 ++--
 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  4 ++--
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 22 
+++---
 5 files changed, 43 insertions(+), 43 deletions(-)

-- 
2.13.3.windows.1

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


Re: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

2018-11-21 Thread Bryan Rosario via edk2-devel
This is for a virtual x86 platform using OVMF. I think I have enough info
at this point to get things set up. Thanks for the help.

Bryan

On Wed, Nov 21, 2018 at 6:06 PM Ken Taylor  wrote:

> Hi Bryan,
>
>
>
> If you were talking about PC architecture, I would suggest that there
> should be a hierarchy of configuration that needs to occur.  Specifically,
> there should be silicon / board / platform specific configuration that is
> architecturally independent of the SATA driver.
>
>
>
> Normally, there would be early initialization to write to silicon specific
> registers.  Later, the PCI bus driver should expose PCI device interfaces.
> That driver would normally be responsible for writing to the PCI
> configuration header for the device, as well as for configuring any PCI
> bridges between the host bus and the device.
>
>
>
> The SATA driver would then connect to the PCI device interface exposed by
> the PCI bus driver.
>
>
>
> However, I think you’re using an ARM based system.  The architecture is
> different from what I am used to.  Is what you have is a SATA driver
> talking directly to the PCI device interface?  This skips several levels of
> the architecture that would be responsible for maintaining platform
> independence.
>
>
>
> If it were me, I would only put generic SATA code in the SATA driver.
> There wouldn’t be anything silicon or platform specific at all.
>
>
>
> If we were talking about the old IDE interfaces (because CF maybe), there
> used to be stuff for configuring 80 conductor vs 40 conductor cables that
> was handled by legacy BIOSes, and configuring high speed DMA and PIO
> transfer modes was silicon specific.  In the legacy architectures I worked
> on, there was usually an interface for silicon specific configuration that
> was architecturally independent of the IDE driver itself.
>
>
>
> If you are facing the same sort of thing, then I would define a protocol
> for features that may require silicon specific register writes, and make my
> SATA code call that protocol.  This allows you to keep all your
> silicon/board/platform specific code in one location (perhaps one per
> design), and you don’t have to touch as many files every time your hardware
> design changes.  Ideally, you should have all the things that need to
> change boiled down to one particular piece of code, so you can focus on
> what you need to do to make new hardware work when you get new hardware and
> don’t have to discover all sorts of files that need editing piecemeal as
> you discover non-functional hardware features.
>
>
>
> Regards,
>
> -Ken.
>
>
>
> *From:* Bryan Rosario [mailto:b...@google.com]
> *Sent:* Wednesday, November 21, 2018 5:29 PM
> *To:* Ken Taylor
> *Cc:* Alain Gefflaut; edk2-devel@lists.01.org
> *Subject:* Re: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in
> BdsPlatform.c?
>
>
>
> Hi Ken,
>
>
>
> That's what I had guessed -- thanks for confirming that it's platform
> specific.
>
>
>
> In my use case, I actually want the code to work on multiple hardware
> configurations, so I can't just replace the hardcoded B/D/F with the one
> used by a particular platform. Does the change to SataController.c that I
> mentioned in the original email make sense? I've tested it and confirmed
> that it works on my platform, but I want to get a sanity check that that is
> an appropriate place to put this code.
>
>
>
> Thanks,
>
> Bryan
>
>
>
> On Wed, Nov 21, 2018 at 4:48 PM Ken Taylor  wrote:
>
> Hi Bryan,
>
> That appears to be silicon or platform specific code.  It's intended for
> one specific hardware configuration.  Unless you have an identical hardware
> configuration, those particular register writes are actually nonsensical.
>
> I think what you need to do is consult the silicon specific documentation
> for your particular hardware configuration, and determine what silicon
> specific registers need to be configured to what specific values to support
> your specific hardware design.
>
> Regards,
> -Ken.
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Bryan Rosario via edk2-devel
> Sent: Wednesday, November 21, 2018 4:07 PM
> To: edk2-devel@lists.01.org
> Cc: Alain Gefflaut
> Subject: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?
>
> Hi all,
>
> I noticed that there is apparently a hardcoded B/D/F for an IDE Controller
> in BdsPlatform.c, when setting bit 15 of a particular register:
>
> https://github.com/tianocore/edk2/blob/14923c1a6bf9940b48feeaf47cb5d6c662b6528c/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c#L1612-L1617
> .
>
> Why is this hardcoded? Is it just old code that has hung around? I noticed
> that this code is from this commit, and the surrounding code at the time
> had lots of hardcoded B/D/Fs:
>
> https://github.com/tianocore/edk2/commit/40f2c454343be84ab3bacf9955cc8d7842c70b5c
> .
>
> The context of this question is that I'm trying to make this work in a
> configuration with an IDE Controller located at 

[edk2] [PATCH] IntelFsp2WrapperPkg: Fix line ending format issue

2018-11-21 Thread Chasel, Chiu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1352

Fixed line ending format wrong issues on some files.

Test: Verified building successfully.

Cc: Jiewen Yao 
Cc: Desimone Nathaniel L 
Cc: Wu Hao A 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chasel Chiu 
---
 IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c   | 32 

 IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf |  4 ++--
 IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 22 
+++---
 3 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c 
b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
index e25854c080..fa0441ce6c 100644
--- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
+++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c
@@ -3,7 +3,7 @@
   register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
   notify to call FspSiliconInit API.
 
-  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -65,7 +65,7 @@ PeiFspMemoryInit (
   FspHobListPtr = NULL;
   FspmUpdDataPtr = NULL;
 
-  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
+  FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 
(PcdFspmBaseAddress));
   DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
   if (FspmHeaderPtr == NULL) {
 return EFI_DEVICE_ERROR;
@@ -155,20 +155,20 @@ FspmWrapperInit (
 {
   EFI_STATUS   Status;
 
-  Status = EFI_SUCCESS;
-
-  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
-Status = PeiFspMemoryInit ();
-ASSERT_EFI_ERROR (Status);
-  } else {
-PeiServicesInstallFvInfoPpi (
-  NULL,
-  (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
-  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspmBaseAddress))->FvLength,
-  NULL,
-  NULL
-  );
-  }
+  Status = EFI_SUCCESS;
+
+  if (FixedPcdGet8 (PcdFspModeSelection) == 1) {
+Status = PeiFspMemoryInit ();
+ASSERT_EFI_ERROR (Status);
+  } else {
+PeiServicesInstallFvInfoPpi (
+  NULL,
+  (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress),
+  (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 
(PcdFspmBaseAddress))->FvLength,
+  NULL,
+  NULL
+  );
+  }
 
   return Status;
 }
diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf 
b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
index 1e63f407cb..910286982b 100644
--- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
+++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
@@ -6,7 +6,7 @@
 # register TemporaryRamDonePpi to call TempRamExit API, and register 
MemoryDiscoveredPpi
 # notify to call FspSiliconInit API.
 #
-#  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
+#  Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -68,7 +68,7 @@
 [Pcd]
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress  ## CONSUMES
-  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection## CONSUMES
 
 [Guids]
   gFspHobGuid   ## CONSUMES ## HOB
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec 
b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
index b901562bb3..96f2858fb4 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
@@ -71,7 +71,7 @@
   ## Indicate the PEI memory size platform want to report
   
gIntelFsp2WrapperTokenSpaceGuid.PcdPeiRecoveryMinMemSize|0x300|UINT32|0x4005
 
-  ## This is the base address of FSP-T
+  ## This is the base address of FSP-T
   
gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x|UINT32|0x0300
 
   ## This PCD indicates if FSP APIs are skipped from FSP wrapper.
@@ -92,17 +92,17 @@
   # @Prompt Skip FSP API from FSP wrapper.
   gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x|UINT32|0x4009
 
-  ## This PCD decides how Wrapper code utilizes FSP
-  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without calling 
FSP API)
-  # 1: API mode (FSP Wrapper will call FSP API)
-  #
-  
gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0x0001|UINT8|0x400A
-
+  ## This PCD decides how Wrapper code utilizes FSP
+  # 0: DISPATCH mode (FSP Wrapper will load PeiCore from FSP without calling 
FSP API)
+  # 1: API mode (FSP 

Re: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

2018-11-21 Thread Ken Taylor
Hi Bryan,

If you were talking about PC architecture, I would suggest that there should be 
a hierarchy of configuration that needs to occur.  Specifically, there should 
be silicon / board / platform specific configuration that is architecturally 
independent of the SATA driver.

Normally, there would be early initialization to write to silicon specific 
registers.  Later, the PCI bus driver should expose PCI device interfaces.  
That driver would normally be responsible for writing to the PCI configuration 
header for the device, as well as for configuring any PCI bridges between the 
host bus and the device.

The SATA driver would then connect to the PCI device interface exposed by the 
PCI bus driver.

However, I think you’re using an ARM based system.  The architecture is 
different from what I am used to.  Is what you have is a SATA driver talking 
directly to the PCI device interface?  This skips several levels of the 
architecture that would be responsible for maintaining platform independence.

If it were me, I would only put generic SATA code in the SATA driver.  There 
wouldn’t be anything silicon or platform specific at all.

If we were talking about the old IDE interfaces (because CF maybe), there used 
to be stuff for configuring 80 conductor vs 40 conductor cables that was 
handled by legacy BIOSes, and configuring high speed DMA and PIO transfer modes 
was silicon specific.  In the legacy architectures I worked on, there was 
usually an interface for silicon specific configuration that was 
architecturally independent of the IDE driver itself.

If you are facing the same sort of thing, then I would define a protocol for 
features that may require silicon specific register writes, and make my SATA 
code call that protocol.  This allows you to keep all your 
silicon/board/platform specific code in one location (perhaps one per design), 
and you don’t have to touch as many files every time your hardware design 
changes.  Ideally, you should have all the things that need to change boiled 
down to one particular piece of code, so you can focus on what you need to do 
to make new hardware work when you get new hardware and don’t have to discover 
all sorts of files that need editing piecemeal as you discover non-functional 
hardware features.

Regards,
-Ken.

From: Bryan Rosario [mailto:b...@google.com]
Sent: Wednesday, November 21, 2018 5:29 PM
To: Ken Taylor
Cc: Alain Gefflaut; edk2-devel@lists.01.org
Subject: Re: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

Hi Ken,

That's what I had guessed -- thanks for confirming that it's platform specific.

In my use case, I actually want the code to work on multiple hardware 
configurations, so I can't just replace the hardcoded B/D/F with the one used 
by a particular platform. Does the change to SataController.c that I mentioned 
in the original email make sense? I've tested it and confirmed that it works on 
my platform, but I want to get a sanity check that that is an appropriate place 
to put this code.

Thanks,
Bryan

On Wed, Nov 21, 2018 at 4:48 PM Ken Taylor 
mailto:ken_tay...@phoenix.com>> wrote:
Hi Bryan,

That appears to be silicon or platform specific code.  It's intended for one 
specific hardware configuration.  Unless you have an identical hardware 
configuration, those particular register writes are actually nonsensical.

I think what you need to do is consult the silicon specific documentation for 
your particular hardware configuration, and determine what silicon specific 
registers need to be configured to what specific values to support your 
specific hardware design.

Regards,
-Ken.

-Original Message-
From: edk2-devel 
[mailto:edk2-devel-boun...@lists.01.org]
 On Behalf Of Bryan Rosario via edk2-devel
Sent: Wednesday, November 21, 2018 4:07 PM
To: edk2-devel@lists.01.org
Cc: Alain Gefflaut
Subject: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

Hi all,

I noticed that there is apparently a hardcoded B/D/F for an IDE Controller in 
BdsPlatform.c, when setting bit 15 of a particular register:
https://github.com/tianocore/edk2/blob/14923c1a6bf9940b48feeaf47cb5d6c662b6528c/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c#L1612-L1617
.

Why is this hardcoded? Is it just old code that has hung around? I noticed that 
this code is from this commit, and the surrounding code at the time had lots of 
hardcoded B/D/Fs:
https://github.com/tianocore/edk2/commit/40f2c454343be84ab3bacf9955cc8d7842c70b5c
.

The context of this question is that I'm trying to make this work in a 
configuration with an IDE Controller located at a different B/D/F, and so the 
hardcoded value of 0/1/1 doesn't work for me.

If I want to change this so that it's not hardcoded, what is a good approach? 
I've added some code locally to the IdeInitSetTiming function in 
SataController.c to set the bit using the PciIo structure which is opened 

Re: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

2018-11-21 Thread Bryan Rosario via edk2-devel
Hi Ken,

That's what I had guessed -- thanks for confirming that it's platform
specific.

In my use case, I actually want the code to work on multiple hardware
configurations, so I can't just replace the hardcoded B/D/F with the one
used by a particular platform. Does the change to SataController.c that I
mentioned in the original email make sense? I've tested it and confirmed
that it works on my platform, but I want to get a sanity check that that is
an appropriate place to put this code.

Thanks,
Bryan

On Wed, Nov 21, 2018 at 4:48 PM Ken Taylor  wrote:

> Hi Bryan,
>
> That appears to be silicon or platform specific code.  It's intended for
> one specific hardware configuration.  Unless you have an identical hardware
> configuration, those particular register writes are actually nonsensical.
>
> I think what you need to do is consult the silicon specific documentation
> for your particular hardware configuration, and determine what silicon
> specific registers need to be configured to what specific values to support
> your specific hardware design.
>
> Regards,
> -Ken.
>
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Bryan Rosario via edk2-devel
> Sent: Wednesday, November 21, 2018 4:07 PM
> To: edk2-devel@lists.01.org
> Cc: Alain Gefflaut
> Subject: [edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?
>
> Hi all,
>
> I noticed that there is apparently a hardcoded B/D/F for an IDE Controller
> in BdsPlatform.c, when setting bit 15 of a particular register:
>
> https://github.com/tianocore/edk2/blob/14923c1a6bf9940b48feeaf47cb5d6c662b6528c/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c#L1612-L1617
> .
>
> Why is this hardcoded? Is it just old code that has hung around? I noticed
> that this code is from this commit, and the surrounding code at the time
> had lots of hardcoded B/D/Fs:
>
> https://github.com/tianocore/edk2/commit/40f2c454343be84ab3bacf9955cc8d7842c70b5c
> .
>
> The context of this question is that I'm trying to make this work in a
> configuration with an IDE Controller located at a different B/D/F, and so
> the hardcoded value of 0/1/1 doesn't work for me.
>
> If I want to change this so that it's not hardcoded, what is a good
> approach? I've added some code locally to the IdeInitSetTiming function in
> SataController.c to set the bit using the PciIo structure which is opened
> specifically on the controller in question -- does that sound like the
> right approach?
> Link to the function I'm referring to:
>
> https://github.com/tianocore/edk2/blob/f6b0258d25a63ae3d3bc6430abe30fb625abc52a/OvmfPkg/SataControllerDxe/SataController.c#L1091-L1099
>
> Thanks,
> Bryan
> ___
> 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 v2] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

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

-Original Message-
From: Vijayenthiran Subramaniam [mailto:vijayenthiran.subraman...@arm.com] 
Sent: Wednesday, November 21, 2018 11:29 PM
To: edk2-devel@lists.01.org; Zeng, Star ; Wang, Jian J 
; Ni, Ruiyu 
Cc: Vijayenthiran Subramaniam 
Subject: [PATCH v2] MdeModulePkg/Variable: add debug logs in 
VariableServiceSetVariable

Print debug messages if size of the VariableName plus DataSize exceeds 
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any 
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to be 
changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Thanks for the review. I have made changes based on Laszlo's and Star's 
suggestions.

- Vijayenthiran

 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 30 
 1 file changed, 30 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..d100b1dcc552 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,44 @@ VariableServiceSetVariable (
 //
 if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxAuthVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxAuthVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVolatileVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVolatileVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 }
--
2.17.1

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


[edk2] Hardcoded IDE Controller B/D/F (0/1/1) in BdsPlatform.c?

2018-11-21 Thread Bryan Rosario via edk2-devel
Hi all,

I noticed that there is apparently a hardcoded B/D/F for an IDE Controller
in BdsPlatform.c, when setting bit 15 of a particular register:
https://github.com/tianocore/edk2/blob/14923c1a6bf9940b48feeaf47cb5d6c662b6528c/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c#L1612-L1617
.

Why is this hardcoded? Is it just old code that has hung around? I noticed
that this code is from this commit, and the surrounding code at the time
had lots of hardcoded B/D/Fs:
https://github.com/tianocore/edk2/commit/40f2c454343be84ab3bacf9955cc8d7842c70b5c
.

The context of this question is that I'm trying to make this work in a
configuration with an IDE Controller located at a different B/D/F, and so
the hardcoded value of 0/1/1 doesn't work for me.

If I want to change this so that it's not hardcoded, what is a good
approach? I've added some code locally to the IdeInitSetTiming function in
SataController.c to set the bit using the PciIo structure which is opened
specifically on the controller in question -- does that sound like the
right approach?
Link to the function I'm referring to:
https://github.com/tianocore/edk2/blob/f6b0258d25a63ae3d3bc6430abe30fb625abc52a/OvmfPkg/SataControllerDxe/SataController.c#L1091-L1099

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


Re: [edk2] [PATCH v3 0/6] ArmPkg related changes for StandaloneMM package

2018-11-21 Thread Ard Biesheuvel
On Wed, 21 Nov 2018 at 17:01, Thomas Abraham  wrote:
>
> Hi Ard, Leif,
>
> On Mon, Nov 19, 2018 at 10:39 AM Sughosh Ganu  wrote:
> >
> > hi Ard,
> >
> > On Thu Oct 25, 2018 at 01:02:33PM +0530, Sughosh Ganu wrote:
> > > The following patch series adds support for Management Mode related
> > > changes for aarch64 based platforms.
> > >
> > > Changes since v2:
> > > Based on review comments from Ard, moved the memory attribute updation
> > > changes out of DebugPeCoffExtraActionLib into an extra action library
> > > added in StandaloneMM package. The patch for setting the memory
> > > attributes, now under StandaloneMmPkg directory, will be submitted
> > > separately from this series.
> >
> > Can you please review the V3 of this series. Based on your review
> > comments, i have moved the memory attribute updation into an extra
> > action lib added under StandaloneMmPkg. Can you please check if these
> > updated patches for ArmPkg[1] and the one under StandaloneMmPkg[2] are
> > fine.
> >
> > I had put you and Leif on Cc while sending out the patches, but i
> > think that the mailserver deleted those, which is why you may have
> > missed the patches.
> >
> > -sughosh
> >
> > [1] - https://lists.01.org/pipermail/edk2-devel/2018-October/031377.html
> > [2] - https://lists.01.org/pipermail/edk2-devel/2018-October/031384.html
> >
> > >
> > >
> > > Achin Gupta (5):
> > >   ArmPkg: Add PCDs needed for MM communication driver.
> > >   ArmPkg/Drivers: Add EFI_MM_COMMUNICATION_PROTOCOL DXE driver.
> > >   ArmPkg/Include: Add MM interface SVC return codes.
> > >   ArmPkg/ArmMmuLib: Add MMU Library suitable for use in S-EL0.
> > >   ArmPkg/ArmMmuLib: Add MMU library inf file suitable for use in S-EL0.
> > >
> > > Sughosh Ganu (1):
> > >   ArmPkg/Include: Fix the SPM version SVC ID
> > >
> > >  ArmPkg/ArmPkg.dec
> > > |   3 +
> > >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
> > > |  56 +++
> > >  ArmPkg/Library/ArmMmuLib/{ArmMmuPeiLib.inf => 
> > > ArmMmuStandaloneMmCoreLib.inf} |  23 +-
> > >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
> > > |  28 ++
> > >  ArmPkg/Include/IndustryStandard/ArmMmSvc.h   
> > > |   9 +-
> > >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c  
> > > | 395 
> > >  ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuStandaloneMmCoreLib.c 
> > > | 204 ++
> > >  7 files changed, 704 insertions(+), 14 deletions(-)
> > >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
> > >  copy ArmPkg/Library/ArmMmuLib/{ArmMmuPeiLib.inf => 
> > > ArmMmuStandaloneMmCoreLib.inf} (51%)
> > >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
> > >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
> > >  create mode 100644 
> > > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuStandaloneMmCoreLib.c
>
> Any feedback on this patch series. This series is important in getting
> the MM Standalone mode feature supported for Arm platforms. There are
> patches being worked on to enable secure variable access feature for
> Arm platforms and it depends on this series. So if there any comments
> on these patches, please let us know.
>

I will look into these patches before the end of the week.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms 0/3] drop GUIDs from NOR flash bank descriptors

2018-11-21 Thread Ard Biesheuvel
On Wed, 21 Nov 2018 at 14:48, Thomas Abraham  wrote:
>
> Hi Ard,
>
> On Wed, Nov 21, 2018 at 5:31 PM Ard Biesheuvel
>  wrote:
> >
> > Align edk2-platform with upcoming changes to EDK2 to get rid of per-bank
> > NOR flash GUIDs.
> >
> > Ard Biesheuvel (3):
> >   Platform/ARM: replace hardcoded VenHW() device paths referring to NOR
> > flash
> >   Silicon/SynQuacer: drop per-bank NOR flash GUIDs
> >   Platform/ARM: drop per-bank NOR flash GUIDs
> >
> >  Platform/ARM/JunoPkg/ArmJuno.dec   |  2 +-
> >  Platform/ARM/JunoPkg/ArmJuno.dsc   |  2 +-
> >  .../JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c |  2 --
> >  .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c   |  2 --
> >  Platform/ARM/SgiPkg/SgiPlatform.dsc|  2 +-
> >  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc  |  2 +-
> >  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc   |  2 +-
> >  .../NorFlashArmVExpressLib/NorFlashArmVExpress.c   |  4 
> >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 14 +++---
> >  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  |  3 +++
> >  .../NorFlashSynQuacerLib/NorFlashSynQuacer.c   |  6 --
> >  11 files changed, 15 insertions(+), 26 deletions(-)
>
> Tested this patch series and "[PATCH v2 0/5] ArmPlatformPkg,
> ArmVirtPkg: discover NOR flash banks from DTB" patch series on the
> Juno board. With these patches applied, the boot fails on Juno board
> with the following messages. I have not yet tried to debug the issue
> but wanted to let you know this.
>
> [...]
> Loading driver at 0x000F830C000 EntryPoint=0x000F831B2AC IScsiDxe.efi
> add-symbol-file
> /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
> 0xF830
> Loading driver at 0x000F82FF000 EntryPoint=0x000F8306DF0 Udp4Dxe.efi
> add-symbol-file
> /home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
> 0xF82EE000
> Loading driver at 0x000F82ED000 EntryPoint=0x000F82F76EC FdtPlatformDxe.efi
> Found image: fip in block 5.
> Found image: norkern in block 20.
> Found image: ramdisk.img in block 116.
> Found image: hdlcdclk in block 151.
> Found image: selftest in block 152.
> Found image: board.dtb in block 156.
> Found image: scp_bl1 in block 249.
> Found image: bl1 in block 251.
> Found image: startup.nsh in block 252.
> ASSERT [BootMonFs]
> /home/thopan01/devel/juno/uefi/uefi/edk2/MdePkg/Library/BaseLib/String.c(173):
> ((UINTN) String & 0x0001) == 0
>

Hi Thomas,

Thanks for testing.

Could you please apply this patch and re-test:

--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -299,7 +299,7 @@
 !if $(TARGET) == RELEASE
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x21
 !else
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x3f
 !endif

   #  DEBUG_INIT  0x0001  // Initialization

This will produce a backtrace when an ASSERT() is triggered, and from
this we can figure out what the call stack looks like exactly (The
ASSERT() occurs in StrLen (), which is called with a misaligned
unicode string, but I cannot figure out where the call is made)

Please share the backtrace and all the .dlls listed in it if you can please.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 5/5] ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from struct

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:58, Ard Biesheuvel wrote:
> We no longer use per-instance GUIDs to identify NOR flash banks so
> there is no longer a need to define them. Drop the Guid member from
> the NOR_FLASH_DESCRIPTION type.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
> This patch should not be merged before users in edk2-platforms have been
> updated.
> 
>  ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h 
> b/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> index e9e1c060787d..e99a217c3a51 100644
> --- a/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> +++ b/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
> @@ -20,7 +20,6 @@ typedef struct {
>UINTN   RegionBaseAddress;// Start address of one single region
>UINTN   Size;
>UINTN   BlockSize;
> -  EFI_GUIDGuid;
>  } NOR_FLASH_DESCRIPTION;
>  
>  EFI_STATUS
> 

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


Re: [edk2] [PATCH v2 4/5] ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:58, Ard Biesheuvel wrote:
> NorFlashQemuLib is one of the last remaining drivers in ArmVirtPkg
> that are not based on the device tree received from QEMU.
> 
> For ArmVirtQemu, this does not really matter, given that the NOR
> flash banks are always the same: the PEI code is linked to execute
> in place from flash bank #0, and the fixed varstore PCDs refer to
> flash bank #1 directly.
> 
> However, ArmVirtQemuKernel can execute at any offset, permitting it
> to be used as an intermediary loader when running QEMU with secure
> world emulation enabled, in which case NOR flash bank #0 is secure
> only and contains the secure world firmware. In this case,
> NorFlashQemuLib should not expose the first flash bank at all.
> 
> To prevent introducing too much internal knowledge about which flash
> bank is accessible under which circumstances, let's switch to using
> the DTB to decide which flash banks to expose to the NOR flash driver.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c   | 78 
> ++--
>  ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf | 12 +++
>  2 files changed, 69 insertions(+), 21 deletions(-)
> 
> diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c 
> b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
> index e3bbae5b06c5..2678f57eaaad 100644
> --- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
> +++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
> @@ -1,6 +1,6 @@
>  /** @file
>  
> - Copyright (c) 2014, Linaro Ltd. All rights reserved.
> + Copyright (c) 2014-2018, Linaro Ltd. All rights reserved.
>  
>   This program and the accompanying materials
>   are licensed and made available under the terms and conditions of the BSD 
> License
> @@ -12,13 +12,16 @@
>  
>   **/
>  
> +#include 
> +#include 
>  #include 
> +#include 
> +
> +#include 
>  
>  #define QEMU_NOR_BLOCK_SIZESIZE_256KB
> -#define QEMU_NOR0_BASE 0x0
> -#define QEMU_NOR0_SIZE SIZE_64MB
> -#define QEMU_NOR1_BASE 0x0400
> -#define QEMU_NOR1_SIZE SIZE_64MB
> +
> +#define MAX_FLASH_BANKS4
>  
>  EFI_STATUS
>  NorFlashPlatformInitialization (
> @@ -28,21 +31,7 @@ NorFlashPlatformInitialization (
>return EFI_SUCCESS;
>  }
>  
> -NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
> -  {
> -QEMU_NOR0_BASE,
> -QEMU_NOR0_BASE,
> -QEMU_NOR0_SIZE,
> -QEMU_NOR_BLOCK_SIZE,
> -{0xF9B94AE2, 0x8BA6, 0x409B, {0x9D, 0x56, 0xB9, 0xB4, 0x17, 0xF5, 0x3C, 
> 0xB3}}
> -  }, {
> -QEMU_NOR1_BASE,
> -QEMU_NOR1_BASE,
> -QEMU_NOR1_SIZE,
> -QEMU_NOR_BLOCK_SIZE,
> -{0x8047DB4B, 0x7E9C, 0x4C0C, {0x8E, 0xBC, 0xDF, 0xBB, 0xAA, 0xCA, 0xCE, 
> 0x8F}}
> -  }
> -};
> +NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];
>  
>  EFI_STATUS
>  NorFlashPlatformGetDevices (
> @@ -50,7 +39,54 @@ NorFlashPlatformGetDevices (
>OUT UINT32  *Count
>)
>  {
> +  FDT_CLIENT_PROTOCOL *FdtClient;
> +  INT32   Node;
> +  EFI_STATUS  Status;
> +  EFI_STATUS  FindNodeStatus;
> +  CONST UINT32*Reg;
> +  UINT32  PropSize;
> +  UINT32  Num;
> +  UINT64  Base;
> +  UINT64  Size;
> +
> +  Status = gBS->LocateProtocol (, NULL,
> +  (VOID **));
> +  ASSERT_EFI_ERROR (Status);
> +
> +  Num = 0;
> +  for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,
> + "cfi-flash", );
> +   !EFI_ERROR (FindNodeStatus) && Num < MAX_FLASH_BANKS;
> +   FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,
> + "cfi-flash", Node, )) {
> +
> +Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",
> +  (CONST VOID **), );
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",
> +__FUNCTION__, Status));
> +  continue;
> +}
> +
> +ASSERT ((PropSize % (4 * sizeof (UINT32))) == 0);
> +
> +while (PropSize >= (4 * sizeof (UINT32)) && Num < MAX_FLASH_BANKS) {
> +  Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));
> +  Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
> +  Reg += 4;
> +
> +  mNorFlashDevices[Num].DeviceBaseAddress = (UINTN)Base;
> +  mNorFlashDevices[Num].RegionBaseAddress = (UINTN)Base;
> +  mNorFlashDevices[Num].Size  = (UINTN)Size;
> +  mNorFlashDevices[Num].BlockSize = QEMU_NOR_BLOCK_SIZE;
> +  Num++;
> +
> +  PropSize -= 4 * sizeof (UINT32);
> +}
> +  }
> +
>*NorFlashDescriptions = mNorFlashDevices;
> -  *Count = ARRAY_SIZE (mNorFlashDevices);
> +  *Count = Num;
> +
>return EFI_SUCCESS;
>  }
> diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf 
> 

Re: [edk2] [PATCH v2 1/5] ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:58, Ard Biesheuvel wrote:
> A subsequent patch will change the layout of devicepath nodes
> produced by this driver. In preparation, make some tweaks to
> the code to use a packed struct for the devicepath and to pass
> the device index to NorFlashCreateInstance(). These are cosmetic
> changes only, the resulting binaries should be identical.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> Reviewed-by: Laszlo Ersek 
> ---
>  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 9 ++---
>  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h | 2 ++
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c 
> b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> index 46e815beb343..53753a4721ac 100644
> --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> @@ -82,7 +82,10 @@ NOR_FLASH_INSTANCE  mNorFlashInstanceTemplate = {
>{
>  HARDWARE_DEVICE_PATH,
>  HW_VENDOR_DP,
> -{ (UINT8)sizeof(VENDOR_DEVICE_PATH), 
> (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8) }
> +{
> +  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End)),
> +  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End) >> 8)
> +}
>},
>{ 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }, // GUID 
> ... NEED TO BE FILLED
>  },
> @@ -99,7 +102,7 @@ NorFlashCreateInstance (
>IN UINTN  NorFlashDeviceBase,
>IN UINTN  NorFlashRegionBase,
>IN UINTN  NorFlashSize,
> -  IN UINT32 MediaId,
> +  IN UINT32 Index,
>IN UINT32 BlockSize,
>IN BOOLEANSupportFvb,
>IN CONST GUID *NorFlashGuid,
> @@ -121,7 +124,7 @@ NorFlashCreateInstance (
>Instance->Size = NorFlashSize;
>  
>Instance->BlockIoProtocol.Media = >Media;
> -  Instance->Media.MediaId = MediaId;
> +  Instance->Media.MediaId = Index;
>Instance->Media.BlockSize = BlockSize;
>Instance->Media.LastBlock = (NorFlashSize / BlockSize)-1;
>  
> diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h 
> b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> index 5c07694fbfaa..910681fd4412 100644
> --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> @@ -122,10 +122,12 @@
>  
>  typedef struct _NOR_FLASH_INSTANCENOR_FLASH_INSTANCE;
>  
> +#pragma pack(1)
>  typedef struct {
>VENDOR_DEVICE_PATH  Vendor;
>EFI_DEVICE_PATH_PROTOCOLEnd;
>  } NOR_FLASH_DEVICE_PATH;
> +#pragma pack()
>  
>  struct _NOR_FLASH_INSTANCE {
>UINT32  Signature;
> 

We tend to insert a space character between "pack" and "(1)"/"()" too.

Feel free to update the patch when you push it, or not at all. My R-b
stands either way.

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


Re: [edk2] [PATCH v2 3/5] ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:58, Ard Biesheuvel wrote:
> DT has a [pseudo-]standardized 'status' property that can be set on
> any node, and which signifies that a node should be treated as
> absent unless it is set to 'ok' or 'okay'.

(I now really want "oktopus" to be [pseudo-]standardized too! ;) /jk)

> So take this into account
> when iterating over nodes.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 38 +---
>  1 file changed, 33 insertions(+), 5 deletions(-)
> 
> diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c 
> b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> index fb6e0aeb9215..5bfde381ecd0 100644
> --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
> @@ -78,6 +78,33 @@ SetNodeProperty (
>return EFI_SUCCESS;
>  }
>  
> +STATIC
> +BOOLEAN
> +IsNodeEnabled (
> +  INT32   Node
> +  )
> +{
> +  CONST CHAR8   *NodeStatus;
> +  INT32 Len;
> +
> +  //
> +  // A missing status property implies 'ok' so ignore any errors that
> +  // may occur here. If the status property is present, check whether
> +  // it is set to 'ok' or 'okay', anything else is treated as 'disabled'.
> +  //
> +  NodeStatus = fdt_getprop (mDeviceTreeBase, Node, "status", );
> +  if (NodeStatus == NULL) {
> +return TRUE;
> +  }
> +  if (Len >= 5 && AsciiStrCmp (NodeStatus, "okay") == 0) {
> +return TRUE;
> +  }
> +  if (Len >= 3 && AsciiStrCmp (NodeStatus, "ok") == 0) {
> +return TRUE;
> +  }
> +  return FALSE;
> +}
> +
>  STATIC
>  EFI_STATUS
>  EFIAPI
> @@ -101,6 +128,10 @@ FindNextCompatibleNode (
>break;
>  }
>  
> +if (!IsNodeEnabled (Next)) {
> +  continue;
> +}
> +
>  Type = fdt_getprop (mDeviceTreeBase, Next, "compatible", );
>  if (Type == NULL) {
>continue;
> @@ -210,7 +241,6 @@ FindNextMemoryNodeReg (
>  {
>INT32  Prev, Next;
>CONST CHAR8*DeviceType;
> -  CONST CHAR8*NodeStatus;
>INT32  Len;
>EFI_STATUS Status;
>  
> @@ -223,10 +253,8 @@ FindNextMemoryNodeReg (
>break;
>  }
>  
> -NodeStatus = fdt_getprop (mDeviceTreeBase, Next, "status", );
> -if (NodeStatus != NULL && AsciiStrCmp (NodeStatus, "okay") != 0) {
> -  DEBUG ((DEBUG_WARN, "%a: ignoring memory node with status \"%a\"\n",
> -__FUNCTION__, NodeStatus));
> +if (!IsNodeEnabled (Next)) {
> +  DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", 
> __FUNCTION__));
>continue;
>  }
>  
> 

Reviewed-by: Laszlo Ersek 

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


Re: [edk2] [PATCH v2 2/5] ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash banks

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:58, Ard Biesheuvel wrote:
> Currently, each flash bank controlled by ArmPlatformPkg/NorFlashDxe
> has its own VendorHw GUID, and instances of NorFlashPlatformLib
> describe each bank to the driver, along with the GUID for each.
> 
> This works ok for bare metal platforms, but it would be useful for
> virtual platforms if we could obtain this information from a
> device tree, which would require us to invent GUIDs on the fly,
> given that the 'cfi-flash' binding does not include a GUID.
> 
> So instead, let's switch to a single GUID for all flash banks,
> and update the driver's device path handling to include an index
> to identify each bank uniquely.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ard Biesheuvel 
> Reviewed-by: Laszlo Ersek 
> Reviewed-by: Leif Lindholm 
> ---
>  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 6 +++---
>  ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h | 1 +
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c 
> b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> index 53753a4721ac..af40a4c88412 100644
> --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
> @@ -89,6 +89,7 @@ NOR_FLASH_INSTANCE  mNorFlashInstanceTemplate = {
>},
>{ 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }, // GUID 
> ... NEED TO BE FILLED
>  },
> +0, // Index
>  {
>END_DEVICE_PATH_TYPE,
>END_ENTIRE_DEVICE_PATH_SUBTYPE,
> @@ -105,7 +106,6 @@ NorFlashCreateInstance (
>IN UINT32 Index,
>IN UINT32 BlockSize,
>IN BOOLEANSupportFvb,
> -  IN CONST GUID *NorFlashGuid,
>OUT NOR_FLASH_INSTANCE**  NorFlashInstance
>)
>  {
> @@ -128,7 +128,8 @@ NorFlashCreateInstance (
>Instance->Media.BlockSize = BlockSize;
>Instance->Media.LastBlock = (NorFlashSize / BlockSize)-1;
>  
> -  CopyGuid (>DevicePath.Vendor.Guid, NorFlashGuid);
> +  CopyGuid (>DevicePath.Vendor.Guid, );
> +  Instance->DevicePath.Index = (UINT8)Index;
>  
>Instance->ShadowBuffer = AllocateRuntimePool (BlockSize);;
>if (Instance->ShadowBuffer == NULL) {
> @@ -1314,7 +1315,6 @@ NorFlashInitialise (
>Index,
>NorFlashDevices[Index].BlockSize,
>ContainVariableStorage,
> -  [Index].Guid,
>[Index]
>  );
>  if (EFI_ERROR(Status)) {
> diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h 
> b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> index 910681fd4412..8886aa43d9f3 100644
> --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
> @@ -125,6 +125,7 @@ typedef struct _NOR_FLASH_INSTANCE
> NOR_FLASH_INSTANCE;
>  #pragma pack(1)
>  typedef struct {
>VENDOR_DEVICE_PATH  Vendor;
> +  UINT8   Index;
>EFI_DEVICE_PATH_PROTOCOLEnd;
>  } NOR_FLASH_DEVICE_PATH;
>  #pragma pack()
> 

looks good, thanks!
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Platform/ARM/Juno: increase max variable size to 8KB

2018-11-21 Thread Thomas Abraham
On Wed, Nov 21, 2018 at 9:26 PM Vijayenthiran Subramaniam
 wrote:
>
> Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
> NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
> package. This driver requires the platform to support a maximum variable
> size of atleast 4KB.
>
> So increase the maximum supported variable size to 8KB on the Juno
> platform. Without this, the iSCSI driver fails to load.
>
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Thomas Abraham 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Vijayenthiran Subramaniam 
> ---
>  Platform/ARM/JunoPkg/ArmJuno.dsc | 2 ++
>  1 file changed, 2 insertions(+)

Tested-by: Thomas Abraham 

>
> diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc 
> b/Platform/ARM/JunoPkg/ArmJuno.dsc
> index ac3d63b..ac85dc0 100644
> --- a/Platform/ARM/JunoPkg/ArmJuno.dsc
> +++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
> @@ -103,6 +103,8 @@
>gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x0BFE
>gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x0001
>
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
> +
># System Memory (2GB - 16MB of Trusted DRAM at the top of the 32bit 
> address space)
>gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
>
> --
> 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 v3 0/6] ArmPkg related changes for StandaloneMM package

2018-11-21 Thread Thomas Abraham
Hi Ard, Leif,

On Mon, Nov 19, 2018 at 10:39 AM Sughosh Ganu  wrote:
>
> hi Ard,
>
> On Thu Oct 25, 2018 at 01:02:33PM +0530, Sughosh Ganu wrote:
> > The following patch series adds support for Management Mode related
> > changes for aarch64 based platforms.
> >
> > Changes since v2:
> > Based on review comments from Ard, moved the memory attribute updation
> > changes out of DebugPeCoffExtraActionLib into an extra action library
> > added in StandaloneMM package. The patch for setting the memory
> > attributes, now under StandaloneMmPkg directory, will be submitted
> > separately from this series.
>
> Can you please review the V3 of this series. Based on your review
> comments, i have moved the memory attribute updation into an extra
> action lib added under StandaloneMmPkg. Can you please check if these
> updated patches for ArmPkg[1] and the one under StandaloneMmPkg[2] are
> fine.
>
> I had put you and Leif on Cc while sending out the patches, but i
> think that the mailserver deleted those, which is why you may have
> missed the patches.
>
> -sughosh
>
> [1] - https://lists.01.org/pipermail/edk2-devel/2018-October/031377.html
> [2] - https://lists.01.org/pipermail/edk2-devel/2018-October/031384.html
>
> >
> >
> > Achin Gupta (5):
> >   ArmPkg: Add PCDs needed for MM communication driver.
> >   ArmPkg/Drivers: Add EFI_MM_COMMUNICATION_PROTOCOL DXE driver.
> >   ArmPkg/Include: Add MM interface SVC return codes.
> >   ArmPkg/ArmMmuLib: Add MMU Library suitable for use in S-EL0.
> >   ArmPkg/ArmMmuLib: Add MMU library inf file suitable for use in S-EL0.
> >
> > Sughosh Ganu (1):
> >   ArmPkg/Include: Fix the SPM version SVC ID
> >
> >  ArmPkg/ArmPkg.dec  
> >   |   3 +
> >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf  
> >   |  56 +++
> >  ArmPkg/Library/ArmMmuLib/{ArmMmuPeiLib.inf => 
> > ArmMmuStandaloneMmCoreLib.inf} |  23 +-
> >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h  
> >   |  28 ++
> >  ArmPkg/Include/IndustryStandard/ArmMmSvc.h 
> >   |   9 +-
> >  ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
> >   | 395 
> >  ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuStandaloneMmCoreLib.c   
> >   | 204 ++
> >  7 files changed, 704 insertions(+), 14 deletions(-)
> >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
> >  copy ArmPkg/Library/ArmMmuLib/{ArmMmuPeiLib.inf => 
> > ArmMmuStandaloneMmCoreLib.inf} (51%)
> >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunicate.h
> >  create mode 100644 ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
> >  create mode 100644 
> > ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuStandaloneMmCoreLib.c

Any feedback on this patch series. This series is important in getting
the MM Standalone mode feature supported for Arm platforms. There are
patches being worked on to enable secure variable access feature for
Arm platforms and it depends on this series. So if there any comments
on these patches, please let us know.

Thanks,
Thomas.


> >
> > --
> > 2.7.4
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
>
> --
> -sughosh
> ___
> 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] Platform/ARM/Juno: increase max variable size to 8KB

2018-11-21 Thread Vijayenthiran Subramaniam
Commit dc37ca75 ("Edk2Platforms: Replace MdeModulePkg PXE/iSCSI/TCP with
NetworkPkg drivers") switched to using iSCSI driver from the NetworkPkg
package. This driver requires the platform to support a maximum variable
size of atleast 4KB.

So increase the maximum supported variable size to 8KB on the Juno
platform. Without this, the iSCSI driver fails to load.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Cc: Thomas Abraham 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
 Platform/ARM/JunoPkg/ArmJuno.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index ac3d63b..ac85dc0 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -103,6 +103,8 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x0BFE
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x0001
 
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
+
   # System Memory (2GB - 16MB of Trusted DRAM at the top of the 32bit address 
space)
   gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
 
-- 
2.7.4

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


Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-21 Thread Laszlo Ersek
On 11/21/18 12:53, Fu, Siyuan wrote:
>> -Original Message-
>> From: Laszlo Ersek [mailto:ler...@redhat.com]
>> Sent: Wednesday, November 21, 2018 6:47 PM
>> To: Fu, Siyuan 
>> Cc: edk2-devel@lists.01.org; Ye, Ting ; Wu, Jiaxin
>> 
>> Subject: Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment
>> files to NetworkPkg.

[...]

>>> +[PcdsFixedAtBuild]
>>> +!if $(NETWORK_ALLOW_HTTP_CONNECTIONS) == TRUE
>>> +  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
>>> +!endif
>>
>> (11) I'm not sure this is flexible enough.
>>
>> First, in "OvmfPkg/OvmfPkgIa32X64.dsc", we set the PCD only under
>> [PcdsFixedAtBuild.X64], not under [PcdsFixedAtBuild]. I agree that in
>> practice, such a change shouldn't be a problem however.
>>
>> Second, a more practical observation: NetworkPkg.dec declares this PCD
>> not just as fixed, but also as patchable-in-module. As far as I
>> understand, the above DSC include hunk will prevent platforms from using
>> the PCD as patchable.
>>
>> I think the most flexible option would be to simply remove the
>> NETWORK_ALLOW_HTTP_CONNECTIONS build flag, from this patch, and to allow
>> platforms to set the PCD however they want. A build macro ("-D") is not
>> expressive enough for this. Also remember that "--pcd" can be passed on
>> the build command line too, so not much usability/convenience is lost by
>> removing NETWORK_ALLOW_HTTP_CONNECTIONS.
> 
> I'm OK to remove this flag.
> 
>>
>>> +
>>> +[Components]
>>
>> (12) How is this going to work with multi-arch platform builds, such as
>> "OvmfPkg/OvmfPkgIa32X64.dsc", where the PEI phase is 32-bit, and the DXE
>> phase is 64-bit?
>>
>> I don't think "OvmfPkgIa32X64.dsc" should build the networking modules
>> for 32-bit too. They would never be included in the final flash device,
>> so it's wasted compilation.
>>
>> Can we introduce separate DSC include files (fragments) for each of the
>> DSC file sections? That is, we could have:
>>
>> - a "NetworkDefines.dsc.inc" for the [Defines] section(s),
>> - a "NetworkLibs.dsc.inc" for the [LibraryClasses*] section(s),
>> - a "NetworkPcds.dsc.inc" for the [Pcds*] section(s),
>> - a "NetworkComponents.dsc.inc" for the [Components*] section(s).
>>
>> Then the platform DSC would be responsible for spelling out the precise
>> section header it wants, and then include the matching DSC include file
>> right below that.
>>
>> In other words, can we split this DSC include into multiple files, at
>> the currently shown section headers, and remove the section headers
>> themselves?
> 
> It's quite a good suggestion.
> 
> My initial intention is to make the include file as simple as possible,
> to minimize the platform owner's work, so I just provide 1 include file
> for DSC, and you are correct that it was done at the cost of losing
> flexibility and wasting build time. 
> 
> Now I think even we have 4 separate DSC include files, it's still much
> easier to organize than original 20 more INF, and with much more flexibility
> to platform owner.
> 
> This could also solve the problem (11).

Right, this would restore flexibility to the PCD settings as well.

[...]

>>> +  !if $(NETWORK_TLS_ENABLE) == TRUE
>>> +NetworkPkg/TlsDxe/TlsDxe.inf
>>> +NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
>>> +  !endif
>>
>> (15) Unfortunately, this isn't flexible enough for OVMF. OVMF hooks
>>
>>   OvmfPkg/Library/TlsAuthConfigLib/TlsAuthConfigLib.inf
>>
>> into TlsAuthConfigDxe via NULL class resolution -- for setting up the CA
>> certificates and cipher suites, in volatile UEFI variables, just in time.
> 
> You are correct, that's why I leave the original "TLS_ENABLE" flag and set
> NETWORK_TLS_ENABLE to false in OVMF package's patch. If a platform want to
> override a driver or library component, it should disable the relative
> NETWORK_*** flag for the include file, and add the override component in
> its DSC/FDF separately.
> 
> I haven't figure out a good solution except this method.

(See also my OvmfPkg patch comments:)

I think this method can work well; the only thing we should be careful
about IMO is that the platform-specific flag should really be clear
about it being platform specific. Hence my earlier suggestion to rename
TLS_ENABLE in OVMF to PLATFORM_TLS_ENABLE.

Because, just "TLS_ENABLE" is a little bit ambiguous (to me anyway) in
whether it utilizes a pre-packaged core feature, or a platform-specific
inclusion of the feature.

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


[edk2] [PATCH v2] NetworkPkg/IScsiDxe: add debug logs for failed SetVariable attempts

2018-11-21 Thread Vijayenthiran Subramaniam
Add debug messages for failed attempts to write to a variable.

Cc: Siyuan Fu 
Cc: Jiaxin Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Made the log messages bit more useful. 

Thanks,
Vijayenthiran

 NetworkPkg/IScsiDxe/IScsiMisc.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index dd0d32dcda16..7bed95a8fba3 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -845,6 +845,10 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigOrder);
 if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR,
+"%a: Failed to set 'InitialAttemptOrder' with Guid (%g): "
+"%r\n",
+__FUNCTION__, , Status));
   return Status;
 }
 
@@ -887,6 +891,10 @@ IScsiCreateAttempts (
 );
 FreePool (AttemptConfigData);
 if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable (mPrivate->PortString) with Guid (%g): "
+  "%r\n",
+  __FUNCTION__, , Status));
   return Status;
 }
   }
-- 
2.17.1

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


[edk2] [PATCH v2] MdeModulePkg/Variable: add debug logs in VariableServiceSetVariable

2018-11-21 Thread Vijayenthiran Subramaniam
Print debug messages if size of the VariableName plus DataSize exceeds
Max(Auth|Voltaile)VariableSize bytes. The messages will be useful if any
platform specific value of Max(Auth|Voltaile)VariableSize PCDs have to
be changed.

Cc: Star Zeng 
Cc: Jian J Wang 
Cc: Ruiyu Ni 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vijayenthiran Subramaniam 
---
Thanks for the review. I have made changes based on Laszlo's and Star's
suggestions.

- Vijayenthiran

 MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 30 
 1 file changed, 30 insertions(+)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
index 8e8db71bd201..d100b1dcc552 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -3234,14 +3234,44 @@ VariableServiceSetVariable (
 //
 if ((Attributes & VARIABLE_ATTRIBUTE_AT_AW) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxAuthVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxAuthVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxAuthVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else if ((Attributes & EFI_VARIABLE_NON_VOLATILE) != 0) {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 } else {
   if (StrSize (VariableName) + PayloadSize > 
mVariableModuleGlobal->MaxVolatileVariableSize - GetVariableHeaderSize ()) {
+DEBUG ((DEBUG_ERROR,
+  "%a: Failed to set variable '%s' with Guid %g\n",
+  __FUNCTION__, VariableName, VendorGuid));
+DEBUG ((DEBUG_ERROR,
+  "NameSize(0x%x) + PayloadSize(0x%x) > "
+  "MaxVolatileVariableSize(0x%x) - HeaderSize(0x%x)\n",
+  StrSize (VariableName), PayloadSize,
+  mVariableModuleGlobal->MaxVolatileVariableSize,
+  GetVariableHeaderSize ()
+  ));
 return EFI_INVALID_PARAMETER;
   }
 }
-- 
2.17.1

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


Re: [edk2] [edk2-test][Patch] uefi-sct/SctPkg:Remove old unused files in EfiCompliant test

2018-11-21 Thread Supreeth Venkatesh
Reviewed-by: Supreeth Venkatesh 

-Original Message-
From: Eric Jin 
Sent: Tuesday, November 20, 2018 8:13 PM
To: edk2-devel@lists.01.org
Cc: Supreeth Venkatesh 
Subject: [edk2-test][Patch] uefi-sct/SctPkg:Remove old unused files in 
EfiCompliant test

Cc: Supreeth Venkatesh 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Jin 
---
 .../BlackBoxTest/EfiCompliantBBTestDriver_efi.c|   64 -
 .../BlackBoxTest/EfiCompliantBBTestMain_efi.c  |  126 --
 .../BlackBoxTest/EfiCompliantBBTestMain_efi.h  |  117 --
 .../BlackBoxTest/EfiCompliantBBTestPlatform_efi.c  | 1441 
 .../BlackBoxTest/EfiCompliantBBTestRequired_efi.c  |  820 ---
 .../BlackBoxTest/EfiCompliantBBTestSupport_efi.c   |  390 --
 .../BlackBoxTest/EfiCompliantBBTest_efi.inf|   56 -
 .../Generic/EfiCompliant/BlackBoxTest/Guid_efi.c   |   65 -
 .../Generic/EfiCompliant/BlackBoxTest/Guid_efi.h   |  116 --
 9 files changed, 3195 deletions(-)
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.h
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestPlatform_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestRequired_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestSupport_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTest_efi.inf
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_efi.c
 delete mode 100644 
uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/Guid_efi.h

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
deleted file mode 100644
index 5db3eae..000
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestDriver_efi.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
-
-  Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 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.
-
-**/
-/*++
-
-Module Name:
-
-  EfiCompliantBbTestDriver.c
-
-Abstract:
-
-  Check the driver specific elements in EFI Spec.
-
---*/
-
-//
-// Includes
-//
-
-#include "SctLib.h"
-#include "EfiCompliantBbTestMain_efi.h"
-
-//
-// Module definitions
-//
-
-#define SECTION_NAME_DRIVER_SPECIFICL"Driver Specific"
-
-//
-// External functions implementation
-//
-
-EFI_STATUS
-DriverSpecificElementsBbTest (
-  IN EFI_BB_TEST_PROTOCOL *This,
-  IN VOID *ClientInterface,
-  IN EFI_TEST_LEVEL   TestLevel,
-  IN EFI_HANDLE   SupportHandle
-  )
-/*++
-
-Routine Description:
-
-  Check the driver specific elements, which defined in the EFI spec 1.10,
-  section 2.6.3.
-
-  We didn't find a good way to test this item. So currently it is commented in
-  the test entry point definitions of TestMain.c.
-
---*/
-{
-  return EFI_UNSUPPORTED;
-}
diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
deleted file mode 100644
index 31ee6c4..000
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Generic/EfiCompliant/BlackBoxTest/EfiCompliantBBTestMain_efi.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/** @file
-
-  Copyright 2006 - 2010 Unified EFI, Inc.
-  Copyright (c) 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.
-
-**/
-/*++
-
-Module Name:
-
-  EfiCompliantBbTestMain.c
-
-Abstract:
-
-  EFI Compliant Black-Box Test.
-
---*/
-
-#include "SctLib.h"
-#include 

Re: [edk2] [PATCH edk2-platforms 0/3] drop GUIDs from NOR flash bank descriptors

2018-11-21 Thread Thomas Abraham
Hi Ard,

On Wed, Nov 21, 2018 at 5:31 PM Ard Biesheuvel
 wrote:
>
> Align edk2-platform with upcoming changes to EDK2 to get rid of per-bank
> NOR flash GUIDs.
>
> Ard Biesheuvel (3):
>   Platform/ARM: replace hardcoded VenHW() device paths referring to NOR
> flash
>   Silicon/SynQuacer: drop per-bank NOR flash GUIDs
>   Platform/ARM: drop per-bank NOR flash GUIDs
>
>  Platform/ARM/JunoPkg/ArmJuno.dec   |  2 +-
>  Platform/ARM/JunoPkg/ArmJuno.dsc   |  2 +-
>  .../JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c |  2 --
>  .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c   |  2 --
>  Platform/ARM/SgiPkg/SgiPlatform.dsc|  2 +-
>  Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc  |  2 +-
>  Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc   |  2 +-
>  .../NorFlashArmVExpressLib/NorFlashArmVExpress.c   |  4 
>  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 14 +++---
>  .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  |  3 +++
>  .../NorFlashSynQuacerLib/NorFlashSynQuacer.c   |  6 --
>  11 files changed, 15 insertions(+), 26 deletions(-)

Tested this patch series and "[PATCH v2 0/5] ArmPlatformPkg,
ArmVirtPkg: discover NOR flash banks from DTB" patch series on the
Juno board. With these patches applied, the boot fails on Juno board
with the following messages. I have not yet tried to debug the issue
but wanted to let you know this.

[...]
Loading driver at 0x000F830C000 EntryPoint=0x000F831B2AC IScsiDxe.efi
add-symbol-file
/home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe/DEBUG/Udp4Dxe.dll
0xF830
Loading driver at 0x000F82FF000 EntryPoint=0x000F8306DF0 Udp4Dxe.efi
add-symbol-file
/home/thopan01/devel/juno/uefi/uefi/edk2/Build/ArmJuno/DEBUG_GCC5/AARCH64/Platform/ARM/Drivers/FdtPlatformDxe/FdtPlatformDxe/DEBUG/FdtPlatformDxe.dll
0xF82EE000
Loading driver at 0x000F82ED000 EntryPoint=0x000F82F76EC FdtPlatformDxe.efi
Found image: fip in block 5.
Found image: norkern in block 20.
Found image: ramdisk.img in block 116.
Found image: hdlcdclk in block 151.
Found image: selftest in block 152.
Found image: board.dtb in block 156.
Found image: scp_bl1 in block 249.
Found image: bl1 in block 251.
Found image: startup.nsh in block 252.
ASSERT [BootMonFs]
/home/thopan01/devel/juno/uefi/uefi/edk2/MdePkg/Library/BaseLib/String.c(173):
((UINTN) String & 0x0001) == 0

Thanks,
Thomas.



>
> --
> 2.17.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


[edk2] [PATCH v3 edk2-platforms 6/6] Platform/ARM/Sgi: Add initial support for SGI-Clark.Helios platform

2018-11-21 Thread Chandni Cherukuri
Add the initial support for ARM's System Guidance for Infrastructure
SGI-Clark.Helios platform. The ACPI tables for this platform are
installed.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h | 1 +
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index 46f35e8..5501895 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -75,6 +75,7 @@
 //SGI-Clark Platform Identification values
 #define SGI_CLARK_PART_NUM0x786
 #define SGI_CLARK_CONF_ARES   0x1
+#define SGI_CLARK_CONF_HELIOS 0x2
 
 #define SGI_CONFIG_MASK   0x0F
 #define SGI_CONFIG_SHIFT  0x1C
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
index 164151a..a8708a5 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
@@ -51,6 +51,9 @@ ArmSgiPkgEntryPoint (
   } else if ((PartNum == SGI_CLARK_PART_NUM) &&
  (ConfigId == SGI_CLARK_CONF_ARES)) {
 Status = LocateAndInstallAcpiFromFv ();
+  } else if ((PartNum == SGI_CLARK_PART_NUM) &&
+ (ConfigId == SGI_CLARK_CONF_HELIOS)) {
+Status = LocateAndInstallAcpiFromFv ();
   } else {
 Status = EFI_UNSUPPORTED;
   }
-- 
2.7.4

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


[edk2] [PATCH v3 edk2-platforms 5/6] Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Helios platform

2018-11-21 Thread Chandni Cherukuri
Add ACPI tables specific for SGI-Clark.Helios platform and let this
platform reuse the rest of the common SGI platform ACPI tables.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec |   1 +
 Platform/ARM/SgiPkg/SgiPlatform.dsc |   1 +
 Platform/ARM/SgiPkg/SgiPlatform.fdf |   1 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf |  58 +
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf |   1 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl  | 262 
+++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Madt.aslc | 266 

 7 files changed, 590 insertions(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index f66fa1f..f6e0ba1 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -34,6 +34,7 @@
   gArmSgiTokenSpaceGuid  = { 0x577d6941, 0xaea1, 0x40b4, { 0x90, 0x93, 
0x2a, 0x86, 0x61, 0x72, 0x5a, 0x57 } }
   gSgi575AcpiTablesFileGuid  = { 0xc712719a, 0x0aaf, 0x438c, { 0x9c, 0xdd, 
0x35, 0xab, 0x4d, 0x60, 0x20, 0x7d } }
   gSgiClarkAresAcpiTablesFileGuid = { 0x4b0b91d0, 0x4a05, 0x45c4, { 0x88, 
0xa7, 0x88, 0xe1, 0x70, 0xe7, 0x66, 0x94 } }
+  gSgiClarkHeliosAcpiTablesFileGuid = { 0x2af40815, 0xa84e, 0x4de9, { 0x8c, 
0x38, 0x91, 0x40, 0xb3, 0x54, 0x40, 0x73 } }
 
 [PcdsFeatureFlag.common]
   # Set this PCD to TRUE to enable virtio support.
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 8b8062a..0c21f1c 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -253,6 +253,7 @@
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
   Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
   Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+  Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   #
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index dc81acd..b7af4a2 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -107,6 +107,7 @@ READ_LOCK_STATUS   = TRUE
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
   INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
   INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
+  INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   # Required by PCI
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
new file mode 100644
index 000..0ecce2d
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
@@ -0,0 +1,58 @@
+## @file
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, ARM Ltd. All rights reserved.
+#
+#  This program and the accompanying materials are licensed and made available
+#  under the terms and conditions of the BSD License which accompanies this
+#  distribution.  The full text of the license may be found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = SgiClarkHeliosAcpiTables
+  FILE_GUID  = 2af40815-a84e-4de9-8c38-9140b3544073
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dbg2.aslc
+  Fadt.aslc
+  Gtdt.aslc
+  Iort.aslc
+  Mcfg.aslc
+  SgiClarkHelios/Dsdt.asl
+  SgiClarkHelios/Madt.aslc
+  Spcr.aslc
+  Ssdt.asl
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+  gArmPlatformTokenSpaceGuid.PcdClusterCount
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdPciBusMin
+  gArmTokenSpaceGuid.PcdPciBusMax
+
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git 

[edk2] [PATCH v3 edk2-platforms 4/6] Platform/ARM/Sgi: Add initial support for SGI-Clark.Ares platform

2018-11-21 Thread Chandni Cherukuri
Add the initial support for ARM's System Guidance for Infrastructure
SGI-Clark.Ares platform. The ACPI tables for this platform are
installed.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h |  4 
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c | 16 +---
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index b0cca4e..46f35e8 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -72,6 +72,10 @@
 #define SGI575_CONF_NUM   0x3
 #define SGI575_PART_NUM   0x783
 
+//SGI-Clark Platform Identification values
+#define SGI_CLARK_PART_NUM0x786
+#define SGI_CLARK_CONF_ARES   0x1
+
 #define SGI_CONFIG_MASK   0x0F
 #define SGI_CONFIG_SHIFT  0x1C
 #define SGI_PART_NUM_MASK 0xFFF
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
index 249d0a0..164151a 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
@@ -48,14 +48,16 @@ ArmSgiPkgEntryPoint (
 
   if ((PartNum == SGI575_PART_NUM) && (ConfigId == SGI575_CONF_NUM)) {
 Status = LocateAndInstallAcpiFromFv ();
-if (EFI_ERROR (Status)) {
-  DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n",
-__FUNCTION__));
-  return Status;
-}
+  } else if ((PartNum == SGI_CLARK_PART_NUM) &&
+ (ConfigId == SGI_CLARK_CONF_ARES)) {
+Status = LocateAndInstallAcpiFromFv ();
   } else {
-DEBUG ((DEBUG_ERROR, "PlatformDxe: Unsupported Platform Id\n"));
-return EFI_UNSUPPORTED;
+Status = EFI_UNSUPPORTED;
+  }
+
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: Failed to install ACPI tables\n", __FUNCTION__));
+return Status;
   }
 
   Status = EFI_REQUEST_UNLOAD_IMAGE;
-- 
2.7.4

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


[edk2] [PATCH v3 edk2-platforms 3/6] Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Ares platform

2018-11-21 Thread Chandni Cherukuri
Add ACPI tables specific for SGI-Clark.Ares platform and let this
platform reuse the rest of the common SGI platform ACPI tables.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec   |   1 +
 Platform/ARM/SgiPkg/SgiPlatform.dsc   |   1 +
 Platform/ARM/SgiPkg/SgiPlatform.fdf   |   1 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf |  58 +++
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf   |   1 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl  | 116 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Madt.aslc | 171 

 7 files changed, 349 insertions(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 2fcc13e..f66fa1f 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -33,6 +33,7 @@
   gArmSgiPlatformIdDescriptorGuid = { 0xf56f152a, 0xad2a, 0x11e6, { 0xb1, 
0xa7, 0x00, 0x50, 0x56, 0x3c, 0x44, 0xcc } }
   gArmSgiTokenSpaceGuid  = { 0x577d6941, 0xaea1, 0x40b4, { 0x90, 0x93, 
0x2a, 0x86, 0x61, 0x72, 0x5a, 0x57 } }
   gSgi575AcpiTablesFileGuid  = { 0xc712719a, 0x0aaf, 0x438c, { 0x9c, 0xdd, 
0x35, 0xab, 0x4d, 0x60, 0x20, 0x7d } }
+  gSgiClarkAresAcpiTablesFileGuid = { 0x4b0b91d0, 0x4a05, 0x45c4, { 0x88, 
0xa7, 0x88, 0xe1, 0x70, 0xe7, 0x66, 0x94 } }
 
 [PcdsFeatureFlag.common]
   # Set this PCD to TRUE to enable virtio support.
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index ede13b5..8b8062a 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -252,6 +252,7 @@
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
   Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+  Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   #
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index de5bca6..dc81acd 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -106,6 +106,7 @@ READ_LOCK_STATUS   = TRUE
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
   INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
+  INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   # Required by PCI
diff --git a/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
new file mode 100644
index 000..dcfe492
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
@@ -0,0 +1,58 @@
+## @file
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, ARM Ltd. All rights reserved.
+#
+#  This program and the accompanying materials are licensed and made available
+#  under the terms and conditions of the BSD License which accompanies this
+#  distribution.  The full text of the license may be found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = SgiClarkAresAcpiTables
+  FILE_GUID  = 4b0b91d0-4a05-45c4-88a7-88e170e76694
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dbg2.aslc
+  Fadt.aslc
+  Gtdt.aslc
+  Iort.aslc
+  Mcfg.aslc
+  SgiClarkAres/Dsdt.asl
+  SgiClarkAres/Madt.aslc
+  Spcr.aslc
+  Ssdt.asl
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[FixedPcd]
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+  gArmPlatformTokenSpaceGuid.PcdClusterCount
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdPciBusMin
+  gArmTokenSpaceGuid.PcdPciBusMax
+
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf
index df546af..0371c40 100644
--- 

[edk2] [PATCH v3 edk2-platforms 2/6] Platform/ARM/Sgi: Refactor ACPI tables for SGI platforms

2018-11-21 Thread Chandni Cherukuri
ACPI tables Dbg2.aslc, Fadt.aslc, Gtdt.aslc, Iort.aslc, Mcfg.aslc,
Spcr.aslc and Ssdt.asl are common for SGI platforms. To reduce
duplication of ACPI tables when new platforms are added these tables
are moved to the AcpiTables folder. Only platform specific tables
Dsdt.asl and Madt.aslc remain in the platform specific folder. Also
the AcpiTables.inf file is renamed as Sgi575AcpiTables.inf and moved to
AcpiTables folder.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc  |   2 +-
 Platform/ARM/SgiPkg/SgiPlatform.fdf  |   2 +-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf |  58 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf  |  58 
 Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h  |   2 +-
 Platform/ARM/SgiPkg/AcpiTables/Dbg2.aslc |  88 
 Platform/ARM/SgiPkg/AcpiTables/Fadt.aslc |  87 +++
 Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc | 152 
 Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 106 ++
 Platform/ARM/SgiPkg/AcpiTables/Mcfg.aslc |  59 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc  |  90 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl   |   2 +-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc  |  87 ---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc  | 152 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Iort.aslc  | 106 --
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Mcfg.aslc  |  59 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc  |  77 --
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Ssdt.asl   |  95 
 Platform/ARM/SgiPkg/AcpiTables/Spcr.aslc |  77 ++
 Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl  |  93 
 20 files changed, 724 insertions(+), 728 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 1c152fa..ede13b5 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -251,7 +251,7 @@
   # ACPI Support
   #
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf
+  Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   #
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf 
b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index c912984..de5bca6 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -105,7 +105,7 @@ READ_LOCK_STATUS   = TRUE
   # ACPI Support
   #
   INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf
+  INF RuleOverride=ACPITABLE 
Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
   INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
 
   # Required by PCI
diff --git a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf
deleted file mode 100644
index feb1018..000
--- a/Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf
+++ /dev/null
@@ -1,58 +0,0 @@
-## @file
-#  ACPI table data and ASL sources required to boot the platform.
-#
-#  Copyright (c) 2018, ARM Ltd. All rights reserved.
-#
-#  This program and the accompanying materials are licensed and made available
-#  under the terms and conditions of the BSD License which accompanies this
-#  distribution.  The full text of the license may be found at
-#  http://opensource.org/licenses/bsd-license.php
-#
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-#
-##
-
-[Defines]
-  INF_VERSION= 0x0001001A
-  BASE_NAME  = Sgi575AcpiTables
-  FILE_GUID  = c712719a-0aaf-438c-9cdd-35ab4d60207d  # 
gSgi575AcpiTablesFileGuid
-  MODULE_TYPE= USER_DEFINED
-  VERSION_STRING = 1.0
-
-[Sources]
-  Dbg2.aslc
-  Dsdt.asl
-  Fadt.aslc
-  Gtdt.aslc
-  Iort.aslc
-  Madt.aslc
-  Mcfg.aslc
-  Spcr.aslc
-  Ssdt.asl
-
-[Packages]
-  ArmPkg/ArmPkg.dec
-  ArmPlatformPkg/ArmPlatformPkg.dec
-  EmbeddedPkg/EmbeddedPkg.dec
-  MdePkg/MdePkg.dec
-  Platform/ARM/SgiPkg/SgiPlatform.dec
-
-[FixedPcd]
-  gArmPlatformTokenSpaceGuid.PcdCoreCount
-  gArmPlatformTokenSpaceGuid.PcdClusterCount
-  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
-  gArmPlatformTokenSpaceGuid.PL011UartInterrupt
-
-  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
-  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
-  gArmTokenSpaceGuid.PcdGicDistributorBase
-  

[edk2] [PATCH v3 edk2-platforms 1/6] Platform/ARM/Sgi: Adapt to changes in system-id DT node.

2018-11-21 Thread Chandni Cherukuri
The 'system-id' node of HW_CONFIG device tree has been updated to have
a new property 'config-id' to hold the platform configuration value.
To adapt to this change, SGI_PLATFORM_DESCRIPTOR gets a new member
named 'ConfigId' and the function GetSgiPlatformId has been renamed
to GetSgiSystemId which takes the SGI_PLATFORM_DESCRIPTOR HoB as the
function parameter.

Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chandni Cherukuri 
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h|  1 +
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c| 14 +++---
 Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c | 50 
+---
 3 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index 1454018..b0cca4e 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -79,6 +79,7 @@
 // ARM platform description data.
 typedef struct {
   UINTN  PlatformId;
+  UINTN  ConfigId;
 } SGI_PLATFORM_DESCRIPTOR;
 
 #endif // __SGI_PLATFORM_H__
diff --git a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c 
b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
index 5ccd01d..249d0a0 100644
--- a/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
+++ b/Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c
@@ -30,21 +30,21 @@ ArmSgiPkgEntryPoint (
   )
 {
   EFI_STATUS  Status;
-  VOID*PlatformIdHob;
+  VOID*SystemIdHob;
   SGI_PLATFORM_DESCRIPTOR *HobData;
   UINT32  ConfigId;
   UINT32  PartNum;
 
-  PlatformIdHob = GetFirstGuidHob ();
-  if (PlatformIdHob == NULL) {
-DEBUG ((DEBUG_ERROR, "Platform ID HOB is NULL\n"));
+  SystemIdHob = GetFirstGuidHob ();
+  if (SystemIdHob == NULL) {
+DEBUG ((DEBUG_ERROR, "System ID HOB is NULL\n"));
 return EFI_INVALID_PARAMETER;
   }
 
-  HobData = (SGI_PLATFORM_DESCRIPTOR *)GET_GUID_HOB_DATA (PlatformIdHob);
+  HobData = (SGI_PLATFORM_DESCRIPTOR *)GET_GUID_HOB_DATA (SystemIdHob);
 
-  PartNum = HobData->PlatformId & SGI_PART_NUM_MASK;
-  ConfigId = (HobData->PlatformId >> SGI_CONFIG_SHIFT) & SGI_CONFIG_MASK;
+  PartNum = HobData->PlatformId;
+  ConfigId = HobData->ConfigId;
 
   if ((PartNum == SGI575_PART_NUM) && (ConfigId == SGI575_CONF_NUM)) {
 Status = LocateAndInstallAcpiFromFv ();
diff --git a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c 
b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
index 081d329..15ea571 100644
--- a/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
+++ b/Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c
@@ -22,19 +22,21 @@
 
 /**
 
-  This function returns the Platform ID of the platform
+  This function returns the System ID of the platform
 
   This functions locates the HwConfig PPI and gets the base address of HW 
CONFIG
-  DT from which the platform ID is obtained using FDT helper functions
+  DT from which the platform ID and config ID is obtained using FDT helper
+  functions
 
-  @return returns the platform ID on success else returns 0 on error
+  @param[out]  Pointer to the SGI_PLATFORM_DESCRIPTOR HoB
+  @return  returns EFI_SUCCESS on success and EFI_INVALID_PARAMETER on 
error
 
 **/
 
 STATIC
-UINT32
-GetSgiPlatformId (
- VOID
+EFI_STATUS
+GetSgiSystemId (
+  OUT SGI_PLATFORM_DESCRIPTOR   *HobData
 )
 {
   CONST UINT32  *Property;
@@ -48,34 +50,44 @@ GetSgiPlatformId (
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR,
   "PeiServicesLocatePpi failed with error %r\n", Status));
-return 0;
+return EFI_INVALID_PARAMETER;
   }
 
   HwCfgDtBlob = (VOID *)(UINTN)HwConfigInfoPpi->HwConfigDtAddr;
   if (fdt_check_header (HwCfgDtBlob) != 0) {
 DEBUG ((DEBUG_ERROR, "Invalid DTB file %p passed\n", HwCfgDtBlob));
-return 0;
+return EFI_INVALID_PARAMETER;
   }
 
   Offset = fdt_subnode_offset (HwCfgDtBlob, 0, "system-id");
   if (Offset == -FDT_ERR_NOTFOUND) {
 DEBUG ((DEBUG_ERROR, "Invalid DTB : system-id node not found\n"));
-return 0;
+return EFI_INVALID_PARAMETER;
   }
 
   Property = fdt_getprop (HwCfgDtBlob, Offset, "platform-id", NULL);
   if (Property == NULL) {
 DEBUG ((DEBUG_ERROR, "Platform Id is NULL\n"));
-return 0;
+return EFI_INVALID_PARAMETER;
   }
 
-  return fdt32_to_cpu (*Property);
+  HobData->PlatformId = fdt32_to_cpu (*Property);
+
+  Property = fdt_getprop (HwCfgDtBlob, Offset, "config-id", NULL);
+  if (Property == NULL) {
+DEBUG ((DEBUG_ERROR, "Config Id is NULL\n"));
+return EFI_INVALID_PARAMETER;
+  }
+
+  HobData->ConfigId = fdt32_to_cpu (*Property);
+
+  return EFI_SUCCESS;
 }
 
 /**
 
- This function creates a Platform ID HOB and assigns PlatformId as the
- HobData
+ This function creates a System ID HOB and assigns PlatformId and
+ ConfigId as 

[edk2] [PATCH v3 edk2-platforms 0/6] Platform/ARM/Sgi: Add support for Clark.Ares and Clark.Helios platforms

2018-11-21 Thread Chandni Cherukuri
Changes since v1:
- No code changes, posting this series again with correct patch subject

This patch series adds support for two new Arm's SGI platforms - 
SGI-Clark.Ares and SGI-Clark.Helios. The first patch in this
series adds support to use a new binding added to the system-id
node for Platform Identification. The second patch refactors the
ACPI tables to prevent duplication of ACPI tables. The common
ACPI tables for SGI platforms are put in the AcpiTables folder.
Dsdt.asl and Madt.aslc remain in the platform specific folder.
The rest of the patches add support for the two new SGI platforms.

Chandni Cherukuri (6):
  Platform/ARM/Sgi: Adapt to changes in system-id DT node.
  Platform/ARM/Sgi: Refactor ACPI tables for SGI platforms
  Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Ares platform
  Platform/ARM/Sgi: Add initial support for SGI-Clark.Ares platform
  Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Helios platform
  Platform/ARM/Sgi: Add initial support for SGI-Clark.Helios platform

 Platform/ARM/SgiPkg/SgiPlatform.dec  |   2 +
 Platform/ARM/SgiPkg/SgiPlatform.dsc  |   4 +-
 Platform/ARM/SgiPkg/SgiPlatform.fdf  |   4 +-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf |  58 -
 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf  |  58 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf|  58 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf  |  58 +
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.inf  |   2 +
 Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h  |   2 +-
 Platform/ARM/SgiPkg/Include/SgiPlatform.h|   6 +
 Platform/ARM/SgiPkg/Drivers/PlatformDxe/PlatformDxe.c|  33 +--
 Platform/ARM/SgiPkg/Library/SgiPlatformPei/SgiPlatformPeim.c |  50 ++--
 Platform/ARM/SgiPkg/AcpiTables/Dbg2.aslc |  88 +++
 Platform/ARM/SgiPkg/AcpiTables/Fadt.aslc |  87 +++
 Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc | 152 +++
 Platform/ARM/SgiPkg/AcpiTables/Iort.aslc | 106 
 Platform/ARM/SgiPkg/AcpiTables/Mcfg.aslc |  59 +
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc  |  90 ---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dsdt.asl   |   2 +-
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc  |  87 ---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc  | 152 ---
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Iort.aslc  | 106 
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Mcfg.aslc  |  59 -
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc  |  77 --
 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Ssdt.asl   |  95 ---
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl | 116 +
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Madt.aslc| 171 
+
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl   | 262 
+++
 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Madt.aslc  | 266 

 Platform/ARM/SgiPkg/AcpiTables/Spcr.aslc |  77 ++
 Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl  |  93 +++
 31 files changed, 1722 insertions(+), 758 deletions(-)
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/AcpiTables.inf
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575AcpiTables.inf
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAresAcpiTables.inf
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHeliosAcpiTables.inf
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Dbg2.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Fadt.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Gtdt.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Iort.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Mcfg.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Dbg2.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Fadt.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Gtdt.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Iort.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Mcfg.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Spcr.aslc
 delete mode 100644 Platform/ARM/SgiPkg/AcpiTables/Sgi575/Ssdt.asl
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Dsdt.asl
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkAres/Madt.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Dsdt.asl
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/SgiClarkHelios/Madt.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Spcr.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/Ssdt.asl

-- 
2.7.4
___
edk2-devel mailing list

[edk2] [PATCH edk2-platforms 2/3] Silicon/SynQuacer: drop per-bank NOR flash GUIDs

2018-11-21 Thread Ard Biesheuvel
Give the SynQuacer NOR flash driver the same treatment as we gave the
one in ArmPlatformPkg: identify NOR flash banks by a single GUID
identifying the driver, and use indexes to identify each device instance
owned by the driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 
14 +++---
 Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  | 
 3 +++
 Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c | 
 6 --
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c 
b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c
index 8d6bca8739d0..98f3e4d5a012 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c
+++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c
@@ -1093,12 +1093,13 @@ STATIC CONST NOR_FLASH_INSTANCE 
mNorFlashInstanceTemplate = {
 HARDWARE_DEVICE_PATH,
 HW_VENDOR_DP,
 {
-  (UINT8)sizeof(VENDOR_DEVICE_PATH),
-  (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)
+  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End)),
+  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End) >> 8)
 }
   },
   { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } },
 },
+0,  // Index
 {
   END_DEVICE_PATH_TYPE,
   END_ENTIRE_DEVICE_PATH_SUBTYPE,
@@ -1118,10 +1119,9 @@ NorFlashCreateInstance (
   IN UINTN  NorFlashDeviceBase,
   IN UINTN  NorFlashRegionBase,
   IN UINTN  NorFlashSize,
-  IN UINT32 MediaId,
+  IN UINT32 Index,
   IN UINT32 BlockSize,
   IN BOOLEANHasVarStore,
-  IN CONST GUID *NorFlashGuid,
   IN CONST CSDC_DEFINITION  *CommandTable,
   IN UINTN  CommandTableSize,
   OUT NOR_FLASH_INSTANCE**  NorFlashInstance
@@ -1146,12 +1146,13 @@ NorFlashCreateInstance (
   Instance->Size = NorFlashSize;
 
   Instance->BlockIoProtocol.Media = >Media;
-  Instance->Media.MediaId = MediaId;
+  Instance->Media.MediaId = Index;
   Instance->Media.BlockSize = BlockSize;
   Instance->Media.LastBlock = (NorFlashSize / BlockSize) - 1;
   Instance->OffsetLba = (NorFlashRegionBase - NorFlashDeviceBase) / BlockSize;
 
-  CopyGuid (>DevicePath.Vendor.Guid, NorFlashGuid);
+  CopyGuid (>DevicePath.Vendor.Guid, );
+  Instance->DevicePath.Index = (UINT8)Index;
 
   Instance->CmdTable = CommandTable;
   Instance->CmdTableSize = CommandTableSize;
@@ -1360,7 +1361,6 @@ NorFlashInitialise (
   Index,
   NorFlashDevices[Index].BlockSize,
   ContainVariableStorage,
-  [Index].Guid,
   mN25qCSDCDefTable,
   ARRAY_SIZE (mN25qCSDCDefTable),
   [Index]
diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h 
b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h
index 5e1e6adecf67..ef1257a64904 100644
--- a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h
+++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h
@@ -83,10 +83,13 @@ typedef struct _NOR_FLASH_INSTANCE
NOR_FLASH_INSTANCE;
 
 typedef EFI_STATUS (*NOR_FLASH_INITIALIZE)(NOR_FLASH_INSTANCE* 
Instance);
 
+#pragma pack(1)
 typedef struct {
   VENDOR_DEVICE_PATH  Vendor;
+  UINT8   Index;
   EFI_DEVICE_PATH_PROTOCOLEnd;
 } NOR_FLASH_DEVICE_PATH;
+#pragma pack()
 
 struct _NOR_FLASH_INSTANCE {
   UINT32  Signature;
diff --git 
a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c 
b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
index d44fe3e4e94c..1b3995d799de 100644
--- 
a/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
+++ 
b/Silicon/Socionext/SynQuacer/Library/NorFlashSynQuacerLib/NorFlashSynQuacer.c
@@ -34,9 +34,6 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
 FW_CODE_REGION_BASE,// region base
 FW_CODE_REGION_SIZE,// region size
 SIZE_64KB,  // block size
-{
-  0x19c118b0, 0xc423, 0x42be, { 0xb8, 0x0f, 0x70, 0x6f, 0x1f, 0xcb, 0x59, 
0x9a }
-}
   },
   {
 // Environment variable region
@@ -44,9 +41,6 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
 FW_ENV_REGION_BASE, // region base
 FW_ENV_REGION_SIZE, // region size
 SIZE_64KB,  // block size
-{
-  0x3105bd7a, 0x82c3, 0x486f, { 0xb1, 0x03, 0x1e, 0x09, 0x54, 0xec, 0x85, 
0x75 }
-}
   },
 };
 
-- 
2.17.1

___
edk2-devel mailing list

[edk2] [PATCH edk2-platforms 3/3] Platform/ARM: drop per-bank NOR flash GUIDs

2018-11-21 Thread Ard Biesheuvel
Remove the GUID definitions from the NOR flash bank structure: the
driver no longer uses them.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c   
| 2 --
 Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c 
| 2 --
 Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c 
| 4 
 3 files changed, 8 deletions(-)

diff --git a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c 
b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c
index b31b9635b7b7..2e49f3acfeb3 100644
--- a/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c
+++ b/Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c
@@ -24,14 +24,12 @@ NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
 ARM_VE_SMB_NOR0_BASE,
 SIZE_256KB * 255,
 SIZE_256KB,
-{0xE7223039, 0x5836, 0x41E1, { 0xB5, 0x42, 0xD7, 0xEC, 0x73, 0x6C, 0x5E, 
0x59} }
   },
   {
 ARM_VE_SMB_NOR0_BASE,
 ARM_VE_SMB_NOR0_BASE + SIZE_256KB * 255,
 SIZE_64KB * 4,
 SIZE_64KB,
-{0x02118005, 0x9DA7, 0x443A, { 0x92, 0xD5, 0x78, 0x1F, 0x02, 0x2A, 0xED, 
0xBB } }
   },
 };
 
diff --git a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c 
b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c
index 3ab296aafda0..04e9710bf286 100644
--- a/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c
+++ b/Platform/ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c
@@ -24,14 +24,12 @@ STATIC NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
 SGI_EXP_SMC_CS0_BASE,
 SIZE_256KB * 256,
 SIZE_256KB,
-{ 0xEBF0B9DF, 0x17d0, 0x4812, { 0xA9, 0x59, 0xCF, 0xD7, 0x92, 0xEE, 0x31, 
0x13 } }
   },
   {
 SGI_EXP_SMC_CS1_BASE,
 SGI_EXP_SMC_CS1_BASE,
 SIZE_256KB * 256,
 SIZE_256KB,
-{ 0x1F15DA3C, 0x37FF, 0x4070, { 0xB4, 0x71, 0xBB, 0x4A, 0xF1, 0x2A, 0x72, 
0x4A } }
   },
 };
 
diff --git 
a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c 
b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c
index a136bff4a1d6..ac270dc3a675 100644
--- 
a/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c
+++ 
b/Platform/ARM/VExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpress.c
@@ -26,28 +26,24 @@ NOR_FLASH_DESCRIPTION 
mNorFlashDevices[NOR_FLASH_DEVICE_COUNT] = {
 ARM_VE_SMB_NOR0_BASE,
 SIZE_256KB * 255,
 SIZE_256KB,
-{ 0xE7223039, 0x5836, 0x41E1, { 0xB5, 0x42, 0xD7, 0xEC, 0x73, 0x6C, 0x5E, 
0x59 } }
   },
   { // BootMon non-volatile storage
 ARM_VE_SMB_NOR0_BASE,
 ARM_VE_SMB_NOR0_BASE + SIZE_256KB * 255,
 SIZE_64KB * 4,
 SIZE_64KB,
-{ 0x02118005, 0x9DA7, 0x443A, { 0x92, 0xD5, 0x78, 0x1F, 0x02, 0x2A, 0xED, 
0xBB } }
   },
   { // UEFI
 ARM_VE_SMB_NOR1_BASE,
 ARM_VE_SMB_NOR1_BASE,
 SIZE_256KB * 255,
 SIZE_256KB,
-{ 0x1F15DA3C, 0x37FF, 0x4070, { 0xB4, 0x71, 0xBB, 0x4A, 0xF1, 0x2A, 0x72, 
0x4A } }
   },
   { // UEFI Variable Services non-volatile storage
 ARM_VE_SMB_NOR1_BASE,
 ARM_VE_SMB_NOR1_BASE + SIZE_256KB * 255,
 SIZE_64KB * 3, //FIXME: Set 3 blocks because I did not succeed to copy 4 
blocks into the ARM Versatile Express NOR Flash in the last NOR Flash. It 
should be 4 blocks
 SIZE_64KB,
-{ 0xCC2CBF29, 0x1498, 0x4CDD, { 0x81, 0x71, 0xF8, 0xB6, 0xB4, 0x1D, 0x09, 
0x09 } }
   }
 };
 
-- 
2.17.1

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


[edk2] [PATCH edk2-platforms 1/3] Platform/ARM: replace hardcoded VenHW() device paths referring to NOR flash

2018-11-21 Thread Ard Biesheuvel
The ArmPlatformPkg NOR flash driver has been updated to use device paths
consisting of a fixed GUID and a numeric index rather than a separate GUID
for each flash bank on a given system. This means all explicit device path
references to NOR flash banks have to be brought up to date as well.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 Platform/ARM/JunoPkg/ArmJuno.dec  | 2 +-
 Platform/ARM/JunoPkg/ArmJuno.dsc  | 2 +-
 Platform/ARM/SgiPkg/SgiPlatform.dsc   | 2 +-
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc | 2 +-
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dec b/Platform/ARM/JunoPkg/ArmJuno.dec
index edbbb827ad45..c511796d8913 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dec
+++ b/Platform/ARM/JunoPkg/ArmJuno.dec
@@ -44,7 +44,7 @@
   
gArmJunoTokenSpaceGuid.PcdSynopsysUsbEhciBaseAddress|0x7FFC|UINT32|0x0005
 
   # Juno Device Trees are loaded from NOR Flash
-  
gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/board.dtb"|VOID*|0x0008
+  
gArmJunoTokenSpaceGuid.PcdJunoFdtDevicePath|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)/board.dtb"|VOID*|0x0008
 
   # MHU Register base used by SCMI Mailbox transport
   gArmJunoTokenSpaceGuid.PcdArmMtlDoorBell|0x2B1F|UINT64|0x0024
diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index ac3d63bd4d39..55b9d64d3deb 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -176,7 +176,7 @@
   gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|24
 
   # List of Device Paths that support BootMonFs
-  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
+  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
 
   #
   # ARM Architectural Timer Frequency
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc
index 3f0ca9872e79..06d866d6dc30 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc
@@ -163,7 +163,7 @@
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
 
   # List of Device Paths that support BootMonFs
-  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)"
+  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)"
 
   # ARM OS Loader
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
index 0542808f7d0c..3a3b4e3dbbc8 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -172,7 +172,7 @@
   #
   # Define the device path to the FDT for the platform
   #
-  
gFdtPlatformDxeTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/ca15a7"
+  
gFdtPlatformDxeTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00)/ca15a7"
 
   #
   # ARM Architectural Timer Frequency
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc 
b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
index 752e525c3469..713c5637b074 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc
@@ -355,7 +355,7 @@
   #
 
   # List of Device Paths that support BootMonFs
-  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59);VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)"
+  
gArmBootMonFsTokenSpaceGuid.PcdBootMonFsSupportedDevicePaths|L"VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,00);VenHw(93E34C7E-B50E-11DF-9223-2443DFD72085,02)"
 
   # RunAxf support via Dynamic Shell Command protocol
   # We want to use the Shell Libraries but don't want it to initialise
-- 
2.17.1

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


[edk2] [PATCH edk2-platforms 0/3] drop GUIDs from NOR flash bank descriptors

2018-11-21 Thread Ard Biesheuvel
Align edk2-platform with upcoming changes to EDK2 to get rid of per-bank
NOR flash GUIDs.

Ard Biesheuvel (3):
  Platform/ARM: replace hardcoded VenHW() device paths referring to NOR
flash
  Silicon/SynQuacer: drop per-bank NOR flash GUIDs
  Platform/ARM: drop per-bank NOR flash GUIDs

 Platform/ARM/JunoPkg/ArmJuno.dec   |  2 +-
 Platform/ARM/JunoPkg/ArmJuno.dsc   |  2 +-
 .../JunoPkg/Library/NorFlashJunoLib/NorFlashJuno.c |  2 --
 .../ARM/SgiPkg/Library/NorFlashLib/NorFlashLib.c   |  2 --
 Platform/ARM/SgiPkg/SgiPlatform.dsc|  2 +-
 Platform/ARM/VExpressPkg/ArmVExpress-CTA15-A7.dsc  |  2 +-
 Platform/ARM/VExpressPkg/ArmVExpress.dsc.inc   |  2 +-
 .../NorFlashArmVExpressLib/NorFlashArmVExpress.c   |  4 
 .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.c  | 14 +++---
 .../SynQuacer/Drivers/Fip006Dxe/NorFlashDxe.h  |  3 +++
 .../NorFlashSynQuacerLib/NorFlashSynQuacer.c   |  6 --
 11 files changed, 15 insertions(+), 26 deletions(-)

-- 
2.17.1

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


[edk2] [PATCH v2 0/5] ArmPlatformPkg, ArmVirtPkg: discover NOR flash banks from DTB

2018-11-21 Thread Ard Biesheuvel
This series fixes an issue reported by Hongbo and Philippe, where
ArmVirtQemuKernel will crash on an attempt to access flash bank #0,
which is secure-only when running QEMU with support for EL3.

So let's switch to discovering the NOR flash banks from the device tree
instead. This requires some preparatory changes in the NOR flash driver
to avoid having to invent GUIDs on the fly.

Changes since v1:
- split ArmPlatformPkg for clarity
- move DT node status check into FdtClientDxe where it belongs
- use correct UINT32* type for DT property values, and be pedantic about
  their potential misalignment when casting to UINT64*
- add patch to remove the 'Guid' member from NOR_FLASH_DESCRIPTION
- add some acks

Ard Biesheuvel (5):
  ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change
  ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash
banks
  ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account
  ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically
  ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from
struct

 .../Drivers/NorFlashDxe/NorFlashDxe.c | 15 ++--
 .../Drivers/NorFlashDxe/NorFlashDxe.h |  3 +
 .../Include/Library/NorFlashPlatformLib.h |  1 -
 ArmVirtPkg/FdtClientDxe/FdtClientDxe.c| 38 +++--
 .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 78 ++-
 .../NorFlashQemuLib/NorFlashQemuLib.inf   | 12 +++
 6 files changed, 114 insertions(+), 33 deletions(-)

-- 
2.17.1

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


[edk2] [PATCH v2 5/5] ArmPlatformPkg/NorFlashPlatformLib: remove unused Guid member from struct

2018-11-21 Thread Ard Biesheuvel
We no longer use per-instance GUIDs to identify NOR flash banks so
there is no longer a need to define them. Drop the Guid member from
the NOR_FLASH_DESCRIPTION type.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
This patch should not be merged before users in edk2-platforms have been
updated.

 ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h 
b/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
index e9e1c060787d..e99a217c3a51 100644
--- a/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
+++ b/ArmPlatformPkg/Include/Library/NorFlashPlatformLib.h
@@ -20,7 +20,6 @@ typedef struct {
   UINTN   RegionBaseAddress;// Start address of one single region
   UINTN   Size;
   UINTN   BlockSize;
-  EFI_GUIDGuid;
 } NOR_FLASH_DESCRIPTION;
 
 EFI_STATUS
-- 
2.17.1

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


[edk2] [PATCH v2 4/5] ArmVirtPkg/NorFlashQemuLib: discover NOR flash banks dynamically

2018-11-21 Thread Ard Biesheuvel
NorFlashQemuLib is one of the last remaining drivers in ArmVirtPkg
that are not based on the device tree received from QEMU.

For ArmVirtQemu, this does not really matter, given that the NOR
flash banks are always the same: the PEI code is linked to execute
in place from flash bank #0, and the fixed varstore PCDs refer to
flash bank #1 directly.

However, ArmVirtQemuKernel can execute at any offset, permitting it
to be used as an intermediary loader when running QEMU with secure
world emulation enabled, in which case NOR flash bank #0 is secure
only and contains the secure world firmware. In this case,
NorFlashQemuLib should not expose the first flash bank at all.

To prevent introducing too much internal knowledge about which flash
bank is accessible under which circumstances, let's switch to using
the DTB to decide which flash banks to expose to the NOR flash driver.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c   | 78 
++--
 ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf | 12 +++
 2 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c 
b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
index e3bbae5b06c5..2678f57eaaad 100644
--- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
+++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
@@ -1,6 +1,6 @@
 /** @file
 
- Copyright (c) 2014, Linaro Ltd. All rights reserved.
+ Copyright (c) 2014-2018, Linaro Ltd. All rights reserved.
 
  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD 
License
@@ -12,13 +12,16 @@
 
  **/
 
+#include 
+#include 
 #include 
+#include 
+
+#include 
 
 #define QEMU_NOR_BLOCK_SIZESIZE_256KB
-#define QEMU_NOR0_BASE 0x0
-#define QEMU_NOR0_SIZE SIZE_64MB
-#define QEMU_NOR1_BASE 0x0400
-#define QEMU_NOR1_SIZE SIZE_64MB
+
+#define MAX_FLASH_BANKS4
 
 EFI_STATUS
 NorFlashPlatformInitialization (
@@ -28,21 +31,7 @@ NorFlashPlatformInitialization (
   return EFI_SUCCESS;
 }
 
-NOR_FLASH_DESCRIPTION mNorFlashDevices[] = {
-  {
-QEMU_NOR0_BASE,
-QEMU_NOR0_BASE,
-QEMU_NOR0_SIZE,
-QEMU_NOR_BLOCK_SIZE,
-{0xF9B94AE2, 0x8BA6, 0x409B, {0x9D, 0x56, 0xB9, 0xB4, 0x17, 0xF5, 0x3C, 
0xB3}}
-  }, {
-QEMU_NOR1_BASE,
-QEMU_NOR1_BASE,
-QEMU_NOR1_SIZE,
-QEMU_NOR_BLOCK_SIZE,
-{0x8047DB4B, 0x7E9C, 0x4C0C, {0x8E, 0xBC, 0xDF, 0xBB, 0xAA, 0xCA, 0xCE, 
0x8F}}
-  }
-};
+NOR_FLASH_DESCRIPTION mNorFlashDevices[MAX_FLASH_BANKS];
 
 EFI_STATUS
 NorFlashPlatformGetDevices (
@@ -50,7 +39,54 @@ NorFlashPlatformGetDevices (
   OUT UINT32  *Count
   )
 {
+  FDT_CLIENT_PROTOCOL *FdtClient;
+  INT32   Node;
+  EFI_STATUS  Status;
+  EFI_STATUS  FindNodeStatus;
+  CONST UINT32*Reg;
+  UINT32  PropSize;
+  UINT32  Num;
+  UINT64  Base;
+  UINT64  Size;
+
+  Status = gBS->LocateProtocol (, NULL,
+  (VOID **));
+  ASSERT_EFI_ERROR (Status);
+
+  Num = 0;
+  for (FindNodeStatus = FdtClient->FindCompatibleNode (FdtClient,
+ "cfi-flash", );
+   !EFI_ERROR (FindNodeStatus) && Num < MAX_FLASH_BANKS;
+   FindNodeStatus = FdtClient->FindNextCompatibleNode (FdtClient,
+ "cfi-flash", Node, )) {
+
+Status = FdtClient->GetNodeProperty (FdtClient, Node, "reg",
+  (CONST VOID **), );
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: GetNodeProperty () failed (Status == %r)\n",
+__FUNCTION__, Status));
+  continue;
+}
+
+ASSERT ((PropSize % (4 * sizeof (UINT32))) == 0);
+
+while (PropSize >= (4 * sizeof (UINT32)) && Num < MAX_FLASH_BANKS) {
+  Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));
+  Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
+  Reg += 4;
+
+  mNorFlashDevices[Num].DeviceBaseAddress = (UINTN)Base;
+  mNorFlashDevices[Num].RegionBaseAddress = (UINTN)Base;
+  mNorFlashDevices[Num].Size  = (UINTN)Size;
+  mNorFlashDevices[Num].BlockSize = QEMU_NOR_BLOCK_SIZE;
+  Num++;
+
+  PropSize -= 4 * sizeof (UINT32);
+}
+  }
+
   *NorFlashDescriptions = mNorFlashDevices;
-  *Count = ARRAY_SIZE (mNorFlashDevices);
+  *Count = Num;
+
   return EFI_SUCCESS;
 }
diff --git a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf 
b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
index 126d1671f544..d86ff36dbd58 100644
--- a/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
+++ b/ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
@@ -28,3 +28,15 @@
 [Packages]
   MdePkg/MdePkg.dec
   ArmPlatformPkg/ArmPlatformPkg.dec
+  

[edk2] [PATCH v2 2/5] ArmPlatformPkg/NorFlashDxe: use one GUID plus index to identify flash banks

2018-11-21 Thread Ard Biesheuvel
Currently, each flash bank controlled by ArmPlatformPkg/NorFlashDxe
has its own VendorHw GUID, and instances of NorFlashPlatformLib
describe each bank to the driver, along with the GUID for each.

This works ok for bare metal platforms, but it would be useful for
virtual platforms if we could obtain this information from a
device tree, which would require us to invent GUIDs on the fly,
given that the 'cfi-flash' binding does not include a GUID.

So instead, let's switch to a single GUID for all flash banks,
and update the driver's device path handling to include an index
to identify each bank uniquely.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
Reviewed-by: Laszlo Ersek 
Reviewed-by: Leif Lindholm 
---
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 6 +++---
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c 
b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index 53753a4721ac..af40a4c88412 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -89,6 +89,7 @@ NOR_FLASH_INSTANCE  mNorFlashInstanceTemplate = {
   },
   { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }, // GUID 
... NEED TO BE FILLED
 },
+0, // Index
 {
   END_DEVICE_PATH_TYPE,
   END_ENTIRE_DEVICE_PATH_SUBTYPE,
@@ -105,7 +106,6 @@ NorFlashCreateInstance (
   IN UINT32 Index,
   IN UINT32 BlockSize,
   IN BOOLEANSupportFvb,
-  IN CONST GUID *NorFlashGuid,
   OUT NOR_FLASH_INSTANCE**  NorFlashInstance
   )
 {
@@ -128,7 +128,8 @@ NorFlashCreateInstance (
   Instance->Media.BlockSize = BlockSize;
   Instance->Media.LastBlock = (NorFlashSize / BlockSize)-1;
 
-  CopyGuid (>DevicePath.Vendor.Guid, NorFlashGuid);
+  CopyGuid (>DevicePath.Vendor.Guid, );
+  Instance->DevicePath.Index = (UINT8)Index;
 
   Instance->ShadowBuffer = AllocateRuntimePool (BlockSize);;
   if (Instance->ShadowBuffer == NULL) {
@@ -1314,7 +1315,6 @@ NorFlashInitialise (
   Index,
   NorFlashDevices[Index].BlockSize,
   ContainVariableStorage,
-  [Index].Guid,
   [Index]
 );
 if (EFI_ERROR(Status)) {
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h 
b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
index 910681fd4412..8886aa43d9f3 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
@@ -125,6 +125,7 @@ typedef struct _NOR_FLASH_INSTANCE
NOR_FLASH_INSTANCE;
 #pragma pack(1)
 typedef struct {
   VENDOR_DEVICE_PATH  Vendor;
+  UINT8   Index;
   EFI_DEVICE_PATH_PROTOCOLEnd;
 } NOR_FLASH_DEVICE_PATH;
 #pragma pack()
-- 
2.17.1

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


[edk2] [PATCH v2 1/5] ArmPlatformPkg/NorFlashDxe: prepare for devicepath format change

2018-11-21 Thread Ard Biesheuvel
A subsequent patch will change the layout of devicepath nodes
produced by this driver. In preparation, make some tweaks to
the code to use a packed struct for the devicepath and to pass
the device index to NorFlashCreateInstance(). These are cosmetic
changes only, the resulting binaries should be identical.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
Reviewed-by: Laszlo Ersek 
---
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c | 9 ++---
 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h | 2 ++
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c 
b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
index 46e815beb343..53753a4721ac 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.c
@@ -82,7 +82,10 @@ NOR_FLASH_INSTANCE  mNorFlashInstanceTemplate = {
   {
 HARDWARE_DEVICE_PATH,
 HW_VENDOR_DP,
-{ (UINT8)sizeof(VENDOR_DEVICE_PATH), 
(UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8) }
+{
+  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End)),
+  (UINT8)(OFFSET_OF (NOR_FLASH_DEVICE_PATH, End) >> 8)
+}
   },
   { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }, // GUID 
... NEED TO BE FILLED
 },
@@ -99,7 +102,7 @@ NorFlashCreateInstance (
   IN UINTN  NorFlashDeviceBase,
   IN UINTN  NorFlashRegionBase,
   IN UINTN  NorFlashSize,
-  IN UINT32 MediaId,
+  IN UINT32 Index,
   IN UINT32 BlockSize,
   IN BOOLEANSupportFvb,
   IN CONST GUID *NorFlashGuid,
@@ -121,7 +124,7 @@ NorFlashCreateInstance (
   Instance->Size = NorFlashSize;
 
   Instance->BlockIoProtocol.Media = >Media;
-  Instance->Media.MediaId = MediaId;
+  Instance->Media.MediaId = Index;
   Instance->Media.BlockSize = BlockSize;
   Instance->Media.LastBlock = (NorFlashSize / BlockSize)-1;
 
diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h 
b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
index 5c07694fbfaa..910681fd4412 100644
--- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
+++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.h
@@ -122,10 +122,12 @@
 
 typedef struct _NOR_FLASH_INSTANCENOR_FLASH_INSTANCE;
 
+#pragma pack(1)
 typedef struct {
   VENDOR_DEVICE_PATH  Vendor;
   EFI_DEVICE_PATH_PROTOCOLEnd;
 } NOR_FLASH_DEVICE_PATH;
+#pragma pack()
 
 struct _NOR_FLASH_INSTANCE {
   UINT32  Signature;
-- 
2.17.1

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


[edk2] [PATCH v2 3/5] ArmVirtPkg/FdtClientDxe: take DT node 'status' properties into account

2018-11-21 Thread Ard Biesheuvel
DT has a [pseudo-]standardized 'status' property that can be set on
any node, and which signifies that a node should be treated as
absent unless it is set to 'ok' or 'okay'. So take this into account
when iterating over nodes.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
---
 ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 38 +---
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c 
b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
index fb6e0aeb9215..5bfde381ecd0 100644
--- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
+++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
@@ -78,6 +78,33 @@ SetNodeProperty (
   return EFI_SUCCESS;
 }
 
+STATIC
+BOOLEAN
+IsNodeEnabled (
+  INT32   Node
+  )
+{
+  CONST CHAR8   *NodeStatus;
+  INT32 Len;
+
+  //
+  // A missing status property implies 'ok' so ignore any errors that
+  // may occur here. If the status property is present, check whether
+  // it is set to 'ok' or 'okay', anything else is treated as 'disabled'.
+  //
+  NodeStatus = fdt_getprop (mDeviceTreeBase, Node, "status", );
+  if (NodeStatus == NULL) {
+return TRUE;
+  }
+  if (Len >= 5 && AsciiStrCmp (NodeStatus, "okay") == 0) {
+return TRUE;
+  }
+  if (Len >= 3 && AsciiStrCmp (NodeStatus, "ok") == 0) {
+return TRUE;
+  }
+  return FALSE;
+}
+
 STATIC
 EFI_STATUS
 EFIAPI
@@ -101,6 +128,10 @@ FindNextCompatibleNode (
   break;
 }
 
+if (!IsNodeEnabled (Next)) {
+  continue;
+}
+
 Type = fdt_getprop (mDeviceTreeBase, Next, "compatible", );
 if (Type == NULL) {
   continue;
@@ -210,7 +241,6 @@ FindNextMemoryNodeReg (
 {
   INT32  Prev, Next;
   CONST CHAR8*DeviceType;
-  CONST CHAR8*NodeStatus;
   INT32  Len;
   EFI_STATUS Status;
 
@@ -223,10 +253,8 @@ FindNextMemoryNodeReg (
   break;
 }
 
-NodeStatus = fdt_getprop (mDeviceTreeBase, Next, "status", );
-if (NodeStatus != NULL && AsciiStrCmp (NodeStatus, "okay") != 0) {
-  DEBUG ((DEBUG_WARN, "%a: ignoring memory node with status \"%a\"\n",
-__FUNCTION__, NodeStatus));
+if (!IsNodeEnabled (Next)) {
+  DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", 
__FUNCTION__));
   continue;
 }
 
-- 
2.17.1

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


Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-21 Thread Fu, Siyuan
Hi, Laszlo

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, November 21, 2018 6:47 PM
> To: Fu, Siyuan 
> Cc: edk2-devel@lists.01.org; Ye, Ting ; Wu, Jiaxin
> 
> Subject: Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment
> files to NetworkPkg.
> 
> On 11/21/18 06:28, Fu Siyuan wrote:
> > The "Network.dsc.inc" and "Network.fdf.inc" are added for platform owner
> to
> > easily enable/disable network stack support on their platform, by adding
> >   !include NetworkPkg/Network.dsc.inc
> > and
> >   !include NetworkPkg/Network.fdf.inc
> > to their platform DSC/FDF files.
> >
> > A set of flags can be changed before the include line or in build
> command
> > line ("-D FLAG=VALUE") to enable or disable related feature set.
> >
> > The default value of these flags are:
> >   DEFINE NETWORK_ENABLE = TRUE
> >   DEFINE NETWORK_SNP_ENABLE = TRUE
> >   DEFINE NETWORK_IP4_ENABLE = TRUE
> >   DEFINE NETWORK_IP6_ENABLE = TRUE
> >   DEFINE NETWORK_TLS_ENABLE = TRUE
> >   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
> >   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
> >   DEFINE NETWORK_IPSEC_ENABLE = TRUE
> >   DEFINE NETWORK_ISCSI_ENABLE = TRUE
> >   DEFINE NETWORK_VLAN_ENABLE  = TRUE
> 
> (1) This table is inconsistent with regard to alignment. In some cases,
> there are attempts to align the equal signs, and the assigned values
> (such as NETWORK_ENABLE and NETWORK_ALLOW_HTTP_CONNECTIONS), however, as
> a whole, the table is inconsistent. Please align all the equal signs and
> the assigned values to the longest macro name, namely
> NETWORK_ALLOW_HTTP_CONNECTIONS.

Agree, I Will fix this in v2 patch.

> 
> > Detail description of each flag is in Network.dsc.inc file.
> >
> > Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1293
> >
> > Cc: Jiaxin Wu 
> > Cc: Ting Ye 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Fu Siyuan 
> > ---
> >  NetworkPkg/Network.dsc.inc | 203 
> >  NetworkPkg/Network.fdf.inc |  81 
> >  2 files changed, 284 insertions(+)
> >
> > diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc
> > new file mode 100644
> > index ..50cf93ba816a
> > --- /dev/null
> > +++ b/NetworkPkg/Network.dsc.inc
> > @@ -0,0 +1,203 @@
> > +## @file
> > +# Network DSC include file for All Architectures.
> > +#
> > +# This file can be included to a platform DSC by using "!include
> NetworkPkg/Network.dsc.inc"
> > +# to add edk2 network stack drivers.
> > +# Below flags can be changed on the command line to enable or disable
> related feature
> > +# support.
> > +#   -D FLAG=VALUE
> > +# The default value of these flags are:
> > +#   DEFINE NETWORK_ENABLE = TRUE
> > +#   DEFINE NETWORK_SNP_ENABLE = TRUE
> > +#   DEFINE NETWORK_IP4_ENABLE = TRUE
> > +#   DEFINE NETWORK_IP6_ENABLE = TRUE
> > +#   DEFINE NETWORK_TLS_ENABLE = TRUE
> > +#   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
> > +#   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
> > +#   DEFINE NETWORK_IPSEC_ENABLE = TRUE
> > +#   DEFINE NETWORK_ISCSI_ENABLE = TRUE
> > +#   DEFINE NETWORK_VLAN_ENABLE  = TRUE
> 
> (2) Same as (1).
> 
> > +#
> > +# Copyright (c) 2018, Intel Corporation. All rights reserved.
> > +#
> > +#This program and the accompanying materials
> > +#are licensed and made available under the terms and conditions of
> the BSD License
> > +#which accompanies this distribution. The full text of the license
> may be found at
> > +#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]
> > +!ifndef NETWORK_ENABLE
> > +  #
> > +  # This flag is to enable or disable the whole network stack.
> > +  # These can be changed on the command line.
> > +  # -D FLAG=VALUE
> 
> (3) I suggest dropping the statement "These can be changed on the
> command line".
> 
> I also suggest dropping the generic "-D FLAG=VALUE" line.
> 
> Both of those apply to all settings, and they are well explained in the
> general description near the top.

You are correct. These lines were added before I wrote the file header, they 
are redundant
now since the file header already describe it. Will remove it in V2 patch.

> 
> > +  #
> > +  DEFINE NETWORK_ENABLE = TRUE
> > +!endif
> > +
> > +!ifndef NETWORK_SNP_ENABLE
> > +  #
> > +  # This flag is to include the common SNP driver or not.
> > +  # These can be changed on the command line.
> > +  # -D FLAG=VALUE
> > +  #
> > +  DEFINE NETWORK_SNP_ENABLE = TRUE
> > +!endif
> > +
> > +!ifndef NETWORK_IP4_ENABLE
> > +  #
> > +  # This flag is to enable or disable IPv4 network stack.
> > +  # These can be changed on the command line.
> > +  # -D FLAG=VALUE
> > +  #
> > +  DEFINE NETWORK_IP4_ENABLE = TRUE
> > +!endif
> > +
> > +!ifndef NETWORK_IP6_ENABLE
> > +  #
> > 

Re: [edk2] [PATCH 3/6] ArmVirtPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Laszlo Ersek
some light comments for now:

On 11/21/18 06:28, Fu Siyuan wrote:
> This patch updates the platform DSC/FDF files to use the include fragment
> files provided by NetworkPkg.
> The feature enabling flags in [Defines] section have been updated to use
> the NetworkPkg's terms, and the value has been overridden with the original
> default value on this platform.
> 
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Cc: Julien Grall 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Fu Siyuan 
> ---
>  ArmVirtPkg/ArmVirt.dsc.inc   | 12 --
>  ArmVirtPkg/ArmVirtQemu.dsc   | 44 
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 28 +
>  ArmVirtPkg/ArmVirtQemuKernel.dsc | 38 +++--
>  4 files changed, 14 insertions(+), 108 deletions(-)
> 
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 70a0ac4d786c..24a064198b5e 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -75,18 +75,6 @@ [LibraryClasses.common]
># use the accelerated BaseMemoryLibOptDxe by default, overrides for 
> SEC/PEI below
>BaseMemoryLib|MdePkg/Library/BaseMemoryLibOptDxe/BaseMemoryLibOptDxe.inf
>  
> -  # Networking Requirements
> -  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
> -  DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
> -  UdpIoLib|MdeModulePkg/Library/DxeUdpIoLib/DxeUdpIoLib.inf
> -  IpIoLib|MdeModulePkg/Library/DxeIpIoLib/DxeIpIoLib.inf
> -!if $(NETWORK_IP6_ENABLE) == TRUE
> -  TcpIoLib|MdeModulePkg/Library/DxeTcpIoLib/DxeTcpIoLib.inf
> -!endif
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
> -!endif
> -
>#
># It is not possible to prevent the ARM compiler from inserting calls to 
> intrinsic functions.
># This library provides the instrinsic functions such a compiler may 
> generate calls to.
> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index 885c6b14b844..5a1b6b0f0519 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -35,9 +35,14 @@ [Defines]
>#
>DEFINE SECURE_BOOT_ENABLE  = FALSE
>DEFINE NETWORK_IP6_ENABLE  = FALSE
> -  DEFINE HTTP_BOOT_ENABLE= FALSE
> -
> +  DEFINE NETWORK_HTTP_BOOT_ENABLE= FALSE
> +  DEFINE NETWORK_SNP_ENABLE  = FALSE
> +  DEFINE NETWORK_TLS_ENABLE  = FALSE
> +  DEFINE NETWORK_IPSEC_ENABLE= FALSE
> +  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS  = TRUE
> +  

(1) Please keep these nicely aligned (I should have mentioned the same
for OvmfPkg too).

>  !include ArmVirtPkg/ArmVirt.dsc.inc
> +!include NetworkPkg/Network.dsc.inc
>  
>  [LibraryClasses.common]
>ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
> @@ -123,10 +128,6 @@ [PcdsFixedAtBuild.common]
>#
>gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0
>  
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections|TRUE
> -!endif
> -
># System Memory Base -- fixed at 0x4000_
>gArmTokenSpaceGuid.PcdSystemMemoryBase|0x4000
>  
> @@ -335,37 +336,6 @@ [Components.common]
>
> NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf
>}
>  
> -  #
> -  # Networking stack
> -  #
> -  MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> -  MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
> -  MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> -  MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Dxe.inf
> -  MdeModulePkg/Universal/Network/MnpDxe/MnpDxe.inf
> -  MdeModulePkg/Universal/Network/VlanConfigDxe/VlanConfigDxe.inf
> -  MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Dxe.inf
> -  MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
> -!if $(NETWORK_IP6_ENABLE) == TRUE
> -  NetworkPkg/Ip6Dxe/Ip6Dxe.inf
> -  NetworkPkg/TcpDxe/TcpDxe.inf
> -  NetworkPkg/Udp6Dxe/Udp6Dxe.inf
> -  NetworkPkg/Dhcp6Dxe/Dhcp6Dxe.inf
> -  NetworkPkg/Mtftp6Dxe/Mtftp6Dxe.inf
> -  NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
> -  NetworkPkg/IScsiDxe/IScsiDxe.inf
> -!else
> -  MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dxe.inf
> -  MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
> -  MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
> -!endif
> -!if $(HTTP_BOOT_ENABLE) == TRUE
> -  NetworkPkg/DnsDxe/DnsDxe.inf
> -  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
> -  NetworkPkg/HttpDxe/HttpDxe.inf
> -  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
> -!endif
> -
>#
># SCSI Bus and Disk Driver
>#
> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc 
> b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index a6390bd4b841..560651e49e0b 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -118,33 +118,7 @@ [FV.FvMain]
>#
># Networking stack
>#
> -  INF MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> -  INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
> -  INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> -  INF 

Re: [edk2] [PATCH 5/6] OvmfPkg: Update DSC/FDF to use NetworkPkg's include fragment file.

2018-11-21 Thread Laszlo Ersek
As I said, I wouldn't like to review this patch in detail right now.
Just some light comments:

On 11/21/18 06:28, Fu Siyuan wrote:
> This patch updates the platform DSC/FDF files to use the include fragment
> files provided by NetworkPkg.
> The feature enabling flags in [Defines] section have been updated to use
> the NetworkPkg's terms, and the value has been overridden with the original
> default value on this platform.
> 
> Cc: Jordan Justen 
> Cc: Laszlo Ersek 
> Cc: Ard Biesheuvel 
> Cc: Anthony Perard 
> Cc: Julien Grall 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Fu Siyuan 
> ---
>  OvmfPkg/OvmfPkgIa32.dsc| 52 ---
>  OvmfPkg/OvmfPkgIa32.fdf| 25 +
>  OvmfPkg/OvmfPkgIa32X64.dsc | 53 
>  OvmfPkg/OvmfPkgIa32X64.fdf | 25 +
>  OvmfPkg/OvmfPkgX64.dsc | 52 ---
>  OvmfPkg/OvmfPkgX64.fdf | 25 +
>  6 files changed, 36 insertions(+), 196 deletions(-)
> 
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index eccf34d3d1cb..5d6ea3e67001 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -35,12 +35,21 @@ [Defines]
># -D FLAG=VALUE
>#
>DEFINE SECURE_BOOT_ENABLE  = FALSE
> -  DEFINE NETWORK_IP6_ENABLE  = FALSE
> -  DEFINE HTTP_BOOT_ENABLE= FALSE
>DEFINE SMM_REQUIRE = FALSE
>DEFINE TLS_ENABLE  = FALSE
>DEFINE TPM2_ENABLE = FALSE
>  
> +  DEFINE NETWORK_IP6_ENABLE = FALSE
> +  #
> +  # TLS_ENABLE flag is used to control platform specific configuration for 
> TLS support.
> +  # NETWORK_TLS_ENABLE should always be set to FALSE.
> +  #
> +  DEFINE NETWORK_TLS_ENABLE = FALSE

(1) Ah, OK, I understand, so basically the suggestion is that OVMF not
make use of NETWORK_TLS_ENABLE, but continue using its own TLS_ENABLE
solution.

Hmmm. I wonder if that's helpful at all. To me it seems to increase the
confusion rather than decrease it.

I guess it can work, but then we should rename TLS_ENABLE to something
better, such as "PLATFORM_TLS_ENABLE". And this comment should be more
detailed *why* we do that. (We do that because we configure the CA
certificates and the cipher suites with a null class lib instance hooked
into TlsAuthConfigDxe, which downloads the necessary data from QEMU via
fw_cfg.)

> +  DEFINE NETWORK_HTTP_BOOT_ENABLE   = FALSE
> +  DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE

(2) This (i.e. NETWORK_ALLOW_HTTP_CONNECTIONS=FALSE) is wrong. We set
PcdAllowHttpConnections to TRUE on purpose. See commit 4b2fb7986d57
("OvmfPkg: Allow HTTP connections if HTTP Boot enabled", 2017-01-23).

More after you post v2, I think.

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


Re: [edk2] [PATCH v2] ArmPkg/ArmSmcPsciResetSystemLib: add missing call to ExitBootServices()

2018-11-21 Thread Ard Biesheuvel
On Tue, 20 Nov 2018 at 17:17, Leif Lindholm  wrote:
>
> On Tue, Nov 20, 2018 at 04:44:33PM +0100, Ard Biesheuvel wrote:
> > Our poor man's implementation of EnterS3WithImmediateWake () currently
> > sets a high TPL level to disable interrupts, and simply calls the
> > PEI entrypoint again after disabling the MMU.
> >
> > Unfortunately, this is not sufficient: DMA capable devices such as
> > network controllers or USB controllers may still be enabled and
> > writing to memory, e.g., in response to incoming network packets.
> >
> > So instead, do the full ExitBootServices() dance: allocate space and
> > get the memory map, call ExitBootServices(), and in case it fails, get
> > the memory map again and call ExitBootServices() again. This ensures
> > that all cleanup related to DMA capable devices is performed before
> > doing the warm reset.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ard Biesheuvel 
> > ---
> > v2: - add asm routines to ensure that we don't access memory after
> >   disabling the MMU and caches
>
> Fun times.
> Reviewed-by: Leif Lindholm 
>

Thanks

Pushed as 6556224e1f262d1d3d3aecab6e86b14edefe95b7

> > - set MemMap to NULL
> >
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S  | 30 
> > +++
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm| 35 
> > 
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S  | 29 
> > ++
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.asm| 34 
> > 
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.c   | 57 
> > +---
> >  ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf |  8 
> > +++
> >  6 files changed, 187 insertions(+), 6 deletions(-)
> >
> > diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S 
> > b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
> > new file mode 100644
> > index ..1edca941cb8f
> > --- /dev/null
> > +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.S
> > @@ -0,0 +1,30 @@
> > +/** @file
> > +  ResetSystemLib implementation using PSCI calls
> > +
> > +  Copyright (c) 2018, Linaro Ltd. 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 
> > +
> > +ASM_FUNC(DisableMmuAndReenterPei)
> > +  stp   x29, x30, [sp, #-16]!
> > +  mov   x29, sp
> > +
> > +  blArmDisableMmu
> > +
> > +  // no memory accesses after MMU and caches have been disabled
> > +
> > +  MOV64 (x0, FixedPcdGet64 (PcdFvBaseAddress))
> > +  blr   x0
> > +
> > +  // never returns
> > +  nop
> > diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm 
> > b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
> > new file mode 100644
> > index ..b3dca150c150
> > --- /dev/null
> > +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/AArch64/Reset.asm
> > @@ -0,0 +1,35 @@
> > +/** @file
> > +  ResetSystemLib implementation using PSCI calls
> > +
> > +  Copyright (c) 2018, Linaro Ltd. 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.
> > +
> > +**/
> > +
> > +  AREA Reset, CODE, READONLY
> > +
> > +  EXPORT DisableMmuAndReenterPei
> > +  IMPORT ArmDisableMmu
> > +
> > +DisableMmuAndReenterPei
> > +  stp   x29, x30, [sp, #-16]!
> > +  mov   x29, sp
> > +
> > +  blArmDisableMmu
> > +
> > +  ; no memory accesses after MMU and caches have been disabled
> > +
> > +  movl  x0, FixedPcdGet64 (PcdFvBaseAddress)
> > +  blr   x0
> > +
> > +  ; never returns
> > +  nop
> > +
> > +  END
> > diff --git a/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S 
> > b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
> > new file mode 100644
> > index ..b6fe2bd82baa
> > --- /dev/null
> > +++ b/ArmPkg/Library/ArmSmcPsciResetSystemLib/Arm/Reset.S
> > @@ -0,0 +1,29 @@
> > +/** @file
> > +  ResetSystemLib implementation using PSCI calls
> > +
> > +  Copyright (c) 2018, Linaro Ltd. All rights reserved.
> > +
> > +  This program and the accompanying materials
> > +  are licensed and made 

Re: [edk2] [RFC] Proposal to remove DuetPkg

2018-11-21 Thread Ni, Ruiyu

On 11/21/2018 7:21 AM, Kinney, Michael D wrote:

Ray,

One additional note.  There are some tools in
BaseTools that are only used by Duet.  We should
remove those tools too.


Good points. Thanks for the reminding.


Mike



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


Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-21 Thread Laszlo Ersek
On 11/21/18 11:46, Laszlo Ersek wrote:
> On 11/21/18 06:28, Fu Siyuan wrote:
>> The "Network.dsc.inc" and "Network.fdf.inc" are added for platform owner to
>> easily enable/disable network stack support on their platform, by adding
>>   !include NetworkPkg/Network.dsc.inc
>> and
>>   !include NetworkPkg/Network.fdf.inc
>> to their platform DSC/FDF files.
>>
>> A set of flags can be changed before the include line or in build command
>> line ("-D FLAG=VALUE") to enable or disable related feature set.
>>
>> The default value of these flags are:
>>   DEFINE NETWORK_ENABLE = TRUE
>>   DEFINE NETWORK_SNP_ENABLE = TRUE
>>   DEFINE NETWORK_IP4_ENABLE = TRUE
>>   DEFINE NETWORK_IP6_ENABLE = TRUE
>>   DEFINE NETWORK_TLS_ENABLE = TRUE
>>   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
>>   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
>>   DEFINE NETWORK_IPSEC_ENABLE = TRUE
>>   DEFINE NETWORK_ISCSI_ENABLE = TRUE
>>   DEFINE NETWORK_VLAN_ENABLE  = TRUE
> 
> [...]

I'd like to review the ArmVirtPkg and OvmfPkg patches in detail once the
NetworkPkg patch stabilizes.

In addition, I have some higher-level comments. This patch series
effectively renames a few preexistent build flags, such as
"HTTP_BOOT_ENABLE" to "NETWORK_HTTP_BOOT_ENABLE", "TLS_ENABLE" to
"NETWORK_TLS_ENABLE", and so on.

- Please grep the edk2 source tree for the original (disappearing)
flags, and update them as necessary, not just in DSC/FDF files, but also
in documentation. For example, "HTTP_BOOT_ENABLE" and "TLS_ENABLE" are
mentioned in "OvmfPkg/README".

- Please also grep the edk2 Wiki for the same (clone it locally and then
run "git grep"). For example, the
"Testing-SMM-with-QEMU,-KVM-and-libvirt.md" article also refers to
HTTP_BOOT_ENABLE and TLS_ENABLE.

- It is likely a good idea to list this change (that is,
), under
.
I see that #1278 is listed already, but the build flag renaming is an
incompatible change, and it deserves a mention.

Thanks!
Laszlo

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


Re: [edk2] [PATCH 1/6] NetworkPkg: Add DSC/FDF include segment files to NetworkPkg.

2018-11-21 Thread Laszlo Ersek
On 11/21/18 06:28, Fu Siyuan wrote:
> The "Network.dsc.inc" and "Network.fdf.inc" are added for platform owner to
> easily enable/disable network stack support on their platform, by adding
>   !include NetworkPkg/Network.dsc.inc
> and
>   !include NetworkPkg/Network.fdf.inc
> to their platform DSC/FDF files.
> 
> A set of flags can be changed before the include line or in build command
> line ("-D FLAG=VALUE") to enable or disable related feature set.
> 
> The default value of these flags are:
>   DEFINE NETWORK_ENABLE = TRUE
>   DEFINE NETWORK_SNP_ENABLE = TRUE
>   DEFINE NETWORK_IP4_ENABLE = TRUE
>   DEFINE NETWORK_IP6_ENABLE = TRUE
>   DEFINE NETWORK_TLS_ENABLE = TRUE
>   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
>   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
>   DEFINE NETWORK_IPSEC_ENABLE = TRUE
>   DEFINE NETWORK_ISCSI_ENABLE = TRUE
>   DEFINE NETWORK_VLAN_ENABLE  = TRUE

(1) This table is inconsistent with regard to alignment. In some cases,
there are attempts to align the equal signs, and the assigned values
(such as NETWORK_ENABLE and NETWORK_ALLOW_HTTP_CONNECTIONS), however, as
a whole, the table is inconsistent. Please align all the equal signs and
the assigned values to the longest macro name, namely
NETWORK_ALLOW_HTTP_CONNECTIONS.

> Detail description of each flag is in Network.dsc.inc file.
> 
> Related BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1293
> 
> Cc: Jiaxin Wu 
> Cc: Ting Ye 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Fu Siyuan 
> ---
>  NetworkPkg/Network.dsc.inc | 203 
>  NetworkPkg/Network.fdf.inc |  81 
>  2 files changed, 284 insertions(+)
> 
> diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc
> new file mode 100644
> index ..50cf93ba816a
> --- /dev/null
> +++ b/NetworkPkg/Network.dsc.inc
> @@ -0,0 +1,203 @@
> +## @file
> +# Network DSC include file for All Architectures.
> +#
> +# This file can be included to a platform DSC by using "!include 
> NetworkPkg/Network.dsc.inc" 
> +# to add edk2 network stack drivers.
> +# Below flags can be changed on the command line to enable or disable 
> related feature
> +# support.
> +#   -D FLAG=VALUE
> +# The default value of these flags are:
> +#   DEFINE NETWORK_ENABLE = TRUE
> +#   DEFINE NETWORK_SNP_ENABLE = TRUE
> +#   DEFINE NETWORK_IP4_ENABLE = TRUE
> +#   DEFINE NETWORK_IP6_ENABLE = TRUE
> +#   DEFINE NETWORK_TLS_ENABLE = TRUE
> +#   DEFINE NETWORK_HTTP_BOOT_ENABLE   = TRUE
> +#   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = FALSE
> +#   DEFINE NETWORK_IPSEC_ENABLE = TRUE
> +#   DEFINE NETWORK_ISCSI_ENABLE = TRUE
> +#   DEFINE NETWORK_VLAN_ENABLE  = TRUE

(2) Same as (1).

> +#
> +# Copyright (c) 2018, Intel Corporation. All rights reserved.
> +#
> +#This program and the accompanying materials
> +#are licensed and made available under the terms and conditions of the 
> BSD License
> +#which accompanies this distribution. The full text of the license may 
> be found at
> +#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]
> +!ifndef NETWORK_ENABLE
> +  #
> +  # This flag is to enable or disable the whole network stack.  
> +  # These can be changed on the command line.
> +  # -D FLAG=VALUE

(3) I suggest dropping the statement "These can be changed on the
command line".

I also suggest dropping the generic "-D FLAG=VALUE" line.

Both of those apply to all settings, and they are well explained in the
general description near the top.

> +  #
> +  DEFINE NETWORK_ENABLE = TRUE
> +!endif
> +
> +!ifndef NETWORK_SNP_ENABLE
> +  #
> +  # This flag is to include the common SNP driver or not.
> +  # These can be changed on the command line.
> +  # -D FLAG=VALUE
> +  #
> +  DEFINE NETWORK_SNP_ENABLE = TRUE
> +!endif
> +
> +!ifndef NETWORK_IP4_ENABLE
> +  #
> +  # This flag is to enable or disable IPv4 network stack.
> +  # These can be changed on the command line.
> +  # -D FLAG=VALUE
> +  #
> +  DEFINE NETWORK_IP4_ENABLE = TRUE
> +!endif
> +
> +!ifndef NETWORK_IP6_ENABLE
> +  #
> +  # This flag is to enable or disable IPv6 network stack.
> +  # These can be changed on the command line.
> +  # -D FLAG=VALUE
> +  #
> +  DEFINE NETWORK_IP6_ENABLE = TRUE
> +!endif
> +
> +!ifndef NETWORK_TLS_ENABLE
> +  #
> +  # This flag is to enable or disable TLS feature.  
> +  # These can be changed on the command line.
> +  # -D FLAG=VALUE
> +  #
> +  # Note: TLS feature highly depends on the OpenSSL building. To enable this 
> +  #   feature, please follow the instructions found in the file 
> "Patch-HOWTO.txt" 

(4) The file is now called "OpenSSL-HOWTO.txt".

(5) Please strip all space characters directly preceding CRLFs. (There
are multiple instances in this patch.)

> +  #   located in CryptoPkg\Library\OpensslLib to enable 

Re: [edk2] [Patch] Maintainers.txt: update Vlv2*Pkg maintainers.

2018-11-21 Thread Wei, David
Reviewed-by:  David Wei david@intel.com

Thanks,
David  Wei

Intel SSG Firmware Integration and Development  

-Original Message-
From: Sun, Zailiang 
Sent: Wednesday, November 21, 2018 5:30 PM
To: edk2-devel@lists.01.org
Cc: Wei, David ; Qian, Yi ; Sun, 
Zailiang 
Subject: [Patch] Maintainers.txt: update Vlv2*Pkg maintainers.

Cc: David Wei 
Cc: Yi Qian 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zailiang Sun 
---
 Maintainers.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index f3ead7c504..9a36f0232b 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -257,12 +257,12 @@ M: Ruiyu Ni 
 R: Laszlo Ersek 
 
 Vlv2DeviceRefCodePkg
-M: David Wei 
-M: Mang Guo 
+M: Zailiang Sun 
+M: Yi Qian 
 
 Vlv2TbltDevicePkg
-M: David Wei 
-M: Mang Guo 
+M: Zailiang Sun 
+M: Yi Qian 
 
 StandaloneMmPkg
 M: Achin Gupta 
-- 
2.19.1.windows.1

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


[edk2] [Patch] Maintainers.txt: update Vlv2*Pkg maintainers.

2018-11-21 Thread Sun, Zailiang
Cc: David Wei 
Cc: Yi Qian 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Zailiang Sun 
---
 Maintainers.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index f3ead7c504..9a36f0232b 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -257,12 +257,12 @@ M: Ruiyu Ni 
 R: Laszlo Ersek 
 
 Vlv2DeviceRefCodePkg
-M: David Wei 
-M: Mang Guo 
+M: Zailiang Sun 
+M: Yi Qian 
 
 Vlv2TbltDevicePkg
-M: David Wei 
-M: Mang Guo 
+M: Zailiang Sun 
+M: Yi Qian 
 
 StandaloneMmPkg
 M: Achin Gupta 
-- 
2.19.1.windows.1

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