[edk2] [PATCH v3] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-07 Thread Ruiyu Ni
Commit b22a62be5cdc8fd19d87ec1ecfa5b28fb9be50ad
* IntelFrameworkModule/LegacyBios:Use reserved memory for legacy data
allocates reserved memory for holding legacy code/data.

But with PcdDxeNxMemoryProtectionPolicy set to certain value to
forbid execution when code is in certain type of memory, it's
possible that a platform forbids execution when code is in reserved
memory. The patch calls GCD service to allow such case otherwise
CPU exception may occur.

Code execution in BSCode area should be enabled by platform by
default.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Star Zeng 
Cc: Laszlo Ersek 
Cc: Jian Wang 
---
 .../Csm/LegacyBiosDxe/LegacyBios.c | 28 ++
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 8f14687b28..80efe40489 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -64,8 +64,9 @@ AllocateLegacyMemory (
   OUT EFI_PHYSICAL_ADDRESS  *Result
   )
 {
-  EFI_STATUSStatus;
-  EFI_PHYSICAL_ADDRESS  MemPage;
+  EFI_STATUS  Status;
+  EFI_PHYSICAL_ADDRESSMemPage;
+  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
 
   //
   // Allocate Pages of memory less <= StartPageAddress
@@ -81,12 +82,29 @@ AllocateLegacyMemory (
   // Do not ASSERT on Status error but let caller decide since some cases
   // memory is already taken but that is ok.
   //
+  if (!EFI_ERROR (Status)) {
+if (MemoryType != EfiBootServicesCode) {
+  //
+  // Make sure that the buffer can be used to store code.
+  //
+  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
+  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
+Status = gDS->SetMemorySpaceAttributes (
+MemPage,
+EFI_PAGES_TO_SIZE (Pages),
+MemDesc.Attributes & (~EFI_MEMORY_XP)
+);
+  }
+  if (EFI_ERROR (Status)) {
+gBS->FreePages (MemPage, Pages);
+  }
+}
+  }
+
   if (!EFI_ERROR (Status)) {
 *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
   }
-  //
-  // If reach here the status = EFI_SUCCESS
-  //
+
   return Status;
 }
 
-- 
2.16.1.windows.1

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


Re: [edk2] [PATCH 3/6] IntelFrameworkModulePkg IdeBusDxe: Remove redundant functions

2018-08-07 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH 3/6] IntelFrameworkModulePkg IdeBusDxe: Remove
> redundant functions
> 
> The redundant functions which are never called have been removed.
> They are AtaNonDataCommandInExt,IDEBusDriverConfigurationSetOptions,
> GetResponse,IDEBusDriverConfigurationOptionsValid and
> IDEBusDriverConfigurationForceDefaults.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  .../Bus/Pci/IdeBusDxe/Ata.c   | 119 
>  .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 261 --
>  .../Bus/Pci/IdeBusDxe/Ide.h   |  24 --
>  .../Bus/Pci/IdeBusDxe/IdeBus.h| 113 
>  4 files changed, 517 deletions(-)
> 
> diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
> b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
> index 7819773f38..2ca06806d5 100644
> --- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
> +++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
> @@ -2676,124 +2676,5 @@ AtaNonDataCommandIn (
>return EFI_SUCCESS;
>  }
> 
> -/**
> -  Send ATA Ext command into device with NON_DATA protocol
> -
> -  @param  IdeDev Standard IDE device private data structure
> -  @param  AtaCommand The ATA command to be sent
> -  @param  Device The value in Device register
> -  @param  Feature The value in Feature register
> -  @param  SectorCount The value in SectorCount register
> -  @param  LbaAddress The LBA address in 48-bit mode
> -
> -  @retval  EFI_SUCCESS Reading succeed
> -  @retval  EFI_ABORTED Command failed
> -  @retval  EFI_DEVICE_ERROR Device status error.
> -
> -**/
> -EFI_STATUS
> -AtaNonDataCommandInExt (
> -  IN  IDE_BLK_IO_DEV  *IdeDev,
> -  IN  UINT8   AtaCommand,
> -  IN  UINT8   Device,
> -  IN  UINT16  Feature,
> -  IN  UINT16  SectorCount,
> -  IN  EFI_LBA LbaAddress
> -  )
> -{
> -  EFI_STATUS  Status;
> -  UINT8   StatusRegister;
> -  UINT8   SectorCount8;
> -  UINT8   Feature8;
> -  UINT8   LbaLow;
> -  UINT8   LbaMid;
> -  UINT8   LbaHigh;
> -
> -  Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
> -  if (EFI_ERROR (Status)) {
> -return EFI_DEVICE_ERROR;
> -  }
> -
> -  //
> -  // Select device (bit4), set LBA mode(bit6) (use 0xe0 for compatibility)
> -  //
> -  IDEWritePortB (
> -IdeDev->PciIo,
> -IdeDev->IoPort->Head,
> -(UINT8) ((IdeDev->Device << 4) | 0xe0)
> -);
> -
> -  //
> -  // ATA commands for ATA device must be issued when DRDY is set
> -  //
> -  Status = DRDYReady (IdeDev, ATATIMEOUT);
> -  if (EFI_ERROR (Status)) {
> -return EFI_DEVICE_ERROR;
> -  }
> -
> -  //
> -  // Pass parameter into device register block
> -  //
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Head, Device);
> -
> -  //
> -  // Fill the feature register, which is a two-byte FIFO. Need write twice.
> -  //
> -  Feature8 = (UINT8) (Feature >> 8);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
> -
> -  Feature8 = (UINT8) Feature;
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
> -
> -  //
> -  // Fill the sector count register, which is a two-byte FIFO. Need write 
> twice.
> -  //
> -  SectorCount8 = (UINT8) (SectorCount >> 8);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount,
> SectorCount8);
> -
> -  SectorCount8 = (UINT8) SectorCount;
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount,
> SectorCount8);
> -
> -  //
> -  // Fill the start LBA registers, which are also two-byte FIFO
> -  //
> -  LbaLow  = (UINT8) RShiftU64 (LbaAddress, 24);
> -  LbaMid  = (UINT8) RShiftU64 (LbaAddress, 32);
> -  LbaHigh = (UINT8) RShiftU64 (LbaAddress, 40);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
> -
> -  LbaLow  = (UINT8) LbaAddress;
> -  LbaMid  = (UINT8) RShiftU64 (LbaAddress, 8);
> -  LbaHigh = (UINT8) RShiftU64 (LbaAddress, 16);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
> -
> -  //
> -  // Send command via Command Register
> -  //
> -  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Command,
> AtaCommand);
> -
> -  //
> -  // Wait for command completion
> -  //
> -  Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
> -  if (EFI_ERROR (Status)) {
> -return EFI_DEVICE_ERROR;
> -  }
> -
> -  StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort-
> >Reg.Status);
> -  if ((StatusRegister & 

Re: [edk2] [PATCH 2/6] IntelFrameworkModulePkg Ps2KeyboardDxe: Remove a redundant function

2018-08-07 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH 2/6] IntelFrameworkModulePkg Ps2KeyboardDxe:
> Remove a redundant function
> 
> The redundant function DisableKeyboard which is never called has been
> removed.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c| 25 ---
>  .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  | 11 
>  2 files changed, 36 deletions(-)
> 
> diff --git
> a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> index 78c4e3b391..202588191e 100644
> --- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> +++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
> @@ -1848,32 +1848,7 @@ Done:
> 
>  }
> 
> -/**
> -  Disable the keyboard interface of the 8042 controller.
> -
> -  @param ConsoleIn   The device instance
> -
> -  @return status of issuing disable command
> -
> -**/
> -EFI_STATUS
> -DisableKeyboard (
> -  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
> -  )
> -{
> -  EFI_STATUS  Status;
> 
> -  //
> -  // Disable keyboard interface
> -  //
> -  Status = KeyboardCommand (ConsoleIn,
> KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
> -  if (EFI_ERROR (Status)) {
> -KeyboardError (ConsoleIn, L"\n\r");
> -return EFI_DEVICE_ERROR;
> -  }
> -
> -  return Status;
> -}
> 
>  /**
>Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard
> Command diff --git
> a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> index 613f176401..220d17419c 100644
> --- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> +++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
> @@ -299,18 +299,7 @@ InitKeyboard (
>IN BOOLEAN ExtendedVerification
>);
> 
> -/**
> -  Disable the keyboard interface of the 8042 controller.
> -
> -  @param ConsoleIn   - the device instance
> 
> -  @return status of issuing disable command
> -
> -**/
> -EFI_STATUS
> -DisableKeyboard (
> -  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
> -  );
> 
>  /**
>Timer event handler: read a series of scancodes from 8042
> --
> 2.18.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/6] IntelFrameworkModulePkg IsaIoDxe: Remove a redundant protocol

2018-08-07 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH 1/6] IntelFrameworkModulePkg IsaIoDxe: Remove a
> redundant protocol
> 
> Remove a redundant protocol which is gEfiGenericMemTestProtocolGuid.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h  | 1 -
> IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
> b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
> index 9639d18318..6b1aaeda0e 100644
> --- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
> +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
> @@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY
> KIND, EITHER EXPRESS OR IMPLIED.
>  #include 
>  #include 
>  #include 
> -#include   #include
> 
> 
>  #include 
> diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
> b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
> index 6f02aea7af..247c66151b 100644
> --- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
> +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
> @@ -62,7 +62,6 @@
>gEfiSioProtocolGuid   ## TO_START
>gEfiPciIoProtocolGuid ## TO_START
>gEfiDevicePathProtocolGuid## TO_START
> -  gEfiGenericMemTestProtocolGuid## TO_START
> 
>  [Pcd]
> 
> gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatur
> es  ## CONSUMES
> --
> 2.18.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 5/6] IntelFrameworkModulePkg LegacyBiosDxe: Remove redundant LibraryClasses

2018-08-07 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH 5/6] IntelFrameworkModulePkg LegacyBiosDxe:
> Remove redundant LibraryClasses
> 
> The redundant LibraryClasses which are PeCoffLib and CacheMaintenanceLib
> have been removed.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf | 2 --
>  IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h | 2 -
> -
>  2 files changed, 4 deletions(-)
> 
> diff --git
> a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> index 6eb01fc185..6d156a4123 100644
> --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
> @@ -72,8 +72,6 @@
>DxeServicesTableLib
>PcdLib
>ReportStatusCodeLib
> -  PeCoffLib
> -  CacheMaintenanceLib
>DebugAgentLib
> 
>  [LibraryClasses.IA32]
> diff --git
> a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
> b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
> index 1e84772688..7779427f68 100644
> --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
> +++
> b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
> @@ -63,8 +63,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY
> KIND, EITHER EXPRESS OR IMPLIED.
>  #include 
>  #include 
>  #include  -#include  -
> #include   #include
> 
> 
>  //
> --
> 2.18.0.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 6/6] IntelFrameworkModulePkg BdsDxe: Remove redundant functions

2018-08-07 Thread Ni, Ruiyu
Reviewed-by: Ruiyu Ni 

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of shenglei
> Sent: Wednesday, August 8, 2018 11:09 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming 
> Subject: [edk2] [PATCH 6/6] IntelFrameworkModulePkg BdsDxe: Remove
> redundant functions
> 
> The redundant functions which are never called have been removed. They
> are GetProducerString,ChangeVariableDevicePath,
> EfiReallocatePool,Var_UpdateAllConsoleOption and BOpt_IsEfiApp.
> https://bugzilla.tianocore.org/show_bug.cgi?id=1063
> 
> Cc: Liming Gao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: shenglei 
> ---
>  .../Universal/BdsDxe/BootMaint/BmLib.c| 36 ---
>  .../Universal/BdsDxe/BootMaint/BootMaint.h| 53 ---
>  .../Universal/BdsDxe/BootMaint/BootOption.c   | 62 --
>  .../BdsDxe/BootMaint/ConsoleOption.c  | 64 ---
>  .../Universal/BdsDxe/BootMaint/Variable.c | 63 --
>  .../Universal/BdsDxe/FrontPage.c  | 29 -
>  .../Universal/BdsDxe/FrontPage.h  | 17 -
>  7 files changed, 324 deletions(-)
> 
> diff --git
> a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
> b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
> index d27113c015..a7ff449557 100644
> --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
> +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
> @@ -323,42 +323,6 @@ EfiDevicePathInstanceCount (
>return Count;
>  }
> 
> -/**
> -  Adjusts the size of a previously allocated buffer.
> -
> -
> -  @param OldPool - A pointer to the buffer whose size is being 
> adjusted.
> -  @param OldSize - The size of the current buffer.
> -  @param NewSize - The size of the new buffer.
> -
> -  @return   The newly allocated buffer.
> -  @retval   NULL  Allocation failed.
> -
> -**/
> -VOID *
> -EfiReallocatePool (
> -  IN VOID *OldPool,
> -  IN UINTNOldSize,
> -  IN UINTNNewSize
> -  )
> -{
> -  VOID  *NewPool;
> -
> -  NewPool = NULL;
> -  if (NewSize != 0) {
> -NewPool = AllocateZeroPool (NewSize);
> -  }
> -
> -  if (OldPool != NULL) {
> -if (NewPool != NULL) {
> -  CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
> -}
> -
> -FreePool (OldPool);
> -  }
> -
> -  return NewPool;
> -}
> 
>  /**
>Get a string from the Data Hub record based on diff --git
> a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
> b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
> index bdd22c8e75..b3b905d7ef 100644
> --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
> +++
> b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
> @@ -548,22 +548,6 @@ BOpt_IsEfiImageName (
>IN UINT16  *FileName
>);
> 
> -/**
> -
> -  Check whether current FileName point to a valid Efi Application
> -
> -  @param Dir   Pointer to current Directory
> -  @param FileName  Pointer to current File name.
> -
> -  @retval TRUE  Is a valid Efi Application
> -  @retval FALSE not a valid Efi Application
> -
> -**/
> -BOOLEAN
> -BOpt_IsEfiApp (
> -  IN EFI_FILE_HANDLE Dir,
> -  IN UINT16  *FileName
> -  );
> 
>  /**
> 
> @@ -702,18 +686,6 @@ FreeAllConsoles (
>VOID
>);
> 
> -/**
> -  Update the device path that describing a terminal device
> -  based on the new BaudRate, Data Bits, parity and Stop Bits
> -  set.
> -
> -  @param DevicePath The devicepath protocol instance wanted to be
> updated.
> -
> -**/
> -VOID
> -ChangeVariableDevicePath (
> -  IN OUT EFI_DEVICE_PATH_PROTOCOL  *DevicePath
> -  );
> 
>  /**
>Update the multi-instance device path of Terminal Device based on @@ -
> 875,15 +847,6 @@ Var_UpdateErrorOutOption (
>VOID
>);
> 
> -/**
> -  Update the device path of "ConOut", "ConIn" and "ErrOut" based on the
> new BaudRate, Data Bits,
> -  parity and stop Bits set.
> -
> -**/
> -VOID
> -Var_UpdateAllConsoleOption (
> -  VOID
> -  );
> 
>  /**
>This function update the "BootNext" EFI Variable. If there is no "BootNex"
> specified in BMM, @@ -1154,22 +1117,6 @@ EfiLibFileInfo (
>IN EFI_FILE_HANDLE  FHand
>);
> 
> -/**
> -  Adjusts the size of a previously allocated buffer.
> -
> -  @param OldPool A pointer to the buffer whose size is being 
> adjusted.
> -  @param OldSize The size of the current buffer.
> -  @param NewSize The size of the new buffer.
> -
> -  @return   The newly allocated buffer. if NULL, allocation failed.
> -
> -**/
> -VOID*
> -EfiReallocatePool (
> -  IN VOID *OldPool,
> -  IN UINTNOldSize,
> -  IN UINTNNewSize
> -  );
> 
>  /**
>Function deletes the variable specified by VarName and VarGuid.
> diff --git
> a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
> 

[edk2] [PATCH v2] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive compare

2018-08-07 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=777

Per Shell spec, the environment variable has a case-sensitive name.
But today's implementation of EfiShellSetEnv() compares the
environment variable name case insensitively, which causes variable
like "CWD" cannot be set due to "cwd" is pre-defined variable.

The patch fixes this issue.

The EfiShellGetEnv() doesn't have such issue because it will
call into ShellFindEnvVarInList() which uses StrCmp().

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Jaben Carsey 
Cc: Jim Dailey 
---
 ShellPkg/Application/Shell/ShellProtocol.c | 39 +++---
 1 file changed, 9 insertions(+), 30 deletions(-)

diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index f2ca2029e3..9e9e6dc052 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -2924,36 +2924,15 @@ EfiShellSetEnv(
   //
   // Make sure we dont 'set' a predefined read only variable
   //
-  if (gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"cwd") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"Lasterror") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"profiles") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefishellsupport") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefishellversion") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefiversion") == 0
-||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
-  gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-(CHAR16*)mNoNestingEnvVarName) == 0)
-   ){
+  if ((StrCmp (Name, L"cwd") == 0) ||
+  (StrCmp (Name, L"lasterror") == 0) ||
+  (StrCmp (Name, L"profiles") == 0) ||
+  (StrCmp (Name, L"uefishellsupport") == 0) ||
+  (StrCmp (Name, L"uefishellversion") == 0) ||
+  (StrCmp (Name, L"uefiversion") == 0) ||
+  (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
+   StrCmp (Name, mNoNestingEnvVarName) == 0)
+ ) {
 return (EFI_INVALID_PARAMETER);
   }
   return (InternalEfiShellSetEnv(Name, Value, Volatile));
-- 
2.16.1.windows.1

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


Re: [edk2] [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive compare

2018-08-07 Thread Ni, Ruiyu
It's a typo. V2 patch will correct this.

Thanks/Ray

> -Original Message-
> From: edk2-devel  On Behalf Of
> jim.dai...@dell.com
> Sent: Wednesday, August 8, 2018 2:27 AM
> To: Ni, Ruiyu 
> Cc: Carsey, Jaben ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case
> sensitive compare
> 
> Ray,
> 
> Table 8 in version 2.2 of the Shell Spec says "lasterror" (lower-case L).  Why
> compare to "Lasterror"?
> 
> Regards,
> Jim
> 
> -Original Message-
> From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> Sent: Tuesday, August 7, 2018 12:57 PM
> To: Ni, Ruiyu; edk2-devel@lists.01.org
> Cc: Dailey, Jim
> Subject: RE: [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive
> compare
> 
> Reviewed-by: Jaben Carsey 
> 
> > -Original Message-
> > From: Ni, Ruiyu
> > Sent: Tuesday, August 07, 2018 2:14 AM
> > To: edk2-devel@lists.01.org
> > Cc: Carsey, Jaben ; Jim Dailey
> > 
> > Subject: [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case
> > sensitive compare
> > Importance: High
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=777
> >
> > Per Shell spec, the environment variable has a case-sensitive name.
> > But today's implementation of EfiShellSetEnv() compares the
> > environment variable name case insensitively, which causes variable
> > like "CWD" cannot be set due to "cwd" is pre-defined variable.
> >
> > The patch fixes this issue.
> >
> > The EfiShellGetEnv() doesn't have such issue because it will call into
> > ShellFindEnvVarInList() which uses StrCmp().
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Ruiyu Ni 
> > Cc: Jaben Carsey 
> > Cc: Jim Dailey 
> > ---
> >  ShellPkg/Application/Shell/ShellProtocol.c | 39
> > +++---
> >  1 file changed, 9 insertions(+), 30 deletions(-)
> >
> > diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> > b/ShellPkg/Application/Shell/ShellProtocol.c
> > index f2ca2029e3..767cbc99a0 100644
> > --- a/ShellPkg/Application/Shell/ShellProtocol.c
> > +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> > @@ -2924,36 +2924,15 @@ EfiShellSetEnv(
> >//
> >// Make sure we dont 'set' a predefined read only variable
> >//
> > -  if (gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"cwd") == 0
> > -||gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"Lasterror") == 0
> > -||gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"profiles") == 0
> > -||gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"uefishellsupport") == 0
> > -||gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"uefishellversion") == 0
> > -||gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -L"uefiversion") == 0
> > -||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> > -  gUnicodeCollation->StriColl(
> > -gUnicodeCollation,
> > -(CHAR16*)Name,
> > -(CHAR16*)mNoNestingEnvVarName) == 0)
> > -   ){
> > +  if ((StrCmp (Name, L"cwd") == 0) ||
> > +  (StrCmp (Name, L"Lasterror") == 0) ||
> > +  (StrCmp (Name, L"profiles") == 0) ||
> > +  (StrCmp (Name, L"uefishellsupport") == 0) ||
> > +  (StrCmp (Name, L"uefishellversion") == 0) ||
> > +  (StrCmp (Name, L"uefiversion") == 0) ||
> > +  (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> > +   StrCmp (Name, mNoNestingEnvVarName) == 0)
> > + ) {
> >  return (EFI_INVALID_PARAMETER);
> >}
> >return (InternalEfiShellSetEnv(Name, Value, Volatile));
> > --
> > 2.16.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 06/38] Hisilicon/D06: Add OemMiscLibD06

2018-08-07 Thread Ming


在 8/3/2018 1:22 AM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:08:50PM +0800, Ming Huang wrote:
>> This library include BoardFeatureD06.c and OemMiscLibD06.c c file,
>> use for several modules like PciHostBridgeLib and Smbios.
>> Enlarge macro PCIEDEVICE_REPORT_MAX for D06.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>  Platform/Hisilicon/D06/D06.dsc  |   
>> 1 +
>>  Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c  | 
>> 432 
>>  Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06Strings.uni | 
>> Bin 0 -> 5204 bytes
> 
> We appear to be permitting UTF-8 these days, which would be easier to
> review. Would you be able to convert this for the next revision?
> 

Yes.
Could you tell me how to convert the .uni to UTF8?

>>  Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.c| 
>> 157 +++
>>  Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.inf  |  
>> 47 +++
>>  Silicon/Hisilicon/Include/Library/OemMiscLib.h  |   
>> 2 +-
>>  6 files changed, 638 insertions(+), 1 deletion(-)
>>
>> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
>> index 88869ba26e..f4dfef1087 100644
>> --- a/Platform/Hisilicon/D06/D06.dsc
>> +++ b/Platform/Hisilicon/D06/D06.dsc
>> @@ -71,6 +71,7 @@
>>  
>>TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
>>
>> RealTimeClockLib|Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
>> +  OemMiscLib|Platform/Hisilicon/D06/Library/OemMiscLibD06/OemMiscLibD06.inf
>>
>> OemAddressMapLib|Platform/Hisilicon/D06/Library/OemAddressMapD06/OemAddressMapD06.inf
>>
>> PlatformSysCtrlLib|Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
>>  
>> diff --git a/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c 
>> b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c
>> new file mode 100644
>> index 00..c8f6cd0e29
>> --- /dev/null
>> +++ b/Platform/Hisilicon/D06/Library/OemMiscLibD06/BoardFeatureD06.c
>> @@ -0,0 +1,432 @@
>> +/** @file
>> +*
>> +*  Copyright (c) 2018, Hisilicon Limited. All rights reserved.
>> +*  Copyright (c) 2018, Linaro Limited. All rights reserved.
>> +*
>> +*  This program and the accompanying materials
>> +*  are licensed and made available under the terms and conditions of the 
>> BSD License
>> +*  which accompanies this distribution.  The full text of the license may 
>> be found at
>> +*  http://opensource.org/licenses/bsd-license.php
>> +*
>> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
>> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
>> IMPLIED.
>> +*
>> +**/
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include 
>> +
>> +I2C_DEVICE gDS3231RtcDevice = {
> 
> *cough* *cough*
> 

The name of global variable will be modify by another patch.

>> +  .Socket = 0,
>> +  .Port = 5,
>> +  .DeviceType = DEVICE_TYPE_SPD,
>> +  .SlaveDeviceAddress = 0x68
>> +};
>> +
>> +SERDES_POLARITY_INVERT gSerdesPolarityTxDesc[] =
>> +{
>> +  {SERDES_INVALID_MACRO_ID, SERDES_INVALID_LANE_NUM}
>> +};
>> +
>> +SERDES_POLARITY_INVERT gSerdesPolarityRxDesc[] =
>> +{
>> +  {SERDES_INVALID_MACRO_ID, SERDES_INVALID_LANE_NUM}
>> +};
>> +
>> +SERDES_PARAM gSerdesParamNA = {
>> +  .Hilink0Mode = EmHilink0Hccs1X8Width16,
>> +  .Hilink1Mode = EmHilink1Hccs0X8Width16,
>> +  .Hilink2Mode = EmHilink2Pcie2X8,
>> +  .Hilink3Mode = 0x0,
>> +  .Hilink4Mode = 0xF,
>> +  .Hilink5Mode = EmHilink5Sas1X4,
>> +  .Hilink6Mode = 0x0,
>> +  .UseSsc  = 0,
>> +};
>> +
>> +SERDES_PARAM gSerdesParamNB = {
>> +  .Hilink0Mode = EmHilink0Pcie1X8,
>> +  .Hilink1Mode = EmHilink1Pcie0X8,
>> +  .Hilink2Mode = EmHilink2Sas0X8,
>> +  .Hilink3Mode = 0x0,
>> +  .Hilink4Mode = 0xF,
>> +  .Hilink5Mode = EmHilink5Pcie2X2Pcie3X2,
>> +  .Hilink6Mode = 0xF,
>> +  .UseSsc  = 0,
>> +};
>> +
>> +SERDES_PARAM gSerdesParamS1NA = {
>> +  .Hilink0Mode = EmHilink0Hccs1X8Width16,
>> +  .Hilink1Mode = EmHilink1Hccs0X8Width16,
>> +  .Hilink2Mode = EmHilink2Pcie2X8,
>> +  .Hilink3Mode = 0x0,
>> +  .Hilink4Mode = 0xF,
>> +  .Hilink5Mode = EmHilink5Sas1X4,
>> +  .Hilink6Mode = 0x0,
>> +  .UseSsc  = 0,
>> +};
>> +
>> +SERDES_PARAM gSerdesParamS1NB = {
>> +  .Hilink0Mode = EmHilink0Pcie1X8,
>> +  .Hilink1Mode = EmHilink1Pcie0X8,
>> +  .Hilink2Mode = EmHilink2Sas0X8,
>> +  .Hilink3Mode = 0x0,
>> +  .Hilink4Mode = 0xF,
>> +  .Hilink5Mode = EmHilink5Pcie2X2Pcie3X2,
>> +  .Hilink6Mode = 0xF,
>> +  .UseSsc  = 0,
>> +};
>> +
>> +
>> +EFI_STATUS
>> +OemGetSerdesParam (
>> +  OUT SERDES_PARAM *ParamA,
>> +  OUT SERDES_PARAM *ParamB,
>> +  IN  UINT32   SocketId
>> + )
>> +{
>> +  if (NULL == ParamA) {
>> 

Re: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid parameter

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

Best Regards,
Zhu Yonghong


-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Carsey, 
Jaben
Sent: Friday, August 03, 2018 11:07 PM
To: Gao, Liming ; edk2-devel@lists.01.org
Subject: Re: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid 
parameter

Absolutely.  I should have thought to add that.

"Python ScriptCheck.py t"

Assuming there is no commit or file called "t".  Basically just anything that 
is not a commit identifier nor a filename.  I found it when I tried to select a 
commit and misspelled it.

-Jaben

> -Original Message-
> From: Gao, Liming
> Sent: Friday, August 03, 2018 2:44 AM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH v1 1/1] PatchCheck - add error message for 
> invalid parameter
> Importance: High
> 
> Jaben:
>   Could you give me one failure case? Then, I can further understand 
> the patch.
> 
> Thanks
> Liming
> >-Original Message-
> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf 
> >Of Jaben Carsey
> >Sent: Friday, August 03, 2018 7:21 AM
> >To: edk2-devel@lists.01.org
> >Cc: Gao, Liming 
> >Subject: [edk2] [PATCH v1 1/1] PatchCheck - add error message for 
> >invalid parameter
> >
> >Currently if an invalid parameter is passed, it gives a stack trace.
> >This changes it to an error message.
> >
> >Cc: Liming Gao 
> >Cc: Yonghong Zhu 
> >Contributed-under: TianoCore Contribution Agreement 1.1
> >Signed-off-by: Jaben Carsey 
> >---
> > BaseTools/Scripts/PatchCheck.py | 9 ++---
> > 1 file changed, 6 insertions(+), 3 deletions(-)
> >
> >diff --git a/BaseTools/Scripts/PatchCheck.py 
> >b/BaseTools/Scripts/PatchCheck.py
> >index 7b7fba8b7044..96b3cdf1fd8a 100755
> >--- a/BaseTools/Scripts/PatchCheck.py
> >+++ b/BaseTools/Scripts/PatchCheck.py
> >@@ -1,7 +1,7 @@
> > ## @file
> > #  Check a patch for various format issues  # -#  Copyright (c) 2015 
> >- 2017, Intel Corporation. All rights reserved.
> >+#  Copyright (c) 2015 - 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 
> >@@ -528,6 +528,8 @@ class CheckGitCommits:
> > print('Checking git commit:', commit)
> > patch = self.read_patch_from_git(commit)
> > self.ok &= CheckOnePatch(commit, patch).ok
> >+if not commits:
> >+print("Couldn't find commit matching: 
> >+ '{}'".format(rev_spec))
> >
> > def read_commit_list_from_git(self, rev_spec, max_count):
> > # Run git to get the commit patch @@ -536,7 +538,7 @@ class 
> >CheckGitCommits:
> > cmd.append('--max-count=' + str(max_count))
> > cmd.append(rev_spec)
> > out = self.run_git(*cmd)
> >-return out.split()
> >+return out.split() if out else []
> >
> > def read_patch_from_git(self, commit):
> > # Run git to get the commit patch @@ -548,7 +550,8 @@ class 
> >CheckGitCommits:
> > p = subprocess.Popen(cmd,
> >  stdout=subprocess.PIPE,
> >  stderr=subprocess.STDOUT)
> >-return p.communicate()[0].decode('utf-8', 'ignore')
> >+Result = p.communicate()
> >+return Result[0].decode('utf-8', 'ignore') if Result[0] and
> >Result[0].find("fatal")!=0 else None
> >
> > class CheckOnePatchFile:
> > """Performs a patch check for a single file.
> >--
> >2.16.2.windows.1
> >
> >___
> >edk2-devel mailing list
> >edk2-devel@lists.01.org
> >https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] BaseTools: Add Dns and BluetoothLE DevicePath

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Monday, August 06, 2018 3:37 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Add Dns and BluetoothLE DevicePath

Add Dns and BluetoothLE for support DevicePath

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/C/DevicePath/DevicePathFromText.c | 127 +
 1 file changed, 127 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/DevicePathFromText.c 
b/BaseTools/Source/C/DevicePath/DevicePathFromText.c
index bfd91d23b5..bb74e2e170 100644
--- a/BaseTools/Source/C/DevicePath/DevicePathFromText.c
+++ b/BaseTools/Source/C/DevicePath/DevicePathFromText.c
@@ -2537,10 +2537,135 @@ DevPathFromTextWiFi (
 
   return (EFI_DEVICE_PATH_PROTOCOL *) WiFiDp;  }
 
 /**
+  Converts a text device path node to Bluetooth LE device path structure.
+
+  @param TextDeviceNode  The input Text device path node.
+
+  @return A pointer to the newly-created Bluetooth LE device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextBluetoothLE (
+  IN CHAR16 *TextDeviceNode
+  )
+{
+  CHAR16 *BluetoothLeAddrStr;
+  CHAR16 *BluetoothLeAddrTypeStr;
+  BLUETOOTH_LE_DEVICE_PATH   *BluetoothLeDp;
+
+  BluetoothLeAddrStr = GetNextParamStr ();
+  BluetoothLeAddrTypeStr = GetNextParamStr ();  
+ BluetoothLeDp = (BLUETOOTH_LE_DEVICE_PATH *) CreateDeviceNode (
+ MESSAGING_DEVICE_PATH,
+ MSG_BLUETOOTH_LE_DP,
+ (UINT16) sizeof 
(BLUETOOTH_LE_DEVICE_PATH)
+ );
+
+  BluetoothLeDp->Address.Type = (UINT8) Strtoi 
+(BluetoothLeAddrTypeStr);
+  StrHexToBytes (
+BluetoothLeAddrStr, sizeof (BluetoothLeDp->Address.Address) * 2,
+BluetoothLeDp->Address.Address, sizeof (BluetoothLeDp->Address.Address)
+);
+  return (EFI_DEVICE_PATH_PROTOCOL *) BluetoothLeDp; }
+
+/**
+  Converts a text device path node to DNS device path structure.
+
+  @param TextDeviceNode  The input Text device path node.
+
+  @return A pointer to the newly-created DNS device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextDns (
+  IN CHAR16 *TextDeviceNode
+  )
+{
+  CHAR16*DeviceNodeStr;
+  CHAR16*DeviceNodeStrPtr;
+  UINT32DnsServerIpCount;
+  UINT16DnsDeviceNodeLength;
+  DNS_DEVICE_PATH   *DnsDeviceNode;
+  UINT32DnsServerIpIndex;
+  CHAR16*DnsServerIp;
+
+
+  //
+  // Count the DNS server address number.
+  //
+  DeviceNodeStr = UefiDevicePathLibStrDuplicate (TextDeviceNode);  if 
+ (DeviceNodeStr == NULL) {
+return NULL;
+  }
+
+  DeviceNodeStrPtr = DeviceNodeStr;
+
+  DnsServerIpCount = 0;
+  while (DeviceNodeStrPtr != NULL && *DeviceNodeStrPtr != L'\0') {
+GetNextParamStr ();
+DnsServerIpCount ++;
+  }
+
+  free (DeviceNodeStr);
+  DeviceNodeStr = NULL;
+
+  //
+  // One or more instances of the DNS server address in EFI_IP_ADDRESS,  
+ // otherwise, NULL will be returned.
+  //
+  if (DnsServerIpCount == 0) {
+return NULL;
+  }
+
+  //
+  // Create the DNS DeviceNode.
+  //
+  DnsDeviceNodeLength = (UINT16) (sizeof (EFI_DEVICE_PATH_PROTOCOL) + sizeof 
(UINT8) + DnsServerIpCount * sizeof (EFI_IP_ADDRESS));
+  DnsDeviceNode   = (DNS_DEVICE_PATH *) CreateDeviceNode (
+  MESSAGING_DEVICE_PATH,
+  MSG_DNS_DP,
+  DnsDeviceNodeLength
+  );  if (DnsDeviceNode == 
+ NULL) {
+return NULL;
+  }
+
+  //
+  // Confirm the DNS server address is IPv4 or IPv6 type.
+  //
+  DeviceNodeStrPtr = TextDeviceNode;
+  while (!IS_NULL (*DeviceNodeStrPtr)) {
+if (*DeviceNodeStrPtr == L'.') {
+  DnsDeviceNode->IsIPv6 = 0x00;
+  break;
+}
+
+if (*DeviceNodeStrPtr == L':') {
+  DnsDeviceNode->IsIPv6 = 0x01;
+  break;
+}
+
+DeviceNodeStrPtr++;
+  }
+
+  for (DnsServerIpIndex = 0; DnsServerIpIndex < DnsServerIpCount; 
DnsServerIpIndex++) {
+DnsServerIp = GetNextParamStr ();
+if (DnsDeviceNode->IsIPv6 == 0x00) {
+  StrToIpv4Address (DnsServerIp,  NULL, 
&(DnsDeviceNode->DnsServerIp[DnsServerIpIndex].v4), NULL);
+} else {
+  StrToIpv6Address (DnsServerIp, NULL, 
&(DnsDeviceNode->DnsServerIp[DnsServerIpIndex].v6), NULL);
+}
+  }
+
+  return (EFI_DEVICE_PATH_PROTOCOL *) DnsDeviceNode; }
+
+/**
   Converts a text device path node to URI device path structure.
 
   @param TextDeviceNode  The input Text device path node.
 
   @return A pointer to the newly-created URI device path structure.
@@ -3209,13 +3334,15 @@ DEVICE_PATH_FROM_TEXT_TABLE 

Re: [edk2] [PATCH] BaseTools: Fix report flexible value issue

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Tuesday, August 07, 2018 2:24 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Fix report flexible value issue

Report flexible value in INF file encounter error

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

diff --git a/BaseTools/Source/Python/build/BuildReport.py 
b/BaseTools/Source/Python/build/BuildReport.py
index 50717b7c86..deb88a7817 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -983,10 +983,15 @@ class PcdReport(object):
 if ModulePcdSet is not None:
 if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in 
ModulePcdSet:
 continue
 InfDefaultValue, PcdValue = ModulePcdSet[Pcd.TokenCName, 
Pcd.TokenSpaceGuidCName, Type]
 Pcd.DefaultValue = PcdValue
+if InfDefaultValue:
+try:
+InfDefaultValue = 
ValueExpressionEx(InfDefaultValue, Pcd.DatumType, self._GuidDict)(True)
+except BadExpression as InfDefaultValue:
+EdkLogger.error('BuildReport', FORMAT_INVALID, 
"PCD Value: %s, Type: %s" % (InfDefaultValue, Pcd.DatumType))
 if InfDefaultValue == "":
 InfDefaultValue = None
 
 BuildOptionMatch = False
 if GlobalData.BuildOptionPcd:
-- 
2.12.2.windows.2

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


Re: [edk2] [PATCH] BaseTools: Remove duplicate function declaration

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Wednesday, August 08, 2018 9:59 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Remove duplicate function declaration

Remove duplicate function declaration

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/C/DevicePath/UefiDevicePathLib.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h 
b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
index 7bc974d771..1801eb33e6 100644
--- a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
+++ b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
@@ -378,17 +378,10 @@ CreateDeviceNode (
UINT8   NodeType,
UINT8   NodeSubType,
UINT16  NodeLength
   );
 
- EFI_DEVICE_PATH_PROTOCOL *
-CreateDeviceNode (
-   UINT8   NodeType,
-   UINT8   NodeSubType,
-   UINT16  NodeLength
-  );
-
 BOOLEAN
 IsDevicePathMultiInstance (
CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath
   );
 
-- 
2.12.2.windows.2

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


[edk2] [PATCH 3/6] IntelFrameworkModulePkg IdeBusDxe: Remove redundant functions

2018-08-07 Thread shenglei
The redundant functions which are never called have been removed.
They are AtaNonDataCommandInExt,IDEBusDriverConfigurationSetOptions,
GetResponse,IDEBusDriverConfigurationOptionsValid and
IDEBusDriverConfigurationForceDefaults.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Bus/Pci/IdeBusDxe/Ata.c   | 119 
 .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 261 --
 .../Bus/Pci/IdeBusDxe/Ide.h   |  24 --
 .../Bus/Pci/IdeBusDxe/IdeBus.h| 113 
 4 files changed, 517 deletions(-)

diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c 
b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
index 7819773f38..2ca06806d5 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/Ata.c
@@ -2676,124 +2676,5 @@ AtaNonDataCommandIn (
   return EFI_SUCCESS;
 }
 
-/**
-  Send ATA Ext command into device with NON_DATA protocol
-
-  @param  IdeDev Standard IDE device private data structure
-  @param  AtaCommand The ATA command to be sent
-  @param  Device The value in Device register
-  @param  Feature The value in Feature register
-  @param  SectorCount The value in SectorCount register
-  @param  LbaAddress The LBA address in 48-bit mode
-
-  @retval  EFI_SUCCESS Reading succeed
-  @retval  EFI_ABORTED Command failed
-  @retval  EFI_DEVICE_ERROR Device status error.
-
-**/
-EFI_STATUS
-AtaNonDataCommandInExt (
-  IN  IDE_BLK_IO_DEV  *IdeDev,
-  IN  UINT8   AtaCommand,
-  IN  UINT8   Device,
-  IN  UINT16  Feature,
-  IN  UINT16  SectorCount,
-  IN  EFI_LBA LbaAddress
-  )
-{
-  EFI_STATUS  Status;
-  UINT8   StatusRegister;
-  UINT8   SectorCount8;
-  UINT8   Feature8;
-  UINT8   LbaLow;
-  UINT8   LbaMid;
-  UINT8   LbaHigh;
-
-  Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
-  if (EFI_ERROR (Status)) {
-return EFI_DEVICE_ERROR;
-  }
-
-  //
-  // Select device (bit4), set LBA mode(bit6) (use 0xe0 for compatibility)
-  //
-  IDEWritePortB (
-IdeDev->PciIo,
-IdeDev->IoPort->Head,
-(UINT8) ((IdeDev->Device << 4) | 0xe0)
-);
-
-  //
-  // ATA commands for ATA device must be issued when DRDY is set
-  //
-  Status = DRDYReady (IdeDev, ATATIMEOUT);
-  if (EFI_ERROR (Status)) {
-return EFI_DEVICE_ERROR;
-  }
-
-  //
-  // Pass parameter into device register block
-  //
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Head, Device);
-
-  //
-  // Fill the feature register, which is a two-byte FIFO. Need write twice.
-  //
-  Feature8 = (UINT8) (Feature >> 8);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
-
-  Feature8 = (UINT8) Feature;
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Feature, Feature8);
-
-  //
-  // Fill the sector count register, which is a two-byte FIFO. Need write 
twice.
-  //
-  SectorCount8 = (UINT8) (SectorCount >> 8);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount, SectorCount8);
-
-  SectorCount8 = (UINT8) SectorCount;
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorCount, SectorCount8);
-
-  //
-  // Fill the start LBA registers, which are also two-byte FIFO
-  //
-  LbaLow  = (UINT8) RShiftU64 (LbaAddress, 24);
-  LbaMid  = (UINT8) RShiftU64 (LbaAddress, 32);
-  LbaHigh = (UINT8) RShiftU64 (LbaAddress, 40);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
-
-  LbaLow  = (UINT8) LbaAddress;
-  LbaMid  = (UINT8) RShiftU64 (LbaAddress, 8);
-  LbaHigh = (UINT8) RShiftU64 (LbaAddress, 16);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->SectorNumber, LbaLow);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderLsb, LbaMid);
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->CylinderMsb, LbaHigh);
-
-  //
-  // Send command via Command Register
-  //
-  IDEWritePortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Command, AtaCommand);
-
-  //
-  // Wait for command completion
-  //
-  Status = WaitForBSYClear (IdeDev, ATATIMEOUT);
-  if (EFI_ERROR (Status)) {
-return EFI_DEVICE_ERROR;
-  }
-
-  StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);
-  if ((StatusRegister & ATA_STSREG_ERR) == ATA_STSREG_ERR) {
-//
-// Failed to execute command, abort operation
-//
-return EFI_ABORTED;
-  }
-
-  return EFI_SUCCESS;
-}
-
 
 
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverConfiguration.c 
b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverConfiguration.c
index 3a5d3c6f6b..8f72240386 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverConfiguration.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/DriverConfiguration.c
@@ -26,267 +26,6 @@ CHAR16 *OptionString[4] = {
 //
 // EFI Driver Configuration Protocol
 //

[edk2] [PATCH 6/6] IntelFrameworkModulePkg BdsDxe: Remove redundant functions

2018-08-07 Thread shenglei
The redundant functions which are never called have been
removed. They are GetProducerString,ChangeVariableDevicePath,
EfiReallocatePool,Var_UpdateAllConsoleOption and BOpt_IsEfiApp.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Universal/BdsDxe/BootMaint/BmLib.c| 36 ---
 .../Universal/BdsDxe/BootMaint/BootMaint.h| 53 ---
 .../Universal/BdsDxe/BootMaint/BootOption.c   | 62 --
 .../BdsDxe/BootMaint/ConsoleOption.c  | 64 ---
 .../Universal/BdsDxe/BootMaint/Variable.c | 63 --
 .../Universal/BdsDxe/FrontPage.c  | 29 -
 .../Universal/BdsDxe/FrontPage.h  | 17 -
 7 files changed, 324 deletions(-)

diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c 
b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
index d27113c015..a7ff449557 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BmLib.c
@@ -323,42 +323,6 @@ EfiDevicePathInstanceCount (
   return Count;
 }
 
-/**
-  Adjusts the size of a previously allocated buffer.
-
-
-  @param OldPool - A pointer to the buffer whose size is being 
adjusted.
-  @param OldSize - The size of the current buffer.
-  @param NewSize - The size of the new buffer.
-
-  @return   The newly allocated buffer.
-  @retval   NULL  Allocation failed.
-
-**/
-VOID *
-EfiReallocatePool (
-  IN VOID *OldPool,
-  IN UINTNOldSize,
-  IN UINTNNewSize
-  )
-{
-  VOID  *NewPool;
-
-  NewPool = NULL;
-  if (NewSize != 0) {
-NewPool = AllocateZeroPool (NewSize);
-  }
-
-  if (OldPool != NULL) {
-if (NewPool != NULL) {
-  CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);
-}
-
-FreePool (OldPool);
-  }
-
-  return NewPool;
-}
 
 /**
   Get a string from the Data Hub record based on
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h 
b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
index bdd22c8e75..b3b905d7ef 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
@@ -548,22 +548,6 @@ BOpt_IsEfiImageName (
   IN UINT16  *FileName
   );
 
-/**
-
-  Check whether current FileName point to a valid Efi Application
-
-  @param Dir   Pointer to current Directory
-  @param FileName  Pointer to current File name.
-
-  @retval TRUE  Is a valid Efi Application
-  @retval FALSE not a valid Efi Application
-
-**/
-BOOLEAN
-BOpt_IsEfiApp (
-  IN EFI_FILE_HANDLE Dir,
-  IN UINT16  *FileName
-  );
 
 /**
 
@@ -702,18 +686,6 @@ FreeAllConsoles (
   VOID
   );
 
-/**
-  Update the device path that describing a terminal device
-  based on the new BaudRate, Data Bits, parity and Stop Bits
-  set.
-
-  @param DevicePath The devicepath protocol instance wanted to be updated.
-
-**/
-VOID
-ChangeVariableDevicePath (
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  *DevicePath
-  );
 
 /**
   Update the multi-instance device path of Terminal Device based on
@@ -875,15 +847,6 @@ Var_UpdateErrorOutOption (
   VOID
   );
 
-/**
-  Update the device path of "ConOut", "ConIn" and "ErrOut" based on the new 
BaudRate, Data Bits,
-  parity and stop Bits set.
-
-**/
-VOID
-Var_UpdateAllConsoleOption (
-  VOID
-  );
 
 /**
   This function update the "BootNext" EFI Variable. If there is no "BootNex" 
specified in BMM,
@@ -1154,22 +1117,6 @@ EfiLibFileInfo (
   IN EFI_FILE_HANDLE  FHand
   );
 
-/**
-  Adjusts the size of a previously allocated buffer.
-
-  @param OldPool A pointer to the buffer whose size is being adjusted.
-  @param OldSize The size of the current buffer.
-  @param NewSize The size of the new buffer.
-
-  @return   The newly allocated buffer. if NULL, allocation failed.
-
-**/
-VOID*
-EfiReallocatePool (
-  IN VOID *OldPool,
-  IN UINTNOldSize,
-  IN UINTNNewSize
-  );
 
 /**
   Function deletes the variable specified by VarName and VarGuid.
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c 
b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
index 895f13f214..c4a0e17f3b 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
@@ -1192,69 +1192,7 @@ BOpt_IsEfiImageName (
   return FALSE;
 }
 
-/**
-
-  Check whether current FileName point to a valid Efi Application
-
-  @param Dir   Pointer to current Directory
-  @param FileName  Pointer to current File name.
-
-  @retval TRUE  Is a valid Efi Application
-  @retval FALSE not a valid Efi Application
-
-**/
-BOOLEAN
-BOpt_IsEfiApp (
-  IN EFI_FILE_HANDLE Dir,
-  IN 

[edk2] [PATCH 2/6] IntelFrameworkModulePkg Ps2KeyboardDxe: Remove a redundant function

2018-08-07 Thread shenglei
The redundant function DisableKeyboard which is never called
has been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c| 25 ---
 .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  | 11 
 2 files changed, 36 deletions(-)

diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c 
b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
index 78c4e3b391..202588191e 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c
@@ -1848,32 +1848,7 @@ Done:
 
 }
 
-/**
-  Disable the keyboard interface of the 8042 controller.
-
-  @param ConsoleIn   The device instance
-
-  @return status of issuing disable command
-
-**/
-EFI_STATUS
-DisableKeyboard (
-  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
-  )
-{
-  EFI_STATUS  Status;
 
-  //
-  // Disable keyboard interface
-  //
-  Status = KeyboardCommand (ConsoleIn, 
KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE);
-  if (EFI_ERROR (Status)) {
-KeyboardError (ConsoleIn, L"\n\r");
-return EFI_DEVICE_ERROR;
-  }
-
-  return Status;
-}
 
 /**
   Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard 
Command
diff --git a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h 
b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
index 613f176401..220d17419c 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
@@ -299,18 +299,7 @@ InitKeyboard (
   IN BOOLEAN ExtendedVerification
   );
 
-/**
-  Disable the keyboard interface of the 8042 controller.
-
-  @param ConsoleIn   - the device instance
 
-  @return status of issuing disable command
-
-**/
-EFI_STATUS
-DisableKeyboard (
-  IN KEYBOARD_CONSOLE_IN_DEV *ConsoleIn
-  );
 
 /**
   Timer event handler: read a series of scancodes from 8042
-- 
2.18.0.windows.1

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


[edk2] [PATCH 4/6] IntelFrameworkModulePkg Snp16Dxe: Remove redundant functions

2018-08-07 Thread shenglei
The redundant functions which are never called have been removed.
They are PxeUndiSetMcastAddr, PxeUndiInitiateDiags,PxeUndiGetState
PxeUndiForceInterrupt and PxeUndiSetPacketFilter.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 .../Csm/BiosThunk/Snp16Dxe/BiosSnp16.h| 180 --
 .../Csm/BiosThunk/Snp16Dxe/PxeUndi.c  |  91 -
 2 files changed, 271 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.h 
b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.h
index 501e27b9c8..5dcbee68d4 100644
--- a/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.h
+++ b/IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.h
@@ -1019,39 +1019,6 @@ PxeUndiTransmit (
   )
 ;
 
-/**
-  PXE
-  UNDI SET MULTICAST ADDRESS
-  Op-Code: PXENV_UNDI_SET_MCAST_ADDRESS (0009h)
-  Input: Far pointer to a PXENV_TFTP_SET_MCAST_ADDRESS_t parameter structure 
that has been
-  initialized by the caller.
-  Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The 
status field in
-  the parameter structure must be set to one of the values represented by the 
PXENV_STATUS_xxx
-  constants.
-  Description: This call changes the current list of multicast addresses to 
the input list and resets the network
-  adapter to accept it. If the number of multicast addresses is zero, 
multicast is disabled.
-  typedef struct {
-PXENV_STATUS Status;
-PXENV_UNDI_MCAST_ADDRESS_t R_Mcast_Buf;
-  } PXENV_UNDI_SET_MCAST_ADDR_T;
-  Set before calling API service
-  R_Mcast_Buf: See description in the UNDI RESET ADAPTER
-  (0004h) API.
-  Returned from API service
-  Status: See the PXENV_STATUS_xxx constants
-
-  @param  SimpleNetworkDevice   Device instance
-  @param  PxeUndiTable  Point to structure which hold parameter and 
return value
-for option ROM call.
-
-  @return Return value of PXE option ROM far call.
-**/
-EFI_STATUS
-PxeUndiSetMcastAddr (
-  IN EFI_SIMPLE_NETWORK_DEV   *SimpleNetworkDevice,
-  IN OUT PXENV_UNDI_SET_MCAST_ADDR_T  *PxeUndiTable
-  )
-;
 
 /**
   PXE
@@ -1088,39 +1055,6 @@ PxeUndiSetStationAddr (
   )
 ;
 
-/**
-  PXE
-  UNDI SET PACKET FILTER
-  Op-Code: PXENV_UNDI_SET_PACKET_FILTER (000Bh)
-  Input: Far pointer to a PXENV_UNDI_SET_PACKET_FILTER_T parameter structure 
that has been
-  initialized by the caller.
-  Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The 
status field in
-  the parameter structure must be set to one of the values represented by the 
PXENV_STATUS_xxx
-  constants.
-  Description: This call resets the adapter's receive unit to accept a new 
filter, different from the one provided with
-  the open call.
-  typedef struct {
-PXENV_STATUS Status;
-UINT8 filter;
-  } PXENV_UNDI_SET_PACKET_FILTER_T;
-  Set before calling API service
-  Filter: See the receive filter values in the UNDI OPEN
-  (0006h) API description.
-  Returned from API service
-  Status: See the PXENV_STATUS_xxx constants.
-
-  @param  SimpleNetworkDevice   Device instance
-  @param  PxeUndiTable  Point to structure which hold parameter and 
return value
-for option ROM call.
-
-  @return Return value of PXE option ROM far call.
-**/
-EFI_STATUS
-PxeUndiSetPacketFilter (
-  IN EFI_SIMPLE_NETWORK_DEV   *SimpleNetworkDevice,
-  IN OUT PXENV_UNDI_SET_PACKET_FILTER_T   *PxeUndiTable
-  )
-;
 
 /**
   PXE
@@ -1252,73 +1186,6 @@ PxeUndiClearStatistics (
   )
 ;
 
-/**
-  PXE
-  UNDI INITIATE DIAGS
-  Op-Code: PXENV_UNDI_INITIATE_DIAGS (000Fh)
-  Input: Far pointer to a PXENV_UNDI_INITIATE_DIAGS_T parameter.
-  Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The 
status field in
-  the parameter structure must be set to one of the values represented by the
-  PXENV_STATUS_xxx constants.
-  Description: This call can be used to initiate the run-time diagnostics. It 
causes the network adapter to run
-  hardware diagnostics and to update its status information.
-  typedef struct {
-PXENV_STATUS Status;
-  } PXENV_UNDI_INITIATE_DIAGS_T;
-  Set before calling API service
-  N/A
-  Returned from API service
-  Status: See the PXENV_STATUS_xxx constants.
-
-  @param  SimpleNetworkDevice   Device instance
-  @param  PxeUndiTable  Point to structure which hold parameter and 
return value
-for option ROM call.
-
-  @return Return value of PXE option ROM far call.
-**/
-EFI_STATUS
-PxeUndiInitiateDiags (
-  IN EFI_SIMPLE_NETWORK_DEV   *SimpleNetworkDevice,
-  IN OUT PXENV_UNDI_INITIATE_DIAGS_T  *PxeUndiTable
-  )
-;
-
-/**
-  PXE
-  UNDI FORCE INTERRUPT
-  Op-Code: PXENV_UNDI_FORCE_INTERRUPT (0010h)
-  Input: Far pointer to a PXENV_UNDI_FORCE_INTERRUPT_T parameter structure 
that has been
-  initialized by the caller.
-  

[edk2] [PATCH 1/6] IntelFrameworkModulePkg IsaIoDxe: Remove a redundant protocol

2018-08-07 Thread shenglei
Remove a redundant protocol which is gEfiGenericMemTestProtocolGuid.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h  | 1 -
 IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf | 1 -
 2 files changed, 2 deletions(-)

diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
index 9639d18318..6b1aaeda0e 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaDriver.h
@@ -24,7 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf 
b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
index 6f02aea7af..247c66151b 100644
--- a/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
+++ b/IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf
@@ -62,7 +62,6 @@
   gEfiSioProtocolGuid   ## TO_START
   gEfiPciIoProtocolGuid ## TO_START
   gEfiDevicePathProtocolGuid## TO_START
-  gEfiGenericMemTestProtocolGuid## TO_START
 
 [Pcd]
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures  ## 
CONSUMES
-- 
2.18.0.windows.1

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


[edk2] [PATCH 5/6] IntelFrameworkModulePkg LegacyBiosDxe: Remove redundant LibraryClasses

2018-08-07 Thread shenglei
The redundant LibraryClasses which are PeCoffLib and CacheMaintenanceLib
have been removed.
https://bugzilla.tianocore.org/show_bug.cgi?id=1063

Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: shenglei 
---
 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf | 2 --
 IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h | 2 --
 2 files changed, 4 deletions(-)

diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
index 6eb01fc185..6d156a4123 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
@@ -72,8 +72,6 @@
   DxeServicesTableLib
   PcdLib
   ReportStatusCodeLib
-  PeCoffLib
-  CacheMaintenanceLib
   DebugAgentLib
 
 [LibraryClasses.IA32]
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h 
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
index 1e84772688..7779427f68 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
@@ -63,8 +63,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 
 //
-- 
2.18.0.windows.1

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


[edk2] [PATCH 0/6] IntelFrameworkModulePkg: Remove something reduntdant

2018-08-07 Thread shenglei
A lot of redundant funcions which are never calld have been removed.I manually 
search these fuctions in source files to make sure that they are not used 
elsewhere.
Also the IntelFrameworkModulePkg was built to ensure that.
A redundant protocol and two LibraryClasses have been removed.

shenglei (6):
  IntelFrameworkModulePkg IsaIoDxe: Remove a redundant protocol
  IntelFrameworkModulePkg Ps2KeyboardDxe: Remove a redundant function
  IntelFrameworkModulePkg IdeBusDxe: Remove redundant functions
  IntelFrameworkModulePkg Snp16Dxe: Remove redundant functions
  IntelFrameworkModulePkg LegacyBiosDxe: Remove redundant LibraryClasses
  IntelFrameworkModulePkg BdsDxe: Remove redundant functions

 .../Bus/Isa/IsaIoDxe/IsaDriver.h  |   1 -
 .../Bus/Isa/IsaIoDxe/IsaIoDxe.inf |   1 -
 .../Bus/Isa/Ps2KeyboardDxe/Ps2KbdCtrller.c|  25 --
 .../Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h  |  11 -
 .../Bus/Pci/IdeBusDxe/Ata.c   | 119 
 .../Bus/Pci/IdeBusDxe/DriverConfiguration.c   | 261 --
 .../Bus/Pci/IdeBusDxe/Ide.h   |  24 --
 .../Bus/Pci/IdeBusDxe/IdeBus.h| 113 
 .../Csm/BiosThunk/Snp16Dxe/BiosSnp16.h| 180 
 .../Csm/BiosThunk/Snp16Dxe/PxeUndi.c  |  91 --
 .../Csm/LegacyBiosDxe/LegacyBiosDxe.inf   |   2 -
 .../Csm/LegacyBiosDxe/LegacyBiosInterface.h   |   2 -
 .../Universal/BdsDxe/BootMaint/BmLib.c|  36 ---
 .../Universal/BdsDxe/BootMaint/BootMaint.h|  53 
 .../Universal/BdsDxe/BootMaint/BootOption.c   |  62 -
 .../BdsDxe/BootMaint/ConsoleOption.c  |  64 -
 .../Universal/BdsDxe/BootMaint/Variable.c |  63 -
 .../Universal/BdsDxe/FrontPage.c  |  29 --
 .../Universal/BdsDxe/FrontPage.h  |  17 --
 19 files changed, 1154 deletions(-)

-- 
2.18.0.windows.1

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


Re: [edk2] [PATCH edk2-non-osi v1 1/1] Hisilicon/D06: Add binary modules

2018-08-07 Thread Ming


在 8/6/2018 6:21 PM, Leif Lindholm 写道:
> On Tue, Jul 24, 2018 at 03:28:16PM +0800, Ming Huang wrote:
>> Add initial binary for D06.
>> Build commit infomation:
>> edk2: e73f499
>> edk2-platforms: 7f223e6
>> HwPkg: e0bf35e
>> TrusedFirmware: 4eda1d1
>> Tools: 6b286b1
> 
> The above information is all good, but can you add a summary
> specifying what each driver is? Just a one-line description per module
> should be enough.
> 

OK, I will add it in v2.

> For the .depex files - they get garbled by git format-patch.
> Could you add a .gitattributes file in your edk2-non-osi root 
> as per
> https://www.mail-archive.com/edk2-devel@lists.01.org/msg13992.html
> before regenerating a new set?
> 
> Actually, could you create that as a patch and send out with me, Mike,
> Ard, Laszlo on cc? I think this topic is ready for another round of
> discussions.
> 

OK, I will send it out later. Could you tell me emails of Mike and Laszlo?

Can I modify some binary files for known issues in v2?

> /
> LEif
> 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang 
>> ---
>>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.depex  
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi
>>| Bin 0 -> 20384 bytes
>>  Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
>>|  26 
>>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.depex
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.efi  
>>| Bin 0 -> 228352 bytes
>>  Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf  
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.depex 
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi   
>>| Bin 0 -> 29376 bytes
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf   
>>|  28 +
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.depex 
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi   
>>| Bin 0 -> 21600 bytes
>>  Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf   
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.depex   
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
>>| Bin 0 -> 24672 bytes
>>  Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf  
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.depex
>>|   1 +
>>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi  
>>| Bin 0 -> 20672 bytes
>>  Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf  
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf   
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpPV600Dxe.efi  
>>| Bin 0 -> 74912 bytes
>>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.depex  
>>| Bin 0 -> 36 bytes
>>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.efi
>>| Bin 0 -> 21184 bytes
>>  Platform/Hisilicon/D06/Drivers/PcieRasInitDxe/PcieRasInitDxe.inf
>>|  26 
>>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.efi
>>| Bin 0 -> 17920 bytes
>>  Platform/Hisilicon/D06/Drivers/RasInitDxe/RasInitDxe.inf
>>|  25 
>>  Platform/Hisilicon/D06/Drivers/SFC/SFCDriver.depex  
>>| Bin 0 -> 36 bytes
>>  Platform/Hisilicon/D06/Drivers/SFC/SFCDriver.efi
>>| Bin 0 -> 262144 bytes
>>  Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf 
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/Sas/SasDriverDxe.depex   
>>| Bin 0 -> 216 bytes
>>  Platform/Hisilicon/D06/Drivers/Sas/SasDriverDxe.efi 
>>| Bin 0 -> 221152 bytes
>>  Platform/Hisilicon/D06/Drivers/Sas/SasDxeDriver.inf 
>>|  27 
>>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/SmiGraphicsOutput.efi   
>>| Bin 0 -> 37856 bytes
>>  Platform/Hisilicon/D06/Drivers/Sm750Dxe/UefiSmi.inf 
>>|  32 +++
>>  Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.depex 
>>|   1 +
>>  

[edk2] [PATCH] BaseTools: Remove duplicate function declaration

2018-08-07 Thread Feng, YunhuaX
Remove duplicate function declaration

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/C/DevicePath/UefiDevicePathLib.h | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h 
b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
index 7bc974d771..1801eb33e6 100644
--- a/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
+++ b/BaseTools/Source/C/DevicePath/UefiDevicePathLib.h
@@ -378,17 +378,10 @@ CreateDeviceNode (
UINT8   NodeType,
UINT8   NodeSubType,
UINT16  NodeLength
   );
 
- EFI_DEVICE_PATH_PROTOCOL *
-CreateDeviceNode (
-   UINT8   NodeType,
-   UINT8   NodeSubType,
-   UINT16  NodeLength
-  );
-
 BOOLEAN
 IsDevicePathMultiInstance (
CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath
   );
 
-- 
2.12.2.windows.2

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


Re: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid parameter

2018-08-07 Thread Gao, Liming
Jaben:
  I verify this case. Your patch fixes it. 

Tested-by: Liming Gao 

Thanks
Liming
>-Original Message-
>From: Carsey, Jaben
>Sent: Friday, August 03, 2018 11:07 PM
>To: Gao, Liming ; edk2-devel@lists.01.org
>Subject: RE: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid
>parameter
>
>Absolutely.  I should have thought to add that.
>
>"Python ScriptCheck.py t"
>
>Assuming there is no commit or file called "t".  Basically just anything that 
>is
>not a commit identifier nor a filename.  I found it when I tried to select a
>commit and misspelled it.
>
>-Jaben
>
>> -Original Message-
>> From: Gao, Liming
>> Sent: Friday, August 03, 2018 2:44 AM
>> To: Carsey, Jaben ; edk2-devel@lists.01.org
>> Subject: RE: [edk2] [PATCH v1 1/1] PatchCheck - add error message for
>> invalid parameter
>> Importance: High
>>
>> Jaben:
>>   Could you give me one failure case? Then, I can further understand the
>> patch.
>>
>> Thanks
>> Liming
>> >-Original Message-
>> >From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
>> >Jaben Carsey
>> >Sent: Friday, August 03, 2018 7:21 AM
>> >To: edk2-devel@lists.01.org
>> >Cc: Gao, Liming 
>> >Subject: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid
>> >parameter
>> >
>> >Currently if an invalid parameter is passed, it gives a stack trace.
>> >This changes it to an error message.
>> >
>> >Cc: Liming Gao 
>> >Cc: Yonghong Zhu 
>> >Contributed-under: TianoCore Contribution Agreement 1.1
>> >Signed-off-by: Jaben Carsey 
>> >---
>> > BaseTools/Scripts/PatchCheck.py | 9 ++---
>> > 1 file changed, 6 insertions(+), 3 deletions(-)
>> >
>> >diff --git a/BaseTools/Scripts/PatchCheck.py
>> >b/BaseTools/Scripts/PatchCheck.py
>> >index 7b7fba8b7044..96b3cdf1fd8a 100755
>> >--- a/BaseTools/Scripts/PatchCheck.py
>> >+++ b/BaseTools/Scripts/PatchCheck.py
>> >@@ -1,7 +1,7 @@
>> > ## @file
>> > #  Check a patch for various format issues
>> > #
>> >-#  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
>> >+#  Copyright (c) 2015 - 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
>> >@@ -528,6 +528,8 @@ class CheckGitCommits:
>> > print('Checking git commit:', commit)
>> > patch = self.read_patch_from_git(commit)
>> > self.ok &= CheckOnePatch(commit, patch).ok
>> >+if not commits:
>> >+print("Couldn't find commit matching: '{}'".format(rev_spec))
>> >
>> > def read_commit_list_from_git(self, rev_spec, max_count):
>> > # Run git to get the commit patch
>> >@@ -536,7 +538,7 @@ class CheckGitCommits:
>> > cmd.append('--max-count=' + str(max_count))
>> > cmd.append(rev_spec)
>> > out = self.run_git(*cmd)
>> >-return out.split()
>> >+return out.split() if out else []
>> >
>> > def read_patch_from_git(self, commit):
>> > # Run git to get the commit patch
>> >@@ -548,7 +550,8 @@ class CheckGitCommits:
>> > p = subprocess.Popen(cmd,
>> >  stdout=subprocess.PIPE,
>> >  stderr=subprocess.STDOUT)
>> >-return p.communicate()[0].decode('utf-8', 'ignore')
>> >+Result = p.communicate()
>> >+return Result[0].decode('utf-8', 'ignore') if Result[0] and
>> >Result[0].find("fatal")!=0 else None
>> >
>> > class CheckOnePatchFile:
>> > """Performs a patch check for a single file.
>> >--
>> >2.16.2.windows.1
>> >
>> >___
>> >edk2-devel mailing list
>> >edk2-devel@lists.01.org
>> >https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/2] Fix ESRT out of date

2018-08-07 Thread Zeng, Star
Agree, thanks very much. :)

Star
-Original Message-
From: Kinney, Michael D 
Sent: Wednesday, August 8, 2018 9:02 AM
To: Zeng, Star ; edk2-devel@lists.01.org; Kinney, Michael 
D 
Subject: RE: [PATCH 0/2] Fix ESRT out of date

Series Reviewed-by: Michael D Kinney 

The commit message in patch 2 should say 

"(reset is not required"

Mike

> -Original Message-
> From: Zeng, Star
> Sent: Monday, August 6, 2018 3:29 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Kinney, Michael D 
> 
> Subject: [PATCH 0/2] Fix ESRT out of date
> 
> Cc: Michael D Kinney 
> 
> Star Zeng (2):
>   FmpDevicePkg FmpDxe: Need repopulate after SetImage is called
>   MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot event
> 
>  FmpDevicePkg/FmpDxe/FmpDxe.c|  21 +--
>  MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 239
> 
>  2 files changed, 109 insertions(+), 151 deletions(-)
> 
> --
> 2.7.0.windows.1

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


Re: [edk2] [Patch] UefiCpuPkg/RegisterCpuFeaturesLib: Implement AllocateAcpiCpuData function.

2018-08-07 Thread Dong, Eric
Hi Laszlo,


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Saturday, August 4, 2018 12:46 AM
> To: Dong, Eric 
> Cc: edk2-devel@lists.01.org; Ni, Ruiyu ; Marvin Häuser
> ; Jeff Fan ; Ard
> Biesheuvel 
> Subject: Re: [Patch] UefiCpuPkg/RegisterCpuFeaturesLib: Implement
> AllocateAcpiCpuData function.
> 
> Hello Eric,
> 
> OVMF does not include CpuFeaturesPei / CpuFeaturesDxe, and so it doesn't
> consume this library. I can't provide test results, but I have some 
> superficial
> comments.
> 
> First, I'm adding Marvin and Jeff -- I *vaguely* recall that this issue may 
> have
> been raised by Marvin. Hm... yes, it seems so:
> 
>   [edk2] CpuS3DataDxe / DxeRegisterCpuFeaturesLib dependency.
> 
>   http://mid.mail-
> archive.com/VI1PR0801MB17908DB1F03A3C5F84545E1080690@VI1PR0801
> MB1790.eurprd08.prod.outlook.com
>   https://lists.01.org/pipermail/edk2-devel/2018-May/025163.html
> 
> I have three questions here:
> 
> (1) Do we have a TianoCore BZ about this?
> 
> (2) If not, does the currently proposed commit message capture the issue in
> enough detail? Should we reference Marvin's initial report and/or a
> TianoCore BZ (if we have one)?
> 

Yes, it has an BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=959
I will include this info in my next version patch.

> (3) The implementation seems to follow Jeff's idea. Marvin and Jeff, can you
> please help with the review?
> 
> Either way, I propose the following two tags to be appended:
> 
> Reported-by: Marvin Häuser 
> Suggested-by: Fan Jeff 
> 

Sure, will include them in my next version patch.

> 
> And one technical question follows below:
> 
> On 08/03/18 04:10, Eric Dong wrote:
> > Current code logic can't confirm CpuS3DataDxe driver start before
> > CpuFeaturesDxe driver. So the assumption in CpuFeaturesDxe not valid.
> > Add implementation for AllocateAcpiCpuData function to remove this
> > assumption.
> >
> > Pass OS boot and resume from S3 test.
> >
> > Cc: Laszlo Ersek 
> > Cc: Ruiyu Ni 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Eric Dong 
> > ---
> >  .../DxeRegisterCpuFeaturesLib.c| 57 
> > --
> >  1 file changed, 54 insertions(+), 3 deletions(-)
> >
> > diff --git
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.
> > c
> > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.
> > c
> > index 902a339529..0722db6c64 100644
> > ---
> > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeaturesLib.
> > c
> > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/DxeRegisterCpuFeatures
> > +++ Lib.c
> > @@ -207,11 +207,62 @@ AllocateAcpiCpuData (
> >VOID
> >)
> >  {
> > +  EFI_STATUS   Status;
> > +  UINTNNumberOfCpus;
> > +  UINTNNumberOfEnabledProcessors;
> > +  ACPI_CPU_DATA*AcpiCpuData;
> > +  EFI_PHYSICAL_ADDRESS Address;
> > +  UINTNTableSize;
> > +  CPU_REGISTER_TABLE   *RegisterTable;
> > +  UINTNIndex;
> > +  EFI_PROCESSOR_INFORMATIONProcessorInfoBuffer;
> > +
> > +  Address = BASE_4GB - 1;
> > +  Status  = gBS->AllocatePages (
> > +   AllocateMaxAddress,
> > +   EfiACPIMemoryNVS,
> > +   EFI_SIZE_TO_PAGES (sizeof (ACPI_CPU_DATA)),
> > +   
> > +   );
> > +  ASSERT_EFI_ERROR (Status);
> 
> I understand that this code is for IA32 and X64 only, but still, Ard has 
> recently
> introduced a DxeServicesLib API for this kind of allocation:
> it's called AllocatePeiAccessiblePages(). See commit a40e0b7aa918.
> 
> (4) Is it feasible to use that function here (and in the second instance 
> below)?
> 

After check the code, I found current usage modal not required it below 4G, 
also it doesn't need ACPI NVS type memory.
I will update it in my next version change.

> From a library dependency standpoint, I think it should be fine: we are
> modifying the DXE instance of the RegisterCpuFeaturesLib class, so a
> dependency on DxeServicesLib should be in order.
> 
> Now, if this allocation *must* be satisfied from below 4GB, even if the PEI
> phase has access to >=4GB RAM (as determined by
> 
>   PhitHob->EfiFreeMemoryTop > MAX_UINT32
> 
> ), then my suggestion is wrong (because in that case,
> AllocatePeiAccessiblePages() wouldn't restrict the allocation under 4GB).
> 
> CC'ing Ard too.
> 
> Thanks!
> Laszlo
> 
> > +  AcpiCpuData = (ACPI_CPU_DATA *) (UINTN) Address;  ASSERT
> > + (AcpiCpuData != NULL);
> > +
> > +  GetNumberOfProcessor (,
> );
> > + AcpiCpuData->NumberOfCpus = (UINT32) NumberOfCpus;
> > +
> >//
> > -  // CpuS3DataDxe will do it.
> > +  // Allocate buffer for empty RegisterTable and
> > + PreSmmInitRegisterTable for all CPUs
> >//
> > -  ASSERT (FALSE);
> > -  return NULL;

Re: [edk2] [PATCH] FmpDevicePkg FmpDxe: Lock variables in entrypoint instead of callback

2018-08-07 Thread Kinney, Michael D
Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: Zeng, Star
> Sent: Tuesday, August 7, 2018 3:28 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Kinney, Michael D
> 
> Subject: [PATCH] FmpDevicePkg FmpDxe: Lock variables in
> entrypoint instead of callback
> 
> Current code locks variables in PcdFmpDeviceLockEventGuid
> callback by
> VariableLock protocol whose interface will be closed at
> EndOfDxe.
> So the PcdFmpDeviceLockEventGuid callback needs be
> executed before
> the EndOfDxe callback in Variable driver.
> When PcdFmpDeviceLockEventGuid =
> gEfiEndOfDxeEventGroupGuid, the
> callback's execution sequence depends on the callback's
> TPL and
> registration sequence.
> When PcdFmpDeviceLockEventGuid =
> gEfiEventReadyToBootGuid, the
> PcdFmpDeviceLockEventGuid callback will be executed after
> the
> EndOfDxe callback in Variable driver, the locking will
> fail.
> 
> The patch moves the variables locking logic to
> entrypoint.
> The patch also moves the
> IsLockFmpDeviceAtLockEventGuidRequired ()
> checking to entrypoint.
> 
> The entrypoint's final return status should be better to
> depend on
> the return status of
> RegisterFmpInstaller/InstallFmpInstance, but not
> gBS->CreateEventEx.
> So the patch also moves the
> RegisterFmpInstaller/InstallFmpInstance
> calling to the end of entrypoint.
> 
> Cc: Michael D Kinney 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng 
> ---
>  FmpDevicePkg/FmpDxe/FmpDxe.c | 96
> ++--
>  1 file changed, 48 insertions(+), 48 deletions(-)
> 
> diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c
> b/FmpDevicePkg/FmpDxe/FmpDxe.c
> index 3794ac5008f9..57eac5ac147f 100644
> --- a/FmpDevicePkg/FmpDxe/FmpDxe.c
> +++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
> @@ -1248,32 +1248,18 @@ FmpDxeLockEventNotify (
>EFI_STATUS  Status;
> 
>if (!mFmpDeviceLocked) {
> -if (IsLockFmpDeviceAtLockEventGuidRequired ()) {
> -  //
> -  // Lock all UEFI Variables used by this module.
> -  //
> -  Status = LockAllFmpVariables ();
> -  if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to lock
> variables.  Status = %r.\n"));
> +//
> +// Lock the firmware device
> +//
> +Status = FmpDeviceLock();
> +if (EFI_ERROR (Status)) {
> +  if (Status != EFI_UNSUPPORTED) {
> +DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLock()
> returned error.  Status = %r\n", Status));
>} else {
> -DEBUG ((DEBUG_INFO, "FmpDxe: All variables
> locked\n"));
> -  }
> -
> -  //
> -  // Lock the firmware device
> -  //
> -  Status = FmpDeviceLock();
> -  if (EFI_ERROR (Status)) {
> -if (Status != EFI_UNSUPPORTED) {
> -  DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLock()
> returned error.  Status = %r\n", Status));
> -} else {
> -  DEBUG ((DEBUG_WARN, "FmpDxe: FmpDeviceLock()
> returned error.  Status = %r\n", Status));
> -}
> +DEBUG ((DEBUG_WARN, "FmpDxe: FmpDeviceLock()
> returned error.  Status = %r\n", Status));
>}
> -  mFmpDeviceLocked = TRUE;
> -} else {
> -  DEBUG ((DEBUG_VERBOSE, "FmpDxe: Not calling
> FmpDeviceLock() because mfg mode\n"));
>  }
> +mFmpDeviceLocked = TRUE;
>}
>  }
> 
> @@ -1417,6 +1403,45 @@ FmpDxeEntryPoint (
>//
>DetectTestKey ();
> 
> +  if (IsLockFmpDeviceAtLockEventGuidRequired ()) {
> +//
> +// Lock all UEFI Variables used by this module.
> +//
> +Status = LockAllFmpVariables ();
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to lock
> variables.  Status = %r.\n", Status));
> +} else {
> +  DEBUG ((DEBUG_INFO, "FmpDxe: All variables
> locked\n"));
> +}
> +
> +//
> +// Register notify function to lock the FMP device.
> +// The lock event GUID is retrieved from
> PcdFmpDeviceLockEventGuid.
> +// If PcdFmpDeviceLockEventGuid is not the size of
> an EFI_GUID, then
> +// gEfiEndOfDxeEventGroupGuid is used.
> +//
> +LockGuid = 
> +if (PcdGetSize (PcdFmpDeviceLockEventGuid) == sizeof
> (EFI_GUID)) {
> +  LockGuid = (EFI_GUID *)PcdGetPtr
> (PcdFmpDeviceLockEventGuid);
> +}
> +DEBUG ((DEBUG_INFO, "FmpDxe: Lock GUID: %g\n",
> LockGuid));
> +
> +Status = gBS->CreateEventEx (
> +EVT_NOTIFY_SIGNAL,
> +TPL_CALLBACK,
> +FmpDxeLockEventNotify,
> +NULL,
> +LockGuid,
> +
> +);
> +if (EFI_ERROR (Status)) {
> +  DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to register
> notification.  Status = %r\n", Status));
> +}
> +ASSERT_EFI_ERROR (Status);
> +  } else {
> +DEBUG ((DEBUG_VERBOSE, "FmpDxe: Not registering
> notification to call FmpDeviceLock() because mfg
> mode\n"));
> +  }
> +
>//
>// Register with library the install function so if
> the library uses
>// UEFI 

Re: [edk2] [PATCH 0/2] Fix ESRT out of date

2018-08-07 Thread Kinney, Michael D
Series Reviewed-by: Michael D Kinney 

The commit message in patch 2 should say 

"(reset is not required"

Mike

> -Original Message-
> From: Zeng, Star
> Sent: Monday, August 6, 2018 3:29 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star ; Kinney, Michael D
> 
> Subject: [PATCH 0/2] Fix ESRT out of date
> 
> Cc: Michael D Kinney 
> 
> Star Zeng (2):
>   FmpDevicePkg FmpDxe: Need repopulate after SetImage
> is called
>   MdeModulePkg ErstFmpDxe: Create ESRT in ReadyToBoot
> event
> 
>  FmpDevicePkg/FmpDxe/FmpDxe.c|  21 +--
>  MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmp.c | 239
> 
>  2 files changed, 109 insertions(+), 151 deletions(-)
> 
> --
> 2.7.0.windows.1

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


Re: [edk2] [PATCH] BaseTools: Optimizing code for function doesn't match

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Monday, August 06, 2018 9:11 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Optimizing code for function doesn't match

Optimizing code for function doesn't match name and comment

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

Cc: Liming Gao 
Cc: Yonghong Zhu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yunhua Feng 
---
 BaseTools/Source/Python/AutoGen/BuildEngine.py | 30 --
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py 
b/BaseTools/Source/Python/AutoGen/BuildEngine.py
index 8a32343846..4291da9001 100644
--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py
+++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py
@@ -528,30 +528,28 @@ class BuildRule:
 ExtraData="Unknown subsection: %s" % 
self.RuleContent[LineIndex])
 ## Parse  sub-section
 #
 #   @param  LineIndex   The line index of build rule text
 #
-def ParseInputFile(self, LineIndex):
+def ParseInputFileSubSection(self, LineIndex):
 FileList = [File.strip() for File in 
self.RuleContent[LineIndex].split(",")]
 for ToolChainFamily in self._FamilyList:
-InputFiles = self._RuleInfo[ToolChainFamily, self._State]
-if InputFiles is None:
-InputFiles = []
-self._RuleInfo[ToolChainFamily, self._State] = InputFiles
-InputFiles.extend(FileList)
+if self._RuleInfo[ToolChainFamily, self._State] is None:
+self._RuleInfo[ToolChainFamily, self._State] = []
+self._RuleInfo[ToolChainFamily, 
+ self._State].extend(FileList)
 
 ## Parse  sub-section
+## Parse  sub-section
+## Parse  sub-section
 #
 #   @param  LineIndex   The line index of build rule text
 #
-def ParseCommon(self, LineIndex):
+def ParseCommonSubSection(self, LineIndex):
 for ToolChainFamily in self._FamilyList:
-Items = self._RuleInfo[ToolChainFamily, self._State]
-if Items is None:
-Items = []
-self._RuleInfo[ToolChainFamily, self._State] = Items
-Items.append(self.RuleContent[LineIndex])
+if self._RuleInfo[ToolChainFamily, self._State] is None:
+self._RuleInfo[ToolChainFamily, self._State] = []
+self._RuleInfo[ToolChainFamily, 
+ self._State].append(self.RuleContent[LineIndex])
 
 ## Get a build rule via [] operator
 #
 #   @param  FileExt The extension of a file
 #   @param  ToolChainFamily The tool chain family name
@@ -582,14 +580,14 @@ class BuildRule:
 _StateHandler = {
 _SectionHeader : ParseSectionHeader,
 _Section   : ParseSection,
 _SubSectionHeader  : ParseSubSectionHeader,
 _SubSection: ParseSubSection,
-_InputFile : ParseInputFile,
-_OutputFile: ParseCommon,
-_ExtraDependency   : ParseCommon,
-_Command   : ParseCommon,
+_InputFile : ParseInputFileSubSection,
+_OutputFile: ParseCommonSubSection,
+_ExtraDependency   : ParseCommonSubSection,
+_Command   : ParseCommonSubSection,
 _UnknownSection: SkipSection,
 }
 
 # This acts like the main() function for the script, unless it is 'import'ed 
into another  # script.
--
2.12.2.windows.2

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


Re: [edk2] [PATCH] BaseTools: Use gGuidPattern for Guid regular expression

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Monday, August 06, 2018 9:02 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Use gGuidPattern for Guid regular expression

Use GlobalData.py gGuidPattern for Guid regular expression

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

diff --git a/BaseTools/Source/Python/GenFds/GenFds.py 
b/BaseTools/Source/Python/GenFds/GenFds.py
index 156aae1d0e..2307a19cbe 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -42,10 +42,11 @@ from Common.Misc import GuidStructureStringToGuidString  
from Common.BuildVersion import gBUILD_VERSION  from Common.MultipleWorkspace 
import MultipleWorkspace as mws  from . import FfsFileStatement  import glob  
from struct import unpack
+from Common.GlobalData import gGuidPattern
 
 ## Version and Copyright
 versionNumber = "1.0" + ' ' + gBUILD_VERSION  __version__ = "%prog Version " + 
versionNumber  __copyright__ = "Copyright (c) 2007 - 2018, Intel Corporation  
All rights reserved."
@@ -603,15 +604,11 @@ class GenFds :
 GuidXRefFileName = os.path.join(GenFdsGlobalVariable.FvDir, 
"Guid.xref")
 GuidXRefFile = BytesIO('')
 GuidDict = {}
 ModuleList = []
 FileGuidList = []
-GuidPattern = re.compile("\s*([0-9a-fA-F]){8}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){4}-"
-   "([0-9a-fA-F]){12}\s*")
+GuidPattern = gGuidPattern
 for Arch in ArchList:
 PlatformDataBase = 
BuildDb.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, 
GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
 for ModuleFile in PlatformDataBase.Modules:
 Module = BuildDb.BuildObject[ModuleFile, Arch, 
GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
 if Module in ModuleList:
--
2.12.2.windows.2

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


Re: [edk2] [PATCH] BaseTools: Debug message make confused

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Feng, YunhuaX 
Sent: Monday, August 06, 2018 9:09 AM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong ; Gao, Liming 
Subject: [PATCH] BaseTools: Debug message make confused

Debug message make confused

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

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

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py 
b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 06ff84b4cd..033ad644c1 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -3238,11 +3238,11 @@ class ModuleAutoGen(AutoGen):
 ToolChainFamilySet = {"", "*", self.ToolChainFamily, 
self.BuildRuleFamily}
 for F in self.Module.Sources:
 # match tool chain
 if F.TagName not in ToolChainTagSet:
 EdkLogger.debug(EdkLogger.DEBUG_9, "The toolchain [%s] for 
processing file [%s] is found, "
-"but [%s] is needed" % (F.TagName, str(F), 
self.ToolChain))
+"but [%s] is currently used" % (F.TagName, 
str(F), self.ToolChain))
 continue
 # match tool chain family or build rule family
 if F.ToolChainFamily not in ToolChainFamilySet:
 EdkLogger.debug(
 EdkLogger.DEBUG_0,
-- 
2.12.2.windows.2

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


Re: [edk2] [platforms: PATCH v2 0/9] Armada7k8k DT/ACPI support

2018-08-07 Thread Marcin Wojtas
Hi Mark,

wt., 7 sie 2018 o 23:48 Mark Kettenis  napisał(a):
>
> > From: Marcin Wojtas 
> > Date: Tue, 7 Aug 2018 13:28:19 +0200
> >
> > wt., 7 sie 2018 o 11:18 Ard Biesheuvel  
> > napisał(a):
> > >
> > > On 7 August 2018 at 10:58, Marcin Wojtas  wrote:
> > > > Hi,
> > > >
> > > > The second version of the patchset modifies AcpiTables
> > > > directory structure in order to avoid passing relative
> > > > paths in the boards' .inf files.
> > > >
> > > > The patches are available in the github:
> > > > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180807
> > > >
> > > > I'm looking forward to review and any comments/remarks.
> > > >
> > > > Best regards,
> > > > Marcin
> > > >
> > > > Marcin Wojtas (9):
> > > >   Marvell/Armada7k8k: Import device tree
> > > >   Marvell/Armada7k8k: Enable including additional DXE FV components
> > > >   Marvell/Armada70x0Db: Enable device tree support
> > > >   Marvell/Armada80x0Db: Enable device tree support
> > > >   Marvell/Armada80x0McBin: Enable device tree support
> > > >   Marvell/Armada7k8k: Add common ACPI tables
> > > >   Marvell/Armada70x0Db: Enable ACPI support
> > > >   Marvell/Armada80x0Db: Enable ACPI support
> > > >   Marvell/Armada80x0McBin: Enable ACPI support
> > > >
> > >
> > > Reviewed-by: Ard Biesheuvel 
> > >
> > > Pushed as 02daa58c21f8..89c6c77b3d91
> > >
> >
> > Thank you!
> > Marcin
>
> Thank you Marcin!
>
> My MACCHIATObin is now running OpenBSD/arm64 on firmware based on
> unmodified mainline ATF and mainline EDK II.

I'm pleased to read that. Last bits left and the mainline
edk2-platforms support will be complete.

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


Re: [edk2] Question about memory map entries

2018-08-07 Thread Yao, Jiewen
Hi
It is unclear to me that which type you have put to MemoryTypeInfo table.

By design, we only need put Reserved/Acpi/Runtime, which should be quite small.

Do you put any other type into MemoryTypeInfo table?

Thank you
Yao Jiewen

From: Rafael Machado [mailto:rafaelrodrigues.mach...@gmail.com]
Sent: Wednesday, August 8, 2018 3:12 AM
To: Laszlo Ersek 
Cc: Andrew Fish ; Ni, Ruiyu ; 
edk2-devel@lists.01.org; Yao, Jiewen 
Subject: Re: [edk2] Question about memory map entries

Hi everyone

Based on the information shared by the members, the understanding is that the 
current state of the system may impact fuutre boots.
The problem is that in my case, due to specific requirements, before booting we 
need to stress the system's memory, allocating a big amount of memory and doing 
some memory validation algorithms.
So the high number of allocations and frees is by choice and not by mistakes.

Considering this. Is there any way to bypass the MemoryTypeInformation var 
store actions?

Thanks and Regards
Rafael

Em qui, 2 de ago de 2018 às 17:39, Laszlo Ersek 
mailto:ler...@redhat.com>> escreveu:
On 08/02/18 21:18, Rafael Machado wrote:
> Just found something interesting.
> Based on the logs from the serial port.
>
> This system works fine:
>
> "PeiInstallPeiMemory MemoryBegin 0x93D5, MemoryLength 0xA2B
> Temp Stack : BaseAddress=0x40 Length=0x8
> Temp Heap  : BaseAddress=0x48 Length=0x8
> Total temporary memory:1048576 bytes.
>   temporary memory stack ever used: 524288 bytes.
>   temporary memory heap used:   63304 bytes.
> Old Stack size 524288, New stack size 524288
> Stack Hob: BaseAddress=0x93D5 Length=0x8
> Heap Offset = 0x9395 Stack Offset = 0x9395
> Loading PEIM at 0x0009DFF4000 EntryPoint=0x0009DFF4260 PeiCore.efi"
> ...
> "CoreInitializeMemoryServices:
>   BaseAddress - 0x93DE1000 Length - 0x8135000 MinimalMemorySizeNeeded -
> 0x5AC"
>
> This one is bricked:
>
> "PeiInstallPeiMemory MemoryBegin 0x9C9000, MemoryLength 0x9D637000
> Temp Stack : BaseAddress=0x40 Length=0x8
> Temp Heap  : BaseAddress=0x48 Length=0x8
> Total temporary memory:1048576 bytes.
>   temporary memory stack ever used: 524288 bytes.
>   temporary memory heap used:   63304 bytes.
> Old Stack size 524288, New stack size 524288
> Stack Hob: BaseAddress=0x9C9000 Length=0x8
> Heap Offset = 0x5C9000 Stack Offset = 0x5C9000
> Loading PEIM at 0x0009DFF4000 EntryPoint=0x0009DFF4260 PeiCore.efi"
> ...
> "CoreInitializeMemoryServices:
>   BaseAddress - 0x0 Length - 0x0 MinimalMemorySizeNeeded - 0x98E47000
> "
> ...
> "ASSERT_EFI_ERROR (Status = Out of Resources)
> ASSERT [DxeCore] ...\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c(299):
> !EFI_ERROR (Status)
> AllocatePoolPages: failed to allocate 1 pages
> AllocatePool: failed to allocate 120 bytes"

The location and the size of the permanent PEI RAM are extremely
different between the two cases.

- Functional system:

  PeiInstallPeiMemory MemoryBegin 0x93D5, MemoryLength 0xA2B

  Base address is ~2365 MB, size is ~162 MB

- Unbootable system:

  PeiInstallPeiMemory MemoryBegin 0x9C9000, MemoryLength 0x9D637000

  Base address is ~9 MB, size is ~2518 MB

The numbers in the second (unbootable) case look very unusual to me. The
permanent PEI RAM is usually tens or (maybe) hundreds of megabytes in
size, and tends to start much higher (usually as high as possible under
4GB, on x86 anyway).


Consult the following sections in the PI spec (v1.6), volume 3:

- 4.3 Example HOB Producer Phase Memory Map and Usage
- 5.3 PHIT HOB

The CoreInitializeMemoryServices() function searches the HOB list for a
tested system memory "Resource Descriptor HOB that contains PHIT range
EfiFreeMemoryBottom..EfiFreeMemoryTop". (Quoted a comment from the code.)

Basically, the function locates the system RAM HOB that contains the
free permanent PEI RAM.

If the search fails, then we trip an ASSERT(). This does not happen in
your case, the search succeeds.

If the search succeeds, then the DXE core will try to initialize itself
in one of three locations in the RAM area defined by that HOB. In
descending preference order: above the permanent PEI RAM, within the
free permanent PEI RAM, and below the permanent PEI RAM.

There is also a fallback (a fourth option) when even the third one from
before proves too small -- the function will then search again for a
memory descriptor HOB, top-down, avoiding the one HOB that it found
earlier to contain the permanent PEI RAM (because, all three options for
that have already failed, see above).

As the result of this search, your broken system finishes with:

BaseAddress - 0x0 Length - 0x0 MinimalMemorySizeNeeded - 0x98E47000

"MinimalMemorySizeNeeded" includes the previous measurements from
MemoryTypeInformation, and the concrete value is very strange -- it
seems to imply that you need ~2446 MB for initializing the DXE core.
It's not surprising that the function cannot fit that anywhere, in
either of 

[edk2] [PATCH v1 1/1] BaseTools: Eot - fix variable names

2018-08-07 Thread Jaben Carsey
1) currently a couple classes use m instead of self (including some mixed
functions that should have previously failed).
2) deleted some blank lines.

Cc: Yonghong Zhu 
Cc: Liming Gao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey 
---
 BaseTools/Source/Python/Eot/Eot.py | 298 ++--
 1 file changed, 144 insertions(+), 154 deletions(-)

diff --git a/BaseTools/Source/Python/Eot/Eot.py 
b/BaseTools/Source/Python/Eot/Eot.py
index 6fb882642bff..ce83da14957b 100644
--- a/BaseTools/Source/Python/Eot/Eot.py
+++ b/BaseTools/Source/Python/Eot/Eot.py
@@ -123,49 +123,49 @@ class CompressedImage(Image):
 _ORIG_SIZE_ = struct.Struct("1I")
 _CMPRS_TYPE_= struct.Struct("4x 1B")
 
-def __init__(m, CompressedData=None, CompressionType=None, 
UncompressedLength=None):
-Image.__init__(m)
+def __init__(self, CompressedData=None, CompressionType=None, 
UncompressedLength=None):
+Image.__init__(self)
 if UncompressedLength is not None:
-m.UncompressedLength = UncompressedLength
+self.UncompressedLength = UncompressedLength
 if CompressionType is not None:
-m.CompressionType = CompressionType
+self.CompressionType = CompressionType
 if CompressedData is not None:
-m.Data = CompressedData
+self.Data = CompressedData
 
-def __str__(m):
+def __str__(self):
 global gIndention
-S = "algorithm=%s uncompressed=%x" % (m.CompressionType, 
m.UncompressedLength)
-for Sec in m.Sections:
+S = "algorithm=%s uncompressed=%x" % (self.CompressionType, 
self.UncompressedLength)
+for Sec in self.Sections:
 S += '\n' + str(Sec)
 
 return S
 
-def _SetOriginalSize(m, Size):
-m.SetField(m._ORIG_SIZE_, 0, Size)
+def _SetOriginalSize(self, Size):
+self.SetField(self._ORIG_SIZE_, 0, Size)
 
-def _GetOriginalSize(m):
-return m.GetField(m._ORIG_SIZE_)[0]
+def _GetOriginalSize(self):
+return self.GetField(self._ORIG_SIZE_)[0]
 
-def _SetCompressionType(m, Type):
-m.SetField(m._CMPRS_TYPE_, 0, Type)
+def _SetCompressionType(self, Type):
+self.SetField(self._CMPRS_TYPE_, 0, Type)
 
-def _GetCompressionType(m):
-return m.GetField(m._CMPRS_TYPE_)[0]
+def _GetCompressionType(self):
+return self.GetField(self._CMPRS_TYPE_)[0]
 
-def _GetSections(m):
+def _GetSections(self):
 try:
 from . import EfiCompressor
 TmpData = EfiCompressor.FrameworkDecompress(
-m[m._HEADER_SIZE_:],
-len(m) - m._HEADER_SIZE_
+self[self._HEADER_SIZE_:],
+len(self) - self._HEADER_SIZE_
 )
 DecData = array('B')
 DecData.fromstring(TmpData)
 except:
 from . import EfiCompressor
 TmpData = EfiCompressor.UefiDecompress(
-m[m._HEADER_SIZE_:],
-len(m) - m._HEADER_SIZE_
+self[self._HEADER_SIZE_:],
+len(self) - self._HEADER_SIZE_
 )
 DecData = array('B')
 DecData.fromstring(TmpData)
@@ -195,20 +195,20 @@ class Ui(Image):
 _HEADER_ = struct.Struct("")
 _HEADER_SIZE_ = 0
 
-def __init__(m):
-Image.__init__(m)
+def __init__(self):
+Image.__init__(self)
 
-def __str__(m):
-return m.String
+def __str__(self):
+return self.String
 
-def _Unpack(m):
+def _Unpack(self):
 # keep header in this Image object
-m.empty()
-m.extend(m._BUF_[m._OFF_ : m._OFF_ + m._LEN_])
-return len(m)
+self.empty()
+self.extend(self._BUF_[self._OFF_ : self._OFF_ + self._LEN_])
+return len(self)
 
-def _GetUiString(m):
-return codecs.utf_16_decode(m[0:-2].tostring())[0]
+def _GetUiString(self):
+return codecs.utf_16_decode(self[0:-2].tostring())[0]
 
 String = property(_GetUiString)
 
@@ -250,18 +250,18 @@ class Depex(Image):
 0x09:   _OPCODE_,   #"SOR"
 }
 
-def __init__(m):
-Image.__init__(m)
-m._ExprList = []
+def __init__(self):
+Image.__init__(self)
+self._ExprList = []
 
-def __str__(m):
+def __str__(self):
 global gIndention
 gIndention += 4
 Indention = ' ' * gIndention
 S = '\n'
-for T in m.Expression:
-if T in m._OPCODE_STRING_:
-S += Indention + m._OPCODE_STRING_[T]
+for T in self.Expression:
+if T in self._OPCODE_STRING_:
+S += Indention + 

Re: [edk2] [platforms: PATCH v2 0/9] Armada7k8k DT/ACPI support

2018-08-07 Thread Mark Kettenis
> From: Marcin Wojtas 
> Date: Tue, 7 Aug 2018 13:28:19 +0200
> 
> wt., 7 sie 2018 o 11:18 Ard Biesheuvel  napisał(a):
> >
> > On 7 August 2018 at 10:58, Marcin Wojtas  wrote:
> > > Hi,
> > >
> > > The second version of the patchset modifies AcpiTables
> > > directory structure in order to avoid passing relative
> > > paths in the boards' .inf files.
> > >
> > > The patches are available in the github:
> > > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180807
> > >
> > > I'm looking forward to review and any comments/remarks.
> > >
> > > Best regards,
> > > Marcin
> > >
> > > Marcin Wojtas (9):
> > >   Marvell/Armada7k8k: Import device tree
> > >   Marvell/Armada7k8k: Enable including additional DXE FV components
> > >   Marvell/Armada70x0Db: Enable device tree support
> > >   Marvell/Armada80x0Db: Enable device tree support
> > >   Marvell/Armada80x0McBin: Enable device tree support
> > >   Marvell/Armada7k8k: Add common ACPI tables
> > >   Marvell/Armada70x0Db: Enable ACPI support
> > >   Marvell/Armada80x0Db: Enable ACPI support
> > >   Marvell/Armada80x0McBin: Enable ACPI support
> > >
> >
> > Reviewed-by: Ard Biesheuvel 
> >
> > Pushed as 02daa58c21f8..89c6c77b3d91
> >
> 
> Thank you!
> Marcin

Thank you Marcin!

My MACCHIATObin is now running OpenBSD/arm64 on firmware based on
unmodified mainline ATF and mainline EDK II.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms] Silicon/Hisilicon: add PlatformBootManagerUnableToBoot() to PlatformBm

2018-08-07 Thread Ard Biesheuvel
On 7 August 2018 at 22:51, Leif Lindholm  wrote:
> edk2 commit 1010873becc5,
> ("MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()") broke the
> d0x build, since they use their own PlatformBootManagerLib, which did not
> include this function.
>
> Implement a trivial one, that just returns.
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Leif Lindholm 

Reviewed-by: Ard Biesheuvel 

> ---
>
> NOTE: The upstream build is currently broken. This failure needs to be
> addressed before d02 deletion and d03 fix can go in.
>
>  Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c | 16 
> 
>  1 file changed, 16 insertions(+)
>
> diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c 
> b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> index 7dd5ba615c..aa6db929ca 100644
> --- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> +++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -641,3 +641,19 @@ PlatformBootManagerWaitCallback (
>  0
>  );
>  }
> +
> +/**
> +  The function is called when no boot option could be launched,
> +  including platform recovery options and options pointing to applications
> +  built into firmware volumes.
> +
> +  If this function returns, BDS attempts to enter an infinite loop.
> +**/
> +VOID
> +EFIAPI
> +PlatformBootManagerUnableToBoot (
> +  VOID
> +  )
> +{
> +  return;
> +}
> --
> 2.11.0
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms] Silicon/Hisilicon: add PlatformBootManagerUnableToBoot() to PlatformBm

2018-08-07 Thread Leif Lindholm
edk2 commit 1010873becc5,
("MdeModulePkg/BdsDxe: Call PlatformBootManagerUnableToBoot()") broke the
d0x build, since they use their own PlatformBootManagerLib, which did not
include this function.

Implement a trivial one, that just returns.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Leif Lindholm 
---

NOTE: The upstream build is currently broken. This failure needs to be
addressed before d02 deletion and d03 fix can go in.

 Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c | 16 

 1 file changed, 16 insertions(+)

diff --git a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c 
b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
index 7dd5ba615c..aa6db929ca 100644
--- a/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/Silicon/Hisilicon/Library/PlatformBootManagerLib/PlatformBm.c
@@ -641,3 +641,19 @@ PlatformBootManagerWaitCallback (
 0
 );
 }
+
+/**
+  The function is called when no boot option could be launched,
+  including platform recovery options and options pointing to applications
+  built into firmware volumes.
+
+  If this function returns, BDS attempts to enter an infinite loop.
+**/
+VOID
+EFIAPI
+PlatformBootManagerUnableToBoot (
+  VOID
+  )
+{
+  return;
+}
-- 
2.11.0

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


Re: [edk2] Question about memory map entries

2018-08-07 Thread Rafael Machado
Hi everyone

Based on the information shared by the members, the understanding is that
the current state of the system may impact fuutre boots.
The problem is that in my case, due to specific requirements, before
booting we need to stress the system's memory, allocating a big amount of
memory and doing some memory validation algorithms.
So the high number of allocations and frees is by choice and not by
mistakes.

Considering this. Is there any way to bypass the MemoryTypeInformation var
store actions?

Thanks and Regards
Rafael

Em qui, 2 de ago de 2018 às 17:39, Laszlo Ersek 
escreveu:

> On 08/02/18 21:18, Rafael Machado wrote:
> > Just found something interesting.
> > Based on the logs from the serial port.
> >
> > This system works fine:
> >
> > "PeiInstallPeiMemory MemoryBegin 0x93D5, MemoryLength 0xA2B
> > Temp Stack : BaseAddress=0x40 Length=0x8
> > Temp Heap  : BaseAddress=0x48 Length=0x8
> > Total temporary memory:1048576 bytes.
> >   temporary memory stack ever used: 524288 bytes.
> >   temporary memory heap used:   63304 bytes.
> > Old Stack size 524288, New stack size 524288
> > Stack Hob: BaseAddress=0x93D5 Length=0x8
> > Heap Offset = 0x9395 Stack Offset = 0x9395
> > Loading PEIM at 0x0009DFF4000 EntryPoint=0x0009DFF4260 PeiCore.efi"
> > ...
> > "CoreInitializeMemoryServices:
> >   BaseAddress - 0x93DE1000 Length - 0x8135000 MinimalMemorySizeNeeded -
> > 0x5AC"
> >
> > This one is bricked:
> >
> > "PeiInstallPeiMemory MemoryBegin 0x9C9000, MemoryLength 0x9D637000
> > Temp Stack : BaseAddress=0x40 Length=0x8
> > Temp Heap  : BaseAddress=0x48 Length=0x8
> > Total temporary memory:1048576 bytes.
> >   temporary memory stack ever used: 524288 bytes.
> >   temporary memory heap used:   63304 bytes.
> > Old Stack size 524288, New stack size 524288
> > Stack Hob: BaseAddress=0x9C9000 Length=0x8
> > Heap Offset = 0x5C9000 Stack Offset = 0x5C9000
> > Loading PEIM at 0x0009DFF4000 EntryPoint=0x0009DFF4260 PeiCore.efi"
> > ...
> > "CoreInitializeMemoryServices:
> >   BaseAddress - 0x0 Length - 0x0 MinimalMemorySizeNeeded - 0x98E47000
> > "
> > ...
> > "ASSERT_EFI_ERROR (Status = Out of Resources)
> > ASSERT [DxeCore] ...\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c(299):
> > !EFI_ERROR (Status)
> > AllocatePoolPages: failed to allocate 1 pages
> > AllocatePool: failed to allocate 120 bytes"
>
> The location and the size of the permanent PEI RAM are extremely
> different between the two cases.
>
> - Functional system:
>
>   PeiInstallPeiMemory MemoryBegin 0x93D5, MemoryLength 0xA2B
>
>   Base address is ~2365 MB, size is ~162 MB
>
> - Unbootable system:
>
>   PeiInstallPeiMemory MemoryBegin 0x9C9000, MemoryLength 0x9D637000
>
>   Base address is ~9 MB, size is ~2518 MB
>
> The numbers in the second (unbootable) case look very unusual to me. The
> permanent PEI RAM is usually tens or (maybe) hundreds of megabytes in
> size, and tends to start much higher (usually as high as possible under
> 4GB, on x86 anyway).
>
>
> Consult the following sections in the PI spec (v1.6), volume 3:
>
> - 4.3 Example HOB Producer Phase Memory Map and Usage
> - 5.3 PHIT HOB
>
> The CoreInitializeMemoryServices() function searches the HOB list for a
> tested system memory "Resource Descriptor HOB that contains PHIT range
> EfiFreeMemoryBottom..EfiFreeMemoryTop". (Quoted a comment from the code.)
>
> Basically, the function locates the system RAM HOB that contains the
> free permanent PEI RAM.
>
> If the search fails, then we trip an ASSERT(). This does not happen in
> your case, the search succeeds.
>
> If the search succeeds, then the DXE core will try to initialize itself
> in one of three locations in the RAM area defined by that HOB. In
> descending preference order: above the permanent PEI RAM, within the
> free permanent PEI RAM, and below the permanent PEI RAM.
>
> There is also a fallback (a fourth option) when even the third one from
> before proves too small -- the function will then search again for a
> memory descriptor HOB, top-down, avoiding the one HOB that it found
> earlier to contain the permanent PEI RAM (because, all three options for
> that have already failed, see above).
>
> As the result of this search, your broken system finishes with:
>
> BaseAddress - 0x0 Length - 0x0 MinimalMemorySizeNeeded - 0x98E47000
>
> "MinimalMemorySizeNeeded" includes the previous measurements from
> MemoryTypeInformation, and the concrete value is very strange -- it
> seems to imply that you need ~2446 MB for initializing the DXE core.
> It's not surprising that the function cannot fit that anywhere, in
> either of the four options described above.
>
> If your system has more (high) RAM to spare, try to install a resource
> descriptor HOB for it. Then the fourth option might succeed.
>
> Honestly though, those permanent PEI RAM values (base address at ~9 MB,
> size ~2518 MB) look super fishy to me in the first place. Something must
> be 

Re: [edk2] [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive compare

2018-08-07 Thread Jim.Dailey
Ray,

Table 8 in version 2.2 of the Shell Spec says "lasterror" (lower-case L).  Why
compare to "Lasterror"?

Regards,
Jim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com] 
Sent: Tuesday, August 7, 2018 12:57 PM
To: Ni, Ruiyu; edk2-devel@lists.01.org
Cc: Dailey, Jim
Subject: RE: [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive 
compare

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Tuesday, August 07, 2018 2:14 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Jim Dailey
> 
> Subject: [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive
> compare
> Importance: High
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=777
> 
> Per Shell spec, the environment variable has a case-sensitive name.
> But today's implementation of EfiShellSetEnv() compares the
> environment variable name case insensitively, which causes variable
> like "CWD" cannot be set due to "cwd" is pre-defined variable.
> 
> The patch fixes this issue.
> 
> The EfiShellGetEnv() doesn't have such issue because it will
> call into ShellFindEnvVarInList() which uses StrCmp().
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Jaben Carsey 
> Cc: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/ShellProtocol.c | 39 
> +++---
>  1 file changed, 9 insertions(+), 30 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> b/ShellPkg/Application/Shell/ShellProtocol.c
> index f2ca2029e3..767cbc99a0 100644
> --- a/ShellPkg/Application/Shell/ShellProtocol.c
> +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> @@ -2924,36 +2924,15 @@ EfiShellSetEnv(
>//
>// Make sure we dont 'set' a predefined read only variable
>//
> -  if (gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"cwd") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"Lasterror") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"profiles") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefishellsupport") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefishellversion") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefiversion") == 0
> -||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> -  gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -(CHAR16*)mNoNestingEnvVarName) == 0)
> -   ){
> +  if ((StrCmp (Name, L"cwd") == 0) ||
> +  (StrCmp (Name, L"Lasterror") == 0) ||
> +  (StrCmp (Name, L"profiles") == 0) ||
> +  (StrCmp (Name, L"uefishellsupport") == 0) ||
> +  (StrCmp (Name, L"uefishellversion") == 0) ||
> +  (StrCmp (Name, L"uefiversion") == 0) ||
> +  (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> +   StrCmp (Name, mNoNestingEnvVarName) == 0)
> + ) {
>  return (EFI_INVALID_PARAMETER);
>}
>return (InternalEfiShellSetEnv(Name, Value, Volatile));
> --
> 2.16.1.windows.1

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


Re: [edk2] [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive compare

2018-08-07 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Tuesday, August 07, 2018 2:14 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Jim Dailey
> 
> Subject: [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive
> compare
> Importance: High
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=777
> 
> Per Shell spec, the environment variable has a case-sensitive name.
> But today's implementation of EfiShellSetEnv() compares the
> environment variable name case insensitively, which causes variable
> like "CWD" cannot be set due to "cwd" is pre-defined variable.
> 
> The patch fixes this issue.
> 
> The EfiShellGetEnv() doesn't have such issue because it will
> call into ShellFindEnvVarInList() which uses StrCmp().
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Jaben Carsey 
> Cc: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/ShellProtocol.c | 39 
> +++---
>  1 file changed, 9 insertions(+), 30 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> b/ShellPkg/Application/Shell/ShellProtocol.c
> index f2ca2029e3..767cbc99a0 100644
> --- a/ShellPkg/Application/Shell/ShellProtocol.c
> +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> @@ -2924,36 +2924,15 @@ EfiShellSetEnv(
>//
>// Make sure we dont 'set' a predefined read only variable
>//
> -  if (gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"cwd") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"Lasterror") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"profiles") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefishellsupport") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefishellversion") == 0
> -||gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -L"uefiversion") == 0
> -||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> -  gUnicodeCollation->StriColl(
> -gUnicodeCollation,
> -(CHAR16*)Name,
> -(CHAR16*)mNoNestingEnvVarName) == 0)
> -   ){
> +  if ((StrCmp (Name, L"cwd") == 0) ||
> +  (StrCmp (Name, L"Lasterror") == 0) ||
> +  (StrCmp (Name, L"profiles") == 0) ||
> +  (StrCmp (Name, L"uefishellsupport") == 0) ||
> +  (StrCmp (Name, L"uefishellversion") == 0) ||
> +  (StrCmp (Name, L"uefiversion") == 0) ||
> +  (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
> +   StrCmp (Name, mNoNestingEnvVarName) == 0)
> + ) {
>  return (EFI_INVALID_PARAMETER);
>}
>return (InternalEfiShellSetEnv(Name, Value, Volatile));
> --
> 2.16.1.windows.1

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


Re: [edk2] [PATCH edk2-platforms v1 0/2] Modify following Switch generic PciHostBridge

2018-08-07 Thread Ming


在 8/6/2018 6:57 PM, Leif Lindholm 写道:
> On Sun, Aug 05, 2018 at 10:38:53AM +0800, Ming Huang wrote:
>> The major features of this patchset include:
>> 1. Remove D02 platform;
>> 2. Fix a D03 issue about switch generic PciHostBridge;
>>
>> Code can also be found in github: 
>> https://github.com/hisilicon/OpenPlatformPkg.git
>> branch: rm-D02
> 
> This looks fine, but I think we also need a companion patch to delete
> items only used by D02 from edk2-non-osi.
> 
> /
> Leif
> 

I have sent the companion patch out.

Ming

>> Ming Huang (2):
>>   Hisilicon/D02: Remove D02 platform
>>   Platform/Hisilicon/D03: Fix PlatformPciLib path wrong issue
>>
>>  Platform/Hisilicon/D02/Pv660D02.dec   |  44 --
>>  Platform/Hisilicon/D02/Pv660D02.dsc   | 425 --
>>  Platform/Hisilicon/D03/D03.dsc|   4 +-
>>  Platform/Hisilicon/D02/Pv660D02.fdf   | 321 -
>>  .../D02/EarlyConfigPeim/EarlyConfigPeim.inf   |  53 ---
>>  .../D02/FdtUpdateLibD02/FdtUpdateLib.inf  |  43 --
>>  .../Library/OemMiscLibD02/OemMiscLibD02.inf   |  45 --
>>  .../Library/PlatformPciLib/PlatformPciLib.inf | 182 
>>  .../D02/OemNicConfigD02/OemNicConfigD02.inf   |  50 ---
>>  .../Hisilicon/D02/Include/Library/CpldD02.h   |  34 --
>>  .../D02/OemNicConfigD02/OemNicConfig.h|  31 --
>>  .../D02/EarlyConfigPeim/EarlyConfigPeim.c |  94 
>>  .../D02/FdtUpdateLibD02/FdtUpdateLib.c| 341 --
>>  .../Library/OemMiscLibD02/BoardFeatureD02.c   | 105 -
>>  .../D02/Library/OemMiscLibD02/OemMiscLibD02.c |  77 
>>  .../Library/PlatformPciLib/PlatformPciLib.c   | 147 --
>>  .../D02/OemNicConfigD02/OemNicConfigD02.c | 173 ---
>>  .../Drivers/AcpiPlatformDxe/EthMac.c  |   4 +-
>>  .../OemMiscLibD02/BoardFeatureD02Strings.uni  | Bin 1796 -> 0 bytes
>>  19 files changed, 3 insertions(+), 2170 deletions(-)
>>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.dec
>>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.dsc
>>  delete mode 100644 Platform/Hisilicon/D02/Pv660D02.fdf
>>  delete mode 100644 
>> Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf
>>  delete mode 100644 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/OemMiscLibD02/OemMiscLibD02.inf
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
>>  delete mode 100644 
>> Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf
>>  delete mode 100644 Platform/Hisilicon/D02/Include/Library/CpldD02.h
>>  delete mode 100644 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfig.h
>>  delete mode 100644 Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.c
>>  delete mode 100644 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.c
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/OemMiscLibD02/BoardFeatureD02.c
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/OemMiscLibD02/OemMiscLibD02.c
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.c
>>  delete mode 100644 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.c
>>  delete mode 100644 
>> Platform/Hisilicon/D02/Library/OemMiscLibD02/BoardFeatureD02Strings.uni
>>
>> -- 
>> 2.17.0
>>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v1 05/38] Platform/Hisilicon/D06: Add binary file for D06

2018-08-07 Thread Ming


在 8/3/2018 1:05 AM, Leif Lindholm 写道:
> Could the subject be changed to "add edk2-non-osi components for D06"?
> 

OK

> I should point out that I really like how this is done as a separate
> patch.
> 

The binary libraries are need for following patch, so this patch is
added here.

> On Tue, Jul 24, 2018 at 03:08:49PM +0800, Ming Huang wrote:
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Ming Huang 
>> Signed-off-by: Heyi Guo 
>> ---
>>  Platform/Hisilicon/D06/D06.dsc |  7 +++
>>  Platform/Hisilicon/D06/D06.fdf | 17 +
>>  2 files changed, 24 insertions(+)
>>
>> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
>> index e05c97e1c6..88869ba26e 100644
>> --- a/Platform/Hisilicon/D06/D06.dsc
>> +++ b/Platform/Hisilicon/D06/D06.dsc
>> @@ -42,6 +42,8 @@
>>  
>>I2CLib|Silicon/Hisilicon/Library/I2CLib/I2CLib.inf
>>TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
>> +  IpmiCmdLib|Silicon/Hisilicon/Hi1610/Library/IpmiCmdLib/IpmiCmdLib.inf
>> +
> 
> Hmm, does this suggest that the IpmiCmdLib should move out of Hi1610
> to Silicon/Hisilicon/Library?
> This is now the fourth platform making use of the Hi1610 variant.
> 
> /
> Leif
> 

It is better to move out of Hi1610. I will add a patch to this patch set
for D0x and add another patch for edk2-non-osi.

Ming

>>NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
>>DpcLib|MdeModulePkg/Library/DxeDpcLib/DxeDpcLib.inf
>>HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
>> @@ -65,8 +67,12 @@
>>  
>>CpldIoLib|Silicon/Hisilicon/Library/CpldIoLib/CpldIoLib.inf
>>  
>> +  
>> SerdesLib|Silicon/Hisilicon/Hi1620/Library/Hi1620Serdes/Hi1620SerdesLib.inf
>> +
>>TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
>>
>> RealTimeClockLib|Platform/Hisilicon/D06/Library/M41T83RealTimeClockLib/M41T83RealTimeClockLib.inf
>> +  
>> OemAddressMapLib|Platform/Hisilicon/D06/Library/OemAddressMapD06/OemAddressMapD06.inf
>> +  
>> PlatformSysCtrlLib|Silicon/Hisilicon/Hi1620/Library/PlatformSysCtrlLibHi1620/PlatformSysCtrlLibHi1620.inf
>>  
>>CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
>>
>> GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
>> @@ -82,6 +88,7 @@
>># USB Requirements
>>UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
>>  
>> +  LpcLib|Silicon/Hisilicon/Hi1620/Library/LpcLibHi1620/LpcLib.inf
>>
>> SerialPortLib|ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf
>>  !if $(SECURE_BOOT_ENABLE) == TRUE
>>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
>> diff --git a/Platform/Hisilicon/D06/D06.fdf b/Platform/Hisilicon/D06/D06.fdf
>> index 93c464c9f7..2730eb42a9 100644
>> --- a/Platform/Hisilicon/D06/D06.fdf
>> +++ b/Platform/Hisilicon/D06/D06.fdf
>> @@ -56,6 +56,7 @@ NumBlocks = 0x40
>>  
>>  0x|0x0010
>>  gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvSize
>> +FILE = Platform/Hisilicon/D06/Sec/FVMAIN_SEC.Fv
>>  
>>  0x0010|0x0028
>>  gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
>> @@ -163,6 +164,7 @@ READ_LOCK_STATUS   = TRUE
>>INF MdeModulePkg/Core/Dxe/DxeMain.inf
>>INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
>>  
>> +  INF Platform/Hisilicon/D06/Drivers/IoInitDxe/IoInitDxe.inf
>>#
>># PI DXE Drivers producing Architectural Protocols (EFI Services)
>>#
>> @@ -170,6 +172,7 @@ READ_LOCK_STATUS   = TRUE
>>INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
>>  
>>INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>> +  INF Platform/Hisilicon/D06/Drivers/SFC/SfcDxeDriver.inf
>>  
>>  
>>INF Silicon/Hisilicon/Drivers/FlashFvbDxe/FlashFvbDxe.inf
>> @@ -225,10 +228,15 @@ READ_LOCK_STATUS   = TRUE
>>INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
>>INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
>>  
>> +  INF 
>> Platform/Hisilicon/D06/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
>> +  INF Platform/Hisilicon/D06/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
>>INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
>>INF Silicon/Hisilicon/Drivers/Smbios/SmbiosMiscDxe/SmbiosMiscDxe.inf
>>INF Silicon/Hisilicon/Drivers/Smbios/AddSmbiosType9/AddSmbiosType9.inf
>> +  INF Platform/Hisilicon/D06/Drivers/TransferSmbiosInfo/TransSmbiosInfo.inf
>> +  INF Platform/Hisilicon/D06/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf
>>  
>> +  INF Platform/Hisilicon/D06/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf
>>  
>>  
>>INF 
>> Silicon/Hisilicon/Drivers/Smbios/MemorySubClassDxe/MemorySubClassDxe.inf
>> @@ -246,6 +254,7 @@ READ_LOCK_STATUS   = TRUE
>>#
>>#Network
>>#
>> +  INF Platform/Hisilicon/D06/Drivers/Net/SnpHi1620NewDxe/SnpDxe.inf
>>  
>>INF MdeModulePkg/Universal/Network/SnpDxe/SnpDxe.inf
>>INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
>> @@ -282,8 +291,14 @@ 

[edk2] [PATCH edk2-non-osi v1 0/1] Remove D02 Platform

2018-08-07 Thread Ming Huang
The major features of this patchset include:
1. Remove D02 platform;

Code can also be found in github: 
https://github.com/hisilicon/OpenPlatformPkg.git
branch: rm-D02-non-osi

*** BLURB HERE ***

Ming Huang (1):
  Hisilicon/D02: Remove D02 platform

 .../AtaAtapiPassThru/AtaAtapiPassThru.inf |  28 -
 .../Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf   |  28 -
 .../D02/Drivers/SFC/SfcDxeDriver.inf  |  29 --
 .../OemAddressMapPv660D02.inf |  44 --
 .../D02/MemoryInitPei/MemoryInitPeim.inf  |  33 ---
 .../PlatformSysCtrlLibPv660.inf   |  54 --
 .../Library/Pv660Serdes/Pv660SerdesLib.inf|  48 
 .../AtaAtapiPassThruDxe.depex | Bin 234 -> 0 bytes
 .../AtaAtapiPassThru/AtaAtapiPassThruDxe.efi  | Bin 80192 -> 0 bytes
 .../Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi   | Bin 62528 -> 0 bytes
 .../Hisilicon/D02/Drivers/SFC/SFCDriver.depex | Bin 36 -> 0 bytes
 .../Hisilicon/D02/Drivers/SFC/SFCDriver.efi   | Bin 262144 -> 0 bytes
 .../OemAddressMapPv660D02.lib | Bin 19648 -> 0 bytes
 .../D02/MemoryInitPei/MemoryInit.efi  | Bin 160672 -> 0 bytes
 Platform/Hisilicon/D02/Sec/FVMAIN_SEC.Fv  | Bin 262144 -> 0 bytes
 Platform/Hisilicon/D02/bl1.bin| Bin 12296 -> 0 bytes
 Platform/Hisilicon/D02/fip.bin| Bin 45621 -> 0 bytes
 .../PlatformSysCtrlLibPv660.lib   | Bin 356858 -> 0 bytes
 .../Library/Pv660Serdes/Pv660SerdesLib.lib| Bin 431524 -> 0 bytes
 19 files changed, 264 deletions(-)
 delete mode 100644 
Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThru.inf
 delete mode 100644 
Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
 delete mode 100644 Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
 delete mode 100644 
Platform/Hisilicon/D02/Library/AddressMapPv660D02/OemAddressMapPv660D02.inf
 delete mode 100644 Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
 delete mode 100644 
Silicon/Hisilicon/Pv660/Library/PlatformSysCtrlLibPv660/PlatformSysCtrlLibPv660.inf
 delete mode 100644 
Silicon/Hisilicon/Pv660/Library/Pv660Serdes/Pv660SerdesLib.inf
 delete mode 100644 
Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThruDxe.depex
 delete mode 100644 
Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThruDxe.efi
 delete mode 100644 
Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi
 delete mode 100644 Platform/Hisilicon/D02/Drivers/SFC/SFCDriver.depex
 delete mode 100644 Platform/Hisilicon/D02/Drivers/SFC/SFCDriver.efi
 delete mode 100644 
Platform/Hisilicon/D02/Library/AddressMapPv660D02/OemAddressMapPv660D02.lib
 delete mode 100644 Platform/Hisilicon/D02/MemoryInitPei/MemoryInit.efi
 delete mode 100644 Platform/Hisilicon/D02/Sec/FVMAIN_SEC.Fv
 delete mode 100644 Platform/Hisilicon/D02/bl1.bin
 delete mode 100644 Platform/Hisilicon/D02/fip.bin
 delete mode 100644 
Silicon/Hisilicon/Pv660/Library/PlatformSysCtrlLibPv660/PlatformSysCtrlLibPv660.lib
 delete mode 100644 
Silicon/Hisilicon/Pv660/Library/Pv660Serdes/Pv660SerdesLib.lib

-- 
2.17.0

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


[edk2] [PATCH edk2-non-osi v1 1/1] Hisilicon/D02: Remove D02 platform

2018-08-07 Thread Ming Huang
D02 is no need to maintain now, so remove D02 platform binary.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThru.inf   
 |  28 --
 Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
 |  28 --
 Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
 |  29 ---
 Platform/Hisilicon/D02/Library/AddressMapPv660D02/OemAddressMapPv660D02.inf
 |  44 
 Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
 |  33 
 
Silicon/Hisilicon/Pv660/Library/PlatformSysCtrlLibPv660/PlatformSysCtrlLibPv660.inf
 |  54 
 Silicon/Hisilicon/Pv660/Library/Pv660Serdes/Pv660SerdesLib.inf 
 |  48 -
 Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThruDxe.depex  
 | Bin 234 -> 0 bytes
 Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThruDxe.efi
 | Bin 80192 -> 0 bytes
 Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi 
 | Bin 62528 -> 0 bytes
 Platform/Hisilicon/D02/Drivers/SFC/SFCDriver.depex 
 | Bin 36 -> 0 bytes
 Platform/Hisilicon/D02/Drivers/SFC/SFCDriver.efi   
 | Bin 262144 -> 0 bytes
 Platform/Hisilicon/D02/Library/AddressMapPv660D02/OemAddressMapPv660D02.lib
 | Bin 19648 -> 0 bytes
 Platform/Hisilicon/D02/MemoryInitPei/MemoryInit.efi
 | Bin 160672 -> 0 bytes
 Platform/Hisilicon/D02/Sec/FVMAIN_SEC.Fv   
 | Bin 262144 -> 0 bytes
 Platform/Hisilicon/D02/bl1.bin 
 | Bin 12296 -> 0 bytes
 Platform/Hisilicon/D02/fip.bin 
 | Bin 45621 -> 0 bytes
 
Silicon/Hisilicon/Pv660/Library/PlatformSysCtrlLibPv660/PlatformSysCtrlLibPv660.lib
 | Bin 356858 -> 0 bytes
 Silicon/Hisilicon/Pv660/Library/Pv660Serdes/Pv660SerdesLib.lib 
 | Bin 431524 -> 0 bytes
 19 files changed, 264 deletions(-)

diff --git 
a/Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThru.inf 
b/Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThru.inf
deleted file mode 100644
index fd586bd..000
--- a/Platform/Hisilicon/D02/Drivers/AtaAtapiPassThru/AtaAtapiPassThru.inf
+++ /dev/null
@@ -1,28 +0,0 @@
-## @file
-#  AtaAtapiPassThru driver to provide native IDE/AHCI mode support.
-#
-#  This driver installs AtaPassThru and ExtScsiPassThru protocol in each 
ide/sata controller
-#  to access to all attached Ata/Atapi devices.
-#
-#  Copyright (c) 2010 - 2012, 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]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = AtaAtapiPassThruDxe
-  FILE_GUID  = 5E523CB4-D397-4986-87BD-A6DD8B22F455
-  MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.0
-  ENTRY_POINT= InitializeAtaAtapiPassThru
-
-[Binaries]
-  PE32|AtaAtapiPassThruDxe.efi|*
-  DXE_DEPEX|AtaAtapiPassThruDxe.depex|*
diff --git a/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
deleted file mode 100644
index 8b9ee1d..000
--- a/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
+++ /dev/null
@@ -1,28 +0,0 @@
-## @file
-# Component name for module SnpNt32Dxe
-#
-# Copyright (c) 2007 - 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.
-#
-#
-##
-
-[Defines]
-  INF_VERSION= 0x00010019
-  BASE_NAME  = SnpPV600Dxe
-  FILE_GUID  = 1AB373EB-2CD7-4D5C-9C39-D31845B67F5E
-  MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.0
-
-  ENTRY_POINT= InitializeSnpPV600Driver
-  UNLOAD_IMAGE   = SnpPV600Unload
-
-[Binaries]
-  

Re: [edk2] [PATCH v2 5/7] SecurityPkg/SecureBootConfigDxe: replace OpenFileByDevicePath() with UefiLib API

2018-08-07 Thread Zhang, Chao B
Reviewed-by : Chao Zhang 

-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com] 
Sent: Friday, August 3, 2018 8:16 PM
To: edk2-devel-01 
Cc: Zhang, Chao B ; Yao, Jiewen ; 
Roman Bacik 
Subject: [PATCH v2 5/7] SecurityPkg/SecureBootConfigDxe: replace 
OpenFileByDevicePath() with UefiLib API

Replace the OpenFileByDevicePath() function with EfiOpenFileByDevicePath() from 
UefiLib, correcting the following issues:

- imprecise comments on OpenFileByDevicePath(),
- code duplication between this module and other modules,
- local variable name "EfiSimpleFileSystemProtocol" starting with "Efi"
  prefix,
- bogus "FileHandle = NULL" assignments,
- leaking "Handle1" when the device path type/subtype check or the
  realignment-motivated AllocateCopyPool() fails in the loop,
- stale SHELL_FILE_HANDLE reference in a comment.

Cc: Chao Zhang 
Cc: Jiewen Yao 
Cc: Roman Bacik 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1008
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek 
Reviewed-by: Chao Zhang 
Reviewed-by: Jaben Carsey 
---

Notes:
v2:

- pick up Chao's and Jaben's R-b's

- insert a space character between "EfiOpenFileByDevicePath" and "(" --
  it was missing from the pre-patch code too

 SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf  
  |   1 -
 
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
 | 151 +---
 2 files changed, 1 insertion(+), 151 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
index 487fc8cda917..caf95ddac7d9 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfigDxe.inf
@@ -114,7 +114,6 @@ [Guids]
 [Protocols]
   gEfiHiiConfigAccessProtocolGuid   ## PRODUCES
   gEfiDevicePathProtocolGuid## PRODUCES
-  gEfiSimpleFileSystemProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiBlockIoProtocolGuid   ## SOMETIMES_CONSUMES
 
 [Depex]
diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
index 2a26c20f394c..aef85c470143 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfigFileExplorer.c
@@ -80,155 +80,6 @@ CleanUpPage (
 );
 }
 
-/**
-  This function will open a file or directory referenced by DevicePath.
-
-  This function opens a file with the open mode according to the file path. The
-  Attributes is valid only for EFI_FILE_MODE_CREATE.
-
-  @param[in, out]  FilePathOn input, the device path to the file.
-   On output, the remaining device path.
-  @param[out]  FileHandle  Pointer to the file handle.
-  @param[in]   OpenModeThe mode to open the file with.
-  @param[in]   Attributes  The file's file attributes.
-
-  @retval EFI_SUCCESS  The information was set.
-  @retval EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
-  @retval EFI_UNSUPPORTED  Could not open the file path.
-  @retval EFI_NOT_FOUNDThe specified file could not be found on the
-   device or the file system could not be 
found on
-   the device.
-  @retval EFI_NO_MEDIA The device has no medium.
-  @retval EFI_MEDIA_CHANGEDThe device has a different medium in it or 
the
-   medium is no longer supported.
-  @retval EFI_DEVICE_ERROR The device reported an error.
-  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
-  @retval EFI_WRITE_PROTECTED  The file or medium is write protected.
-  @retval EFI_ACCESS_DENIEDThe file was opened read only.
-  @retval EFI_OUT_OF_RESOURCES Not enough resources were available to open 
the
-   file.
-  @retval EFI_VOLUME_FULL  The volume is full.
-**/
-EFI_STATUS
-EFIAPI
-OpenFileByDevicePath(
-  IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
-  OUT EFI_FILE_HANDLE *FileHandle,
-  IN UINT64   OpenMode,
-  IN UINT64   Attributes
-  )
-{
-  EFI_STATUS  Status;
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *EfiSimpleFileSystemProtocol;
-  EFI_FILE_PROTOCOL   *Handle1;
-  EFI_FILE_PROTOCOL   *Handle2;
-  EFI_HANDLE  DeviceHandle;
-  CHAR16  *PathName;
-  UINTN   PathLength;
-
-  if ((FilePath == 

Re: [edk2] [Patch] DSC Spec: Update SkuId and DefaultStore name as C name style

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

Best Regards,
Zhu Yonghong


-Original Message-
From: Gao, Liming 
Sent: Tuesday, August 07, 2018 5:47 PM
To: edk2-devel@lists.01.org
Cc: Zhu, Yonghong 
Subject: [Patch] DSC Spec: Update SkuId and DefaultStore name as C name style

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
---
 3_edk_ii_dsc_file_format/310_pcd_sections.md| 15 +--
 3_edk_ii_dsc_file_format/313_[defaultstores]_section.md |  3 +--
 3_edk_ii_dsc_file_format/35_[defines]_section.md|  2 +-
 3_edk_ii_dsc_file_format/37_[skuids]_section.md |  3 +--
 4 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md 
b/3_edk_ii_dsc_file_format/310_pcd_sections.md
index 1879923..741a620 100644
--- a/3_edk_ii_dsc_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md
@@ -138,8 +138,7 @@ file.
   ::=  [","  "PcdsFeatureFlag" ]*
 ::= "."  ["." ]
::=  [ ]*
-  ::= 
-   ::= 
+  ::= 
  ::= 
  ::= {} {} {}
 ```
@@ -219,8 +218,7 @@ fields that are separated by the pipe character, "|".
::=  [","  "PcdsFixedAtBuild" ]*
  ::= "."  ["." ]
 ::=  [ ]*
-   ::= 
-::= 
+   ::= 
  ::= {} {} {} 
{}
   ::=   [ ] 
   ::= if (pcddatumtype == "BOOLEAN"):
@@ -327,8 +325,7 @@ of the DSC file.
 ]*
  ::= "."  ["." ]
 ::=  [ ]*
-   ::= 
-::= 
+   ::= 
  ::= {} {} {} 
{}
   ::=   [ ] 
   ::= if (pcddatumtype == "BOOLEAN"):
@@ -466,8 +463,7 @@ sections of the DSC file.
 ::= "."  ["." ]["." ]
  ::=  [ ]*
::= 
-::= 
- ::= 
+::= 
::=  [ ] 
::= if (pcddatumtype == "BOOLEAN"):
{} {} @@ -681,8 +677,7 @@ 
sections of the DSC file.
 ::= "."  ["." ]["." ]
  ::=  [ ]*
::= 
-::= 
- ::= 
+::= 
::=  [ ] 
::= if (pcddatumtype == "BOOLEAN"):
{} {} diff --git 
a/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md 
b/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
index 614ed01..23dec7d 100644
--- a/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
+++ b/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
@@ -47,8 +47,7 @@ be applied in PcdsDynamicHii/PcdsDynamicExHii section.
 ```c
  ::= "[DefaultStores]" 
 {*}
- ::= 
-::= 
+ ::= 
 ```
 
  Example
diff --git a/3_edk_ii_dsc_file_format/35_[defines]_section.md 
b/3_edk_ii_dsc_file_format/35_[defines]_section.md
index 3961e4c..7337415 100644
--- a/3_edk_ii_dsc_file_format/35_[defines]_section.md
+++ b/3_edk_ii_dsc_file_format/35_[defines]_section.md
@@ -131,7 +131,7 @@ The `!include` statement may be used in a `[Defines]` 
section.
*
*
 ::= {} {(0-9)+ "." (0-9)+}
-::=  [ ]*
+::=  [ ]*
  ::=  [ ]*
  ::= "FIX_LOAD_TOP_MEMORY_ADDRESS"   
   ::= 
diff --git a/3_edk_ii_dsc_file_format/37_[skuids]_section.md 
b/3_edk_ii_dsc_file_format/37_[skuids]_section.md
index 8e70b33..4c4d990 100644
--- a/3_edk_ii_dsc_file_format/37_[skuids]_section.md
+++ b/3_edk_ii_dsc_file_format/37_[skuids]_section.md
@@ -52,8 +52,7 @@ The `!include` file can only contain an ASCII (not Unicode) 
list of  ```c
  ::= "[SkuIds]" 
 {*} {} - ::=  
   [ ] 
-::= 
+ ::= [ ] 
 ```
 
  Example
--
2.8.0.windows.1

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


Re: [edk2] [PATCH v2] IntelFrameworkModulePkg/Csm: Set CSM memory executable

2018-08-07 Thread Laszlo Ersek
Hi Ray,

On 08/07/18 07:58, Ruiyu Ni wrote:
> Commit b22a62be5cdc8fd19d87ec1ecfa5b28fb9be50ad
> * IntelFrameworkModule/LegacyBios:Use reserved memory for legacy data
> allocates reserved memory for holding legacy code/data.
> 
> But with PcdDxeNxMemoryProtectionPolicy set to certain value to
> forbid execution when code is in certain type of memory, it's
> possible that a platform forbids execution when code is in reserved
> memory. The patch calls GCD service to allow such case otherwise
> CPU exception may occur.
> 
> Code execution in BSCode area should be enabled by platform by
> default.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni 
> Cc: Star Zeng 
> Cc: Laszlo Ersek 
> ---
>  .../Csm/LegacyBiosDxe/LegacyBios.c | 22 
> +-
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c 
> b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> index 8f14687b28..f86d00b53f 100644
> --- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> +++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
> @@ -64,8 +64,9 @@ AllocateLegacyMemory (
>OUT EFI_PHYSICAL_ADDRESS  *Result
>)
>  {
> -  EFI_STATUSStatus;
> -  EFI_PHYSICAL_ADDRESS  MemPage;
> +  EFI_STATUS  Status;
> +  EFI_PHYSICAL_ADDRESSMemPage;
> +  EFI_GCD_MEMORY_SPACE_DESCRIPTOR MemDesc;
>  
>//
>// Allocate Pages of memory less <= StartPageAddress
> @@ -83,10 +84,21 @@ AllocateLegacyMemory (
>//
>if (!EFI_ERROR (Status)) {
>  *Result = (EFI_PHYSICAL_ADDRESS) (UINTN) MemPage;
> +if (MemoryType != EfiBootServicesCode) {
> +  //
> +  // Make sure that the buffer can be used to store code.
> +  //
> +  Status = gDS->GetMemorySpaceDescriptor (MemPage, );
> +  if (!EFI_ERROR (Status) && (MemDesc.Attributes & EFI_MEMORY_XP) != 0) {
> +Status = gDS->SetMemorySpaceAttributes (
> +MemPage,
> +EFI_PAGES_TO_SIZE (Pages),
> +MemDesc.Attributes & (~EFI_MEMORY_XP)
> +);
> +  }
> +}
>}
> -  //
> -  // If reach here the status = EFI_SUCCESS
> -  //
> +
>return Status;
>  }
>  
> 

thanks for the update. I think the commit message is now *great*.

I'm adding Jian (like Star did for v1) so he can comment on the general
idea.

I have another remark regarding the logic -- and I apologize for missing
it in v1 --: if the SetMemorySpaceAttributes() calls fails, we correctly
propagate the status to the caller; however, we leak the allocated
memory. If SetMemorySpaceAttributes() fails, we should release the
memory before we return the error.

Can you please CC Jian on v3 at once?

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


Re: [edk2] [platforms: PATCH v2 0/9] Armada7k8k DT/ACPI support

2018-08-07 Thread Marcin Wojtas
wt., 7 sie 2018 o 11:18 Ard Biesheuvel  napisał(a):
>
> On 7 August 2018 at 10:58, Marcin Wojtas  wrote:
> > Hi,
> >
> > The second version of the patchset modifies AcpiTables
> > directory structure in order to avoid passing relative
> > paths in the boards' .inf files.
> >
> > The patches are available in the github:
> > https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180807
> >
> > I'm looking forward to review and any comments/remarks.
> >
> > Best regards,
> > Marcin
> >
> > Marcin Wojtas (9):
> >   Marvell/Armada7k8k: Import device tree
> >   Marvell/Armada7k8k: Enable including additional DXE FV components
> >   Marvell/Armada70x0Db: Enable device tree support
> >   Marvell/Armada80x0Db: Enable device tree support
> >   Marvell/Armada80x0McBin: Enable device tree support
> >   Marvell/Armada7k8k: Add common ACPI tables
> >   Marvell/Armada70x0Db: Enable ACPI support
> >   Marvell/Armada80x0Db: Enable ACPI support
> >   Marvell/Armada80x0McBin: Enable ACPI support
> >
>
> Reviewed-by: Ard Biesheuvel 
>
> Pushed as 02daa58c21f8..89c6c77b3d91
>

Thank you!
Marcin

>
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc  |  18 +
> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc |   7 +
> >  Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc |   7 +
> >  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  |   7 +
> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf  |  22 +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf |  61 +++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf |  61 +++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf  |  61 +++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf |  28 ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf |  28 ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf  |  28 ++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h |  45 ++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h  |  42 ++
> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc |  21 +
> >  Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc |  21 +
> >  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc  |  20 +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl| 229 
> > +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl| 330 
> > +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 310 
> > 
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc|  86 
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc|  64 +++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc| 139 ++
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc| 216 
> > +
> >  Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc|  53 ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi |  16 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts   | 267 
> > +++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi |  16 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi |  64 +++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi |  26 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts   | 336 
> > +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts| 374 
> > +++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi |  25 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi | 108 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi   |  31 ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi   |  43 ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi| 264 
> > ++
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi   |  10 +
> >  Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi| 504 
> > 
> >  Silicon/Marvell/Documentation/PortingGuide.txt |  22 +
> >  39 files changed, 4010 insertions(+)
> >  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
> >  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
> >  create mode 100644 
> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
> >  create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
> >  create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
> >  create mode 100644 
> > Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
> >  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
> >  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
> >  create mode 100644 

[edk2] [PATCH] FmpDevicePkg FmpDxe: Lock variables in entrypoint instead of callback

2018-08-07 Thread Star Zeng
Current code locks variables in PcdFmpDeviceLockEventGuid callback by
VariableLock protocol whose interface will be closed at EndOfDxe.
So the PcdFmpDeviceLockEventGuid callback needs be executed before
the EndOfDxe callback in Variable driver.
When PcdFmpDeviceLockEventGuid = gEfiEndOfDxeEventGroupGuid, the
callback's execution sequence depends on the callback's TPL and
registration sequence.
When PcdFmpDeviceLockEventGuid = gEfiEventReadyToBootGuid, the
PcdFmpDeviceLockEventGuid callback will be executed after the
EndOfDxe callback in Variable driver, the locking will fail.

The patch moves the variables locking logic to entrypoint.
The patch also moves the IsLockFmpDeviceAtLockEventGuidRequired ()
checking to entrypoint.

The entrypoint's final return status should be better to depend on
the return status of RegisterFmpInstaller/InstallFmpInstance, but not
gBS->CreateEventEx.
So the patch also moves the RegisterFmpInstaller/InstallFmpInstance
calling to the end of entrypoint.

Cc: Michael D Kinney 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng 
---
 FmpDevicePkg/FmpDxe/FmpDxe.c | 96 ++--
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/FmpDevicePkg/FmpDxe/FmpDxe.c b/FmpDevicePkg/FmpDxe/FmpDxe.c
index 3794ac5008f9..57eac5ac147f 100644
--- a/FmpDevicePkg/FmpDxe/FmpDxe.c
+++ b/FmpDevicePkg/FmpDxe/FmpDxe.c
@@ -1248,32 +1248,18 @@ FmpDxeLockEventNotify (
   EFI_STATUS  Status;
 
   if (!mFmpDeviceLocked) {
-if (IsLockFmpDeviceAtLockEventGuidRequired ()) {
-  //
-  // Lock all UEFI Variables used by this module.
-  //
-  Status = LockAllFmpVariables ();
-  if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to lock variables.  Status = 
%r.\n"));
+//
+// Lock the firmware device
+//
+Status = FmpDeviceLock();
+if (EFI_ERROR (Status)) {
+  if (Status != EFI_UNSUPPORTED) {
+DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLock() returned error.  Status 
= %r\n", Status));
   } else {
-DEBUG ((DEBUG_INFO, "FmpDxe: All variables locked\n"));
-  }
-
-  //
-  // Lock the firmware device
-  //
-  Status = FmpDeviceLock();
-  if (EFI_ERROR (Status)) {
-if (Status != EFI_UNSUPPORTED) {
-  DEBUG ((DEBUG_ERROR, "FmpDxe: FmpDeviceLock() returned error.  
Status = %r\n", Status));
-} else {
-  DEBUG ((DEBUG_WARN, "FmpDxe: FmpDeviceLock() returned error.  Status 
= %r\n", Status));
-}
+DEBUG ((DEBUG_WARN, "FmpDxe: FmpDeviceLock() returned error.  Status = 
%r\n", Status));
   }
-  mFmpDeviceLocked = TRUE;
-} else {
-  DEBUG ((DEBUG_VERBOSE, "FmpDxe: Not calling FmpDeviceLock() because mfg 
mode\n"));
 }
+mFmpDeviceLocked = TRUE;
   }
 }
 
@@ -1417,6 +1403,45 @@ FmpDxeEntryPoint (
   //
   DetectTestKey ();
 
+  if (IsLockFmpDeviceAtLockEventGuidRequired ()) {
+//
+// Lock all UEFI Variables used by this module.
+//
+Status = LockAllFmpVariables ();
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to lock variables.  Status = 
%r.\n", Status));
+} else {
+  DEBUG ((DEBUG_INFO, "FmpDxe: All variables locked\n"));
+}
+
+//
+// Register notify function to lock the FMP device.
+// The lock event GUID is retrieved from PcdFmpDeviceLockEventGuid.
+// If PcdFmpDeviceLockEventGuid is not the size of an EFI_GUID, then
+// gEfiEndOfDxeEventGroupGuid is used.
+//
+LockGuid = 
+if (PcdGetSize (PcdFmpDeviceLockEventGuid) == sizeof (EFI_GUID)) {
+  LockGuid = (EFI_GUID *)PcdGetPtr (PcdFmpDeviceLockEventGuid);
+}
+DEBUG ((DEBUG_INFO, "FmpDxe: Lock GUID: %g\n", LockGuid));
+
+Status = gBS->CreateEventEx (
+EVT_NOTIFY_SIGNAL,
+TPL_CALLBACK,
+FmpDxeLockEventNotify,
+NULL,
+LockGuid,
+
+);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "FmpDxe: Failed to register notification.  Status = 
%r\n", Status));
+}
+ASSERT_EFI_ERROR (Status);
+  } else {
+DEBUG ((DEBUG_VERBOSE, "FmpDxe: Not registering notification to call 
FmpDeviceLock() because mfg mode\n"));
+  }
+
   //
   // Register with library the install function so if the library uses
   // UEFI driver model/driver binding protocol it can install FMP on its 
device handle
@@ -1436,30 +1461,5 @@ FmpDxeEntryPoint (
   ));
   }
 
-  //
-  // Register notify function to lock the FMP device.
-  // The lock event GUID is retrieved from PcdFmpDeviceLockEventGuid.
-  // If PcdFmpDeviceLockEventGuid is not the size of an EFI_GUID, then
-  // gEfiEndOfDxeEventGroupGuid is used.
-  //
-  LockGuid = 
-  if (PcdGetSize (PcdFmpDeviceLockEventGuid) == sizeof (EFI_GUID)) {
-LockGuid = (EFI_GUID *)PcdGetPtr (PcdFmpDeviceLockEventGuid);
-  }
-  DEBUG ((DEBUG_INFO, "FmpDxe: Lock 

[edk2] [Patch] DSC Spec: Update SkuId and DefaultStore name as C name style

2018-08-07 Thread Liming Gao
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao 
Cc: Yonghong Zhu 
---
 3_edk_ii_dsc_file_format/310_pcd_sections.md| 15 +--
 3_edk_ii_dsc_file_format/313_[defaultstores]_section.md |  3 +--
 3_edk_ii_dsc_file_format/35_[defines]_section.md|  2 +-
 3_edk_ii_dsc_file_format/37_[skuids]_section.md |  3 +--
 4 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/3_edk_ii_dsc_file_format/310_pcd_sections.md 
b/3_edk_ii_dsc_file_format/310_pcd_sections.md
index 1879923..741a620 100644
--- a/3_edk_ii_dsc_file_format/310_pcd_sections.md
+++ b/3_edk_ii_dsc_file_format/310_pcd_sections.md
@@ -138,8 +138,7 @@ file.
   ::=  [","  "PcdsFeatureFlag" ]*
 ::= "."  ["." ]
::=  [ ]*
-  ::= 
-   ::= 
+  ::= 
  ::= 
  ::= {} {} {}
 ```
@@ -219,8 +218,7 @@ fields that are separated by the pipe character, "|".
::=  [","  "PcdsFixedAtBuild" ]*
  ::= "."  ["." ]
 ::=  [ ]*
-   ::= 
-::= 
+   ::= 
  ::= {} {} {} 
{}
   ::=   [ ] 
   ::= if (pcddatumtype == "BOOLEAN"):
@@ -327,8 +325,7 @@ of the DSC file.
 ]*
  ::= "."  ["." ]
 ::=  [ ]*
-   ::= 
-::= 
+   ::= 
  ::= {} {} {} 
{}
   ::=   [ ] 
   ::= if (pcddatumtype == "BOOLEAN"):
@@ -466,8 +463,7 @@ sections of the DSC file.
 ::= "."  ["." ]["." ]
  ::=  [ ]*
::= 
-::= 
- ::= 
+::= 
::=  [ ] 
::= if (pcddatumtype == "BOOLEAN"):
{} {}
@@ -681,8 +677,7 @@ sections of the DSC file.
 ::= "."  ["." ]["." ]
  ::=  [ ]*
::= 
-::= 
- ::= 
+::= 
::=  [ ] 
::= if (pcddatumtype == "BOOLEAN"):
{} {}
diff --git a/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md 
b/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
index 614ed01..23dec7d 100644
--- a/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
+++ b/3_edk_ii_dsc_file_format/313_[defaultstores]_section.md
@@ -47,8 +47,7 @@ be applied in PcdsDynamicHii/PcdsDynamicExHii section.
 ```c
  ::= "[DefaultStores]" 
 {*}
- ::= 
-::= 
+ ::= 
 ```
 
  Example
diff --git a/3_edk_ii_dsc_file_format/35_[defines]_section.md 
b/3_edk_ii_dsc_file_format/35_[defines]_section.md
index 3961e4c..7337415 100644
--- a/3_edk_ii_dsc_file_format/35_[defines]_section.md
+++ b/3_edk_ii_dsc_file_format/35_[defines]_section.md
@@ -131,7 +131,7 @@ The `!include` statement may be used in a `[Defines]` 
section.
*
*
 ::= {} {(0-9)+ "." (0-9)+}
-::=  [ ]*
+::=  [ ]*
  ::=  [ ]*
  ::= "FIX_LOAD_TOP_MEMORY_ADDRESS"   
   ::= 
diff --git a/3_edk_ii_dsc_file_format/37_[skuids]_section.md 
b/3_edk_ii_dsc_file_format/37_[skuids]_section.md
index 8e70b33..4c4d990 100644
--- a/3_edk_ii_dsc_file_format/37_[skuids]_section.md
+++ b/3_edk_ii_dsc_file_format/37_[skuids]_section.md
@@ -52,8 +52,7 @@ The `!include` file can only contain an ASCII (not Unicode) 
list of
 ```c
  ::= "[SkuIds]" 
 {*} {}
- ::= [ ] 
-::= 
+ ::= [ ] 
 ```
 
  Example
-- 
2.8.0.windows.1

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


Re: [edk2] [platforms: PATCH v2 0/9] Armada7k8k DT/ACPI support

2018-08-07 Thread Ard Biesheuvel
On 7 August 2018 at 10:58, Marcin Wojtas  wrote:
> Hi,
>
> The second version of the patchset modifies AcpiTables
> directory structure in order to avoid passing relative
> paths in the boards' .inf files.
>
> The patches are available in the github:
> https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180807
>
> I'm looking forward to review and any comments/remarks.
>
> Best regards,
> Marcin
>
> Marcin Wojtas (9):
>   Marvell/Armada7k8k: Import device tree
>   Marvell/Armada7k8k: Enable including additional DXE FV components
>   Marvell/Armada70x0Db: Enable device tree support
>   Marvell/Armada80x0Db: Enable device tree support
>   Marvell/Armada80x0McBin: Enable device tree support
>   Marvell/Armada7k8k: Add common ACPI tables
>   Marvell/Armada70x0Db: Enable ACPI support
>   Marvell/Armada80x0Db: Enable ACPI support
>   Marvell/Armada80x0McBin: Enable ACPI support
>

Reviewed-by: Ard Biesheuvel 

Pushed as 02daa58c21f8..89c6c77b3d91


>  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc  |  18 +
>  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc |   7 +
>  Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc |   7 +
>  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  |   7 +
>  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf  |  22 +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf |  61 +++
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf |  61 +++
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf  |  61 +++
>  Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf |  28 ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf |  28 ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf  |  28 ++
>  Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h |  45 ++
>  Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h  |  42 ++
>  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc |  21 +
>  Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc |  21 +
>  Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc  |  20 +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl| 229 
> +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl| 330 
> +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 310 
> 
>  Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc|  86 
>  Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc|  64 +++
>  Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc| 139 ++
>  Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc| 216 
> +
>  Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc|  53 ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi |  16 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts   | 267 
> +++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi |  16 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi |  64 +++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi |  26 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts   | 336 
> +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts| 374 
> +++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi |  25 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi | 108 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi   |  31 ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi   |  43 ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi| 264 
> ++
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi   |  10 +
>  Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi| 504 
> 
>  Silicon/Marvell/Documentation/PortingGuide.txt |  22 +
>  39 files changed, 4010 insertions(+)
>  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
>  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
>  create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
>  create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
>  create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
>  create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
>  create mode 100644 
> 

[edk2] [PATCH] ShellPkg/set: Fix EfiShellSetEnv to use case sensitive compare

2018-08-07 Thread Ruiyu Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=777

Per Shell spec, the environment variable has a case-sensitive name.
But today's implementation of EfiShellSetEnv() compares the
environment variable name case insensitively, which causes variable
like "CWD" cannot be set due to "cwd" is pre-defined variable.

The patch fixes this issue.

The EfiShellGetEnv() doesn't have such issue because it will
call into ShellFindEnvVarInList() which uses StrCmp().

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni 
Cc: Jaben Carsey 
Cc: Jim Dailey 
---
 ShellPkg/Application/Shell/ShellProtocol.c | 39 +++---
 1 file changed, 9 insertions(+), 30 deletions(-)

diff --git a/ShellPkg/Application/Shell/ShellProtocol.c 
b/ShellPkg/Application/Shell/ShellProtocol.c
index f2ca2029e3..767cbc99a0 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -2924,36 +2924,15 @@ EfiShellSetEnv(
   //
   // Make sure we dont 'set' a predefined read only variable
   //
-  if (gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"cwd") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"Lasterror") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"profiles") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefishellsupport") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefishellversion") == 0
-||gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-L"uefiversion") == 0
-||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
-  gUnicodeCollation->StriColl(
-gUnicodeCollation,
-(CHAR16*)Name,
-(CHAR16*)mNoNestingEnvVarName) == 0)
-   ){
+  if ((StrCmp (Name, L"cwd") == 0) ||
+  (StrCmp (Name, L"Lasterror") == 0) ||
+  (StrCmp (Name, L"profiles") == 0) ||
+  (StrCmp (Name, L"uefishellsupport") == 0) ||
+  (StrCmp (Name, L"uefishellversion") == 0) ||
+  (StrCmp (Name, L"uefiversion") == 0) ||
+  (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
+   StrCmp (Name, mNoNestingEnvVarName) == 0)
+ ) {
 return (EFI_INVALID_PARAMETER);
   }
   return (InternalEfiShellSetEnv(Name, Value, Volatile));
-- 
2.16.1.windows.1

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


[edk2] [platforms: PATCH v2 1/9] Marvell/Armada7k8k: Import device tree

2018-08-07 Thread Marcin Wojtas
Add a device tree description of the Armada7k8k SoCs,
whose sources are aligned to the Linux v4.18-rc7.
Enablement for each board will be done in the follow-up
commits.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts | 267 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi   |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi   |  64 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi   |  26 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts | 336 
+
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts  | 371 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi   |  25 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi   | 108 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi |  31 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi |  43 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi  | 264 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi |  10 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi  | 503 

 14 files changed, 2080 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi

diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
new file mode 100644
index 000..e2edc26
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 Marvell Technology Group Ltd.
+ *
+ * Device Tree file for the Armada 7020 SoC, made of an AP806 Dual and
+ * one CP110.
+ */
+
+#include "armada-ap806-dual.dtsi"
+#include "armada-70x0.dtsi"
+
+/ {
+model = "Marvell Armada 7020";
+compatible = "marvell,armada7020", "marvell,armada-ap806-dual",
+ "marvell,armada-ap806";
+};
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
new file mode 100644
index 000..6b28bbe
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts
@@ -0,0 +1,267 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (C) 2016 Marvell Technology Group Ltd.
+ *
+ * Device Tree file for Marvell Armada 7040 Development board platform
+ */
+
+#include "armada-7040.dtsi"
+
+#define GPIO_ACTIVE_HIGH 0
+#define GPIO_ACTIVE_LOW  1
+
+/ {
+model = "Marvell Armada 7040 DB board";
+compatible = "marvell,armada7040-db", "marvell,armada7040",
+ "marvell,armada-ap806-quad", "marvell,armada-ap806";
+
+chosen {
+stdout-path = "serial0:115200n8";
+};
+
+memory@0 {
+device_type = "memory";
+reg = <0x0 0x0 0x0 0x8000>;
+};
+
+aliases {
+ethernet0 = _eth0;
+ethernet1 = _eth1;
+ethernet2 = _eth2;
+};
+
+cp0_reg_usb3_0_vbus: cp0-usb3-0-vbus {
+compatible = "regulator-fixed";
+regulator-name = "usb3h0-vbus";
+regulator-min-microvolt = <500>;
+regulator-max-microvolt = <500>;
+enable-active-high;
+gpio = < 0 GPIO_ACTIVE_HIGH>;
+};
+
+cp0_reg_usb3_1_vbus: cp0-usb3-1-vbus {
+compatible = "regulator-fixed";
+regulator-name = "usb3h1-vbus";
+regulator-min-microvolt = <500>;
+regulator-max-microvolt = <500>;
+enable-active-high;
+gpio = < 1 GPIO_ACTIVE_HIGH>;
+};
+
+cp0_usb3_0_phy: cp0-usb3-0-phy {
+compatible = 

[edk2] [platforms: PATCH v2 8/9] Marvell/Armada80x0Db: Enable ACPI support

2018-08-07 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary
wiring in order to enable ACPI support on Armada 8040 DB.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc  |   3 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf  |  61 
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc  |   5 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl | 330 

 4 files changed, 399 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl

diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 3fc33d4..92e2dc8 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -51,6 +51,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
new file mode 100644
index 000..35a679b
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  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  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Armada80x0Db/Dsdt.asl
+  Fadt.aslc
+  Gtdt.aslc
+  Madt.aslc
+  Pptt.aslc
+  Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate
+
+[BuildOptions]
+  *_*_*_ASLCC_FLAGS = -DARMADA8K
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
index 99e1a11..81a81d0 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -14,3 +14,8 @@
 
   # DTB
   INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
+
+!if $(ARCH) == AARCH64
+  # ACPI support
+  INF RuleOverride = ACPITABLE 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
+!endif
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl
new file mode 100644
index 000..7c65949
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl
@@ -0,0 +1,330 @@
+/** @file
+
+  Differentiated System Description Table Fields (DSDT)
+
+  Copyright (c) 2018, Linaro Ltd. All rights reserved.
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  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 "IcuInterrupts.h"
+
+DefinitionBlock ("DSDT.aml", "DSDT", 2, "MVEBU ", 

[edk2] [platforms: PATCH v2 5/9] Marvell/Armada80x0McBin: Enable device tree support

2018-08-07 Thread Marcin Wojtas
This patch enables compilation of the Armada 8040 MacchiatoBin
device tree. Dsable OS acccess to the SPI flash and extend
PCI ranges to use 256MB mmio32 and 4GB mmio64.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf   | 28 

 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts |  5 +++-
 4 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf

diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index e1f5827..e6cb0d6 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -49,6 +49,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
new file mode 100644
index 000..810a52b
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 8040 MacchiatoBin platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada80x0McBinDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-8040-mcbin.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
index 984cf7e..4eb1496 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB 
Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
index 0e20e70..b86e27e 100644
--- a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts
@@ -185,6 +185,9 @@
 num-lanes = <4>;
 num-viewport = <8>;
 reset-gpio = <_gpio1 20 GPIO_ACTIVE_LOW>;
+ranges = <0x100 0x0 0x 0x0 0xeff0 0x0 0x0001>,
+ <0x200 0x0 0xc000 0x0 0xc000 0x0 0x2000>,
+ <0x300 0x8 0x 0x8 0x 0x1 0x>;
 status = "okay";
 };
 
@@ -355,7 +358,7 @@
 _spi1 {
 pinctrl-names = "default";
 pinctrl-0 = <_spi1_pins>;
-status = "okay";
+status = "disabled";
 
 spi-flash@0 {
 compatible = "st,w25q32";
-- 
2.7.4

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


[edk2] [platforms: PATCH v2 9/9] Marvell/Armada80x0McBin: Enable ACPI support

2018-08-07 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary wiring
in order to enable ACPI support on Armada 8040 MacchiatoBin.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  |   3 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf  |  61 
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc  |   4 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 310 

 4 files changed, 378 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl

diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index e6cb0d6..52e2b9b 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -52,6 +52,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
new file mode 100644
index 000..9e52281
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  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  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Armada80x0McBin/Dsdt.asl
+  Fadt.aslc
+  Gtdt.aslc
+  Madt.aslc
+  Pptt.aslc
+  Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogEl2IntrNum
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate
+
+[BuildOptions]
+  *_*_*_ASLCC_FLAGS = -DARMADA8K
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
index 4eb1496..326da2e 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
@@ -14,3 +14,7 @@
 
   # DTB
   INF RuleOverride = DTB 
Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
+
+!if $(ARCH) == AARCH64
+  INF RuleOverride = ACPITABLE 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
+!endif
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
new file mode 100644
index 000..87cb93a
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
@@ -0,0 +1,310 @@
+/** @file
+
+  Differentiated System Description Table Fields (DSDT)
+
+  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 "IcuInterrupts.h"
+
+DefinitionBlock 

[edk2] [platforms: PATCH v2 3/9] Marvell/Armada70x0Db: Enable device tree support

2018-08-07 Thread Marcin Wojtas
This patch enables compilation of the Armada 7040 DB
device tree. Necessary adjustments are added, so that
the OS can use efi-rtc and has no access to the SPI
flash

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc|  4 +++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf|  8 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf   | 28 

 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts |  2 +-
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi  |  1 +
 7 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf

diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
index 2d38ea4..f1ccda0 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
@@ -200,6 +200,7 @@
   PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
   
NonDiscoverableDeviceRegistrationLib|MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf
+  
DtPlatformDtbLoaderLib|EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf
 
 [LibraryClasses.common.UEFI_APPLICATION]
   
UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
@@ -585,6 +586,9 @@
   gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
   }
 
+  # DTB
+  EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+
 !ifdef $(INCLUDE_TFTP_COMMAND)
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 !endif #$(INCLUDE_TFTP_COMMAND)
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index 0c08328..d3dffb0 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -48,6 +48,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 0f38978..909ad3e 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -212,6 +212,9 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   }
 !endif
 
+  # DTB
+  INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+
 !include $(BOARD_DXE_FV_COMPONENTS)
 
 # PEI phase firmware volume
@@ -400,3 +403,8 @@ READ_LOCK_STATUS   = TRUE
  UI   STRING="$(MODULE_NAME)" Optional
  VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
+
+[Rule.Common.USER_DEFINED.DTB]
+  FILE FREEFORM = $(NAMED_GUID) {
+RAW BIN|.dtb
+  }
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
new file mode 100644
index 000..1f2d9ea
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 7040 DB platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada70x0DbDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-7040-db.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
index 984cf7e..b4c3e20 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts 

[edk2] [platforms: PATCH v2 6/9] Marvell/Armada7k8k: Add common ACPI tables

2018-08-07 Thread Marcin Wojtas
This patch adds ACPI tables and necessary headers,
which are common for Armada7k8k SoCs. Per-board
tables and wiring up of support will be done in
the follow-up commits.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h|  45 
 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h |  42 
 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc   |  86 
 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc   |  64 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc   | 139 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc   | 216 

 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc   |  53 +
 7 files changed, 645 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc

diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h 
b/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
new file mode 100644
index 000..f5ebd27
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
@@ -0,0 +1,45 @@
+/** @file
+
+  Multiple APIC Description Table (MADT)
+
+  Copyright (c) 2017, Linaro Ltd. All rights reserved.
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  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 
+
+#define ACPI_OEM_ID_ARRAY{'M','V','E','B','U',' '}
+#define ACPI_OEM_REVISION0
+#define ACPI_CREATOR_ID  SIGNATURE_32('L','N','R','O')
+#define ACPI_CREATOR_REVISION0
+
+#if defined(ARMADA7K)
+#define ACPI_OEM_TABLE_IDSIGNATURE_64('A','R','M','A','D','A','7','K')
+#elif defined (ARMADA8K)
+#define ACPI_OEM_TABLE_IDSIGNATURE_64('A','R','M','A','D','A','8','K')
+#endif
+
+/**
+ * A macro to initialize the common header part of EFI ACPI tables
+ * as defined by EFI_ACPI_DESCRIPTION_HEADER structure.
+ **/
+#define __ACPI_HEADER(sign, type, rev) {\
+  sign,   /* UINT32  Signature */   \
+  sizeof (type),  /* UINT32  Length */  \
+  rev,/* UINT8   Revision */\
+  0,  /* UINT8   Checksum */\
+  ACPI_OEM_ID_ARRAY,  /* UINT8   OemId[6] */\
+  ACPI_OEM_TABLE_ID,  /* UINT64  OemTableId */  \
+  ACPI_OEM_REVISION,  /* UINT32  OemRevision */ \
+  ACPI_CREATOR_ID,/* UINT32  CreatorId */   \
+  ACPI_CREATOR_REVISION   /* UINT32  CreatorRevision */ \
+  }
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h 
b/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
new file mode 100644
index 000..5746ad4
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
@@ -0,0 +1,42 @@
+/**
+
+  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+
+  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.
+
+  Glossary - abbreviations used in Marvell SampleAtReset library 
implementation:
+  ICU - Interrupt Consolidation Unit
+  AP - Application Processor hardware block (Armada 7k8k incorporates AP806)
+  CP - South Bridge hardware blocks (Armada 7k8k incorporates CP110)
+
+**/
+
+#define CP_GIC_SPI_CP0_PCI064
+#define CP_GIC_SPI_CP0_PCI165
+#define CP_GIC_SPI_CP0_PCI266
+#define CP_GIC_SPI_CP0_SDMMC   67
+#define CP_GIC_SPI_PP2_CP0_PORT0   69, 72, 75, 78, 81, 127
+#define CP_GIC_SPI_PP2_CP0_PORT1   70, 73, 76, 79, 82, 126
+#define CP_GIC_SPI_PP2_CP0_PORT2   71, 74, 77, 80, 83, 125
+#define CP_GIC_SPI_CP0_EIP_RNG0105
+#define CP_GIC_SPI_CP0_USB_H1  112
+#define CP_GIC_SPI_CP0_USB_H0  113
+#define CP_GIC_SPI_CP0_SATA_H0 114
+
+#define CP_GIC_SPI_CP1_PCI0288
+#define CP_GIC_SPI_CP1_PCI1289
+#define 

[edk2] [platforms: PATCH v2 4/9] Marvell/Armada80x0Db: Enable device tree support

2018-08-07 Thread Marcin Wojtas
This patch enables compilation of the Armada 8040 DB
device tree. Also disable OS access to the SPI flash.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf   | 28 

 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc   |  3 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts |  2 +-
 4 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf

diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 2d4523f2..3fc33d4 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -48,6 +48,9 @@
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
+[Components.common]
+  Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf 
b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
new file mode 100644
index 000..e4dd41c
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
@@ -0,0 +1,28 @@
+## @file
+#
+#  Device tree description of the Marvell Armada 8040 DB platform
+#
+#  Copyright (c) 2018, Marvell International 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  = Armada80x0DbDeviceTree
+  FILE_GUID  = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # 
gDtPlatformDefaultDtbFileGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  armada-8040-db.dts
+
+[Packages]
+  MdePkg/MdePkg.dec
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
index 984cf7e..99e1a11 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -11,3 +11,6 @@
 #
 
 # Per-board additional content of the DXE phase firmware volume
+
+  # DTB
+  INF RuleOverride = DTB Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
diff --git a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts 
b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
index 7518029..e813922 100644
--- a/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
+++ b/Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts
@@ -213,7 +213,7 @@
 };
 
 _spi1 {
-status = "okay";
+status = "disabled";
 
 spi-flash@0 {
 #address-cells = <0x1>;
-- 
2.7.4

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


[edk2] [platforms: PATCH v2 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-07 Thread Marcin Wojtas
This patch introduces DSDT table and adds necessary
wiring in order to enable ACPI support on Armada 7040 DB.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc   |  14 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc  |   3 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf   |  12 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf  |  61 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc  |   5 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl | 229 

 Silicon/Marvell/Documentation/PortingGuide.txt  |  22 ++
 7 files changed, 346 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl

diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
index f1ccda0..d4c67a2 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
@@ -593,6 +593,20 @@
   ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
 !endif #$(INCLUDE_TFTP_COMMAND)
 
+[Components.AARCH64]
+  #
+  # Generic ACPI modules
+  #
+  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
+
+  
PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
+
+
+  # support ACPI v5.0 or later
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
+  }
+
 
[BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
 
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index d3dffb0..e0bf447 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -51,6 +51,9 @@
 [Components.common]
   Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
 
+[Components.AARCH64]
+  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
+
 

 #
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 909ad3e..c064a43 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -215,6 +215,12 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   # DTB
   INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
 
+!if $(ARCH) == AARCH64
+  # ACPI support
+  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
+  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
+!endif
+
 !include $(BOARD_DXE_FV_COMPONENTS)
 
 # PEI phase firmware volume
@@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
   FILE FREEFORM = $(NAMED_GUID) {
 RAW BIN|.dtb
   }
+
+[Rule.Common.USER_DEFINED.ACPITABLE]
+  FILE FREEFORM = $(NAMED_GUID) {
+RAW ASL|.aml
+RAW ACPI   |.acpi
+  }
diff --git a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf 
b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
new file mode 100644
index 000..659c333
--- /dev/null
+++ b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
@@ -0,0 +1,61 @@
+## @file
+#  Component description file for PlatformAcpiTables module.
+#
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2018, Linaro, Ltd. All rights reserved.
+#  Copyright (C) 2018, Marvell International Ltd. and its affiliates.
+#
+#  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  = PlatformAcpiTables
+  FILE_GUID  = 7E374E25-8E01-4FEE-87F2-390C23C606CD
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Armada70x0Db/Dsdt.asl
+  Fadt.aslc
+  Gtdt.aslc
+  Madt.aslc
+  Pptt.aslc
+  Spcr.aslc
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Silicon/Marvell/Marvell.dec
+
+[FixedPcd]
+  gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
+  

[edk2] [platforms: PATCH v2 0/9] Armada7k8k DT/ACPI support

2018-08-07 Thread Marcin Wojtas
Hi,

The second version of the patchset modifies AcpiTables
directory structure in order to avoid passing relative
paths in the boards' .inf files.

The patches are available in the github:
https://github.com/MarvellEmbeddedProcessors/edk2-open-platform/commits/dt-acpi-upstream-r20180807

I'm looking forward to review and any comments/remarks.

Best regards,
Marcin

Marcin Wojtas (9):
  Marvell/Armada7k8k: Import device tree
  Marvell/Armada7k8k: Enable including additional DXE FV components
  Marvell/Armada70x0Db: Enable device tree support
  Marvell/Armada80x0Db: Enable device tree support
  Marvell/Armada80x0McBin: Enable device tree support
  Marvell/Armada7k8k: Add common ACPI tables
  Marvell/Armada70x0Db: Enable ACPI support
  Marvell/Armada80x0Db: Enable ACPI support
  Marvell/Armada80x0McBin: Enable ACPI support

 Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc  |  18 +
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc |   7 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc |   7 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc  |   7 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf  |  22 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf |  61 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf |  61 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf  |  61 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf |  28 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf |  28 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf  |  28 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h |  45 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h  |  42 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc |  21 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc |  21 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc  |  20 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl| 229 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl| 330 
+
 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl | 310 

 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc|  86 
 Silicon/Marvell/Armada7k8k/AcpiTables/Gtdt.aslc|  64 +++
 Silicon/Marvell/Armada7k8k/AcpiTables/Madt.aslc| 139 ++
 Silicon/Marvell/Armada7k8k/AcpiTables/Pptt.aslc| 216 +
 Silicon/Marvell/Armada7k8k/AcpiTables/Spcr.aslc|  53 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7020.dtsi |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040-db.dts   | 267 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-7040.dtsi |  16 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-70x0.dtsi |  64 +++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8020.dtsi |  26 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-db.dts   | 336 
+
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040-mcbin.dts| 374 
+++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-8040.dtsi |  25 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-80x0.dtsi | 108 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-dual.dtsi   |  31 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806-quad.dtsi   |  43 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-ap806.dtsi| 264 ++
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-common.dtsi   |  10 +
 Silicon/Marvell/Armada7k8k/DeviceTree/armada-cp110.dtsi| 504 

 Silicon/Marvell/Documentation/PortingGuide.txt |  22 +
 39 files changed, 4010 insertions(+)
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0Db.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/DeviceTree/Armada80x0McBin.inf
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/AcpiHeader.h
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/IcuInterrupts.h
 create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0Db/Dsdt.asl
 create mode 100644 
Silicon/Marvell/Armada7k8k/AcpiTables/Armada80x0McBin/Dsdt.asl
 create mode 100644 Silicon/Marvell/Armada7k8k/AcpiTables/Fadt.aslc
 create mode 100644 

[edk2] [platforms: PATCH v2 2/9] Marvell/Armada7k8k: Enable including additional DXE FV components

2018-08-07 Thread Marcin Wojtas
Unified .fdf file allows to update all Armada7k8k-based
boards at the same time. However there may be a need
to add unique DXE firmware volume contents like DTB
or ACPI.

For this purpose create empty files for existing boards
that are included as defined in BOARD_DXE_FV_COMPONENTS
macro.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas 
---
 Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|  1 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc|  1 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc |  1 +
 Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  2 ++
 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc| 13 +
 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc| 13 +
 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc | 13 +
 7 files changed, 44 insertions(+)
 create mode 100644 Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 create mode 100644 Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 create mode 100644 Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc

diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
index 2240a57..0c08328 100644
--- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
index 2425c45..2d4523f2 100644
--- a/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
 
diff --git a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc 
b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
index 1baed88..e1f5827 100644
--- a/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
+++ b/Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc
@@ -44,6 +44,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
   FLASH_DEFINITION   = Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.fdf.inc
   CAPSULE_ENABLE = TRUE
 
 !include Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
index 18d5d06..0f38978 100644
--- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
+++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
@@ -212,6 +212,8 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
   }
 !endif
 
+!include $(BOARD_DXE_FV_COMPONENTS)
+
 # PEI phase firmware volume
 [FV.FVMAIN_COMPACT]
 FvAlignment= 8
diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc 
b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
new file mode 100644
index 000..984cf7e
--- /dev/null
+++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc
@@ -0,0 +1,13 @@
+#
+#  Copyright (C) 2018 Marvell International Ltd. and its affiliates
+#
+#  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.
+#
+
+# Per-board additional content of the DXE phase firmware volume
diff --git a/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc 
b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
new file mode 100644
index 000..984cf7e
--- /dev/null
+++ b/Platform/Marvell/Armada80x0Db/Armada80x0Db.fdf.inc
@@ -0,0 +1,13 @@
+#
+#  Copyright (C) 2018 Marvell International Ltd. and its affiliates
+#
+#  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 

Re: [edk2] [platforms: PATCH 7/9] Marvell/Armada70x0Db: Enable ACPI support

2018-08-07 Thread Ard Biesheuvel
On 6 August 2018 at 19:55, Marcin Wojtas  wrote:
> pon., 6 sie 2018 o 19:44 Leif Lindholm  napisał(a):
>>
>>
>>
>> On Mon, 6 Aug 2018, 17:09 Ard Biesheuvel,  wrote:
>>>
>>> On 6 August 2018 at 18:08, Marcin Wojtas  wrote:
>>> > HI Ard,
>>> >
>>> > pon., 6 sie 2018 o 13:54 Ard Biesheuvel  
>>> > napisał(a):
>>> >>
>>> >> On 6 August 2018 at 01:28, Marcin Wojtas  wrote:
>>> >> > This patch introduces DSDT table and adds necessary
>>> >> > wiring in order to enable ACPI support on Armada 7040 DB.
>>> >> >
>>> >> > Contributed-under: TianoCore Contribution Agreement 1.1
>>> >> > Signed-off-by: Marcin Wojtas 
>>> >> > ---
>>> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc |  
>>> >> > 14 ++
>>> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc|   
>>> >> > 3 +
>>> >> >  Silicon/Marvell/Armada7k8k/Armada7k8k.fdf |  
>>> >> > 12 +
>>> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf |  
>>> >> > 61 ++
>>> >> >  Platform/Marvell/Armada70x0Db/Armada70x0Db.fdf.inc|   
>>> >> > 5 +
>>> >> >  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl   | 
>>> >> > 229 
>>> >> >  Silicon/Marvell/Documentation/PortingGuide.txt|  
>>> >> > 22 ++
>>> >> >  7 files changed, 346 insertions(+)
>>> >> >  create mode 100644 
>>> >> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>>> >> >  create mode 100644 
>>> >> > Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/Dsdt.asl
>>> >> >
>>> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc 
>>> >> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>>> >> > index f1ccda0..d4c67a2 100644
>>> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>>> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.dsc.inc
>>> >> > @@ -593,6 +593,20 @@
>>> >> >ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>>> >> >  !endif #$(INCLUDE_TFTP_COMMAND)
>>> >> >
>>> >> > +[Components.AARCH64]
>>> >> > +  #
>>> >> > +  # Generic ACPI modules
>>> >> > +  #
>>> >> > +  MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>> >> > +  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
>>> >> > +
>>> >> > +  
>>> >> > PlatformHasAcpiLib|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
>>> >> > +
>>> >> > +
>>> >> > +  # support ACPI v5.0 or later
>>> >> > +  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
>>> >> > +  }
>>> >> > +
>>> >> >  
>>> >> > [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOptions.common.EDKII.UEFI_DRIVER,BuildOptions.common.EDKII.UEFI_APPLICATION]
>>> >> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
>>> >> >
>>> >> > diff --git a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc 
>>> >> > b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>>> >> > index d3dffb0..f6faff1 100644
>>> >> > --- a/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>>> >> > +++ b/Platform/Marvell/Armada70x0Db/Armada70x0Db.dsc
>>> >> > @@ -51,6 +51,9 @@
>>> >> >  [Components.common]
>>> >> >Silicon/Marvell/Armada7k8k/DeviceTree/Armada70x0Db.inf
>>> >> >
>>> >> > +[Components.AARCH64]
>>> >> > +  Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>>> >> > +
>>> >> >  
>>> >> > 
>>> >> >  #
>>> >> >  # Pcd Section - list of all EDK II PCD Entries defined by this 
>>> >> > Platform
>>> >> > diff --git a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf 
>>> >> > b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>>> >> > index 909ad3e..c064a43 100644
>>> >> > --- a/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>>> >> > +++ b/Silicon/Marvell/Armada7k8k/Armada7k8k.fdf
>>> >> > @@ -215,6 +215,12 @@ FvNameGuid = 
>>> >> > 5eda4200-2c5f-43cb-9da3-0baf74b1b30c
>>> >> ># DTB
>>> >> >INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
>>> >> >
>>> >> > +!if $(ARCH) == AARCH64
>>> >> > +  # ACPI support
>>> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
>>> >> > +  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
>>> >> > +!endif
>>> >> > +
>>> >> >  !include $(BOARD_DXE_FV_COMPONENTS)
>>> >> >
>>> >> >  # PEI phase firmware volume
>>> >> > @@ -408,3 +414,9 @@ READ_LOCK_STATUS   = TRUE
>>> >> >FILE FREEFORM = $(NAMED_GUID) {
>>> >> >  RAW BIN|.dtb
>>> >> >}
>>> >> > +
>>> >> > +[Rule.Common.USER_DEFINED.ACPITABLE]
>>> >> > +  FILE FREEFORM = $(NAMED_GUID) {
>>> >> > +RAW ASL|.aml
>>> >> > +RAW ACPI   |.acpi
>>> >> > +  }
>>> >> > diff --git 
>>> >> > a/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf 
>>> >> > b/Silicon/Marvell/Armada7k8k/AcpiTables/Armada70x0Db/AcpiTables.inf
>>> >> > new file mode 100644
>>> >> > index 000..8732e10
>>> >> > --- /dev/null
>>> >> > +++ 

[edk2] [PATCH] BaseTools: Fix report flexible value issue

2018-08-07 Thread Feng, YunhuaX
Report flexible value in INF file encounter error

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

diff --git a/BaseTools/Source/Python/build/BuildReport.py 
b/BaseTools/Source/Python/build/BuildReport.py
index 50717b7c86..deb88a7817 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -983,10 +983,15 @@ class PcdReport(object):
 if ModulePcdSet is not None:
 if (Pcd.TokenCName, Pcd.TokenSpaceGuidCName, Type) not in 
ModulePcdSet:
 continue
 InfDefaultValue, PcdValue = ModulePcdSet[Pcd.TokenCName, 
Pcd.TokenSpaceGuidCName, Type]
 Pcd.DefaultValue = PcdValue
+if InfDefaultValue:
+try:
+InfDefaultValue = 
ValueExpressionEx(InfDefaultValue, Pcd.DatumType, self._GuidDict)(True)
+except BadExpression as InfDefaultValue:
+EdkLogger.error('BuildReport', FORMAT_INVALID, 
"PCD Value: %s, Type: %s" % (InfDefaultValue, Pcd.DatumType))
 if InfDefaultValue == "":
 InfDefaultValue = None
 
 BuildOptionMatch = False
 if GlobalData.BuildOptionPcd:
-- 
2.12.2.windows.2

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