[edk2] [PATCH 11/14] ShellPkg/dh: Modify the dump of PciIo protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 87 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | 11 ++-
 2 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 1c62415e86..e5b4bea8f6 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -16,6 +16,7 @@
 
 #include "UefiHandleParsingLib.h"
 #include "IndustryStandard/Acpi10.h"
+#include "IndustryStandard/Pci.h"
 #include 
 #include 
 
@@ -1160,6 +1161,90 @@ DebugSupportProtocolDumpInformation (
 }
 
 /**
+  Function to dump information about PciIoProtocol.
+
+  This will allocate the return buffer from boot services pool.
+
+  @param[in] TheHandle  The handle that has PciRootBridgeIo installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+
+  @retval A poitner to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+PciIoProtocolDumpInformation (
+  IN CONST EFI_HANDLE TheHandle,
+  IN CONST BOOLEANVerbose
+  )
+{
+  EFI_STATUS  Status;
+  EFI_PCI_IO_PROTOCOL *PciIo;
+  PCI_TYPE00  Pci;
+  UINTN   Segment;
+  UINTN   Bus;
+  UINTN   Device;
+  UINTN   Function;
+  UINTN   Index;
+  CHAR16  *GetString;
+  CHAR16  *TempRetVal;
+  CHAR16  *RetVal;
+
+  if (!Verbose) {
+return (NULL);
+  }
+  RetVal = NULL;
+  GetString   = NULL;
+  TempRetVal  = NULL;
+  Status = gBS->OpenProtocol (
+  TheHandle,
+  ,
+  (VOID**),
+  gImageHandle,
+  NULL,
+  EFI_OPEN_PROTOCOL_GET_PROTOCOL
+  );
+
+  if (EFI_ERROR(Status)) {
+return NULL;
+  }
+  PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0, sizeof (Pci), );
+  PciIo->GetLocation (PciIo, , , , );
+  HandleParsingHiiInit ();
+  GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_PCIIO_DUMP_MAIN), NULL);
+  if (GetString == NULL) {
+return NULL;
+  }
+  RetVal = CatSPrint (
+NULL,
+GetString,
+Segment,
+Bus,
+Device,
+Function,
+PciIo->RomSize,
+PciIo->RomImage,
+Pci.Hdr.VendorId,
+Pci.Hdr.DeviceId,
+Pci.Hdr.ClassCode[0],
+Pci.Hdr.ClassCode[1],
+Pci.Hdr.ClassCode[2]
+);
+  for (Index = 0; Index < sizeof (Pci); Index ++) {
+if ((Index % 0x10) == 0) {
+  TempRetVal = CatSPrint (RetVal, L"\r\n   %02x", *((UINT8 *) () + 
Index));
+} else {
+  TempRetVal = CatSPrint (RetVal, L"%02x", *((UINT8 *) () + Index));
+}
+FreePool (RetVal);
+RetVal = TempRetVal;
+TempRetVal = NULL;
+  }
+
+  FreePool(GetString);
+  return RetVal;
+}
+
+/**
   Function to dump information about EfiAdapterInformation Protocol.
 
   @param[in] TheHandle  The handle that has the protocol installed.
@@ -1874,7 +1959,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_UC),, 
   NULL},
   {STRING_TOKEN(STR_UC2),   
,   NULL},
   {STRING_TOKEN(STR_PCIRB_IO),  ,  
   PciRootBridgeIoDumpInformation},
-  {STRING_TOKEN(STR_PCI_IO),,
   NULL},
+  {STRING_TOKEN(STR_PCI_IO),,
   PciIoProtocolDumpInformation},
   {STRING_TOKEN(STR_SCSI_PT),   , 
   NULL},
   {STRING_TOKEN(STR_SCSI_IO),   ,   
   NULL},
   {STRING_TOKEN(STR_SCSI_PT_EXT),   ,  
   NULL},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 4b0c67b42a..59409d9ca0 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -348,7 +348,16 @@
 #string STR_PCIRB_DUMP_IO #language en-US "  IO  : "
 #string STR_PCIRB_DUMP_TITLE  #language en-US "  Type  Flag  Base  
Limit Gran\r\n"
   "      
    \r\n"
-
+#string STR_PCIIO_DUMP_MAIN   #language en-US " Segment #.: 
%02x\r\n"
+  " Bus #.: 
%02x\r\n"
+   

[edk2] [PATCH 13/14] ShellPkg/dh: Modify the dump of UsbIo protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 98299cd1d0..5d8a0d1bb9 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -179,8 +179,8 @@
 #string STR_HII   #language en-US "HII"
 #string STR_HII_FORM_CALLBACK #language en-US "HIICallback"
 
-#string STR_TXT_OUT_DUMP_HEADER   #language en-US "  Address: %%H%X%%N Attrib 
%02x\r\n"
-#string STR_TXT_OUT_DUMP_LINE #language en-US "  %c  mode %d: Col %d Row 
%d\r\n"
+#string STR_TXT_OUT_DUMP_HEADER   #language en-US "  Address: %%H%X%%N Attrib 
%02x"
+#string STR_TXT_OUT_DUMP_LINE #language en-US "\r\n  %c  mode %d: Col %d 
Row %d"
 
 #string STR_DRIVER_FAM_OVERRIDE   #language en-US "DriverFamilyOverride"
 #string STR_PCD   #language en-US "Pcd"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 01/14] ShellPkg/dh: display all the protocol names in a single line

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c  | 36 ++
 .../UefiShellDriver1CommandsLib.uni|  1 +
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
index 170a868e07..3694e501b6 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
@@ -319,7 +319,7 @@ GetProtocolInfoString(
   if (!Verbose) {
 StrnCatGrow(, , L"(", 0);
 StrnCatGrow(, , Temp, 0);
-StrnCatGrow(, , L")\r\n", 0);
+StrnCatGrow(, , L")", 0);
   } else {
 StrnCatGrow(, , Separator, 0);
 StrnCatGrow(, , Temp, 0);
@@ -802,17 +802,29 @@ DoDhByHandle(
 ProtocolInfoString==NULL?L"":ProtocolInfoString
   );
 } else {
-  ProtocolInfoString = GetProtocolInfoString(TheHandle, Language, L"\r\n", 
Verbose, TRUE);
-  ShellPrintHiiEx(
--1,
--1,
-NULL,
-STRING_TOKEN (STR_DH_OUTPUT_SINGLE),
-gShellDriver1HiiHandle,
-ConvertHandleToHandleIndex(TheHandle),
-TheHandle,
-ProtocolInfoString==NULL?L"":ProtocolInfoString
-  );
+  ProtocolInfoString = GetProtocolInfoString(TheHandle, Language, Verbose 
? L"\r\n" : L" ", Verbose, TRUE);
+  if (Verbose) {
+ShellPrintHiiEx(
+  -1,
+  -1,
+  NULL,
+  STRING_TOKEN (STR_DH_OUTPUT_SINGLE),
+  gShellDriver1HiiHandle,
+  ConvertHandleToHandleIndex(TheHandle),
+  TheHandle,
+  ProtocolInfoString==NULL?L"":ProtocolInfoString
+);
+  } else {
+ShellPrintHiiEx(
+  -1,
+  -1,
+  NULL,
+  STRING_TOKEN (STR_DH_OUTPUT_SINGLE_D),
+  gShellDriver1HiiHandle,
+  ConvertHandleToHandleIndex(TheHandle),
+  ProtocolInfoString==NULL?L"":ProtocolInfoString
+);
+  }
 }
 
 if (DriverInfo) {
diff --git 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
index 05101f3782..07e8657113 100644
--- 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
+++ 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
@@ -106,6 +106,7 @@
 #string STR_DH_OUTPUT_ALL_HEADER  #language en-US "Handle dump\r\n"
 #string STR_DH_OUTPUT_GUID_HEADER #language en-US "Handle dump by protocol 
'%g'\r\n"
 #string STR_DH_OUTPUT_NAME_HEADER #language en-US "Handle dump by protocol 
'%s'\r\n"
+#string STR_DH_OUTPUT_SINGLE_D#language en-US "%H%02x%N: %s\r\n"
 #string STR_DH_OUTPUT_SINGLE  #language en-US "%H%02x%N: %x\r\n%s"
 #string STR_DH_OUTPUT_SFO #language en-US "%s, %s, %s, %H%02x%N, %s, 
%s\r\n"
 #string STR_DH_OUTPUT_DRIVER1 #language en-US "   Controller Name: 
%B%s%N\r\n"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 10/14] ShellPkg/dh: Modify the dump of GraphicsOutput protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | 36 +++---
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index ca5e362bc7..4b0c67b42a 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -367,26 +367,26 @@
   " DataType..: 
%%H%s%%N\r\n"
   " Unload: 
%%H%x%%N"
 
-#string STR_GOP_DUMP_MAIN #language en-US " Max Mode: 
%%H0x%08x%%N\r\n"
-  " Current Mode: 
%%H0x%08x%%N\r\n"
-  " Frame Buffer Base...: 
%%H0x%L016x%%N\r\n"
-  " Frame Buffer Size...: 
%%H0x%L016x%%N\r\n"
-  " Mode Info Size..: 
%%H0x%L016x%%N\r\n"
+#string STR_GOP_DUMP_MAIN #language en-US " Max 
Mode..: %%H0x%08x%%N\r\n"
+  " Current 
Mode..: %%H0x%08x%%N\r\n"
+  " Frame Buffer 
Base.: %%H0x%L016x%%N\r\n"
+  " Frame Buffer 
Size.: %%H0x%L016x%%N\r\n"
+  " Mode Info 
Size: %%H0x%L016x%%N\r\n"
   " Information\r\n"
-  "   Version...: 
%%H0x%08x%%N\r\n"
-  "   Res Hor...: 
%%H0x%08x%%N\r\n"
-  "   Res Ver...: 
%%H0x%08x%%N\r\n"
-  "   Pixel Format..: 
%%H%s%%N\r\n"
-  "   Pixels / Scan Line: 
%%H0x%08x%%N\r\n"
+  "   
Version.: %%H0x%08x%%N\r\n"
+  "   
HorizontalResolution: %%H%d%%N\r\n"
+  "   
VerticalResolution..: %%H%d%%N\r\n"
+  "   Pixel 
Format: %%H%s%%N\r\n"
+  "   Pixels / Scan 
Line..: %%H%d%%N\r\n"
   "   Pixel Info\r\n"
-  " RedMask.: 
%%H0x%08x%%N\r\n"
-  " GreenMask...: 
%%H0x%08x%%N\r\n"
-  " BlueMask: 
%%H0x%08x%%N\r\n"
-
-#string STR_GOP_RES_LIST_MAIN #language en-US " Supported Resolution 
List\r\n"
-#string STR_GOP_RES_LIST_ENTRY#language en-US "   
Resolution[%%H%d%%N]:\r\n"
-  " Res Hor.: 
%%H0x%08x%%N\r\n"
-  " Res Ver.: 
%%H0x%08x%%N\r\n"
+  " 
RedMask...: %%H0x%08x%%N\r\n"
+  " 
GreenMask.: %%H0x%08x%%N\r\n"
+  " 
BlueMask..: %%H0x%08x%%N\r\n"
+
+#string STR_GOP_RES_LIST_MAIN #language en-US " Supported Resolution 
List"
+#string STR_GOP_RES_LIST_ENTRY#language en-US "\r\n   
Resolution[%%H%d%%N]:\r\n"
+  " 
Horizontal: %%H%d%%N\r\n"
+  " 
Vertical..: %%H%d%%N"
 #string STR_BSDO_DUMP_MAIN#language en-US " Drv[%02x] 
File:%%H%s%%N"
 #string STR_EDID_DISCOVERED_MAIN  #language en-US " EDID Discovered Size : 
%%H0x%08x%%N\r\n"
 #string STR_EDID_DISCOVERED_DATA  #language en-US " EDID Discovered Data 
:\r\n"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 14/14] ShellPkg/dh: Refine the dump output

2017-09-21 Thread Ruiyu Ni
The patch doesn't change any real functionality.
Only the indent width and EOL are changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni 
Cc: Jaben Carsey 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c|   8 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | 129 +++--
 2 files changed, 69 insertions(+), 68 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 164caa9b91..d12466c7b0 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -497,7 +497,7 @@ EdidDiscoveredProtocolDumpInformation (
 SHELL_FREE_NON_NULL (RetVal);
 RetVal = TempRetVal;
 
-TempRetVal = CatSDumpHex (RetVal, 7, 0, EdidDiscovered->SizeOfEdid, 
EdidDiscovered->Edid);
+TempRetVal = CatSDumpHex (RetVal, 4, 0, EdidDiscovered->SizeOfEdid, 
EdidDiscovered->Edid);
 RetVal = TempRetVal;
   }
   return RetVal;
@@ -561,7 +561,7 @@ EdidActiveProtocolDumpInformation (
 SHELL_FREE_NON_NULL (RetVal);
 RetVal = TempRetVal;
 
-TempRetVal = CatSDumpHex (RetVal, 7, 0, EdidActive->SizeOfEdid, 
EdidActive->Edid);
+TempRetVal = CatSDumpHex (RetVal, 4, 0, EdidActive->SizeOfEdid, 
EdidActive->Edid);
 RetVal = TempRetVal;
   }
   return RetVal;
@@ -614,7 +614,7 @@ PciRootBridgeIoDumpInformation(
   if (Temp == NULL) {
 return NULL;
   }
-  Temp2 = CatSPrint(L"\r\n", Temp, PciRootBridgeIo->ParentHandle);
+  Temp2 = CatSPrint(NULL, Temp, PciRootBridgeIo->ParentHandle);
   FreePool(Temp);
   RetVal = Temp2;
   Temp2 = NULL;
@@ -692,7 +692,7 @@ PciRootBridgeIoDumpInformation(
   }
 
   Temp2 = CatSPrint(RetVal,
-L"%H%02x%016lx  %016lx  %02x%N\r\n",
+L"\r\n%%H%02x%016lx  %016lx  %02x%%N",
 Configuration->SpecificFlag,
 Configuration->AddrRangeMin,
 Configuration->AddrRangeMax,
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 5d8a0d1bb9..f49ca94623 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -339,71 +339,72 @@
 #string STR_DEBUGSUPPORT_INFO #language en-US "  Isa = %s"
 #string STR_DEBUGSUPPORT_UNKNOWN  #language en-US "  Unknown (%%H%s%%N)"
 
-#string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: 
%H%x%N\r\n"
-#string STR_PCIRB_DUMP_SEG#language en-US " Segment #.: 
%H%x%N\r\n"
-#string STR_PCIRB_DUMP_ATT#language en-US " Attributes: 
%H%x%N\r\n"
-#string STR_PCIRB_DUMP_SUPPORTS   #language en-US " Supports..: 
%H%x%N\r\n"
-#string STR_PCIRB_DUMP_BUS#language en-US "  BUS : "
-#string STR_PCIRB_DUMP_MEM#language en-US "  MEM : "
-#string STR_PCIRB_DUMP_IO #language en-US "  IO  : "
-#string STR_PCIRB_DUMP_TITLE  #language en-US "  Type  Flag  Base  
Limit Gran\r\n"
-  "      
    \r\n"
-#string STR_PCIIO_DUMP_MAIN   #language en-US " Segment #.: 
%02x\r\n"
-  " Bus #.: 
%02x\r\n"
-  " Device #..: 
%02x\r\n"
-  " Function #: 
%02x\r\n"
-  " ROM Size..: 
%lx\r\n"
-  " ROM Location..: 
%08x\r\n"
-  " Vendor ID.: 
%04x\r\n"
-  " Device ID.: 
%04x\r\n"
-  " Class Code: %02x 
%02x %02x\r\n"
-  " Configuration Header :"
-#string STR_USBIO_DUMP_MAIN   #language en-US " Interface Number 
#.: %02x\r\n"
-  " Interface Class 
#..: %02x\r\n"
-  " Interface Subclass 
#...: %02x\r\n"
-  " Interface Protocol 
#...: %02x"
-
-#string STR_LI_DUMP_NAME  #language en-US " Name..: 
%%H%s%%N\r\n"
-
-#string STR_LI_DUMP_MAIN  #language en-US " Revision..: 
%%H0x%08x%%N\r\n"
-  " ParentHandle..: 
%%H%x%%N\r\n"
-  " SystemTable...: 
%%H%x%%N\r\n"
-  " DeviceHandle..: 
%%H%x%%N\r\n"
-  

[edk2] [PATCH 12/14] ShellPkg/dh: Modify the dump of UsbIo protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 61 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  |  5 +-
 2 files changed, 64 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index e5b4bea8f6..164caa9b91 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -1245,6 +1245,65 @@ PciIoProtocolDumpInformation (
 }
 
 /**
+  Function to dump information about UsbIoProtocol.
+
+  This will allocate the return buffer from boot services pool.
+
+  @param[in] TheHandle  The handle that has PciRootBridgeIo installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+
+  @retval A poitner to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+UsbIoProtocolDumpInformation (
+  IN CONST EFI_HANDLE TheHandle,
+  IN CONST BOOLEANVerbose
+  )
+{
+  EFI_STATUSStatus;
+  EFI_USB_IO_PROTOCOL   *UsbIo;
+  EFI_USB_INTERFACE_DESCRIPTOR  InterfaceDesc;
+  CHAR16*GetString;
+  CHAR16*RetVal;
+
+  if (!Verbose) {
+return (NULL);
+  }
+  RetVal = NULL;
+  GetString = NULL;
+  Status = gBS->OpenProtocol (
+  TheHandle,
+  ,
+  (VOID**),
+  gImageHandle,
+  NULL,
+  EFI_OPEN_PROTOCOL_GET_PROTOCOL
+  );
+
+  if (EFI_ERROR(Status)) {
+return NULL;
+  }
+  UsbIo->UsbGetInterfaceDescriptor (UsbIo, );
+  HandleParsingHiiInit ();
+  GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_USBIO_DUMP_MAIN), NULL);
+  if (GetString == NULL) {
+return NULL;
+  }
+  RetVal = CatSPrint (
+NULL,
+GetString,
+InterfaceDesc.InterfaceNumber,
+InterfaceDesc.InterfaceClass,
+InterfaceDesc.InterfaceSubClass,
+InterfaceDesc.InterfaceProtocol
+);
+
+  FreePool (GetString);
+  return RetVal;
+}
+
+/**
   Function to dump information about EfiAdapterInformation Protocol.
 
   @param[in] TheHandle  The handle that has the protocol installed.
@@ -1964,7 +2023,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_SCSI_IO),   ,   
   NULL},
   {STRING_TOKEN(STR_SCSI_PT_EXT),   ,  
   NULL},
   {STRING_TOKEN(STR_ISCSI), 
,  NULL},
-  {STRING_TOKEN(STR_USB_IO),,
   NULL},
+  {STRING_TOKEN(STR_USB_IO),,
   UsbIoProtocolDumpInformation},
   {STRING_TOKEN(STR_USB_HC),,
   NULL},
   {STRING_TOKEN(STR_USB_HC2),   ,   
   NULL},
   {STRING_TOKEN(STR_DEBUG_SUPPORT), , 
   DebugSupportProtocolDumpInformation},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 59409d9ca0..98299cd1d0 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -358,7 +358,10 @@
   " Device ID.: 
%04x\r\n"
   " Class Code: %02x 
%02x %02x\r\n"
   " Configuration Header :"
-
+#string STR_USBIO_DUMP_MAIN   #language en-US " Interface Number 
#.: %02x\r\n"
+  " Interface Class 
#..: %02x\r\n"
+  " Interface Subclass 
#...: %02x\r\n"
+  " Interface Protocol 
#...: %02x"
 
 #string STR_LI_DUMP_NAME  #language en-US " Name..: 
%%H%s%%N\r\n"
 
-- 
2.12.2.windows.2

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


[edk2] [PATCH 02/14] ShellPkg/dh: change the key information color from blue to hilight

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

The blue text is very hard to see.

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiShellDriver1CommandsLib.uni| 40 +++---
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
index 07e8657113..55008f5057 100644
--- 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
+++ 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
@@ -109,26 +109,26 @@
 #string STR_DH_OUTPUT_SINGLE_D#language en-US "%H%02x%N: %s\r\n"
 #string STR_DH_OUTPUT_SINGLE  #language en-US "%H%02x%N: %x\r\n%s"
 #string STR_DH_OUTPUT_SFO #language en-US "%s, %s, %s, %H%02x%N, %s, 
%s\r\n"
-#string STR_DH_OUTPUT_DRIVER1 #language en-US "   Controller Name: 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER2 #language en-US "   Device Path: 
%B%s%N\r\n"
-  "   Controller Type: 
%B%s%N\r\n"
-  "   Configuration  : 
%B%s%N\r\n"
-  "   Diagnostics: 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER3 #language en-US "   Managed by : 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER4A#language en-US " Drv[%H%02x%N]  
: Image(%B%s%N)r\n"
-#string STR_DH_OUTPUT_DRIVER4B#language en-US " Drv[%H%02x%N]  
: %B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER5 #language en-US "   Parent Controllers : 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER5B#language en-US " Parent[%H%02x%N]   
: %B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER6 #language en-US "   Child Controllers  : 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER6B#language en-US " Child[%H%02x%N]
: %B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER7 #language en-US "   Driver Name [%H%02x%N]  
: %B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER7B#language en-US "   Driver Image Name  : 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER8 #language en-US "   Driver Version : 
%B%08x%N\r\n"
-  "   Driver Type: 
%B%s%N\r\n"
-  "   Configuration  : 
%B%s%N\r\n"
-  "   Diagnostics: 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER9 #language en-US "   Managing   : 
%B%s%N\r\n"
-#string STR_DH_OUTPUT_DRIVER9B#language en-US " Ctrl[%H%02x%N] 
: %B%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER1 #language en-US "   Controller Name: 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER2 #language en-US "   Device Path: 
%H%s%N\r\n"
+  "   Controller Type: 
%H%s%N\r\n"
+  "   Configuration  : 
%H%s%N\r\n"
+  "   Diagnostics: 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER3 #language en-US "   Managed by : 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER4A#language en-US " Drv[%H%02x%N]  
: Image(%H%s%N)r\n"
+#string STR_DH_OUTPUT_DRIVER4B#language en-US " Drv[%H%02x%N]  
: %H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER5 #language en-US "   Parent Controllers : 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER5B#language en-US " Parent[%H%02x%N]   
: %H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER6 #language en-US "   Child Controllers  : 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER6B#language en-US " Child[%H%02x%N]
: %H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER7 #language en-US "   Driver Name [%H%02x%N]   
: %H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER7B#language en-US "   Driver Image Name  : 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER8 #language en-US "   Driver Version : 
%H%08x%N\r\n"
+  "   Driver Type: 
%H%s%N\r\n"
+  "   Configuration  : 
%H%s%N\r\n"
+  "   Diagnostics: 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER9 #language en-US "   Managing   : 
%H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER9B#language en-US " Ctrl[%H%02x%N] 
: %H%s%N\r\n"
 
 #string STR_DEV_TREE_OUTPUT   #language en-US "Ctrl[%H%02x%N] %s\r\n"
 
-- 
2.12.2.windows.2

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


[edk2] [PATCH 09/14] ShellPkg/dh: Modify the dump of DebugSupport protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 67 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  |  2 +
 2 files changed, 68 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index fb67197171..1c62415e86 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -1095,6 +1095,71 @@ BlockIoProtocolDumpInformation (
 }
 
 /**
+  Function to dump information about DebugSupport Protocol.
+
+  @param[in] TheHandle  The handle that has the protocol installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+
+  @retval A pointer to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+DebugSupportProtocolDumpInformation (
+  IN CONST EFI_HANDLE TheHandle,
+  IN CONST BOOLEANVerbose
+  )
+{
+  EFI_STATUS  Status;
+  EFI_DEBUG_SUPPORT_PROTOCOL  *DebugSupport;
+  CHAR16  *GetString;
+  CHAR16  *RetVal;
+
+  if (!Verbose) {
+return NULL;
+  }
+  GetString = NULL;
+  RetVal = NULL;
+  Status = gBS->OpenProtocol (
+TheHandle,
+,
+(VOID**),
+gImageHandle,
+NULL,
+EFI_OPEN_PROTOCOL_GET_PROTOCOL
+);
+  if (EFI_ERROR (Status)) {
+return NULL;
+  }
+  HandleParsingHiiInit ();
+  GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_DEBUGSUPPORT_INFO), NULL);
+  if (GetString == NULL) {
+return NULL;
+  }
+  //
+  // Dump Debug support info
+  //
+  switch (DebugSupport->Isa) {
+  case (IsaIa32):
+RetVal = CatSPrint (RetVal, GetString, L"IA-32");
+break;
+  case (IsaIpf):
+RetVal = CatSPrint (RetVal, GetString, L"IPF");
+break;
+  case (IsaEbc):
+RetVal = CatSPrint (RetVal, GetString, L"EBC");
+break;
+  default:
+SHELL_FREE_NON_NULL (GetString);
+GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_DEBUGSUPPORT_UNKNOWN), NULL);
+RetVal = GetString != NULL ? CatSPrint (RetVal, GetString, 
DebugSupport->Isa) : NULL;
+break;
+  }
+
+  SHELL_FREE_NON_NULL (GetString);
+  return RetVal;
+}
+
+/**
   Function to dump information about EfiAdapterInformation Protocol.
 
   @param[in] TheHandle  The handle that has the protocol installed.
@@ -1817,7 +1882,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_USB_IO),,
   NULL},
   {STRING_TOKEN(STR_USB_HC),,
   NULL},
   {STRING_TOKEN(STR_USB_HC2),   ,   
   NULL},
-  {STRING_TOKEN(STR_DEBUG_SUPPORT), , 
   NULL},
+  {STRING_TOKEN(STR_DEBUG_SUPPORT), , 
   DebugSupportProtocolDumpInformation},
   {STRING_TOKEN(STR_DEBUG_PORT),,
   NULL},
   {STRING_TOKEN(STR_DECOMPRESS),,   
   NULL},
   {STRING_TOKEN(STR_ACPI_TABLE),,
   NULL},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index eeb6aded6f..ca5e362bc7 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -336,6 +336,8 @@
 #string STR_IDE_CONT_INIT #language en-US "IdeControllerInit"
 #string STR_DISK_INFO #language en-US "DiskInfo"
 #string STR_BLOCKIO_INFO  #language en-US "  %s%sMId:%%H%x%%N bsize 
%%H%x%%N, lblock %lx (%,ld), %s %s %s"
+#string STR_DEBUGSUPPORT_INFO #language en-US "  Isa = %s"
+#string STR_DEBUGSUPPORT_UNKNOWN  #language en-US "  Unknown (%%H%s%%N)"
 
 #string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: 
%H%x%N\r\n"
 #string STR_PCIRB_DUMP_SEG#language en-US " Segment #.: 
%H%x%N\r\n"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 07/14] ShellPkg/dh: Modify the dump of BusSpecificDriverOverride protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 81 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  |  2 +-
 2 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index b9eb564dd0..ce2b49b5a2 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -938,6 +938,85 @@ LoadedImageDevicePathProtocolDumpInformation(
 }
 
 /**
+  Function to dump information about BusSpecificDriverOverride protocol.
+
+  This will allocate the return buffer from boot services pool.
+
+  @param[in] TheHandle  The handle that has the protocol installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+
+  @retval A pointer to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+BusSpecificDriverOverrideProtocolDumpInformation (
+  IN CONST EFI_HANDLE TheHandle,
+  IN CONST BOOLEANVerbose
+  )
+{
+  EFI_STATUSStatus;
+  CHAR16*GetString;
+  CHAR16*RetVal;
+  CHAR16*TempRetVal;
+  EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL *BusSpecificDriverOverride;
+  EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
+  EFI_HANDLEImageHandle;
+  UINTN Size;
+
+  if (!Verbose) {
+return NULL;
+  }
+  Size= 0;
+  GetString   = NULL;
+  RetVal  = NULL;
+  TempRetVal  = NULL;
+  ImageHandle = 0;
+
+  Status = gBS->OpenProtocol (
+  TheHandle,
+  ,
+  (VOID**),
+  gImageHandle,
+  NULL,
+  EFI_OPEN_PROTOCOL_GET_PROTOCOL
+  );
+  if (EFI_ERROR (Status)) {
+return NULL;
+  }
+  HandleParsingHiiInit ();
+  GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_BSDO_DUMP_MAIN), NULL);
+  if (GetString == NULL) {
+return NULL;
+  }
+  do {
+Status = BusSpecificDriverOverride->GetDriver (
+  BusSpecificDriverOverride,
+  
+  );
+if (!EFI_ERROR (Status)) {
+  Status = gBS->HandleProtocol (
+  ImageHandle,
+  ,
+  (VOID **) 
+  );
+  if(!EFI_ERROR (Status)) {
+TempRetVal = CatSPrint (
+   TempRetVal,
+   GetString,
+   ConvertHandleToHandleIndex (ImageHandle),
+   ConvertDevicePathToText (LoadedImage->FilePath, TRUE, 
TRUE)
+   );
+StrnCatGrow (, , TempRetVal, 0);
+SHELL_FREE_NON_NULL (TempRetVal);
+  }
+}
+  } while (!EFI_ERROR (Status));
+
+  SHELL_FREE_NON_NULL (GetString);
+  return RetVal;
+}
+
+/**
   Function to dump information about EfiAdapterInformation Protocol.
 
   @param[in] TheHandle  The handle that has the protocol installed.
@@ -1623,7 +1702,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_DEVICE_PATH_VTUTF8),,   
   NULL},
   {STRING_TOKEN(STR_DRIVER_BINDING),,
   NULL},
   {STRING_TOKEN(STR_PLATFORM_OVERRIDE), 
,  NULL},
-  {STRING_TOKEN(STR_BUS_OVERRIDE),  
,   NULL},
+  {STRING_TOKEN(STR_BUS_OVERRIDE),  
,   
BusSpecificDriverOverrideProtocolDumpInformation},
   {STRING_TOKEN(STR_DRIVER_DIAG),   
,   NULL},
   {STRING_TOKEN(STR_DRIVER_DIAG2),  
,  NULL},
   {STRING_TOKEN(STR_DRIVER_CN), ,
   NULL},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 8541399b68..3f9fc9cbac 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -384,7 +384,7 @@
 #string STR_GOP_RES_LIST_ENTRY#language en-US "   
Resolution[%%H%d%%N]:\r\n"
   " Res Hor.: 
%%H0x%08x%%N\r\n"
   " Res Ver.: 
%%H0x%08x%%N\r\n"
-
+#string STR_BSDO_DUMP_MAIN#language en-US " Drv[%02x] 
File:%%H%s%%N"
 #string STR_EDID_DISCOVERED_MAIN  #language en-US " EDID Discovered Size : 
%%H0x%08x%%N\r\n"
 #string STR_EDID_DISCOVERED_DATA  

[edk2] [PATCH 03/14] ShellPkg/dh: fix the error display "Child Controllers" to "Managing".

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c   | 6 +++---
 .../UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
index 3694e501b6..f37f7e9a9e 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
@@ -705,7 +705,7 @@ DisplayDriverModelHandle (
 -1, 
 -1, 
 NULL, 
-STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), 
+STRING_TOKEN (STR_DH_OUTPUT_DRIVER9),
 gShellDriver1HiiHandle, 
 L"None"
 );
@@ -714,7 +714,7 @@ DisplayDriverModelHandle (
   -1, 
   -1, 
   NULL, 
-  STRING_TOKEN (STR_DH_OUTPUT_DRIVER6), 
+  STRING_TOKEN (STR_DH_OUTPUT_DRIVER9),
   gShellDriver1HiiHandle, 
   L""
   );
@@ -746,7 +746,7 @@ DisplayDriverModelHandle (
 -1, 
 -1, 
 NULL, 
-STRING_TOKEN (STR_DH_OUTPUT_DRIVER6B),
+STRING_TOKEN (STR_DH_OUTPUT_DRIVER6C),
 gShellDriver1HiiHandle,
 
ConvertHandleToHandleIndex(ChildControllerHandleBuffer[ChildIndex]),
 TempStringPointer!=NULL?TempStringPointer:L""
diff --git 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
index 55008f5057..e4bff68838 100644
--- 
a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
+++ 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
@@ -121,6 +121,7 @@
 #string STR_DH_OUTPUT_DRIVER5B#language en-US " Parent[%H%02x%N]   
: %H%s%N\r\n"
 #string STR_DH_OUTPUT_DRIVER6 #language en-US "   Child Controllers  : 
%H%s%N\r\n"
 #string STR_DH_OUTPUT_DRIVER6B#language en-US " Child[%H%02x%N]
: %H%s%N\r\n"
+#string STR_DH_OUTPUT_DRIVER6C#language en-US "   Child[%H%02x%N]  
: %H%s%N\r\n"
 #string STR_DH_OUTPUT_DRIVER7 #language en-US "   Driver Name [%H%02x%N]   
: %H%s%N\r\n"
 #string STR_DH_OUTPUT_DRIVER7B#language en-US "   Driver Image Name  : 
%H%s%N\r\n"
 #string STR_DH_OUTPUT_DRIVER8 #language en-US "   Driver Version : 
%H%08x%N\r\n"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 08/14] ShellPkg/dh: Modify the dump of BlockIo protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 80 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  |  1 +
 2 files changed, 80 insertions(+), 1 deletion(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index ce2b49b5a2..fb67197171 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -1017,6 +1017,84 @@ BusSpecificDriverOverrideProtocolDumpInformation (
 }
 
 /**
+  Function to dump information about BlockIo protocol.
+
+  This will allocate the return buffer from boot services pool.
+
+  @param[in] TheHandle  The handle that has the protocol installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+
+  @retval A pointer to a string containing the information.
+**/
+CHAR16*
+EFIAPI
+BlockIoProtocolDumpInformation (
+  IN CONST EFI_HANDLE TheHandle,
+  IN CONST BOOLEANVerbose
+  )
+{
+  EFI_STATUSStatus;
+  EFI_BLOCK_IO_PROTOCOL *BlockIo;
+  EFI_BLOCK_IO_MEDIA*BlockMedia;
+  CHAR16*GetString;
+  CHAR16*RetVal;
+
+  if (!Verbose) {
+return NULL;
+  }
+  GetString   = NULL;
+  RetVal = NULL;
+
+  Status = gBS->OpenProtocol (
+TheHandle,
+,
+(VOID**),
+gImageHandle,
+NULL,
+EFI_OPEN_PROTOCOL_GET_PROTOCOL
+);
+  if (EFI_ERROR (Status)) {
+return NULL;
+  }
+  BlockMedia = BlockIo->Media;
+  //
+  // Per spec:
+  //   The function (ReadBlocks) must return EFI_NO_MEDIA or
+  //   EFI_MEDIA_CHANGED even if LBA, BufferSize, or Buffer are invalid so the 
caller can probe
+  //   for changes in media state.
+  //
+  BlockIo->ReadBlocks (
+ BlockIo,
+ BlockIo->Media->MediaId,
+ 0,
+ 0,
+ NULL
+ );
+
+  HandleParsingHiiInit ();
+  GetString = HiiGetString (mHandleParsingHiiHandle, 
STRING_TOKEN(STR_BLOCKIO_INFO), NULL);
+  if (GetString == NULL) {
+return NULL;
+  }
+  RetVal = CatSPrint (
+RetVal,
+GetString,
+BlockMedia->RemovableMedia ? L"Removable " : L"Fixed ",
+BlockMedia->MediaPresent ? L"" : L"not-present ",
+BlockMedia->MediaId,
+BlockMedia->BlockSize,
+BlockMedia->LastBlock,
+MultU64x32 (BlockMedia->LastBlock + 1, BlockMedia->BlockSize),
+BlockMedia->LogicalPartition ? L"partition" : L"raw",
+BlockMedia->ReadOnly ? L"ro" : L"rw",
+BlockMedia->WriteCaching ? L"cached" : L"!cached"
+);
+
+  SHELL_FREE_NON_NULL (GetString);
+  return RetVal;
+}
+
+/**
   Function to dump information about EfiAdapterInformation Protocol.
 
   @param[in] TheHandle  The handle that has the protocol installed.
@@ -1727,7 +1805,7 @@ STATIC CONST GUID_INFO_BLOCK mGuidStringList[] = {
   {STRING_TOKEN(STR_SIMPLE_FILE_SYS),   , 
   NULL},
   {STRING_TOKEN(STR_TAPE_IO),   ,   
   NULL},
   {STRING_TOKEN(STR_DISK_IO),   ,   
   NULL},
-  {STRING_TOKEN(STR_BLK_IO),,  
   NULL},
+  {STRING_TOKEN(STR_BLK_IO),,  
   BlockIoProtocolDumpInformation},
   {STRING_TOKEN(STR_UC),, 
   NULL},
   {STRING_TOKEN(STR_UC2),   
,   NULL},
   {STRING_TOKEN(STR_PCIRB_IO),  ,  
   PciRootBridgeIoDumpInformation},
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index 3f9fc9cbac..eeb6aded6f 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -335,6 +335,7 @@
 
 #string STR_IDE_CONT_INIT #language en-US "IdeControllerInit"
 #string STR_DISK_INFO #language en-US "DiskInfo"
+#string STR_BLOCKIO_INFO  #language en-US "  %s%sMId:%%H%x%%N bsize 
%%H%x%%N, lblock %lx (%,ld), %s %s %s"
 
 #string STR_PCIRB_DUMP_PH #language en-US " ParentHandle..: 
%H%x%N\r\n"
 #string STR_PCIRB_DUMP_SEG#language en-US " Segment #.: 
%H%x%N\r\n"
-- 
2.12.2.windows.2

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


[edk2] [PATCH 06/14] ShellPkg/dh: Modify the dump of LoadedImage protocol

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 24 ++
 .../UefiHandleParsingLib/UefiHandleParsingLib.h|  3 ++-
 .../UefiHandleParsingLib/UefiHandleParsingLib.inf  |  3 ++-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  |  3 ++-
 4 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index 1f2ca92bdd..b9eb564dd0 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -232,14 +232,11 @@ LoadedImageProtocolDumpInformation(
   CHAR16*RetVal;
   CHAR16*Temp;
   CHAR16*FileName;
+  CHAR8 *PdbFileName;
   CHAR16*FilePath;
   CHAR16*CodeType;
   CHAR16*DataType;
 
-  if (!Verbose) {
-return (CatSPrint(NULL, L"LoadedImage"));
-  }
-
   Status = gBS->OpenProtocol (
 TheHandle,
 ,
@@ -253,10 +250,20 @@ LoadedImageProtocolDumpInformation(
 return NULL;
   }
 
-  HandleParsingHiiInit();
-
   FileName = FindLoadedImageFileName(LoadedImage);
+  FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE);
+  if (!Verbose) {
+if (FileName == NULL) {
+  FileName = FilePath;
+} else {
+  SHELL_FREE_NON_NULL(FilePath);
+}
+RetVal = CatSPrint(NULL, FileName);
+SHELL_FREE_NON_NULL(FileName);
+return RetVal;
+  }
 
+  HandleParsingHiiInit();
   RetVal = NULL;
   if (FileName != NULL) {
 Temp = HiiGetString(mHandleParsingHiiHandle, 
STRING_TOKEN(STR_LI_DUMP_NAME), NULL);
@@ -273,9 +280,7 @@ LoadedImageProtocolDumpInformation(
   if (Temp == NULL) {
 return NULL;
   }
-
-  FilePath = ConvertDevicePathToText(LoadedImage->FilePath, TRUE, TRUE);
-
+  PdbFileName = PeCoffLoaderGetPdbPointer (LoadedImage->ImageBase);
   DataType = ConvertMemoryType(LoadedImage->ImageDataType);
   CodeType = ConvertMemoryType(LoadedImage->ImageCodeType);
 
@@ -287,6 +292,7 @@ LoadedImageProtocolDumpInformation(
  LoadedImage->SystemTable,
  LoadedImage->DeviceHandle,
  FilePath,
+ PdbFileName,
  LoadedImage->LoadOptionsSize,
  LoadedImage->LoadOptions,
  LoadedImage->ImageBase,
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index ada2b4aa38..cf849658aa 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -1,7 +1,7 @@
 /** @file
   Provides interface to advanced shell functionality for parsing both handle 
and protocol database.
 
-  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
+  Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP
   (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.
   This program and the accompanying materials
@@ -153,6 +153,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1   1
 #define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2   2
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
index 3bd4dbe423..4c1c3d3846 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
@@ -1,6 +1,6 @@
 ##  @file
 #  Provides interface to advanced shell functionality for parsing both handle 
and protocol database.
-#  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. 
+#  Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. 
 #  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
 #  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
 #
@@ -50,6 +50,7 @@ [LibraryClasses]
   UefiLib
   HiiLib
   SortLib
+  PeCoffGetEntryPointLib
 
 [Protocols]
   gEfiSimpleFileSystemProtocolGuid## SOMETIMES_CONSUMES
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
index e07c9a1670..8541399b68 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
@@ -355,13 +355,14 @@
   " SystemTable...: 

[edk2] [PATCH 04/14] ShellPkg/dh: Display the protocol instance pointer value for "-v"

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c 
b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
index f37f7e9a9e..7d06163a7b 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c
@@ -286,6 +286,8 @@ GetProtocolInfoString(
   UINTN Size;
   CHAR16*Temp;
   CHAR16GuidStr[40];
+  VOID  *instance;
+  CHAR16InstanceStr[17];
 
   ProtocolGuidArray = NULL;
   RetVal= NULL;
@@ -312,6 +314,17 @@ GetProtocolInfoString(
 FreePool(Temp);
   }
   StrnCatGrow(, , L"%N", 0);
+
+  if(Verbose) {
+Status = gBS->HandleProtocol (TheHandle, 
ProtocolGuidArray[ProtocolIndex], );
+if (!EFI_ERROR (Status)) {
+  StrnCatGrow (, , L"(%H", 0);
+  UnicodeSPrint (InstanceStr, sizeof (InstanceStr), L"%x", instance);
+  StrnCatGrow (, , InstanceStr, 0);
+  StrnCatGrow (, , L"%N)", 0);
+}
+  }
+
   if (ExtraInfo) {
 Temp = GetProtocolInformationDump(TheHandle, 
ProtocolGuidArray[ProtocolIndex], Verbose);
 if (Temp != NULL) {
-- 
2.12.2.windows.2

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


[edk2] [PATCH 05/14] ShellPkg/dh: Modify the dump of "ImageDevicePath" and "DevicePath"

2017-09-21 Thread Ruiyu Ni
From: Huajing Li 

Reviewed-by: Ruiyu Ni 
Cc: Jaben Carsey 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Huajing Li 
---
 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 68 +++---
 1 file changed, 46 insertions(+), 22 deletions(-)

diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c 
b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
index d3ee068eba..1f2ca92bdd 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
@@ -848,6 +848,50 @@ ConvertDevicePathToShortText(
 }
 
 /**
+  Function to dump protocol information.
+
+  This will allocate the return buffer from boot services pool.
+
+  @param[in] TheHandle  The handle that has the protocol installed.
+  @param[in] VerboseTRUE for additional information, FALSE otherwise.
+  @param[in] Protocol   The protocol is needed to dump.
+
+  @retval A pointer to a string containing the information.
+**/
+STATIC CHAR16*
+EFIAPI
+DevicePathProtocolDumpInformationEx (
+  IN CONST EFI_HANDLE   TheHandle,
+  IN CONST BOOLEAN  Verbose,
+  IN   EFI_GUID *Protocol
+)
+{
+  EFI_DEVICE_PATH_PROTOCOL  *DevPath;
+  CHAR16*DevPathStr;
+  CHAR16*DevPathStrTemp;
+  UINTN Size;
+  EFI_STATUSStatus;
+  DevPathStr = NULL;
+  DevPathStrTemp = NULL;
+  Status = gBS->OpenProtocol(TheHandle, Protocol, (VOID**), 
gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
+  if (!EFI_ERROR(Status)) {
+DevPathStr = ConvertDevicePathToShortText (DevPath, Verbose, 30);
+if (Verbose) {
+  Size = StrSize(DevPathStr) + sizeof(CHAR16) * 2;
+  DevPathStrTemp = AllocateZeroPool (Size);
+  if (DevPathStrTemp != NULL) {
+StrnCatS (DevPathStrTemp, Size/sizeof(CHAR16), L"  ", 2);
+StrnCatS (DevPathStrTemp, Size/sizeof(CHAR16), DevPathStr, StrLen 
(DevPathStr));
+  }
+  FreePool (DevPathStr);
+  DevPathStr = DevPathStrTemp;
+}
+gBS->CloseProtocol(TheHandle, Protocol, gImageHandle, NULL);
+  }
+  return DevPathStr;
+}
+
+/**
   Function to dump information about DevicePath protocol.
 
   This will allocate the return buffer from boot services pool.
@@ -864,17 +908,7 @@ DevicePathProtocolDumpInformation(
   IN CONST BOOLEANVerbose
   )
 {
-  EFI_DEVICE_PATH_PROTOCOL  *DevPath;
-  CHAR16*Temp;
-  EFI_STATUSStatus;
-  Temp = NULL;
-
-  Status = gBS->OpenProtocol(TheHandle, , 
(VOID**), gImageHandle, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-  if (!EFI_ERROR(Status)) {
-Temp = ConvertDevicePathToShortText (DevPath, Verbose, 30);
-gBS->CloseProtocol(TheHandle, , gImageHandle, 
NULL);
-  }
-  return (Temp);
+  return DevicePathProtocolDumpInformationEx (TheHandle, Verbose, 
);
 }
 
 /**
@@ -894,17 +928,7 @@ LoadedImageDevicePathProtocolDumpInformation(
   IN CONST BOOLEANVerbose
   )
 {
-  EFI_DEVICE_PATH_PROTOCOL  *DevPath;
-  CHAR16*Temp;
-  EFI_STATUSStatus;
-  Temp = NULL;
-
-  Status = gBS->OpenProtocol(TheHandle, 
, (VOID**), gImageHandle, NULL, 
EFI_OPEN_PROTOCOL_GET_PROTOCOL);
-  if (!EFI_ERROR(Status)) {
-Temp = ConvertDevicePathToShortText (DevPath, Verbose, 30);
-gBS->CloseProtocol(TheHandle, , gImageHandle, 
NULL);
-  }
-  return (Temp);
+  return DevicePathProtocolDumpInformationEx (TheHandle, Verbose, 
);
 }
 
 /**
-- 
2.12.2.windows.2

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


[edk2] [PATCH 00/14] Refine output of "dh"

2017-09-21 Thread Ruiyu Ni
The patches refine the output of "dh":
1. Support more detailed dump for some protocols.
2. Refine the output by changing the hilight, indent, EOL

Huajing Li (13):
  ShellPkg/dh: display all the protocol names in a single line
  ShellPkg/dh: change the key information color from blue to hilight
  ShellPkg/dh: fix the error display "Child Controllers" to "Managing".
  ShellPkg/dh: Display the protocol instance pointer value for "-v"
  ShellPkg/dh: Modify the dump of "ImageDevicePath" and "DevicePath"
  ShellPkg/dh: Modify the dump of LoadedImage protocol
  ShellPkg/dh: Modify the dump of BusSpecificDriverOverride protocol
  ShellPkg/dh: Modify the dump of BlockIo protocol
  ShellPkg/dh: Modify the dump of DebugSupport protocol
  ShellPkg/dh: Modify the dump of GraphicsOutput protocol
  ShellPkg/dh: Modify the dump of PciIo protocol
  ShellPkg/dh: Modify the dump of UsbIo protocol
  ShellPkg/dh: Modify the dump of UsbIo protocol

Ruiyu Ni (1):
  ShellPkg/dh: Refine the dump output

 .../UefiHandleParsingLib/UefiHandleParsingLib.c| 472 +++--
 .../UefiHandleParsingLib/UefiHandleParsingLib.h|   3 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.inf  |   3 +-
 .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | 127 +++---
 ShellPkg/Library/UefiShellDriver1CommandsLib/Dh.c  |  55 ++-
 .../UefiShellDriver1CommandsLib.uni|  42 +-
 6 files changed, 572 insertions(+), 130 deletions(-)

-- 
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 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3

2017-09-21 Thread Yao, Jiewen
Good catch. Typo. It should be VTdPmr.

Yes, we need add gEfiPeiMasterBootModePpiGuid - that is very good suggestion.

Thank you
Yao Jiewen

> -Original Message-
> From: Zeng, Star
> Sent: Friday, September 22, 2017 12:22 PM
> To: Yao, Jiewen ; edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: RE: [PATCH 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for 
> S3
> 
> Is the code comment correct?
> 
> +  //
> +  // Register EndOfPei Notify for S3 to run FSP NotifyPhase
> +  //
> 
> Should the "VTdPrm" be "VTdPmr"?
> 
> If checking the bootmode in entrypoint, should add
> gEfiPeiMasterBootModePpiGuid in the depex or not?
> 
> 
> Thanks,
> Star
> -Original Message-
> From: Yao, Jiewen
> Sent: Friday, September 22, 2017 11:45 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star 
> Subject: [PATCH 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3
> 
> In S3 resume, before system transfer to waking vector,
> the VTdPrm need turn off VTd protection based upon VTdPolicy.
> 
> Cc: Star Zeng 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jiewen Yao 
> ---
>  IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c   | 59
> +++-
>  IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf |  1 +
>  2 files changed, 58 insertions(+), 2 deletions(-)
> 
> diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> index e768274..3fe6d65 100644
> --- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> @@ -24,16 +24,18 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include "IntelVTdPmrPei.h"
> 
>  #define  TOTAL_DMA_BUFFER_SIZESIZE_4MB
> +#define  TOTAL_DMA_BUFFER_SIZE_S3 SIZE_1MB
> 
>  EFI_ACPI_DMAR_HEADER  *mAcpiDmarTable;
>  VTD_INFO  *mVTdInfo;
>  UINT64mEngineMask;
>  UINTN mDmaBufferBase;
> -UINTN mDmaBufferSize =
> TOTAL_DMA_BUFFER_SIZE;
> +UINTN mDmaBufferSize;
>  UINTN mDmaBufferCurrentTop;
>  UINTN mDmaBufferCurrentBottom;
> 
> @@ -544,6 +546,7 @@ InitDmaProtection (
>}
>ASSERT (DmaBufferSize == ALIGN_VALUE(DmaBufferSize,
> MemoryAlignment));
>*DmaBufferBase = (UINTN)AllocateAlignedPages
> (EFI_SIZE_TO_PAGES(DmaBufferSize), MemoryAlignment);
> +  ASSERT (*DmaBufferBase != 0);
>if (*DmaBufferBase == 0) {
>  DEBUG ((DEBUG_INFO, " InitDmaProtection : OutOfResource\n"));
>  return EFI_OUT_OF_RESOURCES;
> @@ -1105,6 +1108,41 @@ ParseDmarAcpiTableRmrr (
>  }
> 
>  /**
> +  This function handles S3 resume task at the end of PEI
> +
> +  @param[in] PeiServicesPointer to PEI Services Table.
> +  @param[in] NotifyDesc Pointer to the descriptor for the Notification
> event that
> +caused this function to execute.
> +  @param[in] PpiPointer to the PPI data associated with this
> function.
> +
> +  @retval EFI_STATUSAlways return EFI_SUCCESS
> +**/
> +EFI_STATUS
> +EFIAPI
> +S3EndOfPeiNotify(
> +  IN EFI_PEI_SERVICES  **PeiServices,
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
> +  IN VOID  *Ppi
> +  )
> +{
> +  UINT64  EngineMask;
> +
> +  DEBUG((DEBUG_INFO, "VTdPmr S3EndOfPeiNotify\n"));
> +
> +  if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT1) == 0) {
> +EngineMask = LShiftU64 (1, mVTdInfo->VTdEngineCount) - 1;
> +DisableDmaProtection (EngineMask);
> +  }
> +  return EFI_SUCCESS;
> +}
> +
> +EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
> +  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
> +  ,
> +  S3EndOfPeiNotify
> +};
> +
> +/**
>Initializes the Intel VTd PMR PEIM.
> 
>@param  FileHandle  Handle of the file being invoked.
> @@ -1122,11 +1160,14 @@ IntelVTdPmrInitialize (
>)
>  {
>EFI_STATUS  Status;
> +  EFI_BOOT_MODE   BootMode;
> 
>if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) == 0) {
>  return EFI_UNSUPPORTED;
>}
> 
> +  PeiServicesGetBootMode ();
> +
>Status = PeiServicesLocatePpi (
>   ,
>   0,
> @@ -1150,6 +1191,13 @@ IntelVTdPmrInitialize (
>//
>ParseDmarAcpiTableRmrr ();
> 
> +  if (BootMode == BOOT_ON_S3_RESUME) {
> +mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE_S3;
> +  } else {
> +mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE;
> +  }
> +  DEBUG ((DEBUG_INFO, " DmaBufferSize : 0x%x\n", mDmaBufferSize));
> +
>//
>// Find a pre-memory in resource hob as DMA buffer
>// Mark PEI memory to be DMA protected.
> @@ -1160,7 +1208,6 @@ IntelVTdPmrInitialize (
>}
> 
>DEBUG 

Re: [edk2] [PATCH 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3

2017-09-21 Thread Zeng, Star
Is the code comment correct?

+  //
+  // Register EndOfPei Notify for S3 to run FSP NotifyPhase
+  //

Should the "VTdPrm" be "VTdPmr"?

If checking the bootmode in entrypoint, should add gEfiPeiMasterBootModePpiGuid 
in the depex or not?


Thanks,
Star
-Original Message-
From: Yao, Jiewen 
Sent: Friday, September 22, 2017 11:45 AM
To: edk2-devel@lists.01.org
Cc: Zeng, Star 
Subject: [PATCH 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3

In S3 resume, before system transfer to waking vector,
the VTdPrm need turn off VTd protection based upon VTdPolicy.

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao 
---
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c   | 59 
+++-
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf |  1 +
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c 
b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index e768274..3fe6d65 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -24,16 +24,18 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "IntelVTdPmrPei.h"
 
 #define  TOTAL_DMA_BUFFER_SIZESIZE_4MB
+#define  TOTAL_DMA_BUFFER_SIZE_S3 SIZE_1MB
 
 EFI_ACPI_DMAR_HEADER  *mAcpiDmarTable;
 VTD_INFO  *mVTdInfo;
 UINT64mEngineMask;
 UINTN mDmaBufferBase;
-UINTN mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE;
+UINTN mDmaBufferSize;
 UINTN mDmaBufferCurrentTop;
 UINTN mDmaBufferCurrentBottom;
 
@@ -544,6 +546,7 @@ InitDmaProtection (
   }
   ASSERT (DmaBufferSize == ALIGN_VALUE(DmaBufferSize, MemoryAlignment));
   *DmaBufferBase = (UINTN)AllocateAlignedPages 
(EFI_SIZE_TO_PAGES(DmaBufferSize), MemoryAlignment);
+  ASSERT (*DmaBufferBase != 0);
   if (*DmaBufferBase == 0) {
 DEBUG ((DEBUG_INFO, " InitDmaProtection : OutOfResource\n"));
 return EFI_OUT_OF_RESOURCES;
@@ -1105,6 +1108,41 @@ ParseDmarAcpiTableRmrr (
 }
 
 /**
+  This function handles S3 resume task at the end of PEI
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @param[in] PpiPointer to the PPI data associated with this 
function.
+
+  @retval EFI_STATUSAlways return EFI_SUCCESS
+**/
+EFI_STATUS
+EFIAPI
+S3EndOfPeiNotify(
+  IN EFI_PEI_SERVICES  **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+  IN VOID  *Ppi
+  )
+{
+  UINT64  EngineMask;
+
+  DEBUG((DEBUG_INFO, "VTdPmr S3EndOfPeiNotify\n"));
+
+  if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT1) == 0) {
+EngineMask = LShiftU64 (1, mVTdInfo->VTdEngineCount) - 1;
+DisableDmaProtection (EngineMask);
+  }
+  return EFI_SUCCESS;
+}
+
+EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  ,
+  S3EndOfPeiNotify
+};
+
+/**
   Initializes the Intel VTd PMR PEIM.
 
   @param  FileHandle  Handle of the file being invoked.
@@ -1122,11 +1160,14 @@ IntelVTdPmrInitialize (
   )
 {
   EFI_STATUS  Status;
+  EFI_BOOT_MODE   BootMode;
 
   if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) == 0) {
 return EFI_UNSUPPORTED;
   }
 
+  PeiServicesGetBootMode ();
+
   Status = PeiServicesLocatePpi (
  ,
  0,
@@ -1150,6 +1191,13 @@ IntelVTdPmrInitialize (
   //
   ParseDmarAcpiTableRmrr ();
 
+  if (BootMode == BOOT_ON_S3_RESUME) {
+mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE_S3;
+  } else {
+mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE;
+  }
+  DEBUG ((DEBUG_INFO, " DmaBufferSize : 0x%x\n", mDmaBufferSize));
+
   //
   // Find a pre-memory in resource hob as DMA buffer
   // Mark PEI memory to be DMA protected.
@@ -1160,7 +1208,6 @@ IntelVTdPmrInitialize (
   }
 
   DEBUG ((DEBUG_INFO, " DmaBufferBase : 0x%x\n", mDmaBufferBase));
-  DEBUG ((DEBUG_INFO, " DmaBufferSize : 0x%x\n", mDmaBufferSize));
 
   mDmaBufferCurrentTop = mDmaBufferBase + mDmaBufferSize;
   mDmaBufferCurrentBottom = mDmaBufferBase;
@@ -1171,6 +1218,14 @@ IntelVTdPmrInitialize (
   Status = PeiServicesInstallPpi ();
   ASSERT_EFI_ERROR(Status);
 
+  //
+  // Register EndOfPei Notify for S3 to run FSP NotifyPhase
+  //
+  if (BootMode == BOOT_ON_S3_RESUME) {
+Status = PeiServicesNotifyPpi ();
+ASSERT_EFI_ERROR (Status);
+  }
+
   return Status;
 }
 
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf 
b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf

Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54ce57c2608b8b3ea051c7041f036f21153

2017-09-21 Thread Wu, Hao A
After altering the commit logs, push at:
96207191fd715e268c6ba6d6ac8650ef914e1686


Best Regards,
Hao Wu


> -Original Message-
> From: Wang, Jian J
> Sent: Friday, September 22, 2017 11:34 AM
> To: Wu, Hao A; edk2-devel@lists.01.org
> Cc: Anthony PERARD
> Subject: RE: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit
> c1cab54ce57c2608b8b3ea051c7041f036f21153
> 
> Ok, thanks for the review.
> 
> -Original Message-
> From: Wu, Hao A
> Sent: Friday, September 22, 2017 11:21 AM
> To: Wang, Jian J ; edk2-devel@lists.01.org
> Cc: Anthony PERARD 
> Subject: RE: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit
> c1cab54ce57c2608b8b3ea051c7041f036f21153
> 
> One minor comment, please shorten the subject of the patch.
> 
> Maybe like:
> UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54
> 
> With that change,
> Reviewed-by: Hao Wu 
> 
> 
> Best Regards,
> Hao Wu
> 
> > -Original Message-
> > From: Wang, Jian J
> > Sent: Friday, September 22, 2017 10:15 AM
> > To: edk2-devel@lists.01.org
> > Cc: Wu, Hao A; Anthony PERARD
> > Subject: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit
> > c1cab54ce57c2608b8b3ea051c7041f036f21153
> >
> > Cc: Hao Wu 
> > Cc: Anthony PERARD 
> > Suggested-by: Jiewen Yao 
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Jian J Wang 
> > ---
> >  UefiCpuPkg/CpuDxe/CpuPageTable.c | 8 ++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > index ae93f3f553..d312eb66f8 100644
> > --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> > @@ -802,8 +802,12 @@ RefreshGcdMemoryAttributesFromPaging (
> >
> >GetCurrentPagingContext ();
> >
> > -  BaseAddress = 0;
> > -  PageLength  = 0;
> > +  DoUpdate  = FALSE;
> > +  Capabilities  = 0;
> > +  Attributes= 0;
> > +  BaseAddress   = 0;
> > +  PageLength= 0;
> > +
> >for (Index = 0; Index < NumberOfDescriptors; Index++) {
> >  if (MemorySpaceMap[Index].GcdMemoryType ==
> > EfiGcdMemoryTypeNonExistent) {
> >continue;
> > --
> > 2.14.1.windows.1

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


Re: [edk2] [patch] MdeModulePkg/SetupBrowser:Add NULL check before using a pointer

2017-09-21 Thread Wu, Hao A
Reviewed-by: Hao Wu 


Best Regards,
Hao Wu


> -Original Message-
> From: Bi, Dandan
> Sent: Friday, September 22, 2017 9:57 AM
> To: edk2-devel@lists.01.org
> Cc: Dong, Eric; Wu, Hao A
> Subject: [patch] MdeModulePkg/SetupBrowser:Add NULL check before using a
> pointer
> 
> Add NULL pointer check before using a pointer to avoid possible
> NULL pointer dereference.
> 
> Cc: Eric Dong 
> Cc: Hao Wu 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi 
> ---
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> index 48beeb6..c2cfa5c 100644
> --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
> @@ -1484,11 +1484,13 @@ BufferToValue (
>  //
>  // Other type of Questions
>  //
>  if (Question->QuestionReferToBitField) {
>Buffer = (UINT8 *)AllocateZeroPool (Question->StorageWidth);
> -  ASSERT (Buffer != NULL);
> +  if (Buffer == NULL) {
> +return EFI_OUT_OF_RESOURCES;
> +  }
>Dst = Buffer;
>  } else {
>Dst = (UINT8 *) >HiiValue.Value;
>  }
>}
> @@ -1546,15 +1548,13 @@ BufferToValue (
>  }
>}
> 
>*StringPtr = TempChar;
> 
> -  if (Question->QuestionReferToBitField) {
> +  if (Buffer != NULL && Question->QuestionReferToBitField) {
>  GetBitsQuestionValue (Question, Buffer);
> -if (Buffer != NULL) {
> -  FreePool (Buffer);
> -}
> +FreePool (Buffer);
>}
> 
>return Status;
>  }
> 
> --
> 1.9.5.msysgit.1

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


[edk2] [PATCH 3/3] IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3

2017-09-21 Thread Jiewen Yao
In S3 resume, before system transfer to waking vector,
the VTdPrm need turn off VTd protection based upon VTdPolicy.

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao 
---
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c   | 59 
+++-
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf |  1 +
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c 
b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index e768274..3fe6d65 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -24,16 +24,18 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "IntelVTdPmrPei.h"
 
 #define  TOTAL_DMA_BUFFER_SIZESIZE_4MB
+#define  TOTAL_DMA_BUFFER_SIZE_S3 SIZE_1MB
 
 EFI_ACPI_DMAR_HEADER  *mAcpiDmarTable;
 VTD_INFO  *mVTdInfo;
 UINT64mEngineMask;
 UINTN mDmaBufferBase;
-UINTN mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE;
+UINTN mDmaBufferSize;
 UINTN mDmaBufferCurrentTop;
 UINTN mDmaBufferCurrentBottom;
 
@@ -544,6 +546,7 @@ InitDmaProtection (
   }
   ASSERT (DmaBufferSize == ALIGN_VALUE(DmaBufferSize, MemoryAlignment));
   *DmaBufferBase = (UINTN)AllocateAlignedPages 
(EFI_SIZE_TO_PAGES(DmaBufferSize), MemoryAlignment);
+  ASSERT (*DmaBufferBase != 0);
   if (*DmaBufferBase == 0) {
 DEBUG ((DEBUG_INFO, " InitDmaProtection : OutOfResource\n"));
 return EFI_OUT_OF_RESOURCES;
@@ -1105,6 +1108,41 @@ ParseDmarAcpiTableRmrr (
 }
 
 /**
+  This function handles S3 resume task at the end of PEI
+
+  @param[in] PeiServicesPointer to PEI Services Table.
+  @param[in] NotifyDesc Pointer to the descriptor for the Notification 
event that
+caused this function to execute.
+  @param[in] PpiPointer to the PPI data associated with this 
function.
+
+  @retval EFI_STATUSAlways return EFI_SUCCESS
+**/
+EFI_STATUS
+EFIAPI
+S3EndOfPeiNotify(
+  IN EFI_PEI_SERVICES  **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc,
+  IN VOID  *Ppi
+  )
+{
+  UINT64  EngineMask;
+
+  DEBUG((DEBUG_INFO, "VTdPmr S3EndOfPeiNotify\n"));
+
+  if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT1) == 0) {
+EngineMask = LShiftU64 (1, mVTdInfo->VTdEngineCount) - 1;
+DisableDmaProtection (EngineMask);
+  }
+  return EFI_SUCCESS;
+}
+
+EFI_PEI_NOTIFY_DESCRIPTOR mS3EndOfPeiNotifyDesc = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  ,
+  S3EndOfPeiNotify
+};
+
+/**
   Initializes the Intel VTd PMR PEIM.
 
   @param  FileHandle  Handle of the file being invoked.
@@ -1122,11 +1160,14 @@ IntelVTdPmrInitialize (
   )
 {
   EFI_STATUS  Status;
+  EFI_BOOT_MODE   BootMode;
 
   if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) == 0) {
 return EFI_UNSUPPORTED;
   }
 
+  PeiServicesGetBootMode ();
+
   Status = PeiServicesLocatePpi (
  ,
  0,
@@ -1150,6 +1191,13 @@ IntelVTdPmrInitialize (
   //
   ParseDmarAcpiTableRmrr ();
 
+  if (BootMode == BOOT_ON_S3_RESUME) {
+mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE_S3;
+  } else {
+mDmaBufferSize = TOTAL_DMA_BUFFER_SIZE;
+  }
+  DEBUG ((DEBUG_INFO, " DmaBufferSize : 0x%x\n", mDmaBufferSize));
+
   //
   // Find a pre-memory in resource hob as DMA buffer
   // Mark PEI memory to be DMA protected.
@@ -1160,7 +1208,6 @@ IntelVTdPmrInitialize (
   }
 
   DEBUG ((DEBUG_INFO, " DmaBufferBase : 0x%x\n", mDmaBufferBase));
-  DEBUG ((DEBUG_INFO, " DmaBufferSize : 0x%x\n", mDmaBufferSize));
 
   mDmaBufferCurrentTop = mDmaBufferBase + mDmaBufferSize;
   mDmaBufferCurrentBottom = mDmaBufferBase;
@@ -1171,6 +1218,14 @@ IntelVTdPmrInitialize (
   Status = PeiServicesInstallPpi ();
   ASSERT_EFI_ERROR(Status);
 
+  //
+  // Register EndOfPei Notify for S3 to run FSP NotifyPhase
+  //
+  if (BootMode == BOOT_ON_S3_RESUME) {
+Status = PeiServicesNotifyPpi ();
+ASSERT_EFI_ERROR (Status);
+  }
+
   return Status;
 }
 
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf 
b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
index 86cd7d1..e1aa980 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
@@ -46,6 +46,7 @@
 [Ppis]
   gEdkiiIoMmuPpiGuid## PRODUCES
   gEdkiiVTdInfoPpiGuid  ## CONSUMES
+  gEfiEndOfPeiSignalPpiGuid ## CONSUMES
 
 [Pcd]
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES
-- 
2.7.4.windows.1

___
edk2-devel 

[edk2] [PATCH 2/3] IntelSiliconPkg/dec: Clarify VTdPolicy.

2017-09-21 Thread Jiewen Yao
Clarify the VTdPolicy is for both PEI and DXE.

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao 
---
 IntelSiliconPkg/IntelSiliconPkg.dec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/IntelSiliconPkg/IntelSiliconPkg.dec 
b/IntelSiliconPkg/IntelSiliconPkg.dec
index 941380a..b88630d 100644
--- a/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -48,8 +48,8 @@
   gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid|{ 0xa9, 0x2d, 
0x75, 0x56, 0x6b, 0xde, 0x95, 0x48, 0x88, 0x19, 0x19, 0x45, 0xb6, 0xb7, 0x6c, 
0x22 }|VOID*|0x0001
 
   ## The mask is used to control VTd behavior.
-  #  BIT0: Enable IOMMU during boot.
-  #  BIT1: Enable IOMMU on exit boot service.
+  #  BIT0: Enable IOMMU during boot (If DMAR table is installed in DXE. If 
VTD_INFO_PPI is installed in PEI.)
+  #  BIT1: Enable IOMMU when transfer control to OS (ExitBootService in normal 
boot. EndOfPEI in S3)
   # @Prompt The policy for VTd driver behavior.
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask|1|UINT8|0x0002
 
-- 
2.7.4.windows.1

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


[edk2] [PATCH 0/3] IntelVTd fix

2017-09-21 Thread Jiewen Yao
1) Make sure context cache in VTdDxe is flushed in every path.
2) Clarify VTdPolicy PCD usage for PEI and DXE.
3) Add EndOfPei callback in VTdPrmPei for S3 resume.

The patch is tested in Intel Kabylake platform.
Windows 10 boot and S3 resume success with VTd enabled.

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao 

Jiewen Yao (3):
  IntelSiliconPkg/VTdDxe: Clean up DXE flush memory.
  IntelSiliconPkg/dec: Clarify VTdPolicy.
  IntelSiliconPkg/VTdPmrPei: Add EndOfPei callback for S3

 IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c|  9 ++-
 IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c  |  4 +-
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c   | 59 
+++-
 IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf |  1 +
 IntelSiliconPkg/IntelSiliconPkg.dec   |  4 +-
 5 files changed, 69 insertions(+), 8 deletions(-)

-- 
2.7.4.windows.1

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


[edk2] [PATCH 1/3] IntelSiliconPkg/VTdDxe: Clean up DXE flush memory.

2017-09-21 Thread Jiewen Yao
Make sure the context table are flush to memory.

Cc: Star Zeng 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao 
---
 IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c   | 9 +++--
 IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c | 4 ++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c 
b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
index ccecc95..cecb5d2 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
@@ -124,7 +124,6 @@ CreateContextEntry (
   RootEntry->Bits.ContextTablePointerHi  = (UINT32) RShiftU64 
((UINT64)(UINTN)Buffer, 32);
   RootEntry->Bits.Present = 1;
   Buffer = (UINT8 *)Buffer + EFI_PAGES_TO_SIZE (ContextPages);
-  FlushPageTableMemory (VtdIndex, (UINTN)RootEntry, sizeof(*RootEntry));
 }
 
 ContextEntryTable = (VTD_CONTEXT_ENTRY 
*)(UINTN)VTD_64BITS_ADDRESS(RootEntry->Bits.ContextTablePointerLo, 
RootEntry->Bits.ContextTablePointerHi) ;
@@ -143,9 +142,10 @@ CreateContextEntry (
   ContextEntry->Bits.AddressWidth = 0x2;
   break;
 }
-FlushPageTableMemory (VtdIndex, (UINTN)ContextEntry, 
sizeof(*ContextEntry));
   }
 
+  FlushPageTableMemory (VtdIndex, 
(UINTN)mVtdUnitInformation[VtdIndex].RootEntryTable, 
EFI_PAGES_TO_SIZE(EntryTablePages));
+
   return EFI_SUCCESS;
 }
 
@@ -196,6 +196,7 @@ CreateSecondLevelPagingEntryTable (
   DEBUG ((DEBUG_ERROR,"Could not Alloc LVL4 PT. \n"));
   return NULL;
 }
+FlushPageTableMemory (VtdIndex, (UINTN)SecondLevelPagingEntry, 
EFI_PAGES_TO_SIZE(1));
   }
 
   //
@@ -219,6 +220,7 @@ CreateSecondLevelPagingEntryTable (
 ASSERT(FALSE);
 return NULL;
   }
+  FlushPageTableMemory (VtdIndex, (UINTN)Lvl4PtEntry[Index4].Uint64, 
SIZE_4KB);
   SetSecondLevelPagingEntryAttribute ([Index4], 
EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE);
 }
 
@@ -239,6 +241,7 @@ CreateSecondLevelPagingEntryTable (
   ASSERT(FALSE);
   return NULL;
 }
+FlushPageTableMemory (VtdIndex, (UINTN)Lvl3PtEntry[Index3].Uint64, 
SIZE_4KB);
 SetSecondLevelPagingEntryAttribute ([Index3], 
EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE);
   }
 
@@ -542,6 +545,7 @@ GetSecondLevelPageTableEntry (
   *PageAttribute = PageNone;
   return NULL;
 }
+FlushPageTableMemory (VtdIndex, (UINTN)L4PageTable[Index4], SIZE_4KB);
 SetSecondLevelPagingEntryAttribute ((VTD_SECOND_LEVEL_PAGING_ENTRY 
*)[Index4], EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE);
 FlushPageTableMemory (VtdIndex, (UINTN)[Index4], 
sizeof(L4PageTable[Index4]));
   }
@@ -555,6 +559,7 @@ GetSecondLevelPageTableEntry (
   *PageAttribute = PageNone;
   return NULL;
 }
+FlushPageTableMemory (VtdIndex, (UINTN)L3PageTable[Index3], SIZE_4KB);
 SetSecondLevelPagingEntryAttribute ((VTD_SECOND_LEVEL_PAGING_ENTRY 
*)[Index3], EDKII_IOMMU_ACCESS_READ | EDKII_IOMMU_ACCESS_WRITE);
 FlushPageTableMemory (VtdIndex, (UINTN)[Index3], 
sizeof(L3PageTable[Index3]));
   }
diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c 
b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c
index 68b25a7..0b3006a 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTableEx.c
@@ -73,7 +73,6 @@ CreateExtContextEntry (
   ExtRootEntry->Bits.UpperContextTablePointerLo  = (UINT32) RShiftU64 
((UINT64)(UINTN)Buffer, 12) + 1;
   ExtRootEntry->Bits.UpperContextTablePointerHi  = (UINT32) RShiftU64 
(RShiftU64 ((UINT64)(UINTN)Buffer, 12) + 1, 20);
   ExtRootEntry->Bits.UpperPresent = 1;
-  FlushPageTableMemory (VtdIndex, (UINTN)ExtRootEntry, 
sizeof(*ExtRootEntry));
   Buffer = (UINT8 *)Buffer + EFI_PAGES_TO_SIZE (ContextPages);
 }
 
@@ -93,9 +92,10 @@ CreateExtContextEntry (
   ExtContextEntry->Bits.AddressWidth = 0x2;
   break;
 }
-FlushPageTableMemory (VtdIndex, (UINTN)ExtContextEntry, 
sizeof(*ExtContextEntry));
   }
 
+  FlushPageTableMemory (VtdIndex, 
(UINTN)mVtdUnitInformation[VtdIndex].ExtRootEntryTable, 
EFI_PAGES_TO_SIZE(EntryTablePages));
+
   return EFI_SUCCESS;
 }
 
-- 
2.7.4.windows.1

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


Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54ce57c2608b8b3ea051c7041f036f21153

2017-09-21 Thread Wang, Jian J
Ok, thanks for the review.

-Original Message-
From: Wu, Hao A 
Sent: Friday, September 22, 2017 11:21 AM
To: Wang, Jian J ; edk2-devel@lists.01.org
Cc: Anthony PERARD 
Subject: RE: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit 
c1cab54ce57c2608b8b3ea051c7041f036f21153

One minor comment, please shorten the subject of the patch.

Maybe like:
UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54

With that change,
Reviewed-by: Hao Wu 


Best Regards,
Hao Wu

> -Original Message-
> From: Wang, Jian J
> Sent: Friday, September 22, 2017 10:15 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Anthony PERARD
> Subject: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit
> c1cab54ce57c2608b8b3ea051c7041f036f21153
> 
> Cc: Hao Wu 
> Cc: Anthony PERARD 
> Suggested-by: Jiewen Yao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang 
> ---
>  UefiCpuPkg/CpuDxe/CpuPageTable.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index ae93f3f553..d312eb66f8 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -802,8 +802,12 @@ RefreshGcdMemoryAttributesFromPaging (
> 
>GetCurrentPagingContext ();
> 
> -  BaseAddress = 0;
> -  PageLength  = 0;
> +  DoUpdate  = FALSE;
> +  Capabilities  = 0;
> +  Attributes= 0;
> +  BaseAddress   = 0;
> +  PageLength= 0;
> +
>for (Index = 0; Index < NumberOfDescriptors; Index++) {
>  if (MemorySpaceMap[Index].GcdMemoryType ==
> EfiGcdMemoryTypeNonExistent) {
>continue;
> --
> 2.14.1.windows.1

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


Re: [edk2] [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54ce57c2608b8b3ea051c7041f036f21153

2017-09-21 Thread Wu, Hao A
One minor comment, please shorten the subject of the patch.

Maybe like:
UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54

With that change,
Reviewed-by: Hao Wu 


Best Regards,
Hao Wu

> -Original Message-
> From: Wang, Jian J
> Sent: Friday, September 22, 2017 10:15 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A; Anthony PERARD
> Subject: [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit
> c1cab54ce57c2608b8b3ea051c7041f036f21153
> 
> Cc: Hao Wu 
> Cc: Anthony PERARD 
> Suggested-by: Jiewen Yao 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jian J Wang 
> ---
>  UefiCpuPkg/CpuDxe/CpuPageTable.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> index ae93f3f553..d312eb66f8 100644
> --- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
> +++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
> @@ -802,8 +802,12 @@ RefreshGcdMemoryAttributesFromPaging (
> 
>GetCurrentPagingContext ();
> 
> -  BaseAddress = 0;
> -  PageLength  = 0;
> +  DoUpdate  = FALSE;
> +  Capabilities  = 0;
> +  Attributes= 0;
> +  BaseAddress   = 0;
> +  PageLength= 0;
> +
>for (Index = 0; Index < NumberOfDescriptors; Index++) {
>  if (MemorySpaceMap[Index].GcdMemoryType ==
> EfiGcdMemoryTypeNonExistent) {
>continue;
> --
> 2.14.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 v3 00/11] Update D03/D05 binary for edk2 update and bug fix.

2017-09-21 Thread Heyi Guo

Sorry we didn't catch up the community updates for several months...

Actually this is a really good change for ARM MMIO controllers and we 
appreciate your patches to improve D0x platforms. There may be some 
minor issue (or even in SoC IP) that causes D05 into exception, which 
was just found when we updated edk2 and edk2-platforms these days, and 
we have not enough time to find the root cause yet.


We will continue to investigate the issue and let you know the result.

Regards,

Heyi Guo

在 9/21/2017 9:32 PM, Ard Biesheuvel 写道:

On 21 September 2017 at 05:40, Leif Lindholm  wrote:

On Thu, Sep 21, 2017 at 06:59:39PM +0800, Heyi Guo wrote:

Code can also be found in github:
https://github.com/hisilicon/OpenPlatformPkg.git
branch: rp-1710-platforms-v3rp-1710-osi-v3

This is looking a lot better, thanks.
But it could be useful to have a separate cover letter for the
edk2-non-osi patches.


Note: If occurs BIOS boot hang up issue, please revert below commit to fix:
   "2f03dc8"

Can you give more information?
2f03dc8 is "Silicon/Hisilicon: switch to NonDiscoverable driver for
EHCI".


If that patch broke your platform, you should probably have mentioned
this when it was sent out for review. (Apologies if I failed to CC
you, but I think I probably did)


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


Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Ni, Ruiyu
Paulo,
Are you ok to the macro related comments I provided to patch V3.#1?
If yes, could you please update the patch V3.#2 accordingly?

I noticed that you put some structures that seem to be UDF standard
into the UdfDxe driver local header file.
I am ok with your decision. For public interfaces, none is better than bad.

I also checked a bit of your updated code, but didn't dig into very details.
I am ok to the logic.

Thanks/Ray

> -Original Message-
> From: Zeng, Star
> Sent: Friday, September 22, 2017 10:27 AM
> To: Paulo Alcantara ; Wu, Hao A ;
> edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Laszlo Ersek ; Dong,
> Eric ; Zeng, Star 
> Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation
> of UDF logical partition
> 
> Ok, I will go to help push the patch series if Ray has no any comments.
> 
> Thanks,
> Star
> -Original Message-
> From: Paulo Alcantara [mailto:pca...@gmail.com]
> Sent: Thursday, September 21, 2017 10:17 PM
> To: Zeng, Star ; Wu, Hao A ;
> edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Laszlo Ersek ; Dong,
> Eric 
> Subject: Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
> creation of UDF logical partition
> 
> On Thu, Sep 21, 2017 at 10:52 AM, Paulo Alcantara 
> wrote:
> >
> >
> > On September 21, 2017 10:47:07 AM GMT-03:00, "Zeng, Star"
>  wrote:
> >>Does it have functional impact?
> >
> > Nope. When Partition driver walks the partition detect routine table, it
> executes each routine and then checks for EFI_NO_MEDIA and
> EFI_MEDIA_CHANGED only. So, the child handle is installed and the
> EFI_NOT_FOUND is a no-op in that case.
> 
> BTW, I performed a quick test with UdfDxe enabled and disabled in OVMF
> and the removal did not seem to break or change any behavior.
> 
> Thanks!
> Paulo
> 
> >
> > Thanks!
> > Paulo
> >
> >>
> >>Thanks,
> >>Star
> >>-Original Message-
> >>From: Paulo Alcantara [mailto:pca...@zytor.com]
> >>Sent: Thursday, September 21, 2017 9:29 PM
> >>To: Wu, Hao A ; edk2-devel@lists.01.org
> >>Cc: Ni, Ruiyu ; Laszlo Ersek ;
> >>Dong, Eric ; Zeng, Star 
> >>Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
> >>creation of UDF logical partition
> >>
> >>
> >>
> >>On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"
> >> wrote:
> >>>One small comment, within function PartitionInstallUdfChildHandles():
> >>>
> >>>  ...
> >>>  //
> >>>  // Install partition child handle for UDF file system
> >>>  //
> >>>  Status = PartitionInstallChildHandle (
> >>>...
> >>>);
> >>>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
> >>>(Status)) {"
> >>>Status = EFI_NOT_FOUND;
> >>>  }
> >>
> >>Yes, it is. Good catch! Could you please fix that for me by removing
> >>the if condition? Otherwise I can send a v4 later with that.
> >>
> >>Thanks!
> >>Paulo
> >>
> >>>
> >>>
> >>>Best Regards,
> >>>Hao Wu
> >>>
> >>>
>  -Original Message-
>  From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> >>>Of Paulo
>  Alcantara
>  Sent: Thursday, September 21, 2017 2:16 AM
>  To: edk2-devel@lists.01.org
>  Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
>  Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
> >>>creation of
>  UDF logical partition
> 
>  Do not reserve entire block device size for an UDF file system -
>  instead, reserve the appropriate space (UDF logical volume space)
> >>for
>  it.
> 
>  Additionally, only create a logical partition for UDF logical
> >>volumes
>  that are currently supported by EDK2 UDF file system implementation.
> >>>For
>  instance, an UDF volume with a single LVD and a single Physical
> >>(Type
> >>>1)
>  Partition will be supported.
> 
>  Cc: Eric Dong 
>  Cc: Ruiyu Ni 
>  Cc: Star Zeng 
>  Cc: Laszlo Ersek 
>  Reported-by: Ruiyu Ni 
>  Contributed-under: TianoCore Contribution Agreement 1.1
>  Signed-off-by: Paulo Alcantara 
>  ---
>   MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
> >>>++--
>   MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>   MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
>  
>   MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>   MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
> >>>++---
>   5 files changed, 606 insertions(+), 565 deletions(-)
> 
>  diff --git 

Re: [edk2] [PATCH v3 1/2] MdePkg: Add UDF volume structure definitions

2017-09-21 Thread Ni, Ruiyu
Paulo,
Comments below:

#define UDF_TAG_ID(_Tag) \
  (UDF_VOLUME_DESCRIPTOR_ID)((_Tag)->TagIdentifier)
1. I prefer to remove the UDF_TAG_ID macro. Adding type-cast to get TAG_ID is 
very straightforward.
 
#define UDF_LVD_REVISION(_Lv) \
  *(UINT16 *)(UINTN)(_Lv)->DomainIdentifier.IdentifierSuffix
typedef struct {
  UINT8   Flags;
  UINT8   Identifier[23];
  UINT8   IdentifierSuffix[8];
} UDF_ENTITY_ID;
2. Entity structure is defined by ECMA-167 spec and re-used by UDF spec.
 I think since we are creating UDF structure in udf.h, how about using the 
below
 structure layout and removing the UDF_LVD_REVISION macro:
 Typedef struct {
   UINT8   Flags;
   UINT8   Identifier[23];
   UINT16 UdfRevision;
   UINT8   DomainFlags;
   UINT8   Reserved[5];
} UDF_ENTITY_ID;

I am not sure if there are other structures that are defined in ECMA spec and
re-used by UDF spec. I think we can apply the similar rules to those structures
as well.

Thanks/Ray

> -Original Message-
> From: Paulo Alcantara [mailto:pca...@zytor.com]
> Sent: Thursday, September 21, 2017 2:16 AM
> To: edk2-devel@lists.01.org
> Cc: Paulo Alcantara ; Kinney, Michael D
> ; Gao, Liming ; Laszlo
> Ersek ; Ni, Ruiyu 
> Subject: [PATCH v3 1/2] MdePkg: Add UDF volume structure definitions
> 
> This patch adds a few more UDF volume structures in order to detect an UDF
> file system which is supported by current EDK2 UDF file system
> implementation in Partition driver.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Laszlo Ersek 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Paulo Alcantara 
> ---
>  MdePkg/Include/IndustryStandard/Udf.h | 63 ++--
>  1 file changed, 59 insertions(+), 4 deletions(-)
> 
> diff --git a/MdePkg/Include/IndustryStandard/Udf.h
> b/MdePkg/Include/IndustryStandard/Udf.h
> index 0febb4bcda..002e87e150 100644
> --- a/MdePkg/Include/IndustryStandard/Udf.h
> +++ b/MdePkg/Include/IndustryStandard/Udf.h
> @@ -24,11 +24,28 @@
>  #define UDF_LOGICAL_SECTOR_SIZE   ((UINT64)(1ULL <<
> UDF_LOGICAL_SECTOR_SHIFT))
>  #define UDF_VRS_START_OFFSET  ((UINT64)(16ULL <<
> UDF_LOGICAL_SECTOR_SHIFT))
> 
> -#define _GET_TAG_ID(_Pointer) \
> -  (((UDF_DESCRIPTOR_TAG *)(_Pointer))->TagIdentifier)
> +typedef enum {
> +  UdfPrimaryVolumeDescriptor = 1,
> +  UdfAnchorVolumeDescriptorPointer = 2,
> +  UdfVolumeDescriptorPointer = 3,
> +  UdfImplemenationUseVolumeDescriptor = 4,
> +  UdfPartitionDescriptor = 5,
> +  UdfLogicalVolumeDescriptor = 6,
> +  UdfUnallocatedSpaceDescriptor = 7,
> +  UdfTerminatingDescriptor = 8,
> +  UdfLogicalVolumeIntegrityDescriptor = 9,
> +  UdfFileSetDescriptor = 256,
> +  UdfFileIdentifierDescriptor = 257,
> +  UdfAllocationExtentDescriptor = 258,
> +  UdfFileEntry = 261,
> +  UdfExtendedFileEntry = 266,
> +} UDF_VOLUME_DESCRIPTOR_ID;
> 
> -#define IS_AVDP(_Pointer) \
> -  ((BOOLEAN)(_GET_TAG_ID (_Pointer) == 2))
> +#define UDF_TAG_ID(_Tag) \
> +  (UDF_VOLUME_DESCRIPTOR_ID)((_Tag)->TagIdentifier)
> +
> +#define UDF_LVD_REVISION(_Lv) \
> +  *(UINT16 *)(UINTN)(_Lv)->DomainIdentifier.IdentifierSuffix
> 
>  #pragma pack(1)
> 
> @@ -49,12 +66,50 @@ typedef struct {
>  } UDF_EXTENT_AD;
> 
>  typedef struct {
> +  UINT8   CharacterSetType;
> +  UINT8   CharacterSetInfo[63];
> +} UDF_CHAR_SPEC;
> +
> +typedef struct {
> +  UINT8   Flags;
> +  UINT8   Identifier[23];
> +  UINT8   IdentifierSuffix[8];
> +} UDF_ENTITY_ID;
> +
> +typedef struct {
> +  UINT32LogicalBlockNumber;
> +  UINT16PartitionReferenceNumber;
> +} UDF_LB_ADDR;
> +
> +typedef struct {
> +  UINT32   ExtentLength;
> +  UDF_LB_ADDR  ExtentLocation;
> +  UINT8ImplementationUse[6];
> +} UDF_LONG_ALLOCATION_DESCRIPTOR;
> +
> +typedef struct {
>UDF_DESCRIPTOR_TAG  DescriptorTag;
>UDF_EXTENT_AD   MainVolumeDescriptorSequenceExtent;
>UDF_EXTENT_AD   ReserveVolumeDescriptorSequenceExtent;
>UINT8   Reserved[480];
>  } UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER;
> 
> +typedef struct {
> +  UDF_DESCRIPTOR_TAG  DescriptorTag;
> +  UINT32  VolumeDescriptorSequenceNumber;
> +  UDF_CHAR_SPEC   DescriptorCharacterSet;
> +  UINT8   LogicalVolumeIdentifier[128];
> +  UINT32  LogicalBlockSize;
> +  UDF_ENTITY_ID   DomainIdentifier;
> +  UDF_LONG_ALLOCATION_DESCRIPTOR  LogicalVolumeContentsUse;
> +  UINT32  MapTableLength;
> +  UINT32  NumberOfPartitionMaps;
> +  UDF_ENTITY_ID   

Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Zeng, Star
Ok, I will go to help push the patch series if Ray has no any comments.

Thanks,
Star
-Original Message-
From: Paulo Alcantara [mailto:pca...@gmail.com] 
Sent: Thursday, September 21, 2017 10:17 PM
To: Zeng, Star ; Wu, Hao A ; 
edk2-devel@lists.01.org
Cc: Ni, Ruiyu ; Laszlo Ersek ; Dong, 
Eric 
Subject: Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of 
UDF logical partition

On Thu, Sep 21, 2017 at 10:52 AM, Paulo Alcantara  wrote:
>
>
> On September 21, 2017 10:47:07 AM GMT-03:00, "Zeng, Star" 
>  wrote:
>>Does it have functional impact?
>
> Nope. When Partition driver walks the partition detect routine table, it 
> executes each routine and then checks for EFI_NO_MEDIA and EFI_MEDIA_CHANGED 
> only. So, the child handle is installed and the EFI_NOT_FOUND is a no-op in 
> that case.

BTW, I performed a quick test with UdfDxe enabled and disabled in OVMF and the 
removal did not seem to break or change any behavior.

Thanks!
Paulo

>
> Thanks!
> Paulo
>
>>
>>Thanks,
>>Star
>>-Original Message-
>>From: Paulo Alcantara [mailto:pca...@zytor.com]
>>Sent: Thursday, September 21, 2017 9:29 PM
>>To: Wu, Hao A ; edk2-devel@lists.01.org
>>Cc: Ni, Ruiyu ; Laszlo Ersek ; 
>>Dong, Eric ; Zeng, Star 
>>Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix 
>>creation of UDF logical partition
>>
>>
>>
>>On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"
>> wrote:
>>>One small comment, within function PartitionInstallUdfChildHandles():
>>>
>>>  ...
>>>  //
>>>  // Install partition child handle for UDF file system
>>>  //
>>>  Status = PartitionInstallChildHandle (
>>>...
>>>);
>>>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
>>>(Status)) {"
>>>Status = EFI_NOT_FOUND;
>>>  }
>>
>>Yes, it is. Good catch! Could you please fix that for me by removing 
>>the if condition? Otherwise I can send a v4 later with that.
>>
>>Thanks!
>>Paulo
>>
>>>
>>>
>>>Best Regards,
>>>Hao Wu
>>>
>>>
 -Original Message-
 From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>>>Of Paulo
 Alcantara
 Sent: Thursday, September 21, 2017 2:16 AM
 To: edk2-devel@lists.01.org
 Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
 Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>>>creation of
 UDF logical partition

 Do not reserve entire block device size for an UDF file system - 
 instead, reserve the appropriate space (UDF logical volume space)
>>for
 it.

 Additionally, only create a logical partition for UDF logical
>>volumes
 that are currently supported by EDK2 UDF file system implementation.
>>>For
 instance, an UDF volume with a single LVD and a single Physical
>>(Type
>>>1)
 Partition will be supported.

 Cc: Eric Dong 
 Cc: Ruiyu Ni 
 Cc: Star Zeng 
 Cc: Laszlo Ersek 
 Reported-by: Ruiyu Ni 
 Contributed-under: TianoCore Contribution Agreement 1.1
 Signed-off-by: Paulo Alcantara 
 ---
  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>>>++--
  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
 
  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>>>++---
  5 files changed, 606 insertions(+), 565 deletions(-)

 diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 index 609f56cef6..572ba7a81a 100644
 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
)
  {
 -  EFI_STATUS  Status;
 -  UINT32  BlockSize;
 -  EFI_LBA EndLBA;
 -  EFI_LBA DescriptorLBAs[4];
 -  UINTN   Index;
 +  EFI_STATUS  Status;
 +  UINT32  BlockSize;
 +  EFI_LBA EndLBA;
 +  EFI_LBA DescriptorLBAs[4];
 +  UINTN   Index;
 +  UDF_DESCRIPTOR_TAG  *DescriptorTag;

BlockSize = BlockIo->Media->BlockSize;
EndLBA = BlockIo->Media->LastBlock; @@ -88,10 +89,13 @@ 
 FindAnchorVolumeDescriptorPointer (
  if (EFI_ERROR (Status)) {
return Status;
  }
 +
 +DescriptorTag = >DescriptorTag;
 +
  //
  // 

[edk2] [PATCH] UefiCpuPkg/CpuDxe: Fix GCC build error on commit c1cab54ce57c2608b8b3ea051c7041f036f21153

2017-09-21 Thread Jian J Wang
Cc: Hao Wu 
Cc: Anthony PERARD 
Suggested-by: Jiewen Yao 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang 
---
 UefiCpuPkg/CpuDxe/CpuPageTable.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c
index ae93f3f553..d312eb66f8 100644
--- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
+++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
@@ -802,8 +802,12 @@ RefreshGcdMemoryAttributesFromPaging (
 
   GetCurrentPagingContext ();
 
-  BaseAddress = 0;
-  PageLength  = 0;
+  DoUpdate  = FALSE;
+  Capabilities  = 0;
+  Attributes= 0;
+  BaseAddress   = 0;
+  PageLength= 0;
+
   for (Index = 0; Index < NumberOfDescriptors; Index++) {
 if (MemorySpaceMap[Index].GcdMemoryType == EfiGcdMemoryTypeNonExistent) {
   continue;
-- 
2.14.1.windows.1

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


Re: [edk2] [PATCH V5] MdeModulePkg/DxeCore: Fixed Interface returned by CoreOpenProtocol

2017-09-21 Thread Zeng, Star
Thanks all.
The patch has been pushed at 89f7f2cdf0266619976cb53b45b5de1aba2f8fac.

Star
-Original Message-
From: Zeng, Star 
Sent: Tuesday, September 19, 2017 3:14 PM
To: Laszlo Ersek ; edk2-devel@lists.01.org
Cc: Amit Kumar ; Kinney, Michael D 
; Gao, Liming ; Gabriel Somlo 
; Zeng, Star 
Subject: RE: [PATCH V5] MdeModulePkg/DxeCore: Fixed Interface returned by 
CoreOpenProtocol

Thanks all the Tested-by and Reviewed-by.

The new UEFI spec 2.7a has been published at 
http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf
which includes the spec change "1815 OpenProtocol() / EFI_ALREADY_STARTED 
should output existent Interface" that is required for this patch.

If no more comments, I will go to push this patch. :)


Thanks,
Star
-Original Message-
From: Laszlo Ersek [mailto:ler...@redhat.com]
Sent: Wednesday, June 28, 2017 10:14 PM
To: Zeng, Star ; edk2-devel@lists.01.org
Cc: Amit Kumar ; Kinney, Michael D 
; Gao, Liming ; Gabriel Somlo 

Subject: Re: [PATCH V5] MdeModulePkg/DxeCore: Fixed Interface returned by 
CoreOpenProtocol

On 06/28/17 15:22, Star Zeng wrote:
> From: Amit Kumar 
> 
> Change since v4: Revise the patch based on V4 sent by Amit Kumar
> 1) Only return the corresponding protocol interface in *Interface if 
> the return status is EFI_SUCCESS or EFI_ALREADY_STARTED.
> 2) Interface is returned unmodified for all error conditions except 
> EFI_UNSUPPORTED and EFI_ALREADY_STARTED, NULL will be returned in 
> *Interface when EFI_UNSUPPORTED and Attributes is not 
> EFI_OPEN_PROTOCOL_TEST_PROTOCOL, the protocol interface will be 
> returned in *Interface when EFI_ALREADY_STARTED.
> 
> Change since v3:
> 1) Fixed issue when Attributes = EFI_OPEN_PROTOCOL_TEST_PROTOCOL and 
> Inteface = NULL case. [Reported by:star.zeng at intel.com]
> 
> Change Since v2:
> 1) Modified to use EFI_ERROR to get status code
> 
> Change since v1:
> 1) Fixed typo protocal to protocol
> 2) Fixed coding style
> 
> Cc: Laszlo Ersek 
> Cc: Amit Kumar 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Gabriel Somlo 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Amit Kumar 
> Signed-off-by: Star Zeng 
> ---
>  MdeModulePkg/Core/Dxe/Hand/Handle.c | 36
> +++-
>  1 file changed, 23 insertions(+), 13 deletions(-)

Reviewed-by: Laszlo Ersek 
Tested-by: Laszlo Ersek 

Thanks!
Laszlo

> diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c
> b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> index 59b89148c8f0..3862a3876f4a 100644
> --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c
> +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c
> @@ -1006,12 +1006,8 @@ CoreOpenProtocol (
>//
>// Check for invalid Interface
>//
> -  if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {
> -if (Interface == NULL) {
> -  return EFI_INVALID_PARAMETER;
> -} else {
> -  *Interface = NULL;
> -}
> +  if ((Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) && (Interface == 
> NULL)) {
> +return EFI_INVALID_PARAMETER;
>}
>  
>//
> @@ -1078,12 +1074,6 @@ CoreOpenProtocol (
>  goto Done;
>}
>  
> -  //
> -  // This is the protocol interface entry for this protocol
> -  //
> -  if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {
> -*Interface = Prot->Interface;
> -  }
>Status = EFI_SUCCESS;
>  
>ByDriver= FALSE;
> @@ -1177,8 +1167,28 @@ CoreOpenProtocol (
>}
>  
>  Done:
> +
> +  if (Attributes != EFI_OPEN_PROTOCOL_TEST_PROTOCOL) {
> +//
> +// Keep Interface unmodified in case of any Error
> +// except EFI_ALREADY_STARTED and EFI_UNSUPPORTED.
> +//
> +if (!EFI_ERROR (Status) || Status == EFI_ALREADY_STARTED) {
> +  //
> +  // EFI_ALREADY_STARTED is not an error for bus driver.
> +  // Return the corresponding protocol interface. 
> +  //
> +  *Interface = Prot->Interface;
> +} else if (Status == EFI_UNSUPPORTED) {
> +  //
> +  // Return NULL Interface if Unsupported Protocol.
> +  //
> +  *Interface = NULL;
> +}
> +  }
> +
>//
> -  // Done. Release the database lock are return
> +  // Done. Release the database lock and return
>//
>CoreReleaseProtocolLock ();
>return Status;
> 

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


[edk2] [patch] MdeModulePkg/SetupBrowser:Add NULL check before using a pointer

2017-09-21 Thread Dandan Bi
Add NULL pointer check before using a pointer to avoid possible
NULL pointer dereference.

Cc: Eric Dong 
Cc: Hao Wu 
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi 
---
 MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c 
b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 48beeb6..c2cfa5c 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -1484,11 +1484,13 @@ BufferToValue (
 //
 // Other type of Questions
 //
 if (Question->QuestionReferToBitField) {
   Buffer = (UINT8 *)AllocateZeroPool (Question->StorageWidth);
-  ASSERT (Buffer != NULL);
+  if (Buffer == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
   Dst = Buffer;
 } else {
   Dst = (UINT8 *) >HiiValue.Value;
 }
   }
@@ -1546,15 +1548,13 @@ BufferToValue (
 }
   }
 
   *StringPtr = TempChar;
 
-  if (Question->QuestionReferToBitField) {
+  if (Buffer != NULL && Question->QuestionReferToBitField) {
 GetBitsQuestionValue (Question, Buffer);
-if (Buffer != NULL) {
-  FreePool (Buffer);
-}
+FreePool (Buffer);
   }
 
   return Status;
 }
 
-- 
1.9.5.msysgit.1

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


Re: [edk2] [PATCH] SecurityPkg/SecureBootConfigImpl.c: Secure Boot DBX UI Enhancement.

2017-09-21 Thread Zhang, Chao B
Reviewed-by: Chao Zhang 

-Original Message-
From: Chen, Chen A 
Sent: Friday, September 22, 2017 9:07 AM
To: edk2-devel@lists.01.org
Cc: Chen, Chen A ; Zhang, Chao B 
; Long, Qin 
Subject: [PATCH] SecurityPkg/SecureBootConfigImpl.c: Secure Boot DBX UI 
Enhancement.

Use 2-level format to display signature list and signature data.
Support batch delete operation to delete signature list or signature data.
Display more useful information for each signature data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen A Chen 
Cc: Zhang Chao B 
Cc: Long Qin 
---
 .../SecureBootConfigDxe/SecureBootConfig.vfr   |   53 +-
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 1036 +++-
 .../SecureBootConfigDxe/SecureBootConfigImpl.h |   35 +
 .../SecureBootConfigDxe/SecureBootConfigNvData.h   |   23 +-
 .../SecureBootConfigStrings.uni|   26 +
 5 files changed, 1144 insertions(+), 29 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
index bbecff2b08..296b9c9b9e 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfig.vfr
@@ -316,11 +316,11 @@ formset
 
 subtitle text = STRING_TOKEN(STR_NULL);
 
-goto SECUREBOOT_DELETE_SIGNATURE_FROM_DBX,
+goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
 prompt = STRING_TOKEN (STR_SECURE_BOOT_DELETE_SIGNATURE),
 help   = STRING_TOKEN (STR_SECURE_BOOT_DELETE_SIGNATURE),
 flags  = INTERACTIVE,
-key= SECUREBOOT_DELETE_SIGNATURE_FROM_DBX;
+key= KEY_VALUE_FROM_DBX_TO_LIST_FORM;
 
   endform;
 
@@ -360,17 +360,58 @@ formset
   endform;
 
   //
-  // Form: 'Delete Signature' for DBX Options.
+  // Form: Display Signature List.
   //
-  form formid = SECUREBOOT_DELETE_SIGNATURE_FROM_DBX,
-title  = STRING_TOKEN(STR_SECURE_BOOT_DELETE_SIGNATURE);
+  form formid = SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+title  = STRING_TOKEN(STR_SECURE_BOOT_DELETE_LIST_FORM);
+
+subtitle text = STRING_TOKEN(STR_NULL);
+
+grayoutif ideqval SECUREBOOT_CONFIGURATION.ListCount == 0;
+  label LABEL_DELETE_ALL_LIST_BUTTON;
+  //
+  // Will create a goto button dynamically here.
+  //
+  label LABEL_END;
+   endif;
+
+   subtitle text = STRING_TOKEN(STR_NULL);
+   label LABEL_SIGNATURE_LIST_START;
+   label LABEL_END;
+   subtitle text = STRING_TOKEN(STR_NULL);
 
-label LABEL_DBX_DELETE;
+  endform;
+
+  //
+  // Form: Display Signature Data.
+  //
+  form formid = SECUREBOOT_DELETE_SIGNATURE_DATA_FORM,
+title = STRING_TOKEN(STR_SECURE_BOOT_DELETE_DATA_FORM);
+
+subtitle text = STRING_TOKEN(STR_NULL);
+
+goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+  prompt = STRING_TOKEN(STR_SECURE_BOOT_DELETE_ALL_DATA),
+  help   = STRING_TOKEN(STR_SECURE_BOOT_DELETE_ALL_DATA_HELP),
+  flags  = INTERACTIVE,
+  key= KEY_SECURE_BOOT_DELETE_ALL_DATA;
+
+grayoutif ideqval SECUREBOOT_CONFIGURATION.CheckedDataCount == 0;
+  goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+prompt = STRING_TOKEN(STR_SECURE_BOOT_DELETE_CHECK_DATA),
+help   = STRING_TOKEN(STR_SECURE_BOOT_DELETE_CHECK_DATA_HELP),
+flags  = INTERACTIVE,
+key= KEY_SECURE_BOOT_DELETE_CHECK_DATA;
+endif;
+
+subtitle text = STRING_TOKEN(STR_NULL);
+label LABEL_SIGNATURE_DATA_START;
 label LABEL_END;
 subtitle text = STRING_TOKEN(STR_NULL);
 
   endform;
 
+
   //
   // Form: 'Delete Signature' for DBT Options.
   //
diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 2eaf24633d..3df1f431a9 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootCo
+++ nfigImpl.c
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 **/
 
 #include "SecureBootConfigImpl.h"
+#include 
 
 CHAR16  mSecureBootStorageName[] = L"SECUREBOOT_CONFIGURATION";
 
@@ -3051,6 +3052,184 @@ ON_EXIT:
 }
 
 /**
+  This function to delete signature list or data, according by DelType.
+
+  @param[in]  PrivateData   Module's private data.
+  @param[in]  DelType   Indicate delete signature list or data.
+  @param[in]  CheckedCount  Indicate how many signature data have
+been checked in current signature list.
+
+  @retval   EFI_SUCCESS Success to update the signature list page
+  @retval   EFI_OUT_OF_RESOURCESUnable to allocate 

Re: [edk2] Shell input redirection question

2017-09-21 Thread Tiger Liu
Hi, All:
Thanks for your suggestions.
Appreciate it.

Thanks

best wishes,
-邮件原件-
发件人: Carsey, Jaben [mailto:jaben.car...@intel.com]
发送时间: 2017年9月21日 22:13
收件人: jim.dai...@dell.com
抄送: edk2-devel@lists.01.org; Tiger Liu
主题: RE: [edk2] Shell input redirection question

The SHELL_PARAMETERS_PROTOCOL used by the pci command lists both the command 
line and the StdIn for the command.  I think that you could check the StdIn for 
the file specified and then change the behavior.

If we really require a parameter to enable some sort of file input mode, the 
spec says that implementers can freely add -_ parameters.  In the past 
these have even been moved to standard parameters in future versions of the 
spec (-_exit is an example that springs to mind for me).

I also agree that your sample NSH file is definitely the quickest way to get a 
solution in this case.

-Jaben

> -Original Message-
> From: jim.dai...@dell.com [mailto:jim.dai...@dell.com]
> Sent: Thursday, September 21, 2017 6:32 AM
> To: Carsey, Jaben 
> Cc: edk2-devel@lists.01.org; tiger...@zhaoxin.com
> Subject: RE: [edk2] Shell input redirection question
> Importance: High
>
> I think the technicality here is that given "pci < inputfile", no
> parameters are passed to the pci command, so it should, according to
> the spec, display all the devices.
>
> Another problem may be that in the "pci < inputfile" case, the pci
> command has no way to know that its input is being redirected and that
> it should behave differently than normal. I may be wrong about that
> point; I know it is possible, but it might require some sort of
> generic change or addition to the shell's behavior.
>
> A different tack would be to add (in a future spec version) a command
> line argument that simply indicated to pci that its input (commands)
> are in some file (e.g. "pci -cmdfile inputfile"). Of course, if that
> were to happen, the new spec should also specify the format of the
> command file's content.
>
> A simple way to do what Tiger was trying and that works right now is
> to create a shell script instead of an input file:
>
> @echo -off
> pci 00 00 01 -i
> pci 00 00 02 -i
>
> Regards,
> Jim
>
> -Original Message-
> From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> Sent: Thursday, September 21, 2017 8:11 AM
> To: Dailey, Jim ; tiger...@zhaoxin.com
> Cc: edk2-devel@lists.01.org
> Subject: RE: [edk2] Shell input redirection question
>
> If the requirement for PCI to display the information when there are
> no parameters present, I see no reason that it could not also use a file for 
> input.
> i.e. "pci" must act according to the spec, but "pci < inputfile" is not 
> prohibited.
> I think that as no code currently uses PCI with file input as long as
> current behavior still works it should be fine.
>
> I would think that would be a great improvement for the PCI command.
>
> -Jaben
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> > Of jim.dai...@dell.com
> > Sent: Thursday, September 21, 2017 4:52 AM
> > To: tiger...@zhaoxin.com
> > Cc: edk2-devel@lists.01.org
> > Subject: Re: [edk2] Shell input redirection question
> > Importance: High
> >
> > The shell's pci command was not written to read from standard input.
> > It expects all its input on the command line.
> >
> > I would say in general that if you execute a command and pass it no
> > parameters, and it then prompts you in some way for input, then that
> > command will likely accept input redirected from a file.
> >
> > If you execute pci without any parameters, it simply lists all the
> > devices in the system and terminates, so it clearly is not prepared
> > to read from standard input (or a redirected file).
> >
> > It is strictly up to whomever writes a program/command whether they
> > do so in a manner that allows it to accept input from standard
> > input. For example, I have written a grep utility for the shell that
> > expects one or more filenames to search to be on the command line;
> > however, if there are no filenames on the command line, the utility
> > searches standard input.
> >
> > Regards,
> > Jim
> >
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> > Of Tiger Liu
> > Sent: Thursday, September 21, 2017 1:11 AM
> > To: edk2-devel@lists.01.org
> > Subject: [edk2] Shell input redirection question
> >
> > Hi, experts:
> > I have a question about input redirection in Shell environment.
> >
> > Take pci command as sample.
> > I wrote a txt file(file name is : inputsample.txt), its content is:
> > 00 00 01 -i
> > 00 00 02 –i
> >
> > It means I just wanted to dump D0F1/D0F2’s config space.
> >
> > Then, I use this command sequence in shell :
> > pci  >
> > But it seems not recognize this input file’s content.
> >
> > Why?
> >
> > Thanks
> >
> > best wishes,
> >
> >
> > 保密声明:
> > 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮
> 件
> 

Re: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU driver

2017-09-21 Thread Wang, Jian J
Thanks for catching it. Patch is on the way.

-Original Message-
From: Anthony PERARD [mailto:anthony.per...@citrix.com] 
Sent: Thursday, September 21, 2017 11:05 PM
To: Wang, Jian J 
Cc: Yao, Jiewen ; edk2-devel@lists.01.org; Kinney, 
Michael D ; Laszlo Ersek ; Dong, 
Eric ; Zeng, Star 
Subject: Re: [edk2] [PATCH 0/2] Fixe out-of-sync issue between GCD and CPU 
driver

On Wed, Sep 20, 2017 at 07:53:36AM +, Wang, Jian J wrote:
> Jiewen,
> 
> Yes. The patch has passed the validation of the UEFI booting Windows 10, 
> Windows 7 and Fedora 25.
> 
> If no comments from you and others, I'll push the patch to upstream soon.
> 

Hi,

I think this patch series does not build, while building OVMF we have
those errors:

GNUmakefile:527: recipe for target 
'/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe/OUTPUT/Cp
uPageTable.obj' failed
make[8]: Leaving directory 
'/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/Build/OvmfX64/DEBUG_GCC49/X64/UefiCpuPkg/CpuDxe/CpuDxe'
/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:
 In function 'RefreshGcdMemoryAttributesFromPaging':
/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:852:10:
 error: 'DoUpdate' may be used uninitialized in this functio
n [-Werror=maybe-uninitialized]
   if (DoUpdate) {
  ^
/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:853:9:
 error: 'Capabilities' may be used uninitialized in this func
tion [-Werror=maybe-uninitialized]
 gDS->SetMemorySpaceCapabilities (BaseAddress, Length, Capabilities);
 ^
/home/osstest/build.113661.build-amd64/xen/tools/firmware/ovmf-dir-remote/UefiCpuPkg/CpuDxe/CpuPageTable.c:855:90:
 error: 'Attributes' may be used uninitialized in this funct
ion [-Werror=maybe-uninitialized]
 DEBUG ((DEBUG_INFO, "Update memory space attribute: [%02d] %016lx - 
%016lx (%08lx -> %08lx)\r\n",

  ^
cc1: all warnings being treated as errors



Full log can be found at:
http://logs.test-lab.xenproject.org/osstest/logs/113661/build-amd64/6.ts-xen-build.log

Regards,

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


[edk2] [PATCH] SecurityPkg/SecureBootConfigImpl.c: Secure Boot DBX UI Enhancement.

2017-09-21 Thread chenc2
Use 2-level format to display signature list and signature data.
Support batch delete operation to delete signature list or signature data.
Display more useful information for each signature data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen A Chen 
Cc: Zhang Chao B 
Cc: Long Qin 
---
 .../SecureBootConfigDxe/SecureBootConfig.vfr   |   53 +-
 .../SecureBootConfigDxe/SecureBootConfigImpl.c | 1036 +++-
 .../SecureBootConfigDxe/SecureBootConfigImpl.h |   35 +
 .../SecureBootConfigDxe/SecureBootConfigNvData.h   |   23 +-
 .../SecureBootConfigStrings.uni|   26 +
 5 files changed, 1144 insertions(+), 29 deletions(-)

diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
index bbecff2b08..296b9c9b9e 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfig.vfr
@@ -316,11 +316,11 @@ formset
 
 subtitle text = STRING_TOKEN(STR_NULL);
 
-goto SECUREBOOT_DELETE_SIGNATURE_FROM_DBX,
+goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
 prompt = STRING_TOKEN (STR_SECURE_BOOT_DELETE_SIGNATURE),
 help   = STRING_TOKEN (STR_SECURE_BOOT_DELETE_SIGNATURE),
 flags  = INTERACTIVE,
-key= SECUREBOOT_DELETE_SIGNATURE_FROM_DBX;
+key= KEY_VALUE_FROM_DBX_TO_LIST_FORM;
 
   endform;
 
@@ -360,17 +360,58 @@ formset
   endform;
 
   //
-  // Form: 'Delete Signature' for DBX Options.
+  // Form: Display Signature List.
   //
-  form formid = SECUREBOOT_DELETE_SIGNATURE_FROM_DBX,
-title  = STRING_TOKEN(STR_SECURE_BOOT_DELETE_SIGNATURE);
+  form formid = SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+title  = STRING_TOKEN(STR_SECURE_BOOT_DELETE_LIST_FORM);
+
+subtitle text = STRING_TOKEN(STR_NULL);
+
+grayoutif ideqval SECUREBOOT_CONFIGURATION.ListCount == 0;
+  label LABEL_DELETE_ALL_LIST_BUTTON;
+  //
+  // Will create a goto button dynamically here.
+  //
+  label LABEL_END;
+   endif;
+
+   subtitle text = STRING_TOKEN(STR_NULL);
+   label LABEL_SIGNATURE_LIST_START;
+   label LABEL_END;
+   subtitle text = STRING_TOKEN(STR_NULL);
 
-label LABEL_DBX_DELETE;
+  endform;
+
+  //
+  // Form: Display Signature Data.
+  //
+  form formid = SECUREBOOT_DELETE_SIGNATURE_DATA_FORM,
+title = STRING_TOKEN(STR_SECURE_BOOT_DELETE_DATA_FORM);
+
+subtitle text = STRING_TOKEN(STR_NULL);
+
+goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+  prompt = STRING_TOKEN(STR_SECURE_BOOT_DELETE_ALL_DATA),
+  help   = STRING_TOKEN(STR_SECURE_BOOT_DELETE_ALL_DATA_HELP),
+  flags  = INTERACTIVE,
+  key= KEY_SECURE_BOOT_DELETE_ALL_DATA;
+
+grayoutif ideqval SECUREBOOT_CONFIGURATION.CheckedDataCount == 0;
+  goto SECUREBOOT_DELETE_SIGNATURE_LIST_FORM,
+prompt = STRING_TOKEN(STR_SECURE_BOOT_DELETE_CHECK_DATA),
+help   = STRING_TOKEN(STR_SECURE_BOOT_DELETE_CHECK_DATA_HELP),
+flags  = INTERACTIVE,
+key= KEY_SECURE_BOOT_DELETE_CHECK_DATA;
+endif;
+
+subtitle text = STRING_TOKEN(STR_NULL);
+label LABEL_SIGNATURE_DATA_START;
 label LABEL_END;
 subtitle text = STRING_TOKEN(STR_NULL);
 
   endform;
 
+
   //
   // Form: 'Delete Signature' for DBT Options.
   //
diff --git 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 2eaf24633d..3df1f431a9 100644
--- 
a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ 
b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 **/
 
 #include "SecureBootConfigImpl.h"
+#include 
 
 CHAR16  mSecureBootStorageName[] = L"SECUREBOOT_CONFIGURATION";
 
@@ -3051,6 +3052,184 @@ ON_EXIT:
 }
 
 /**
+  This function to delete signature list or data, according by DelType.
+
+  @param[in]  PrivateData   Module's private data.
+  @param[in]  DelType   Indicate delete signature list or data.
+  @param[in]  CheckedCount  Indicate how many signature data have
+been checked in current signature list.
+
+  @retval   EFI_SUCCESS Success to update the signature list page
+  @retval   EFI_OUT_OF_RESOURCESUnable to allocate required resources.
+**/
+EFI_STATUS
+DeleteSignatureEx (
+  IN SECUREBOOT_CONFIG_PRIVATE_DATA   *PrivateData,
+  IN SIGNATURE_DELETE_TYPEDelType,
+  IN UINT32   CheckedCount
+  )
+{
+  EFI_STATUS  Status;
+  EFI_SIGNATURE_LIST  *ListWalker;
+  EFI_SIGNATURE_LIST  *NewCertList;
+  EFI_SIGNATURE_DATA  *DataWalker;
+  CHAR16  

[edk2] [PATCH v2 2/2] [edk2-platforms] Platforms/ARM: SBSA Watchdog PCD and build option

2017-09-21 Thread evan . lloyd
From: Sami Mujawar 

Added PcdWatchdogCount to specify the number of Watchdog timers
that are available on Juno and FVP platform.

Also added DISABLE_SBSA_WATCHDOG option to disable the watchdog
timers if required for testing.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Signed-off-by: Evan Lloyd 
---

Notes:
162_WDpcd_v2:
- Moved JUNO_WATCHDOG_COUNT [Thomas Panakamattam Abraham]

 Platform/ARM/JunoPkg/ArmJuno.dsc |  7 ++-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc |  7 ++-
 Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf   |  4 +++-
 Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf   |  4 +++-
 Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc|  9 -
 Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc| 14 +++---
 6 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/Platform/ARM/JunoPkg/ArmJuno.dsc b/Platform/ARM/JunoPkg/ArmJuno.dsc
index 
72eab8b5be22a5516b243b2b5e70f6b919854707..54158d709ae836202254eef8b2e0eac8209ca9cc
 100644
--- a/Platform/ARM/JunoPkg/ArmJuno.dsc
+++ b/Platform/ARM/JunoPkg/ArmJuno.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -131,6 +131,11 @@ [PcdsFixedAtBuild.common]
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
 
+  ## SBSA Watchdog Count
+!ifndef DISABLE_SBSA_WATCHDOG
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount|2
+!endif
+
   # LAN9118 Ethernet Driver
   gEmbeddedTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x1800
   gEmbeddedTokenSpaceGuid.PcdLan9118DefaultMacAddress|0x1215161822242628
diff --git a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc 
b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
index 
e9f954d926ac25a2abd2f97a4141267927dfc0a3..51f0529db2516285641a8b6a49473db9d3d9224a
 100644
--- a/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -135,6 +135,11 @@ [PcdsFixedAtBuild.common]
   ## PL031 RealTimeClock
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C17
 
+  ## SBSA Watchdog Count
+!ifndef DISABLE_SBSA_WATCHDOG
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount|1
+!endif
+
 !ifdef EDK2_ENABLE_PL111
   ## PL111 Versatile Express Motherboard controller
   gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x1C1F
diff --git a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf 
b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
index 
e099c02f39dad4bb19692c87a12d8d3d6f1da4b6..741ea191be3672db225b82dc0e182fceddec83f2
 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf
@@ -2,7 +2,7 @@
 #
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2014-2016, ARM Ltd. All rights reserved.
+#  Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -61,3 +61,5 @@ [FixedPcd]
   gArmPlatformTokenSpaceGuid.PL011UartInterrupt
 
   gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount
diff --git a/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf 
b/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
index 
59d323840a3a5e32a1a870f2098bdb2588ae91e1..cc0f06f533236b3bf68bfc6eefc745b776fdad16
 100644
--- a/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
+++ b/Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf
@@ -2,7 +2,7 @@
 #
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2014-2016, ARM Ltd. All rights reserved.
+#  Copyright (c) 2014-2017, ARM Ltd. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -41,3 +41,5 @@ [FixedPcd]
   gArmTokenSpaceGuid.PcdGicDistributorBase
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
   gArmTokenSpaceGuid.PcdGicRedistributorsBase
+
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount
diff --git a/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc 
b/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
index 
5e83802d576b11178a7fdb556086dea41ee0859f..9d1296fdf29e9c233557cc8fb502fbbe932bc2db
 100644
--- a/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
+++ b/Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc
@@ -1,7 +1,7 @@
 /** @file
 *  Generic Timer 

[edk2] [PATCH v2 0/2] Use PCD for Watchdog count

2017-09-21 Thread evan . lloyd
From: EvanLloyd 

Paired patches for edk2 and edk2-platforms that add and use a PCD
indicating the number of SBSA Watchdog timers present.  This makes
things more configurable, and is consistent with other examples of
platform characteristics. It may also help with debates over GTDT
inclusion (or not) of secure timers.

Code is available at:
  https://github.com/EvanLloyd/tianocore/tree/162_WDpcd_v2
  https://github.com/EvanLloyd/edk2-platforms/tree/162_WDpcd_v2

Orignal submission was:
https://lists.01.org/pipermail/edk2-devel/2017-September/014838.html

Sami Mujawar (1):
  ArmPlatformPkg: Add PCD for SBSA Watchdog Count

 ArmPlatformPkg/ArmPlatformPkg.dec   | 4 +++-
 ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

Sami Mujawar (1):
  Platforms/ARM: SBSA Watchdog PCD and build option

 Platform/ARM/JunoPkg/ArmJuno.dsc |  7 ++-
 Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc |  7 ++-
 Platform/ARM/JunoPkg/AcpiTables/AcpiTables.inf   |  4 +++-
 Platform/ARM/VExpressPkg/AcpiTables/AcpiTables.inf   |  4 +++-
 Platform/ARM/JunoPkg/AcpiTables/Gtdt.aslc|  6 +-
 Platform/ARM/VExpressPkg/AcpiTables/Gtdt.aslc| 14 +++---
 6 files changed, 34 insertions(+), 8 deletions(-)

-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

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


[edk2] [PATCH v2 1/2] ArmPlatformPkg: Add PCD for SBSA Watchdog Count

2017-09-21 Thread evan . lloyd
From: Sami Mujawar 

The Juno and FVP platform implement the SBSA Watchdog timers.
Added PcdWatchdogCount to specify the number of Watchdog timers
that are available.

This allows configurability and an option to disable the watchdog
timers if required for testing.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar 
Signed-off-by: Evan Lloyd 
---

Notes:
162_WDpcd_v2:
- Moved JUNO_WATCHDOG_COUNT [Thomas Panakamattam Abraham]

 ArmPlatformPkg/ArmPlatformPkg.dec   | 4 +++-
 ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec 
b/ArmPlatformPkg/ArmPlatformPkg.dec
index 
b8a6b131632dc6788b73a034a41b9e3176dffafa..2d82ead7612ae05c6f16f76008bde605a80ae5b9
 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dec
+++ b/ArmPlatformPkg/ArmPlatformPkg.dec
@@ -1,6 +1,6 @@
 #/** @file
 #
-#  Copyright (c) 2011-2016, ARM Limited. All rights reserved.
+#  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
 #  Copyright (c) 2015, Intel Corporation. All rights reserved.
 #
 #  This program and the accompanying materials
@@ -131,6 +131,8 @@ [PcdsFixedAtBuild.common,PcdsDynamic.common]
   gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0|UINT32|0x0024
   gArmPlatformTokenSpaceGuid.PcdPL031RtcPpmAccuracy|3|UINT32|0x0022
 
+  gArmPlatformTokenSpaceGuid.PcdWatchdogCount|0x0|UINT32|0x0033
+
 [PcdsFixedAtBuild.ARM]
   # Stack for CPU Cores in Secure Monitor Mode
   gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0|UINT64|0x0007
diff --git a/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h 
b/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h
index 
7eaa239b1cbd4a2f54aa2d71e4e3b0279c5527d1..f7bfe0a1f937f17dfb68d0761cea3cbc5eacc14e
 100644
--- a/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h
+++ b/ArmPlatformPkg/ArmJunoPkg/Include/ArmPlatform.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2013-2014, ARM Limited. All rights reserved.
+*  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -108,7 +108,6 @@
   JunoRevision = ARM_VE_BOARD_SYS_ID_REV( SysId ); \
 }
 
-#define JUNO_WATCHDOG_COUNT  2
 
 // Define if the exported ACPI Tables are based on ACPI 5.0 spec or latest
 //#define ARM_JUNO_ACPI_5_0
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

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


Re: [edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM

2017-09-21 Thread Evan Lloyd
Hi Andrew.

> From: af...@apple.com [mailto:af...@apple.com] 
> Sent: 21 September 2017 20:15
> To: Evan Lloyd 
> Cc: Leif Lindholm ; nd ; Ard 
> Biesheuvel ; edk2-devel@lists.01.org; Thomas 
> Panakamattam Abraham ; Arvind Chauhan 
> 
> Subject: Re: [edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM
> ?
> 
> If you let me move that | before pushing, I'm happy with this set.
> 
> [[Evan Lloyd]] Very well, if you really feel that strongly. 
> How come you have a code style rooted in the 1960s before you were born, 
> while I've move forward to at least the 1990s.  Shouldn't I be the surly, 
> hide-bound, old, luddite dinosaur?
> 
> 
> Yikes. There is actually no scientific data that one coding standard is 
> better than another. The data does show having a consistent coding style is 
> what has value. 
> 
> I wrote the original coding standard a long time ago I remember I was a 4 
> space indent person, and as a compromise we moved to 2 space indent. It drove 
> me crazy for about 2 weeks and then my brain flipped over and now I prefer 2 
> spaces, and 4 spaces look strange. Same kind of thing happened when Apple 
> flipped the scroll direction. Folks went crazy, but after a while your brain 
> gets accustomed to the new normal. 
> 
> Thanks,
> 
> Andrew Fish

[[Evan Lloyd]] Reading my comment, one could infer that I overdid calling Leif 
names.
Now I do do that, frequently, but generally to his face, and, if possible, over 
beer.
He also knows me well enough to know that I WAS there in the 1960s.

The topic under discussion is the placement of operators when splitting lines,
and the standard has no rules but lots of examples that support my case,
which is that:
if (   (   (some long condition)
&& (Another long condition))
|| (   (something shortish || something shorter)
&& (another test)
&& (yet another check)))

is clearer than:

if (((some long condition) &&
 (Another long condition)) ||
((something shortish || something shorter) &&
 (another test) &&
 (yet another check)))

A major reason for that is that aligning the operators at the start gives
an extra clue as to how they relate to each other. In the second example
the matching of operators can be obscured.

I hold that a similar case applies to ordinary operators:
variable = (a * (calculation + with))
   / sums;
rather than:
variable = (a * (calculation + with)) /
   sums;

Regards,
Evan

PS Outlook insists on messing with the "plain text" format, so this may not 
look right, sorry.

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


Re: [edk2] [PATCH v1] MdePkg: Add definitions for the SPI protocols introduced in UEFI PI 1.6.

2017-09-21 Thread Zimmer, Vincent
Good points on the use case.  I'll take a look.
Thanks again
Vincent

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Marvin 
Häuser
Sent: Wednesday, September 20, 2017 2:26 PM
To: edk2-devel@lists.01.org
Cc: Zimmer, Vincent 
Subject: Re: [edk2] [PATCH v1] MdePkg: Add definitions for the SPI protocols 
introduced in UEFI PI 1.6.

Hey Vincent,

Thank you for your response!
It would be very kind of you if you would post an update to edk2-devel and CC 
me once you get a response from the Forum!

In case you know somebody working on the MM part of the specification, could 
you please forward the following?
There is a potential problem with EFI_MM_IO_TRAP_DISPATCH_PROTOCOL.Register() 
that might prevent a Standalone MM implementation:
"If the base of the I/O range specified is zero, then an I/O range with the 
specified length and characteristics will be allocated and the Address field in 
RegisterContext updated."
With the current specification, the only way to allocate an I/O Range I know is 
via the DXE Services, though using the DXE services means that a Standalone MM 
implementation is not possible. Maybe 0 should no longer be accepted as a 
possible value (of course that would require an IoTrapDispatch2)? A Standalone 
MM driver which calls this function would then depend on a DXE driver to 
already have allocated the range via the DXE Services (the MM driver should 
probably hook the EndOfDxe event to make sure the DXE code has run). On the 
other hand, the Standalone MM IoTrap consumer has no way of knowing whether the 
allocation was completed successfully. So, the only proper way I see would be 
implementing I/O range allocation during PEI phase and then exposing those 
allocations via the HOB list, which is available to both the DXE Core to take 
note of the allocations, as well as the Standalone MM Core, which can expose 
them to the MM Standalone Drivers. Any comments? Did I maybe overlook something?

Thanks,
Marvin.

> -Original Message-
> From: Zimmer, Vincent [mailto:vincent.zim...@intel.com]
> Sent: Wednesday, September 20, 2017 10:24 PM
> To: Marvin Häuser ; edk2-
> de...@lists.01.org
> Cc: Bi, Dandan ; Shaw, Kevin W
> ; Leahy, Leroy P ; UEFI
> Administration 
> Subject: RE: [PATCH v1] MdePkg: Add definitions for the SPI protocols
> introduced in UEFI PI 1.6.
> 
> Marvin:
> 
> Thanks for all of the feedback on the SPI items from the most recent UEFI PI
> spec. We're updating the PI spec now responsive to your findings and these
> corrections will be reflected in an upcoming errata.
> 
> Sorry for the delayed response to you on the findings. I'll follow up w/ UEFI
> Forum on why we cannot readily use the fw/os forum mailing list for this
> type of discussion, too.
> 
> Vincent
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Marvin Häuser
> Sent: Friday, September 15, 2017 7:57 AM
> To: edk2-devel@lists.01.org
> Cc: Bi, Dandan 
> Subject: Re: [edk2] [PATCH v1] MdePkg: Add definitions for the SPI protocols
> introduced in UEFI PI 1.6.
> 
> Hey Dandan,
> 
> Sorry for the mistakes, I will send them a part of a V2 once you finished
> reviewing.
> No problem for the delay, it's not high priority at all. Thanks for reviewing 
> it!
> 
> There are problems within the specification regarding the SPI protocols
> anyway.
> I wanted to report these, though I don't know where to. Andrew suggested
> to post to the FW/OS Forum,
> though it is currently not available, so I'm awaiting response from the UEFI
> Forum administration.
> 
> Best regards,
> Marvin.
> 
> > -Original Message-
> > From: Bi, Dandan [mailto:dandan...@intel.com]
> > Sent: Friday, September 15, 2017 10:22 AM
> > To: Ni, Ruiyu ; Marvin Häuser
> > ; edk2-devel@lists.01.org
> > Cc: Kinney, Michael D ; Gao, Liming
> > 
> > Subject: RE: [PATCH v1] MdePkg: Add definitions for the SPI protocols
> > introduced in UEFI PI 1.6.
> >
> > Hi Marvin,
> >
> > Thank you for your contribution. I am reviewing this patch now. Currently I
> > just take a look at the SMM SPI part and find:
> >
> > 1. There is a typo in LegacySpiSmmController.h
> > The definition should be EFI_LEGACY_SPI_SMM_CONTROLLER_GUID, not
> > EFI_LEGACY_SPI_SMM_FLASH_PROTOCOL_GUID.
> > Typo:
> > #define EFI_LEGACY_SPI_SMM_FLASH_PROTOCOL_GUID  \
> >   { 0x62331b78, 0xd8d0, 0x4c8c, \
> > { 0x8c, 0xcb, 0xd2, 0x7d, 0xfe, 0x32, 0xdb, 0x9b }}
> > And it should  be:
> > #define EFI_LEGACY_SPI_SMM_CONTROLLER_GUID \
> > { 0x62331b78, 0xd8d0, 0x4c8c, { 0x8c, 0xcb, 0xd2, 0x7d, \ 0xfe, 0x32, 0xdb,
> > 0x9b }}
> >
> > 2. EFI_SPI_SMM_NOR_FLASH_PROTOCOL definition seems to be missing.
> >
> > I will review 

Re: [edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM

2017-09-21 Thread Andrew Fish

> On Sep 21, 2017, at 11:39 AM, Evan Lloyd  wrote:
> 
> 
> 
>> -Original Message-
>> From: Leif Lindholm [mailto:leif.lindh...@linaro.org 
>> ]
>> Sent: 21 September 2017 18:56
>> To: Evan Lloyd >
>> Cc: edk2-devel@lists.01.org ; Ard Biesheuvel 
>> >;
>> Matteo Carlini >; nd 
>> >; Arvind
>> Chauhan >; Daniil 
>> Egranov
>> >; Thomas 
>> Panakamattam Abraham
>> >
>> Subject: Re: [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM
>> 
>> On Thu, Sep 21, 2017 at 05:23:40PM +0100, evan.ll...@arm.com wrote:
>>> From: EvanLloyd 
>>> 
>>> This v4 series of patches corrects a problem detected on the ARM Juno
>>> platform that is actually generic (at least to ARM GIC platforms).
>>> The HardwareInterrupt protocol had no means of handling
>>> characteristics like Edge/Level triggered and polarity.
>>> 
>>> A new HardwareInterrupt2 protocol (provided by Ard) is added, and code
>>> changed to utilise the new capabilities.
>>> 
>>> The code is available for examination on Github at:
>>>https://github.com/EvanLloyd/tianocore/tree/376_irqtype_v4
>>> 
>>> v4 responds to further comments from maintainers, being mainly
>>> cosmetic changes.
>>> 
>>> Note: Significant defects exist in the (original) Watchdog handling,
>>>  and a new patch will follow.
>> 
>> If you let me move that | before pushing, I'm happy with this set.
> 
> [[Evan Lloyd]] Very well, if you really feel that strongly. 
> How come you have a code style rooted in the 1960s before you were born, 
> while I've move forward to at least the 1990s.  Shouldn't I be the surly, 
> hide-bound, old, luddite dinosaur?
> 

Yikes. There is actually no scientific data that one coding standard is better 
than another. The data does show having a consistent coding style is what has 
value. 

I wrote the original coding standard a long time ago I remember I was a 4 
space indent person, and as a compromise we moved to 2 space indent. It drove 
me crazy for about 2 weeks and then my brain flipped over and now I prefer 2 
spaces, and 4 spaces look strange. Same kind of thing happened when Apple 
flipped the scroll direction. Folks went crazy, but after a while your brain 
gets accustomed to the new normal. 

Thanks,

Andrew Fish

>> 
>> Arvind, Daniil, Thomas - any comments?
>> 
>> /
>>Leif
>> 
>>> Ard Biesheuvel (3):
>>>  EmbeddedPkg: Introduce HardwareInterrupt2 protocol
>>>  ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol
>>>  ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type
>>> 
>>> Evan Lloyd (1):
>>>  ArmPkg: Tidy GIC code before changes.
>>> 
>>> EmbeddedPkg/EmbeddedPkg.dec  |   1 +
>>> ArmPkg/Drivers/ArmGic/ArmGicDxe.inf  |   3 +-
>>> ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf |   6 +-
>>> ArmPkg/Drivers/ArmGic/ArmGicDxe.h|  31 ++-
>>> ArmPkg/Include/Library/ArmGicLib.h   |  34 +--
>>> EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h| 182
>> 
>>> ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c  |  76 +--
>>> ArmPkg/Drivers/ArmGic/ArmGicLib.c|  73 +--
>>> ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c| 195
>> ++---
>>> ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c| 218
>> +---
>>> ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c   | 146
>> +++--
>>> 11 files changed, 779 insertions(+), 186 deletions(-)  create mode
>>> 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
>>> 
>>> --
>>> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
>>> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel

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


[edk2] [PATCH] UefiCpuPkg/SmmCpuFeaturesLib: replace hard-coded machine code

2017-09-21 Thread Chris Ruffin
Replace hard-coded machine code with equivalent assembly source code.

Change-Id: I44d08276a5f788bf46c5050c14c5257bad6b6199
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chris Ruffin 
---
 .../Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm   | 24 ++
 .../SmmCpuFeaturesLib/Ia32/SmiException.nasm   |  5 ++--
 .../Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm| 29 --
 .../SmmCpuFeaturesLib/X64/SmiException.nasm|  5 ++--
 4 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
index b1c84a494f..00c0f0672c 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiEntry.nasm
@@ -1,5 +1,5 @@
 
;-- 
;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
+; Copyright (c) 2016 - 2017, 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
@@ -51,6 +51,11 @@ global ASM_PFX(gStmSmbase)
 global ASM_PFX(gStmXdSupported)
 extern ASM_PFX(gStmSmiHandlerIdtr)
 
+ASM_PFX(gStmSmiCr3)  EQU StmSmiCr3Patch - 4
+ASM_PFX(gStmSmiStack)EQU StmSmiStackPatch - 4
+ASM_PFX(gStmSmbase)  EQU StmSmbasePatch - 4
+ASM_PFX(gStmXdSupported) EQU StmXdSupportedPatch - 1
+
 SECTION .text
 
 BITS 16
@@ -66,8 +71,8 @@ _StmSmiEntryPoint:
 o32 lgdt[cs:bx]   ; lgdt fword ptr cs:[bx]
 mov ax, PROTECT_MODE_CS
 mov [cs:bx-0x2],ax
-DB  0x66, 0xbf   ; mov edi, SMBASE
-ASM_PFX(gStmSmbase): DD 0
+o32 mov edi, strict dword 0
+StmSmbasePatch:
 lea eax, [edi + (@32bit - _StmSmiEntryPoint) + 0x8000]
 mov [cs:bx-0x6],eax
 mov ebx, cr0
@@ -87,15 +92,15 @@ o16 mov es, ax
 o16 mov fs, ax
 o16 mov gs, ax
 o16 mov ss, ax
-DB  0xbc   ; mov esp, imm32
-ASM_PFX(gStmSmiStack): DD 0
+mov esp, strict dword 0
+StmSmiStackPatch:
 mov eax, ASM_PFX(gStmSmiHandlerIdtr)
 lidt[eax]
 jmp ProtFlatMode
 
 ProtFlatMode:
-DB  0xb8; mov eax, imm32
-ASM_PFX(gStmSmiCr3): DD 0
+mov eax, strict dword 0
+StmSmiCr3Patch:
 mov cr3, eax
 ;
 ; Need to test for CR4 specific bit support
@@ -134,8 +139,8 @@ ASM_PFX(gStmSmiCr3): DD 0
 .6:
 
 ; enable NXE if supported
-DB  0b0h; mov al, imm8
-ASM_PFX(gStmXdSupported): DB  1
+mov al, strict byte 1
+StmXdSupportedPatch:
 cmp al, 0
 jz  @SkipXd
 ;
@@ -268,4 +273,3 @@ _StmSmiHandler:
 
 ASM_PFX(gcStmSmiHandlerSize)   : DW$ - _StmSmiEntryPoint
 ASM_PFX(gcStmSmiHandlerOffset) : DW_StmSmiHandler - _StmSmiEntryPoint
-
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm
index 0ce8501ba9..93dc3005b7 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/Ia32/SmiException.nasm
@@ -1,5 +1,5 @@
 
;-- 
;
-; Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
+; Copyright (c) 2009 - 2017, 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
@@ -87,7 +87,7 @@ ASM_PFX(OnException):
 
 mov  ebx, eax
 mov  eax, 4
-DB  0x0f, 0x01, 0x0c1 ; VMCALL
+vmcall
 jmp $
 
 global ASM_PFX(OnStmSetup)
@@ -173,4 +173,3 @@ ASM_PFX(OnStmTeardown):
 
 .72:
   rsm
-
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
index c801591fc7..bcac643e96 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/X64/SmiEntry.nasm
@@ -1,5 +1,5 @@
 
;-- 
;
-; Copyright (c) 2016, Intel Corporation. All rights reserved.
+; Copyright (c) 2016 - 2017, 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
@@ -61,6 +61,11 @@ global ASM_PFX(gcStmSmiHandlerTemplate)
 global ASM_PFX(gcStmSmiHandlerSize)
 global ASM_PFX(gcStmSmiHandlerOffset)
 
+ASM_PFX(gStmSmbase)  EQU StmSmbasePatch - 4

Re: [edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM

2017-09-21 Thread Evan Lloyd


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: 21 September 2017 18:56
> To: Evan Lloyd 
> Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> Matteo Carlini ; nd ; Arvind
> Chauhan ; Daniil Egranov
> ; Thomas Panakamattam Abraham
> 
> Subject: Re: [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM
> 
> On Thu, Sep 21, 2017 at 05:23:40PM +0100, evan.ll...@arm.com wrote:
> > From: EvanLloyd 
> >
> > This v4 series of patches corrects a problem detected on the ARM Juno
> > platform that is actually generic (at least to ARM GIC platforms).
> > The HardwareInterrupt protocol had no means of handling
> > characteristics like Edge/Level triggered and polarity.
> >
> > A new HardwareInterrupt2 protocol (provided by Ard) is added, and code
> > changed to utilise the new capabilities.
> >
> > The code is available for examination on Github at:
> > https://github.com/EvanLloyd/tianocore/tree/376_irqtype_v4
> >
> > v4 responds to further comments from maintainers, being mainly
> > cosmetic changes.
> >
> > Note: Significant defects exist in the (original) Watchdog handling,
> >   and a new patch will follow.
> 
> If you let me move that | before pushing, I'm happy with this set.

[[Evan Lloyd]] Very well, if you really feel that strongly. 
How come you have a code style rooted in the 1960s before you were born, while 
I've move forward to at least the 1990s.  Shouldn't I be the surly, hide-bound, 
old, luddite dinosaur?

> 
> Arvind, Daniil, Thomas - any comments?
> 
> /
> Leif
> 
> > Ard Biesheuvel (3):
> >   EmbeddedPkg: Introduce HardwareInterrupt2 protocol
> >   ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol
> >   ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type
> >
> > Evan Lloyd (1):
> >   ArmPkg: Tidy GIC code before changes.
> >
> >  EmbeddedPkg/EmbeddedPkg.dec  |   1 +
> >  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf  |   3 +-
> >  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf |   6 +-
> >  ArmPkg/Drivers/ArmGic/ArmGicDxe.h|  31 ++-
> >  ArmPkg/Include/Library/ArmGicLib.h   |  34 +--
> >  EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h| 182
> 
> >  ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c  |  76 +--
> >  ArmPkg/Drivers/ArmGic/ArmGicLib.c|  73 +--
> >  ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c| 195
> ++---
> >  ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c| 218
> +---
> >  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c   | 146
> +++--
> >  11 files changed, 779 insertions(+), 186 deletions(-)  create mode
> > 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
> >
> > --
> > Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 05:23:40PM +0100, evan.ll...@arm.com wrote:
> From: EvanLloyd 
> 
> This v4 series of patches corrects a problem detected on the ARM Juno
> platform that is actually generic (at least to ARM GIC platforms).
> The HardwareInterrupt protocol had no means of handling characteristics
> like Edge/Level triggered and polarity.
> 
> A new HardwareInterrupt2 protocol (provided by Ard) is added, and code
> changed to utilise the new capabilities.
> 
> The code is available for examination on Github at:
> https://github.com/EvanLloyd/tianocore/tree/376_irqtype_v4
> 
> v4 responds to further comments from maintainers, being mainly
> cosmetic changes.
> 
> Note: Significant defects exist in the (original) Watchdog handling,
>   and a new patch will follow.

If you let me move that | before pushing, I'm happy with this set.

Arvind, Daniil, Thomas - any comments?

/
Leif

> Ard Biesheuvel (3):
>   EmbeddedPkg: Introduce HardwareInterrupt2 protocol
>   ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol
>   ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type
> 
> Evan Lloyd (1):
>   ArmPkg: Tidy GIC code before changes.
> 
>  EmbeddedPkg/EmbeddedPkg.dec  |   1 +
>  ArmPkg/Drivers/ArmGic/ArmGicDxe.inf  |   3 +-
>  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf |   6 +-
>  ArmPkg/Drivers/ArmGic/ArmGicDxe.h|  31 ++-
>  ArmPkg/Include/Library/ArmGicLib.h   |  34 +--
>  EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h| 182 
> 
>  ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c  |  76 +--
>  ArmPkg/Drivers/ArmGic/ArmGicLib.c|  73 +--
>  ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c| 195 
> ++---
>  ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c| 218 
> +---
>  ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c   | 146 +++--
>  11 files changed, 779 insertions(+), 186 deletions(-)
>  create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
> 
> -- 
> Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/5] ArmPkg: Tidy GIC code before changes.

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 03:34:07PM +, Evan Lloyd wrote:
> Hi Leif.
> I agree/accept all the comments, except:
> 
> > -Original Message-
> > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > Sent: 14 September 2017 17:41
> > To: Evan Lloyd 
> > Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> > Matteo Carlini ; nd 
> > Subject: Re: [PATCH 1/5] ArmPkg: Tidy GIC code before changes.
> > 
> > On Mon, Sep 11, 2017 at 04:23:31PM +0100, evan.ll...@arm.com wrote:
> > > From: Evan Lloyd 
> > >
> ...
> > 
> > >// whereas Affinity3 is defined at [32:39] in MPIDR
> > > -  CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> > > ARM_CORE_AFF2)) | ((MpId & ARM_CORE_AFF3) >> 8);
> > > +  CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> > ARM_CORE_AFF2))
> > > +| ((MpId & ARM_CORE_AFF3) >> 8);
> > 
> > I can't find an explicit rule on this, but my preference aligns with what
> > examples I can see in the Coding Style: moving that lone '|' to the end of 
> > the
> > preceding line:
> > 
> >   CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> > ARM_CORE_AFF2)) |
> > ((MpId & ARM_CORE_AFF3) >> 8);
> 
> [[Evan Lloyd]] 5.2.1.6 and 5.7.2.4 have multiple examples of prefix style, 
>   with 5.2.2.11 and 5.7.2.3 providing only 2 instances of a line suffix 
> operator.

The example of 5.2.1.6 already violates the rule of 5.2.2.11.
But the whole problem is that there is no explicit rule about
prefix/suffix, which leads to...

>   I can change it if you insist, but it will be a clear instance of a 
>   maintainer's personal prejudice overriding the coding standard.

If you can point me to a rule I have missed, then yes, you would be
absolutely correct. But I can only find uses, of both variants, in
examples explaining other rules.

If not, I am doing exactly what I am meant to be doing.

Since the maintainer is the one who a) has to review patches without
prior understanding of what the author was thinking and b) the one who
needs to review future modifications to that code, it would be highly
irresponsible to not ask for the code to be presented in the form most
clear to them, where this does not conflict with the coding style.

>   I strongly believe prefix format is much clearer, especially for
>   compound conditions with nesting.

Then why this prefix format not uniformly used in the patch?

Further down, there is
---
-CpuTarget = MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 | ARM_CORE_AFF2 | 
ARM_CORE_AFF3);
+CpuTarget = MpId &
+(ARM_CORE_AFF0 | ARM_CORE_AFF1 | ARM_CORE_AFF2 | 
ARM_CORE_AFF3);
---

Now, a) I think that's very clear and b) any other way pushes the
length of the second line over 80 characters. But it does mean you are
not adhering to the rules you are arguing for.

> > 
> > >if (Revision == ARM_GIC_ARCH_REVISION_3) {
> ...
> > >  // Write set-enable register
> > > -MmioWrite32 (GicCpuRedistributorBase +
> > ARM_GICR_CTLR_FRAME_SIZE + ARM_GICR_ISENABLER + (4 * RegOffset), 1
> > << RegShift);
> > > +MmioWrite32 (
> > > +  (GicCpuRedistributorBase
> > > ++ ARM_GICR_CTLR_FRAME_SIZE
> > > ++ ARM_GICR_ISENABLER
> > > ++ (4 * RegOffset)),
> > > +  1 << RegShift
> > > +  );
> > 
> > Maybe rewrite as
> > 
> > #define SET_ENABLE_ADDRESS(base,offset) ((base) +
> > ARM_GICR_CTLR_FRAME_SIZE + \
> >  ARM_GICR_ISENABLER + (4 * offset))
> > 
> > (further up)
> > 
> > then
> > 
> > MmioWrite32 (
> >   SET_ENABLE_ADDRESS (GicCpuRedistributorBase, RegOffset),
> >   1 << RegShift
> >   );
> > 
> > ?
> 
> [[Evan Lloyd]] Agree, but I called the macros ISENABLER_ADDRESS and 
> ISENABLER_ADDRESS
> (using the register names) because SET_ seemed to imply writing something in 
> this context.

Yes, this is much better.

Another reason why I keep banging on about macros - they let you
add descriptive semantics that makes the code easier to understand for
someone unfamiliar with it.

Regards,

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


[edk2] [PATCH 3/4] ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol

2017-09-21 Thread evan . lloyd
From: Ard Biesheuvel 

The existing HardwareInterrupt protocol lacked a means to configure the
level/edge properties of an interrupt.  The new HardwareInterrupt2
protocol introduced this capability.
This patch updates the GIC drivers to provide the new interfaces.
The changes comprise:
  Update to use HardwareInterrupt2 protocol
  Additions to register info in ArmGicLib.h
  Added new functionality (GetTriggerType and SetTriggerType)

The requirement for this change derives from a problem detected on ARM
Juno boards, but the change is of generic (ARM) relevance.

This commit is in response to review on the mailing list and, as
suggested there, rolls Girish's updates onto Ard's original example.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
Signed-off-by: Girish Pathak 
Signed-off-by: Evan Lloyd 
Tested-by: Girish Pathak 
---

Notes:
376_irqtype_v4
  [Leif Lindholm]
  - Fixed continuation line indent
  - Moved EFI_D_ERROR changes out
  - Replaced MmioBitFieldRead32
  - Fixed indent and parentheses

 ArmPkg/Drivers/ArmGic/ArmGicDxe.inf   |   3 +-
 ArmPkg/Drivers/ArmGic/ArmGicDxe.h |  23 
 ArmPkg/Include/Library/ArmGicLib.h|  11 +-
 ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c   |  43 ++
 ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 137 
 ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 136 +++
 6 files changed, 351 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf 
b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
index 
e554301c4b28022c805f69242cf6ee979d19abc2..d5921533fb68fa32c3e0705b05930700ee81da07
 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
+++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
@@ -1,7 +1,7 @@
 #/** @file
 #
 #  Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-#  Copyright (c) 2012 - 2015, ARM Ltd. All rights reserved.
+#  Copyright (c) 2012 - 2017, ARM Ltd. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -48,6 +48,7 @@ [LibraryClasses]
 
 [Protocols]
   gHardwareInterruptProtocolGuid
+  gHardwareInterrupt2ProtocolGuid
   gEfiCpuArchProtocolGuid
 
 [Pcd.common]
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h 
b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
index 
76945282d9b9bbf6da872a408a56387ee321a3b5..610ffacc7eb025011f87ad5e6e457a610bd570a9
 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
+++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
@@ -24,6 +24,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 
 #include 
 #include 
+#include 
 
 extern UINTNmGicNumInterrupts;
 extern HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers;
@@ -32,6 +33,7 @@ extern HARDWARE_INTERRUPT_HANDLER  
*gRegisteredInterruptHandlers;
 EFI_STATUS
 InstallAndRegisterInterruptService (
   IN EFI_HARDWARE_INTERRUPT_PROTOCOL   *InterruptProtocol,
+  IN EFI_HARDWARE_INTERRUPT2_PROTOCOL  *Interrupt2Protocol,
   IN EFI_CPU_INTERRUPT_HANDLER  InterruptHandler,
   IN EFI_EVENT_NOTIFY   ExitBootServicesEvent
   );
@@ -58,4 +60,25 @@ GicV3DxeInitialize (
   IN EFI_SYSTEM_TABLE   *SystemTable
   );
 
+
+// Shared code
+
+/**
+  Calculate GICD_ICFGRn base address and corresponding bit
+  field Int_config[1] of the GIC distributor register.
+
+  @param Source   Hardware source of the interrupt.
+  @param RegAddress   Corresponding GICD_ICFGRn base address.
+  @param Config1Bit   Bit number of F Int_config[1] bit in the register.
+
+  @retval EFI_SUCCESS   Source interrupt supported.
+  @retval EFI_UNSUPPORTED   Source interrupt is not supported.
+**/
+EFI_STATUS
+GicGetDistributorIcfgBaseAndBit (
+  IN HARDWARE_INTERRUPT_SOURCE Source,
+  OUT UINTN   *RegAddress,
+  OUT UINTN   *Config1Bit
+  );
+
 #endif
diff --git a/ArmPkg/Include/Library/ArmGicLib.h 
b/ArmPkg/Include/Library/ArmGicLib.h
index 
a4ede82bc6c07733f880a12fff54001590a0518a..4b21ea9e4e76cb83c0c3421c1d9d88b456192687
 100644
--- a/ArmPkg/Include/Library/ArmGicLib.h
+++ b/ArmPkg/Include/Library/ArmGicLib.h
@@ -49,8 +49,17 @@
 #define ARM_GIC_ICDDCR_ARE  (1 << 4) // Affinity Routing Enable (ARE)
 #define ARM_GIC_ICDDCR_DS   (1 << 6) // Disable Security (DS)
 
+// GICD_ICDICFR bits
+#define ARM_GIC_ICDICFR_WIDTH32   // ICDICFR is a 32 bit register
+#define ARM_GIC_ICDICFR_BYTES(ARM_GIC_ICDICFR_WIDTH / 8)
+#define ARM_GIC_ICDICFR_F_WIDTH  2// Each F field is 2 bits
+#define ARM_GIC_ICDICFR_F_STRIDE 16   // (32/2) F fields per register
+#define ARM_GIC_ICDICFR_F_CONFIG1_BIT1// Bit number within F field
+#define ARM_GIC_ICDICFR_LEVEL_TRIGGERED  0x0  // Level triggered interrupt
+#define 

[edk2] [PATCH 1/4] ArmPkg: Tidy GIC code before changes.

2017-09-21 Thread evan . lloyd
From: Evan Lloyd 

This change is purely cosmetic, to tidy some code before change.
Mods involve:
Re-order #includes
Reformat comments.
Use ns consistently (always "100ns" not sometimes "100 nS")
Split overlength code lines.
Make protocol functions STATIC.
Remove "Horor vacui" comments.
Rationalize GIC register address calculations
Replace explicit test and assert with ASSERT_EFI_ERROR.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Girish Pathak 
Signed-off-by: Alexei Fedorov 
Signed-off-by: Evan Lloyd 
---

Notes:
376_irqtype_v4
  [Leif Lindholm]
  - Change SOB order
  - Tidy // replacement
  - Rework gRegisteredInterruptHandlers allocation
  - Reformat CPU affinity comment
  - Use ISENABLER_ADDRESS macro, etc
  - moved stuff previously in ArmPkg: Tidy up GenericWatchdogDxe.c

  -  Did NOT include Move | to end of line before

 ArmPkg/Drivers/ArmGic/ArmGicDxe.h  |   8 +-
 ArmPkg/Include/Library/ArmGicLib.h |  23 ++--
 ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c|  33 +++---
 ArmPkg/Drivers/ArmGic/ArmGicLib.c  |  73 +---
 ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c  |  58 ++
 ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c  |  82 -
 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 121 
+---
 7 files changed, 226 insertions(+), 172 deletions(-)

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h 
b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
index 
af33aa90b00c6775e10a831d63ed707394862362..76945282d9b9bbf6da872a408a56387ee321a3b5
 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
+++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.h
@@ -1,6 +1,6 @@
 /*++
 
-Copyright (c) 2013-2014, ARM Ltd. All rights reserved.
+Copyright (c) 2013-2017, ARM Ltd. All rights reserved.
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -28,9 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 extern UINTNmGicNumInterrupts;
 extern HARDWARE_INTERRUPT_HANDLER  *gRegisteredInterruptHandlers;
 
-//
 // Common API
-//
 EFI_STATUS
 InstallAndRegisterInterruptService (
   IN EFI_HARDWARE_INTERRUPT_PROTOCOL   *InterruptProtocol,
@@ -46,18 +44,14 @@ RegisterInterruptSource (
   IN HARDWARE_INTERRUPT_HANDLER Handler
   );
 
-//
 // GicV2 API
-//
 EFI_STATUS
 GicV2DxeInitialize (
   IN EFI_HANDLE ImageHandle,
   IN EFI_SYSTEM_TABLE   *SystemTable
   );
 
-//
 // GicV3 API
-//
 EFI_STATUS
 GicV3DxeInitialize (
   IN EFI_HANDLE ImageHandle,
diff --git a/ArmPkg/Include/Library/ArmGicLib.h 
b/ArmPkg/Include/Library/ArmGicLib.h
index 
4364f3ffef464596f64cf59881d703cf54cf0ddd..a4ede82bc6c07733f880a12fff54001590a0518a
 100644
--- a/ArmPkg/Include/Library/ArmGicLib.h
+++ b/ArmPkg/Include/Library/ArmGicLib.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
+*  Copyright (c) 2011-2017, ARM Limited. All rights reserved.
 *
 *  This program and the accompanying materials
 *  are licensed and made available under the terms and conditions of the BSD 
License
@@ -17,9 +17,7 @@
 
 #include 
 
-//
 // GIC Distributor
-//
 #define ARM_GIC_ICDDCR  0x000 // Distributor Control Register
 #define ARM_GIC_ICDICTR 0x004 // Interrupt Controller Type Register
 #define ARM_GIC_ICDIIDR 0x008 // Implementer Identification Register
@@ -51,9 +49,7 @@
 #define ARM_GIC_ICDDCR_ARE  (1 << 4) // Affinity Routing Enable (ARE)
 #define ARM_GIC_ICDDCR_DS   (1 << 6) // Disable Security (DS)
 
-//
 // GIC Redistributor
-//
 
 #define ARM_GICR_CTLR_FRAME_SIZESIZE_64KB
 #define ARM_GICR_SGI_PPI_FRAME_SIZE SIZE_64KB
@@ -65,9 +61,7 @@
 #define ARM_GICR_ISENABLER  0x0100  // Interrupt Set-Enable Registers
 #define ARM_GICR_ICENABLER  0x0180  // Interrupt Clear-Enable Registers
 
-//
 // GIC Cpu interface
-//
 #define ARM_GIC_ICCICR  0x00  // CPU Interface Control Register
 #define ARM_GIC_ICCPMR  0x04  // Interrupt Priority Mask Register
 #define ARM_GIC_ICCBPR  0x08  // Binary Point Register
@@ -104,9 +98,7 @@ ArmGicGetInterfaceIdentification (
   IN  INTN  GicInterruptInterfaceBase
   );
 
-//
 // GIC Secure interfaces
-//
 VOID
 EFIAPI
 ArmGicSetupNonSecure (
@@ -170,7 +162,8 @@ ArmGicSendSgiTo (
  * in the GICv3 the register value is only the InterruptId.
  *
  * @param GicInterruptInterfaceBase   Base Address of the GIC CPU Interface
- * @param InterruptId InterruptId read from the Interrupt 
Acknowledge Register
+ * @param InterruptId InterruptId read from the Interrupt
+ *Acknowledge Register
  *
  * @retval value returned by the 

[edk2] [PATCH 4/4] ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type

2017-09-21 Thread evan . lloyd
From: Ard Biesheuvel 

Utilise the new HardwareInterrupt2 protocol to adjust the
Edge/Level characteristics of the Watchdog interrupt.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel 
Signed-off-by: Girish Pathak 
Signed-off-by: Evan Lloyd 
Tested-by: Girish Pathak 
Reviewed-by: Leif Lindholm 
---
 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf |  6 ++--
 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c   | 29 

 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf 
b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
index 
fece14cc18315cd15510680c438288687b60c018..ba0403d7fdc3589803c643c27a44918e73afa97e
 100644
--- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
+++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2013-2014, ARM Limited. All rights reserved.
+#  Copyright (c) 2013-2017, ARM Limited. All rights reserved.
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD 
License
@@ -47,7 +47,7 @@ [Pcd.common]
 
 [Protocols]
   gEfiWatchdogTimerArchProtocolGuid
-  gHardwareInterruptProtocolGuid
+  gHardwareInterrupt2ProtocolGuid
 
 [Depex]
-  gHardwareInterruptProtocolGuid
+  gHardwareInterrupt2ProtocolGuid
diff --git a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c 
b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
index 
c5372056f3ea080c350ff67ce8f78f0a77663343..252ba5bf321e379ef440830cab468af7c55905b3
 100644
--- a/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
+++ b/ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c
@@ -24,8 +24,8 @@
 #include 
 #include 
 
+#include 
 #include 
-#include 
 
 #include "GenericWatchdog.h"
 
@@ -41,7 +41,7 @@ UINTN mTimerFrequencyHz = 0;
It is therefore stored here. 0 means the timer is not running. */
 UINT64 mNumTimerTicks = 0;
 
-EFI_HARDWARE_INTERRUPT_PROTOCOL *mInterruptProtocol;
+EFI_HARDWARE_INTERRUPT2_PROTOCOL *mInterruptProtocol;
 
 EFI_STATUS
 WatchdogWriteOffsetRegister (
@@ -311,7 +311,7 @@ GenericWatchdogEntry (
   if (!EFI_ERROR (Status)) {
 // Install interrupt handler
 Status = gBS->LocateProtocol (
-,
+,
 NULL,
 (VOID **)
 );
@@ -322,14 +322,21 @@ GenericWatchdogEntry (
  WatchdogInterruptHandler
  );
   if (!EFI_ERROR (Status)) {
-// Install the Timer Architectural Protocol onto a new handle
-Handle = NULL;
-Status = gBS->InstallMultipleProtocolInterfaces (
-,
-,
-,
-NULL
-);
+Status = mInterruptProtocol->SetTriggerType (
+   mInterruptProtocol,
+   FixedPcdGet32 (PcdGenericWatchdogEl2IntrNum),
+   EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING
+   );
+if (!EFI_ERROR (Status)) {
+  // Install the Timer Architectural Protocol onto a new handle
+  Handle = NULL;
+  Status = gBS->InstallMultipleProtocolInterfaces (
+  ,
+  ,
+  ,
+  NULL
+  );
+}
   }
 }
   }
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

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


[edk2] [PATCH 2/4] EmbeddedPkg: Introduce HardwareInterrupt2 protocol

2017-09-21 Thread evan . lloyd
From: Ard Biesheuvel 

The existing HardwareInterrupt protocol lacks the means to configure
the level/edge and polarity properties of an interrupt. So introduce a
new protocol HardwareInterrupt2, and add some new members that allow
manipulation of those properties.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
Signed-off-by: Girish Pathak 
Signed-off-by: Evan Lloyd 
Tested-by: Girish Pathak 
Reviewed-by: Leif Lindholm 
---
 EmbeddedPkg/EmbeddedPkg.dec   |   1 +
 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 182 
 2 files changed, 183 insertions(+)

diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec
index 
0be102ad9c767d81a004c757f40a65063aab1d7a..151b1d503dee463d529a173d2555b6c9208100e5
 100644
--- a/EmbeddedPkg/EmbeddedPkg.dec
+++ b/EmbeddedPkg/EmbeddedPkg.dec
@@ -69,6 +69,7 @@ [Guids.common]
 
 [Protocols.common]
   gHardwareInterruptProtocolGuid =  { 0x2890B3EA, 0x053D, 0x1643, { 0xAD, 
0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } }
+  gHardwareInterrupt2ProtocolGuid = { 0x32898322, 0x2da1, 0x474a, { 0xba, 
0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } }
   gEfiDebugSupportPeriodicCallbackProtocolGuid = { 0x9546e07c, 0x2cbb, 0x4c88, 
{ 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } }
   gEfiEblAddCommandProtocolGuid =   { 0xaeda2428, 0x9a22, 0x4637, { 0x9b, 
0x21, 0x54, 0x5e, 0x28, 0xfb, 0xb8, 0x29 } }
   gEmbeddedDeviceGuid =   { 0xbf4b9d10, 0x13ec, 0x43dd, { 0x88, 0x80, 0xe9, 
0xb, 0x71, 0x8f, 0x27, 0xde } }
diff --git a/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h 
b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
new file mode 100644
index 
..caa28d4b06c893d220efdbdb8814abaa1ddef1a6
--- /dev/null
+++ b/EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
@@ -0,0 +1,182 @@
+/** @file
+
+  Copyright (c) 2016-2017, 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.
+
+**/
+
+#ifndef __HARDWARE_INTERRUPT2_H__
+#define __HARDWARE_INTERRUPT2_H__
+
+#include 
+
+// 22838932-1a2d-4a47-aaba-f3f7cf569470
+
+#define EFI_HARDWARE_INTERRUPT2_PROTOCOL_GUID \
+  { 0x32898322, 0x2d1a, 0x474a, \
+{ 0xba, 0xaa, 0xf3, 0xf7, 0xcf, 0x56, 0x94, 0x70 } }
+
+typedef enum {
+  EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_LOW,
+  EFI_HARDWARE_INTERRUPT2_TRIGGER_LEVEL_HIGH,
+  EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_FALLING,
+  EFI_HARDWARE_INTERRUPT2_TRIGGER_EDGE_RISING,
+} EFI_HARDWARE_INTERRUPT2_TRIGGER_TYPE;
+
+typedef struct _EFI_HARDWARE_INTERRUPT2_PROTOCOL \
+ EFI_HARDWARE_INTERRUPT2_PROTOCOL;
+
+/**
+  Register Handler for the specified interrupt source.
+
+  @param This Instance pointer for this protocol
+  @param Source   Hardware source of the interrupt
+  @param Handler  Callback for interrupt. NULL to unregister
+
+  @retval EFI_SUCCESS Source was updated to support Handler.
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *HARDWARE_INTERRUPT2_REGISTER) (
+  IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
+  IN HARDWARE_INTERRUPT_SOURCE Source,
+  IN HARDWARE_INTERRUPT_HANDLER Handler
+  );
+
+
+/**
+  Enable interrupt source Source.
+
+  @param This Instance pointer for this protocol
+  @param Source   Hardware source of the interrupt
+
+  @retval EFI_SUCCESS   Source interrupt enabled.
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *HARDWARE_INTERRUPT2_ENABLE) (
+  IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
+  IN HARDWARE_INTERRUPT_SOURCE Source
+  );
+
+
+/**
+  Disable interrupt source Source.
+
+  @param This Instance pointer for this protocol
+  @param Source   Hardware source of the interrupt
+
+  @retval EFI_SUCCESS   Source interrupt disabled.
+  @retval EFI_DEVICE_ERROR  Hardware could not be programmed.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *HARDWARE_INTERRUPT2_DISABLE) (
+  IN EFI_HARDWARE_INTERRUPT2_PROTOCOL *This,
+  IN HARDWARE_INTERRUPT_SOURCE Source
+  );
+
+
+/**
+  Return current state of interrupt source Source.
+
+  @param This Instance pointer for this protocol
+  @param Source   Hardware source of the interrupt
+  @param InterruptState  TRUE: source enabled, FALSE: source disabled.
+
+  @retval EFI_SUCCESS   InterruptState is valid
+  @retval EFI_DEVICE_ERROR  InterruptState is not valid
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *HARDWARE_INTERRUPT2_INTERRUPT_STATE) (
+ 

[edk2] [PATCH 0/4] [PATCH 0/5] Add HardwareInterrupt2 for ARM

2017-09-21 Thread evan . lloyd
From: EvanLloyd 

This v4 series of patches corrects a problem detected on the ARM Juno
platform that is actually generic (at least to ARM GIC platforms).
The HardwareInterrupt protocol had no means of handling characteristics
like Edge/Level triggered and polarity.

A new HardwareInterrupt2 protocol (provided by Ard) is added, and code
changed to utilise the new capabilities.

The code is available for examination on Github at:
https://github.com/EvanLloyd/tianocore/tree/376_irqtype_v4

v4 responds to further comments from maintainers, being mainly
cosmetic changes.

Note: Significant defects exist in the (original) Watchdog handling,
  and a new patch will follow.

Ard Biesheuvel (3):
  EmbeddedPkg: Introduce HardwareInterrupt2 protocol
  ArmPkg/ArmGicDxe: Expose HardwareInterrupt2 protocol
  ArmPkg/GenericWatchdogDxe: Set Watchdog interrupt type

Evan Lloyd (1):
  ArmPkg: Tidy GIC code before changes.

 EmbeddedPkg/EmbeddedPkg.dec  |   1 +
 ArmPkg/Drivers/ArmGic/ArmGicDxe.inf  |   3 +-
 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf |   6 +-
 ArmPkg/Drivers/ArmGic/ArmGicDxe.h|  31 ++-
 ArmPkg/Include/Library/ArmGicLib.h   |  34 +--
 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h| 182 
 ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c  |  76 +--
 ArmPkg/Drivers/ArmGic/ArmGicLib.c|  73 +--
 ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c| 195 
++---
 ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c| 218 
+---
 ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c   | 146 +++--
 11 files changed, 779 insertions(+), 186 deletions(-)
 create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h

-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")

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


Re: [edk2] [PATCH 1/5] ArmPkg: Tidy GIC code before changes.

2017-09-21 Thread Evan Lloyd
Hi Leif.
I agree/accept all the comments, except:

> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: 14 September 2017 17:41
> To: Evan Lloyd 
> Cc: edk2-devel@lists.01.org; Ard Biesheuvel ;
> Matteo Carlini ; nd 
> Subject: Re: [PATCH 1/5] ArmPkg: Tidy GIC code before changes.
> 
> On Mon, Sep 11, 2017 at 04:23:31PM +0100, evan.ll...@arm.com wrote:
> > From: Evan Lloyd 
> >
...
> 
> >// whereas Affinity3 is defined at [32:39] in MPIDR
> > -  CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> > ARM_CORE_AFF2)) | ((MpId & ARM_CORE_AFF3) >> 8);
> > +  CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> ARM_CORE_AFF2))
> > +| ((MpId & ARM_CORE_AFF3) >> 8);
> 
> I can't find an explicit rule on this, but my preference aligns with what
> examples I can see in the Coding Style: moving that lone '|' to the end of the
> preceding line:
> 
>   CpuAffinity = (MpId & (ARM_CORE_AFF0 | ARM_CORE_AFF1 |
> ARM_CORE_AFF2)) |
> ((MpId & ARM_CORE_AFF3) >> 8);

[[Evan Lloyd]] 5.2.1.6 and 5.7.2.4 have multiple examples of prefix style, 
  with 5.2.2.11 and 5.7.2.3 providing only 2 instances of a line suffix 
operator.
  I can change it if you insist, but it will be a clear instance of a 
  maintainer's personal prejudice overriding the coding standard. I strongly
  believe prefix format is much clearer, especially for compound conditions
  with nesting.

> 
> >if (Revision == ARM_GIC_ARCH_REVISION_3) {
...
> >  // Write set-enable register
> > -MmioWrite32 (GicCpuRedistributorBase +
> ARM_GICR_CTLR_FRAME_SIZE + ARM_GICR_ISENABLER + (4 * RegOffset), 1
> << RegShift);
> > +MmioWrite32 (
> > +  (GicCpuRedistributorBase
> > ++ ARM_GICR_CTLR_FRAME_SIZE
> > ++ ARM_GICR_ISENABLER
> > ++ (4 * RegOffset)),
> > +  1 << RegShift
> > +  );
> 
> Maybe rewrite as
> 
> #define SET_ENABLE_ADDRESS(base,offset) ((base) +
> ARM_GICR_CTLR_FRAME_SIZE + \
>  ARM_GICR_ISENABLER + (4 * offset))
> 
> (further up)
> 
> then
> 
> MmioWrite32 (
>   SET_ENABLE_ADDRESS (GicCpuRedistributorBase, RegOffset),
>   1 << RegShift
>   );
> 
> ?

[[Evan Lloyd]] Agree, but I called the macros ISENABLER_ADDRESS and 
ISENABLER_ADDRESS
(using the register names) because SET_ seemed to imply writing something in 
this context.

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


Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Paulo Alcantara
On Thu, Sep 21, 2017 at 10:52 AM, Paulo Alcantara  wrote:
>
>
> On September 21, 2017 10:47:07 AM GMT-03:00, "Zeng, Star" 
>  wrote:
>>Does it have functional impact?
>
> Nope. When Partition driver walks the partition detect routine table, it 
> executes each routine and then checks for EFI_NO_MEDIA and EFI_MEDIA_CHANGED 
> only. So, the child handle is installed and the EFI_NOT_FOUND is a no-op in 
> that case.

BTW, I performed a quick test with UdfDxe enabled and disabled in OVMF
and the removal did not seem to break or change any behavior.

Thanks!
Paulo

>
> Thanks!
> Paulo
>
>>
>>Thanks,
>>Star
>>-Original Message-
>>From: Paulo Alcantara [mailto:pca...@zytor.com]
>>Sent: Thursday, September 21, 2017 9:29 PM
>>To: Wu, Hao A ; edk2-devel@lists.01.org
>>Cc: Ni, Ruiyu ; Laszlo Ersek ;
>>Dong, Eric ; Zeng, Star 
>>Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>>creation of UDF logical partition
>>
>>
>>
>>On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"
>> wrote:
>>>One small comment, within function PartitionInstallUdfChildHandles():
>>>
>>>  ...
>>>  //
>>>  // Install partition child handle for UDF file system
>>>  //
>>>  Status = PartitionInstallChildHandle (
>>>...
>>>);
>>>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
>>>(Status)) {"
>>>Status = EFI_NOT_FOUND;
>>>  }
>>
>>Yes, it is. Good catch! Could you please fix that for me by removing
>>the if condition? Otherwise I can send a v4 later with that.
>>
>>Thanks!
>>Paulo
>>
>>>
>>>
>>>Best Regards,
>>>Hao Wu
>>>
>>>
 -Original Message-
 From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>>>Of Paulo
 Alcantara
 Sent: Thursday, September 21, 2017 2:16 AM
 To: edk2-devel@lists.01.org
 Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
 Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>>>creation of
 UDF logical partition

 Do not reserve entire block device size for an UDF file system -
 instead, reserve the appropriate space (UDF logical volume space)
>>for
 it.

 Additionally, only create a logical partition for UDF logical
>>volumes
 that are currently supported by EDK2 UDF file system implementation.
>>>For
 instance, an UDF volume with a single LVD and a single Physical
>>(Type
>>>1)
 Partition will be supported.

 Cc: Eric Dong 
 Cc: Ruiyu Ni 
 Cc: Star Zeng 
 Cc: Laszlo Ersek 
 Reported-by: Ruiyu Ni 
 Contributed-under: TianoCore Contribution Agreement 1.1
 Signed-off-by: Paulo Alcantara 
 ---
  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>>>++--
  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
 
  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>>>++---
  5 files changed, 606 insertions(+), 565 deletions(-)

 diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 index 609f56cef6..572ba7a81a 100644
 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
 @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
)
  {
 -  EFI_STATUS  Status;
 -  UINT32  BlockSize;
 -  EFI_LBA EndLBA;
 -  EFI_LBA DescriptorLBAs[4];
 -  UINTN   Index;
 +  EFI_STATUS  Status;
 +  UINT32  BlockSize;
 +  EFI_LBA EndLBA;
 +  EFI_LBA DescriptorLBAs[4];
 +  UINTN   Index;
 +  UDF_DESCRIPTOR_TAG  *DescriptorTag;

BlockSize = BlockIo->Media->BlockSize;
EndLBA = BlockIo->Media->LastBlock; @@ -88,10 +89,13 @@
 FindAnchorVolumeDescriptorPointer (
  if (EFI_ERROR (Status)) {
return Status;
  }
 +
 +DescriptorTag = >DescriptorTag;
 +
  //
  // Check if read LBA has a valid AVDP descriptor.
  //
 -if (IS_AVDP (AnchorPoint)) {
 +if (DescriptorTag->TagIdentifier ==
>>>UdfAnchorVolumeDescriptorPointer) {
return EFI_SUCCESS;
  }
}
 @@ -102,23 +106,18 @@ FindAnchorVolumeDescriptorPointer (  }

  /**
 -  Check if block device supports a valid UDF file system as
>>>specified by OSTA
 -  Universal Disk Format Specification 2.60.
 +  Find UDF volume identifiers in a Volume Recognition 

Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Paulo Alcantara


On September 21, 2017 10:47:07 AM GMT-03:00, "Zeng, Star"  
wrote:
>Does it have functional impact?

Nope. When Partition driver walks the partition detect routine table, it 
executes each routine and then checks for EFI_NO_MEDIA and EFI_MEDIA_CHANGED 
only. So, the child handle is installed and the EFI_NOT_FOUND is a no-op in 
that case.

Thanks!
Paulo

>
>Thanks,
>Star
>-Original Message-
>From: Paulo Alcantara [mailto:pca...@zytor.com] 
>Sent: Thursday, September 21, 2017 9:29 PM
>To: Wu, Hao A ; edk2-devel@lists.01.org
>Cc: Ni, Ruiyu ; Laszlo Ersek ;
>Dong, Eric ; Zeng, Star 
>Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>creation of UDF logical partition
>
>
>
>On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"
> wrote:
>>One small comment, within function PartitionInstallUdfChildHandles():
>>
>>  ...
>>  //
>>  // Install partition child handle for UDF file system
>>  //
>>  Status = PartitionInstallChildHandle (
>>...
>>);
>>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
>>(Status)) {"  
>>Status = EFI_NOT_FOUND;
>>  }
>
>Yes, it is. Good catch! Could you please fix that for me by removing
>the if condition? Otherwise I can send a v4 later with that.
>
>Thanks!
>Paulo
>
>>  
>>
>>Best Regards,
>>Hao Wu
>>
>>
>>> -Original Message-
>>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>>Of Paulo
>>> Alcantara
>>> Sent: Thursday, September 21, 2017 2:16 AM
>>> To: edk2-devel@lists.01.org
>>> Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
>>> Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>>creation of
>>> UDF logical partition
>>> 
>>> Do not reserve entire block device size for an UDF file system - 
>>> instead, reserve the appropriate space (UDF logical volume space)
>for 
>>> it.
>>> 
>>> Additionally, only create a logical partition for UDF logical
>volumes 
>>> that are currently supported by EDK2 UDF file system implementation.
>>For
>>> instance, an UDF volume with a single LVD and a single Physical
>(Type
>>1)
>>> Partition will be supported.
>>> 
>>> Cc: Eric Dong 
>>> Cc: Ruiyu Ni 
>>> Cc: Star Zeng 
>>> Cc: Laszlo Ersek 
>>> Reported-by: Ruiyu Ni 
>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>> Signed-off-by: Paulo Alcantara 
>>> ---
>>>  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>>++--
>>>  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>>>  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
>>> 
>>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>>++---
>>>  5 files changed, 606 insertions(+), 565 deletions(-)
>>> 
>>> diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>>> b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>>> index 609f56cef6..572ba7a81a 100644
>>> --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>>> +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>>> @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
>>>OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
>>>)
>>>  {
>>> -  EFI_STATUS  Status;
>>> -  UINT32  BlockSize;
>>> -  EFI_LBA EndLBA;
>>> -  EFI_LBA DescriptorLBAs[4];
>>> -  UINTN   Index;
>>> +  EFI_STATUS  Status;
>>> +  UINT32  BlockSize;
>>> +  EFI_LBA EndLBA;
>>> +  EFI_LBA DescriptorLBAs[4];
>>> +  UINTN   Index;
>>> +  UDF_DESCRIPTOR_TAG  *DescriptorTag;
>>> 
>>>BlockSize = BlockIo->Media->BlockSize;
>>>EndLBA = BlockIo->Media->LastBlock; @@ -88,10 +89,13 @@ 
>>> FindAnchorVolumeDescriptorPointer (
>>>  if (EFI_ERROR (Status)) {
>>>return Status;
>>>  }
>>> +
>>> +DescriptorTag = >DescriptorTag;
>>> +
>>>  //
>>>  // Check if read LBA has a valid AVDP descriptor.
>>>  //
>>> -if (IS_AVDP (AnchorPoint)) {
>>> +if (DescriptorTag->TagIdentifier ==
>>UdfAnchorVolumeDescriptorPointer) {
>>>return EFI_SUCCESS;
>>>  }
>>>}
>>> @@ -102,23 +106,18 @@ FindAnchorVolumeDescriptorPointer (  }
>>> 
>>>  /**
>>> -  Check if block device supports a valid UDF file system as
>>specified by OSTA
>>> -  Universal Disk Format Specification 2.60.
>>> +  Find UDF volume identifiers in a Volume Recognition Sequence.
>>> 
>>> -  @param[in]   BlockIo  BlockIo interface.
>>> -  @param[in]   DiskIo   DiskIo interface.
>>> +  @param[in]  BlockIo BlockIo interface.
>>> +  @param[in]  DiskIo  DiskIo interface.
>>> 
>>> -  @retval EFI_SUCCESS  UDF file system found.
>>> -  @retval EFI_UNSUPPORTED  UDF file system not found.
>>> -  

Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Zeng, Star
Does it have functional impact?

Thanks,
Star
-Original Message-
From: Paulo Alcantara [mailto:pca...@zytor.com] 
Sent: Thursday, September 21, 2017 9:29 PM
To: Wu, Hao A ; edk2-devel@lists.01.org
Cc: Ni, Ruiyu ; Laszlo Ersek ; Dong, 
Eric ; Zeng, Star 
Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of 
UDF logical partition



On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"  
wrote:
>One small comment, within function PartitionInstallUdfChildHandles():
>
>  ...
>  //
>  // Install partition child handle for UDF file system
>  //
>  Status = PartitionInstallChildHandle (
>...
>);
>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
>(Status)) {"  
>Status = EFI_NOT_FOUND;
>  }

Yes, it is. Good catch! Could you please fix that for me by removing the if 
condition? Otherwise I can send a v4 later with that.

Thanks!
Paulo

>  
>
>Best Regards,
>Hao Wu
>
>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>Of Paulo
>> Alcantara
>> Sent: Thursday, September 21, 2017 2:16 AM
>> To: edk2-devel@lists.01.org
>> Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
>> Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>creation of
>> UDF logical partition
>> 
>> Do not reserve entire block device size for an UDF file system - 
>> instead, reserve the appropriate space (UDF logical volume space) for 
>> it.
>> 
>> Additionally, only create a logical partition for UDF logical volumes 
>> that are currently supported by EDK2 UDF file system implementation.
>For
>> instance, an UDF volume with a single LVD and a single Physical (Type
>1)
>> Partition will be supported.
>> 
>> Cc: Eric Dong 
>> Cc: Ruiyu Ni 
>> Cc: Star Zeng 
>> Cc: Laszlo Ersek 
>> Reported-by: Ruiyu Ni 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Paulo Alcantara 
>> ---
>>  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>++--
>>  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>>  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
>> 
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>++---
>>  5 files changed, 606 insertions(+), 565 deletions(-)
>> 
>> diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> index 609f56cef6..572ba7a81a 100644
>> --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
>>OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
>>)
>>  {
>> -  EFI_STATUS  Status;
>> -  UINT32  BlockSize;
>> -  EFI_LBA EndLBA;
>> -  EFI_LBA DescriptorLBAs[4];
>> -  UINTN   Index;
>> +  EFI_STATUS  Status;
>> +  UINT32  BlockSize;
>> +  EFI_LBA EndLBA;
>> +  EFI_LBA DescriptorLBAs[4];
>> +  UINTN   Index;
>> +  UDF_DESCRIPTOR_TAG  *DescriptorTag;
>> 
>>BlockSize = BlockIo->Media->BlockSize;
>>EndLBA = BlockIo->Media->LastBlock; @@ -88,10 +89,13 @@ 
>> FindAnchorVolumeDescriptorPointer (
>>  if (EFI_ERROR (Status)) {
>>return Status;
>>  }
>> +
>> +DescriptorTag = >DescriptorTag;
>> +
>>  //
>>  // Check if read LBA has a valid AVDP descriptor.
>>  //
>> -if (IS_AVDP (AnchorPoint)) {
>> +if (DescriptorTag->TagIdentifier ==
>UdfAnchorVolumeDescriptorPointer) {
>>return EFI_SUCCESS;
>>  }
>>}
>> @@ -102,23 +106,18 @@ FindAnchorVolumeDescriptorPointer (  }
>> 
>>  /**
>> -  Check if block device supports a valid UDF file system as
>specified by OSTA
>> -  Universal Disk Format Specification 2.60.
>> +  Find UDF volume identifiers in a Volume Recognition Sequence.
>> 
>> -  @param[in]   BlockIo  BlockIo interface.
>> -  @param[in]   DiskIo   DiskIo interface.
>> +  @param[in]  BlockIo BlockIo interface.
>> +  @param[in]  DiskIo  DiskIo interface.
>> 
>> -  @retval EFI_SUCCESS  UDF file system found.
>> -  @retval EFI_UNSUPPORTED  UDF file system not found.
>> -  @retval EFI_NO_MEDIA The device has no media.
>> -  @retval EFI_DEVICE_ERROR The device reported an error.
>> -  @retval EFI_VOLUME_CORRUPTED The file system structures are
>corrupted.
>> -  @retval EFI_OUT_OF_RESOURCES The scan was not successful due to
>lack of
>> -   resources.
>> +  @retval EFI_SUCCESS UDF volume identifiers were found.
>> +  @retval EFI_NOT_FOUND   UDF volume identifiers were not
>found.
>> +  @retval 

Re: [edk2] Shell input redirection question

2017-09-21 Thread Jim.Dailey
I think the technicality here is that given "pci < inputfile", no
parameters are passed to the pci command, so it should, according to
the spec, display all the devices.

Another problem may be that in the "pci < inputfile" case, the pci
command has no way to know that its input is being redirected and that
it should behave differently than normal. I may be wrong about that
point; I know it is possible, but it might require some sort of generic
change or addition to the shell's behavior.

A different tack would be to add (in a future spec version) a command
line argument that simply indicated to pci that its input (commands)
are in some file (e.g. "pci -cmdfile inputfile"). Of course, if that
were to happen, the new spec should also specify the format of the
command file's content.

A simple way to do what Tiger was trying and that works right now is
to create a shell script instead of an input file:

@echo -off
pci 00 00 01 -i
pci 00 00 02 -i

Regards,
Jim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com] 
Sent: Thursday, September 21, 2017 8:11 AM
To: Dailey, Jim ; tiger...@zhaoxin.com
Cc: edk2-devel@lists.01.org
Subject: RE: [edk2] Shell input redirection question

If the requirement for PCI to display the information when there are no 
parameters present, I see no reason that it could not also use a file for 
input.  i.e. "pci" must act according to the spec, but "pci < inputfile" is not 
prohibited.  I think that as no code currently uses PCI with file input as long 
as current behavior still works it should be fine.

I would think that would be a great improvement for the PCI command.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim.dai...@dell.com
> Sent: Thursday, September 21, 2017 4:52 AM
> To: tiger...@zhaoxin.com
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Shell input redirection question
> Importance: High
> 
> The shell's pci command was not written to read from standard input. It
> expects all its input on the command line.
> 
> I would say in general that if you execute a command and pass it no
> parameters, and it then prompts you in some way for input, then that
> command will likely accept input redirected from a file.
> 
> If you execute pci without any parameters, it simply lists all the
> devices in the system and terminates, so it clearly is not prepared to
> read from standard input (or a redirected file).
> 
> It is strictly up to whomever writes a program/command whether they do
> so in a manner that allows it to accept input from standard input. For
> example, I have written a grep utility for the shell that expects one or
> more filenames to search to be on the command line; however, if there
> are no filenames on the command line, the utility searches standard
> input.
> 
> Regards,
> Jim
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Tiger Liu
> Sent: Thursday, September 21, 2017 1:11 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Shell input redirection question
> 
> Hi, experts:
> I have a question about input redirection in Shell environment.
> 
> Take pci command as sample.
> I wrote a txt file(file name is : inputsample.txt), its content is:
> 00 00 01 -i
> 00 00 02 –i
> 
> It means I just wanted to dump D0F1/D0F2’s config space.
> 
> Then, I use this command sequence in shell :
> pci  
> But it seems not recognize this input file’s content.
> 
> Why?
> 
> Thanks
> 
> best wishes,
> 
> 
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件
> 或其内容做任何未经授权的查阅、使用、复制或转发。
> CONFIDENTIAL NOTE:
> This email contains confidential or legally privileged information and is for 
> the
> sole use of its intended recipient. Any unauthorized review, use, copying or
> forwarding of this email or the content of this email is strictly prohibited.
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 00/11] Update D03/D05 binary for edk2 update and bug fix.

2017-09-21 Thread Ard Biesheuvel
On 21 September 2017 at 05:40, Leif Lindholm  wrote:
> On Thu, Sep 21, 2017 at 06:59:39PM +0800, Heyi Guo wrote:
>> Code can also be found in github:
>> https://github.com/hisilicon/OpenPlatformPkg.git
>> branch: rp-1710-platforms-v3rp-1710-osi-v3
>
> This is looking a lot better, thanks.
> But it could be useful to have a separate cover letter for the
> edk2-non-osi patches.
>
>> Note: If occurs BIOS boot hang up issue, please revert below commit to fix:
>>   "2f03dc8"
>
> Can you give more information?
> 2f03dc8 is "Silicon/Hisilicon: switch to NonDiscoverable driver for
> EHCI".
>

If that patch broke your platform, you should probably have mentioned
this when it was sent out for review. (Apologies if I failed to CC
you, but I think I probably did)
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Paulo Alcantara


On September 21, 2017 9:44:10 AM GMT-03:00, "Wu, Hao A"  
wrote:
>One small comment, within function PartitionInstallUdfChildHandles():
>
>  ...
>  //
>  // Install partition child handle for UDF file system
>  //
>  Status = PartitionInstallChildHandle (
>...
>);
>if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR
>(Status)) {"  
>Status = EFI_NOT_FOUND;
>  }

Yes, it is. Good catch! Could you please fix that for me by removing the if 
condition? Otherwise I can send a v4 later with that.

Thanks!
Paulo

>  
>
>Best Regards,
>Hao Wu
>
>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>Of Paulo
>> Alcantara
>> Sent: Thursday, September 21, 2017 2:16 AM
>> To: edk2-devel@lists.01.org
>> Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
>> Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>creation of
>> UDF logical partition
>> 
>> Do not reserve entire block device size for an UDF file system -
>> instead, reserve the appropriate space (UDF logical volume space) for
>> it.
>> 
>> Additionally, only create a logical partition for UDF logical volumes
>> that are currently supported by EDK2 UDF file system implementation.
>For
>> instance, an UDF volume with a single LVD and a single Physical (Type
>1)
>> Partition will be supported.
>> 
>> Cc: Eric Dong 
>> Cc: Ruiyu Ni 
>> Cc: Star Zeng 
>> Cc: Laszlo Ersek 
>> Reported-by: Ruiyu Ni 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Paulo Alcantara 
>> ---
>>  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>++--
>>  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>>  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
>> 
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>++---
>>  5 files changed, 606 insertions(+), 565 deletions(-)
>> 
>> diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> index 609f56cef6..572ba7a81a 100644
>> --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
>>OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
>>)
>>  {
>> -  EFI_STATUS  Status;
>> -  UINT32  BlockSize;
>> -  EFI_LBA EndLBA;
>> -  EFI_LBA DescriptorLBAs[4];
>> -  UINTN   Index;
>> +  EFI_STATUS  Status;
>> +  UINT32  BlockSize;
>> +  EFI_LBA EndLBA;
>> +  EFI_LBA DescriptorLBAs[4];
>> +  UINTN   Index;
>> +  UDF_DESCRIPTOR_TAG  *DescriptorTag;
>> 
>>BlockSize = BlockIo->Media->BlockSize;
>>EndLBA = BlockIo->Media->LastBlock;
>> @@ -88,10 +89,13 @@ FindAnchorVolumeDescriptorPointer (
>>  if (EFI_ERROR (Status)) {
>>return Status;
>>  }
>> +
>> +DescriptorTag = >DescriptorTag;
>> +
>>  //
>>  // Check if read LBA has a valid AVDP descriptor.
>>  //
>> -if (IS_AVDP (AnchorPoint)) {
>> +if (DescriptorTag->TagIdentifier ==
>UdfAnchorVolumeDescriptorPointer) {
>>return EFI_SUCCESS;
>>  }
>>}
>> @@ -102,23 +106,18 @@ FindAnchorVolumeDescriptorPointer (
>>  }
>> 
>>  /**
>> -  Check if block device supports a valid UDF file system as
>specified by OSTA
>> -  Universal Disk Format Specification 2.60.
>> +  Find UDF volume identifiers in a Volume Recognition Sequence.
>> 
>> -  @param[in]   BlockIo  BlockIo interface.
>> -  @param[in]   DiskIo   DiskIo interface.
>> +  @param[in]  BlockIo BlockIo interface.
>> +  @param[in]  DiskIo  DiskIo interface.
>> 
>> -  @retval EFI_SUCCESS  UDF file system found.
>> -  @retval EFI_UNSUPPORTED  UDF file system not found.
>> -  @retval EFI_NO_MEDIA The device has no media.
>> -  @retval EFI_DEVICE_ERROR The device reported an error.
>> -  @retval EFI_VOLUME_CORRUPTED The file system structures are
>corrupted.
>> -  @retval EFI_OUT_OF_RESOURCES The scan was not successful due to
>lack of
>> -   resources.
>> +  @retval EFI_SUCCESS UDF volume identifiers were found.
>> +  @retval EFI_NOT_FOUND   UDF volume identifiers were not
>found.
>> +  @retval other   Failed to perform disk I/O.
>> 
>>  **/
>>  EFI_STATUS
>> -SupportUdfFileSystem (
>> +FindUdfVolumeIdentifiers (
>>IN EFI_BLOCK_IO_PROTOCOL  *BlockIo,
>>IN EFI_DISK_IO_PROTOCOL   *DiskIo
>>)
>> @@ -128,7 +127,6 @@ SupportUdfFileSystem (
>>UINT64EndDiskOffset;
>>CDROM_VOLUME_DESCRIPTOR   VolDescriptor;
>>CDROM_VOLUME_DESCRIPTOR   TerminatingVolDescriptor;
>> -  

Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Paulo Alcantara


On September 21, 2017 5:49:19 AM GMT-03:00, "Zeng, Star"  
wrote:
>VS2015 Build-tested-by: Star Zeng 
>
>I have a minor comment to this patch title, how about to use
>"MdeModulePkg/UDF: Fix creation of UDF logical partition" as this patch
>is touching both PartitionDxe and UdfDxe? Otherwise, you'd better to
>split this patch to two, one for PartitionDxe and one for UdfDxe.
>
>Since the patch could fix the issue we found, and if you agree my minor
>comment above, Reviewed-by: Star Zeng 

Thank you all for the tests! Star, I agree with you. Could you please fix the 
title for me? Also, please add Laszlo's Build-tested-by in the series.

Thanks!
Paulo

>
>
>Thanks,
>Star
>-Original Message-
>From: Wu, Hao A 
>Sent: Thursday, September 21, 2017 4:09 PM
>To: Paulo Alcantara ; edk2-devel@lists.01.org
>Cc: Ni, Ruiyu ; Laszlo Ersek ;
>Dong, Eric ; Zeng, Star 
>Subject: RE: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>creation of UDF logical partition
>
>I did a simple test on a Windows8.1 installation DVD, and here's the
>result
>of a map command under shell:
>
>Before the patch:
>Mapping table
>  FS0: Alias(s):CD0f65535a1:;BLK2:
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/CDROM(0x1)
> BLK0: Alias(s):
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)
> BLK1: Alias(s):
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/CDROM(0x0)
>  FS1: Alias(s):CD0f65535ab:;BLK5:
>PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/VenMedia(C5BD4D42-1A76-4996-8956-73CDA326CD0A)/CDROM(0x1)
> BLK3: Alias(s):
>PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/VenMedia(C5BD4D42-1A76-4996-8956-73CDA326CD0A)
> BLK4: Alias(s):
>PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/VenMedia(C5BD4D42-1A76-4996-8956-73CDA326CD0A)/CDROM(0x0)
>
>After the patch:
>Mapping table
>  FS0: Alias(s):CD0f65535a1:;BLK2:
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/CDROM(0x1)
> BLK0: Alias(s):
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)
> BLK1: Alias(s):
>  PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/CDROM(0x0)
> BLK3: Alias(s):
>PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x5,0x,0x0)/VenMedia(C5BD4D42-1A76-4996-8956-73CDA326CD0A)
>
>
>Since the additional file system is gone:
>Tested-by: Hao Wu 
>
>
>Best Regards,
>Hao Wu
>
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
>Of Paulo
>> Alcantara
>> Sent: Thursday, September 21, 2017 2:16 AM
>> To: edk2-devel@lists.01.org
>> Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
>> Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix
>creation of
>> UDF logical partition
>> 
>> Do not reserve entire block device size for an UDF file system -
>> instead, reserve the appropriate space (UDF logical volume space) for
>> it.
>> 
>> Additionally, only create a logical partition for UDF logical volumes
>> that are currently supported by EDK2 UDF file system implementation.
>For
>> instance, an UDF volume with a single LVD and a single Physical (Type
>1)
>> Partition will be supported.
>> 
>> Cc: Eric Dong 
>> Cc: Ruiyu Ni 
>> Cc: Star Zeng 
>> Cc: Laszlo Ersek 
>> Reported-by: Ruiyu Ni 
>> Contributed-under: TianoCore Contribution Agreement 1.1
>> Signed-off-by: Paulo Alcantara 
>> ---
>>  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363
>++--
>>  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>>  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
>> 
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158
>++---
>>  5 files changed, 606 insertions(+), 565 deletions(-)
>> 
>> diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> index 609f56cef6..572ba7a81a 100644
>> --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
>> @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
>>OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
>>)
>>  {
>> -  EFI_STATUS  Status;
>> -  UINT32  BlockSize;
>> -  EFI_LBA EndLBA;
>> -  EFI_LBA DescriptorLBAs[4];
>> -  UINTN   Index;
>> +  EFI_STATUS  Status;
>> +  UINT32  BlockSize;
>> +  EFI_LBA EndLBA;
>> +  EFI_LBA DescriptorLBAs[4];
>> +  UINTN   Index;
>> +  UDF_DESCRIPTOR_TAG  *DescriptorTag;
>> 
>>BlockSize = BlockIo->Media->BlockSize;
>>EndLBA = BlockIo->Media->LastBlock;
>> @@ -88,10 +89,13 @@ FindAnchorVolumeDescriptorPointer (
>>  if 

Re: [edk2] [RFC 0/6] Create central repository for boilerplate configuration

2017-09-21 Thread Kirkendall, Garrett
Something I have found useful is leaving the intended file extension at the end 
of the file name.  That way, you still know it is intended to be "!include"ed, 
but any editor file extensions you have set up still work on these files.

ConfigPkg/Security/Security.dsc.inc => ConfigPkg/Security/Security.inc.dsc

Since DSC can merge sections from different files, one *.inc.dsc file is 
sufficient with multiple sections.  
For FDF files, I've found that sections cannot be merged so it might be better 
to indicate where pieces are intended to be included *.pei.inc.fdf and 
*.dxe.inc.fdf.  Also, these files probably shouldn't contain section headers 
because you don't know what a platform might call the sections/FVs.  (general 
statements, not critique on this RFC)

This allows people to "!include" directly and know where the pieces are 
intended to go.  Plus it gives a quick view indication in the platform DSC and 
FDF files that things have been "!include"ed in the correct sections of the 
file.


Thanks,
GARRETT KIRKENDALL
SMTS Firmware Engineer | CTE
7171 Southwest Parkway, Austin, TX 78735 USA 
AMD   facebook  |  amd.com

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif Lindholm
> Sent: Wednesday, September 20, 2017 12:28 PM
> To: edk2-devel@lists.01.org
> Cc: Michael D Kinney ; Jordan Justen
> ; Laszlo Ersek ; Andrew Fish
> ; Ard Biesheuvel 
> Subject: [edk2] [RFC 0/6] Create central repository for boilerplate
> configuration
> 
> An awful lot of platform configuration is just repeated verbatim for every
> platform. This is my first stab at eliminating some of this redundancy.
> 
> I have additional bits as work in progress, but before I sink too much
> time into it, I would like to try to gather feedback on this approach (all
> the way down to directory structure).
> 
> This first round deals with basic network support and Secure Boot
> requirements.
> 
> Leif Lindholm (6):
>   ConfigPkg: add new package for holding common config fragments
>   ArmVirtPkg: use ConfigPkg for common network items
>   OvmfPkg: use ConfigPkg for common network items
>   ConfigPkg: add common Security settings
>   ArmVirtPkg: use ConfigPkg for common security items
>   OvmfPkg: use ConfigPkg for common security items
> 
>  ArmVirtPkg/ArmVirt.dsc.inc   | 25 ++
>  ArmVirtPkg/ArmVirtQemu.dsc   | 46 +++---
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 24 ++
>  ArmVirtPkg/ArmVirtQemuKernel.dsc | 46 +++---
>  ConfigPkg/Network/Network.dsc.inc| 92
> 
>  ConfigPkg/Network/Network.fdf.inc| 47 ++
>  ConfigPkg/Security/Security.dsc.inc  | 67 ++
> ConfigPkg/Security/Security.fdf.inc  | 17 +++
>  OvmfPkg/OvmfPkgIa32.dsc  | 92 ---
> -
>  OvmfPkg/OvmfPkgIa32.fdf  | 37 +--
>  OvmfPkg/OvmfPkgIa32X64.dsc   | 90 ---
> 
>  OvmfPkg/OvmfPkgIa32X64.fdf   | 37 +--
>  OvmfPkg/OvmfPkgX64.dsc   | 92 ---
> -
>  OvmfPkg/OvmfPkgX64.fdf   | 37 +--
>  14 files changed, 276 insertions(+), 473 deletions(-)  create mode 100644
> ConfigPkg/Network/Network.dsc.inc  create mode 100644
> ConfigPkg/Network/Network.fdf.inc  create mode 100644
> ConfigPkg/Security/Security.dsc.inc
>  create mode 100644 ConfigPkg/Security/Security.fdf.inc
> 
> --
> 2.11.0
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 11/11] Hisilicon D03/D05: Enlarge iATU for RP with ARI capable device.

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:57PM +0800, Heyi Guo wrote:
> From: Ming Huang 
> 
> 1. Because Hi161x chip doesn't support "ARI Forwarding Enable"
>function, BIOS will enumerate 32 same devices (Device Number 0~31)
>when attach a Non-ARI capable device in the RP. Hi161x chip will
>not fix it, need BIOS patch.
> 2. Just enlarge iatu for those root port with ARI capable device
>attached, Non-ARI capable device's RP, keep iatu limitation.
> 3. Remove previous temporary solution as below commit id:
>"7d157da88852cc91df2b11b10ade2edbbfbe77da"
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jason zhang 

Please adjust + add email addresses.
The content below is fine.

/
Leif

> ---
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c   |  1 +
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h   |  7 ++
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 79 
> 
>  3 files changed, 87 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c 
> b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> index e3d3988..9fa3f84 100644
> --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> @@ -839,6 +839,7 @@ NotifyPhase(
>  
>case EfiPciHostBridgeEndEnumeration:
>  PCIE_DEBUG("Case EfiPciHostBridgeEndEnumeration\n");
> +EnlargeAtuConfig0 (This);
>  break;
>  
>case EfiPciHostBridgeBeginBusAllocation:
> diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h 
> b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h
> index cddda6b..c04361f 100644
> --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h
> +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h
> @@ -401,6 +401,9 @@ PreprocessController (
>  #define EFI_RESOURCE_NONEXISTENT   0xULL
>  #define EFI_RESOURCE_LESS  0xFFFEULL
>  
> +#define  INVALID_CAPABILITY_00   0x00
> +#define  INVALID_CAPABILITY_FF   0xFF
> +#define  PCI_CAPABILITY_POINTER_MASK 0xFC
>  
>  //
>  // Driver Instance Data Prototypes
> @@ -518,4 +521,8 @@ RootBridgeConstructor (
>IN UINT32 Seg
>);
>  
> +VOID
> +EnlargeAtuConfig0 (
> +  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This
> +  );
>  #endif
> diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c 
> b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
> index 10d766a..b57bd51 100644
> --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
> +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
> @@ -14,6 +14,7 @@
>   **/
>  
>  #include "PciHostBridge.h"
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -2322,3 +2323,81 @@ RootBridgeIoConfiguration (
>return EFI_SUCCESS;
>  }
>  
> +BOOLEAN
> +PcieCheckAriFwdEn (
> +  UINTN  PciBaseAddr
> +  )
> +{
> +  UINT8   PciPrimaryStatus;
> +  UINT8   CapabilityOffset;
> +  UINT8   CapId;
> +  UINT8   TempData;
> +
> +  PciPrimaryStatus = MmioRead16 (PciBaseAddr + PCI_PRIMARY_STATUS_OFFSET);
> +
> +  if (PciPrimaryStatus & EFI_PCI_STATUS_CAPABILITY) {
> +CapabilityOffset = MmioRead8 (PciBaseAddr + 
> PCI_CAPBILITY_POINTER_OFFSET);
> +CapabilityOffset &= PCI_CAPABILITY_POINTER_MASK;
> +
> +while ((CapabilityOffset != INVALID_CAPABILITY_00) && (CapabilityOffset 
> != INVALID_CAPABILITY_FF)) {
> +  CapId = MmioRead8 (PciBaseAddr + CapabilityOffset);
> +  if (CapId == EFI_PCI_CAPABILITY_ID_PCIEXP) {
> +break;
> +  }
> +  CapabilityOffset = MmioRead8 (PciBaseAddr + CapabilityOffset + 1);
> +  CapabilityOffset &= PCI_CAPABILITY_POINTER_MASK;
> +}
> +  } else {
> +PCIE_DEBUG ("[%a:%d] - No PCIE Capability.\n", __FUNCTION__, __LINE__);
> +return FALSE;
> +  }
> +
> +  if ((CapabilityOffset == INVALID_CAPABILITY_FF) || (CapabilityOffset == 
> INVALID_CAPABILITY_00)) {
> +PCIE_DEBUG ("[%a:%d] - No PCIE Capability.\n", __FUNCTION__, __LINE__);
> +return FALSE;
> +  }
> +
> +  TempData = MmioRead16 (PciBaseAddr + CapabilityOffset +
> +  EFI_PCIE_CAPABILITY_DEVICE_CONTROL_2_OFFSET);
> +  TempData &= EFI_PCIE_CAPABILITY_DEVICE_CAPABILITIES_2_ARI_FORWARDING;
> +
> +  if (TempData == EFI_PCIE_CAPABILITY_DEVICE_CAPABILITIES_2_ARI_FORWARDING) {
> +return TRUE;
> +  } else {
> +return FALSE;
> +  }
> +}
> +
> +VOID
> +EnlargeAtuConfig0 (
> +  IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This
> +  )
> +{
> +  UINTN   RbPciBase;
> +  UINT64  MemLimit;
> +  LIST_ENTRY  *List;
> +  PCI_HOST_BRIDGE_INSTANCE*HostBridgeInstance;
> +  PCI_ROOT_BRIDGE_INSTANCE*RootBridgeInstance;
> +
> +  PCIE_DEBUG ("In Enlarge RP iatu Config 0.\n");
> +
> +  

Re: [edk2] [PATCH edk2-platforms v3 10/11] D05/ACPI: Modify I2C device

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:56PM +0800, Heyi Guo wrote:
> From: Ming Huang 

From: Ming Huang 

> 1. Disable I2C0 device avoiding access conflict in OS;
> 2. Modify _HID of I2C2 for matching the string in OS driver;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

+ Signed-off-by: Heyi Guo

> ---
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl | 20 
> +---
>  1 file changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl
> index eb906ef..3cc60d1 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl
> @@ -18,26 +18,8 @@
>  
>  Scope(_SB)
>  {
> -  Device(I2C0) {
> -Name(_HID, "APMC0D0F")
> -Name(_CID, "APMC0D0F")
> -Name(_CRS, ResourceTemplate() {
> -  Memory32Fixed(ReadWrite, 0xd00e, 0x1)
> -  Interrupt(ResourceConsumer, Level, ActiveHigh, Exclusive, 0, 
> "\\_SB.MBI6") { 705 }
> -})
> -Name (_DSD, Package () {
> -  ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> -  Package () {
> -Package () {"clock-frequency", 10},
> -Package () {"i2c-sda-falling-time-ns", 913},
> -Package () {"i2c-scl-falling-time-ns", 303},
> -Package () {"i2c-sda-hold-time-ns", 0x9c2},
> -  }
> -})
> -  }
> -
>Device(I2C2) {
> -Name(_HID, "APMC0D0F")
> +Name(_HID, "HISI02A1")
>  Name(_CID, "APMC0D0F")
>  Name(_CRS, ResourceTemplate() {
>Memory32Fixed(ReadWrite, 0xd010, 0x1)
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 09/11] D05/ACPI: Disable D05 SAS0 and SAS2

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:55PM +0800, Heyi Guo wrote:
> From: Ming Huang 

Can you ensure all "From: " tags use the proper huawei.com addresses?
Signed-off-by below is already correct.
Also, since you are sending these patches out, you should also add
your "Signed-off-by:" below that of the patch author. (Please double
check this on other patches where I have missed it.)

Apart from that, this patch is fine.

/
Leif

> 
> There are no interface from SAS0 and SAS2 controller on D05,
> so SAS0 and SAS2 can't be use.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
> index 93beb95..6455130 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
> @@ -88,6 +88,11 @@ Scope(_SB)
>Store(0x7, CLK)
>Sleep(1)
>  }
> +
> + Method (_STA, 0, NotSerialized)
> + {
> +   Return (0x0)
> + }
>}
>  
>Device(SAS1) {
> @@ -239,6 +244,11 @@ Scope(_SB)
>Store(0x7, CLK)
>Sleep(1)
>  }
> +
> + Method (_STA, 0, NotSerialized)
> + {
> +   Return (0x0)
> + }
>}
>  
>  }
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg/dmpstore: Show name of known variable vendor GUID

2017-09-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Wednesday, September 20, 2017 10:30 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Li, Huajing 
> Subject: RE: [PATCH] ShellPkg/dmpstore: Show name of known variable
> vendor GUID
> Importance: High
> 
> "Variable %H%s%N '%H%g%N:%H%s%N' DataSize = 0x%02x\r\n"
> "Variable %H%s%N '%H%s%N:%H%s%N' DataSize = 0x%02x\r\n"
> 
> HEADER_LINE dumps the GUID in hex format, using %g.
> HEADER_LINE2 dumps the GUID name, using %s.
> 
> Thanks/Ray
> 
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Monday, September 18, 2017 11:24 PM
> > To: Ni, Ruiyu ; edk2-devel@lists.01.org
> > Cc: Li, Huajing 
> > Subject: RE: [PATCH] ShellPkg/dmpstore: Show name of known variable
> > vendor GUID
> >
> > Whats the difference between HEADER_LINE and HEADER_LINE2?  They
> look
> > the same to me...
> >
> > > -Original Message-
> > > From: Ni, Ruiyu
> > > Sent: Sunday, September 17, 2017 11:42 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Li, Huajing ; Carsey, Jaben
> > > 
> > > Subject: [PATCH] ShellPkg/dmpstore: Show name of known variable
> > vendor
> > > GUID
> > > Importance: High
> > >
> > > From: Huajing Li 
> > >
> > > Change "dmpstore" to show name of known variable vendor GUID.
> > > The name is got from ShellProtocol.GetGuidName().
> > >
> > > Cc: Jaben Carsey 
> > > Reviewed-by: Ruiyu Ni 
> > > Contributed-under: TianoCore Contribution Agreement 1.1
> > > Signed-off-by: Huajing Li 
> > > ---
> > >  ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c  | 17
> > > +
> > >  .../UefiShellDebug1CommandsLib.uni  |  1 +
> > >  2 files changed, 14 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> > > index aeffc89b19..062ab5dc3a 100644
> > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
> > > @@ -424,6 +424,7 @@ CascadeProcessVariables (
> > >CHAR16*AttrString;
> > >CHAR16*HexString;
> > >EFI_STATUSSetStatus;
> > > +  CHAR16*GuidName;
> > >
> > >if (ShellGetExecutionBreakFlag()) {
> > >  return (SHELL_ABORTED);
> > > @@ -521,10 +522,18 @@ CascadeProcessVariables (
> > >  Status = EFI_OUT_OF_RESOURCES;
> > >}
> > >  } else {
> > > -  ShellPrintHiiEx (
> > > --1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE),
> > > gShellDebug1HiiHandle,
> > > -AttrString, , FoundVarName, DataSize
> > > -);
> > > +  Status = gEfiShellProtocol->GetGuidName(,
> > > );
> > > +  if (EFI_ERROR (Status)) {
> > > +ShellPrintHiiEx (
> > > +  -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE),
> > > gShellDebug1HiiHandle,
> > > +  AttrString, , FoundVarName, DataSize
> > > +  );
> > > +  } else {
> > > +ShellPrintHiiEx (
> > > +  -1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_HEADER_LINE2),
> > > gShellDebug1HiiHandle,
> > > +  AttrString, GuidName, FoundVarName, DataSize
> > > +  );
> > > +  }
> > >DumpHex (2, 0, DataSize, DataBuffer);
> > >  }
> > >  SHELL_FREE_NON_NULL (AttrString); diff --git
> > >
> >
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> > > dsLib.uni
> > >
> >
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> > > dsLib.uni
> > > index f733a67f0b..b6a133a454 100644
> > > ---
> > >
> >
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> > > dsLib.uni
> > > +++
> > >
> >
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
> > > dsLib.uni
> > > @@ -385,6 +385,7 @@
> > >  #string STR_DMPSTORE_LOAD_GEN_FAIL #language en-US "%H%s%N:
> > > Failed to set variable %H%s%N: %r.\r\n"
> > >  #string STR_DMPSTORE_LOAD_BAD_FILE #language en-US "%H%s%N:
> > > Incorrect file format.\r\n"
> > >  #string STR_DMPSTORE_HEADER_LINE   #language en-US "Variable
> > > %H%s%N '%H%g%N:%H%s%N' DataSize = 0x%02x\r\n"
> > > +#string STR_DMPSTORE_HEADER_LINE2  #language en-US "Variable
> > > %H%s%N '%H%s%N:%H%s%N' DataSize = 0x%02x\r\n"
> > >  #string STR_DMPSTORE_DELETE_LINE   #language en-US "Delete
> variable
> > > '%H%g%N:%H%s%N': %r\r\n"
> > >  #string STR_DMPSTORE_NO_VAR_FOUND  #language en-US
> "%H%s%N:
> > > No matching variables found.\r\n"
> > >  #string STR_DMPSTORE_NO_VAR_FOUND_SFO  #language en-US
> > > 

Re: [edk2] Shell input redirection question

2017-09-21 Thread Carsey, Jaben
If the requirement for PCI to display the information when there are no 
parameters present, I see no reason that it could not also use a file for 
input.  i.e. "pci" must act according to the spec, but "pci < inputfile" is not 
prohibited.  I think that as no code currently uses PCI with file input as long 
as current behavior still works it should be fine.

I would think that would be a great improvement for the PCI command.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim.dai...@dell.com
> Sent: Thursday, September 21, 2017 4:52 AM
> To: tiger...@zhaoxin.com
> Cc: edk2-devel@lists.01.org
> Subject: Re: [edk2] Shell input redirection question
> Importance: High
> 
> The shell's pci command was not written to read from standard input. It
> expects all its input on the command line.
> 
> I would say in general that if you execute a command and pass it no
> parameters, and it then prompts you in some way for input, then that
> command will likely accept input redirected from a file.
> 
> If you execute pci without any parameters, it simply lists all the
> devices in the system and terminates, so it clearly is not prepared to
> read from standard input (or a redirected file).
> 
> It is strictly up to whomever writes a program/command whether they do
> so in a manner that allows it to accept input from standard input. For
> example, I have written a grep utility for the shell that expects one or
> more filenames to search to be on the command line; however, if there
> are no filenames on the command line, the utility searches standard
> input.
> 
> Regards,
> Jim
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Tiger Liu
> Sent: Thursday, September 21, 2017 1:11 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Shell input redirection question
> 
> Hi, experts:
> I have a question about input redirection in Shell environment.
> 
> Take pci command as sample.
> I wrote a txt file(file name is : inputsample.txt), its content is:
> 00 00 01 -i
> 00 00 02 –i
> 
> It means I just wanted to dump D0F1/D0F2’s config space.
> 
> Then, I use this command sequence in shell :
> pci  
> But it seems not recognize this input file’s content.
> 
> Why?
> 
> Thanks
> 
> best wishes,
> 
> 
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件
> 或其内容做任何未经授权的查阅、使用、复制或转发。
> CONFIDENTIAL NOTE:
> This email contains confidential or legally privileged information and is for 
> the
> sole use of its intended recipient. Any unauthorized review, use, copying or
> forwarding of this email or the content of this email is strictly prohibited.
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 08/11] Hisilicon/D03: Disable the function of PerfTuning

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:54PM +0800, Heyi Guo wrote:
> From: Chenhui Sun 
> 
> The PerTuning function is not stable, it will cause the
> 3008/3108 crash, disable this function first.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Chenhui Sun 

I do not see any of my comments from previous revision addressed, and
I received no reply. Feedback was:
---
Should this not also delete the PciPerfTuning() function from
PcieInitLib.c, and the declaration of
gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable from HisiPkg.dec?
---

/
Leif

> ---
>  Platform/Hisilicon/D03/D03.dsc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
> index fca6781..ac880d9 100644
> --- a/Platform/Hisilicon/D03/D03.dsc
> +++ b/Platform/Hisilicon/D03/D03.dsc
> @@ -112,7 +112,7 @@
>#  It could be set FALSE to save size.
>gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
>gHisiTokenSpaceGuid.PcdIsItsSupported|TRUE
> -  gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|TRUE
> +  gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|FALSE
>  
>  [PcdsFixedAtBuild.common]
>gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"D03"
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 07/11] D05/PCIe: Modify PcieRegionBase of secondary chip

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:52PM +0800, Heyi Guo wrote:
> From: huangming 
> 
> On D05 PCIe now, 2p NA PCIe2 and 2p NB PCIe0's pci domain addresses are
> 0x2000 and 0x3000 based. These addresses overlap with the DDR
> memory range 0-1G. In this situation, on the inbound direction, our pcie
> will drop the DDR address access that are located in the pci range window
> and lead to a dataflow error.
> 
> Modify 2p NA PCIe2 and 2p NB PCIe0's pci domain addresses to 0x4000
> and decrease PciRegion Size accordingly.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Thanks - this patch is a lot cleaner when ordered after the previous
one.

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D05/D05.dsc | 12 ++--
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl |  8 
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 01defe0..64101a7 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -329,12 +329,12 @@
>gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionBaseAddress|0x400a940
>gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbf
> -  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x2000
> -  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xd000
> +  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x4000
> +  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xb000
>gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionBaseAddress|0x400ab40
>gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbf
> -  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x3000
> -  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xc000
> +  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x4000
> +  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xb000
>gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionBaseAddress|0x4000
>gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xb000
>gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionBaseAddress|0x408aa40
> @@ -352,9 +352,9 @@
>gHisiTokenSpaceGuid.PcdHb0Rb7CpuMemRegionBase|0x8B980
>gHisiTokenSpaceGuid.PcdHb1Rb0CpuMemRegionBase|0x400A840
>gHisiTokenSpaceGuid.PcdHb1Rb1CpuMemRegionBase|0x400A940
> -  gHisiTokenSpaceGuid.PcdHb1Rb2CpuMemRegionBase|0x6502000
> +  gHisiTokenSpaceGuid.PcdHb1Rb2CpuMemRegionBase|0x6504000
>gHisiTokenSpaceGuid.PcdHb1Rb3CpuMemRegionBase|0x400AB40
> -  gHisiTokenSpaceGuid.PcdHb1Rb4CpuMemRegionBase|0x7503000
> +  gHisiTokenSpaceGuid.PcdHb1Rb4CpuMemRegionBase|0x7504000
>gHisiTokenSpaceGuid.PcdHb1Rb5CpuMemRegionBase|0x7904000
>gHisiTokenSpaceGuid.PcdHb1Rb6CpuMemRegionBase|0x408AA40
>gHisiTokenSpaceGuid.PcdHb1Rb7CpuMemRegionBase|0x408AB40
> diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl 
> b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
> index 79267e5..55c7f50 100644
> --- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
> +++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
> @@ -646,10 +646,10 @@ Scope(_SB)
>Cacheable,
>ReadWrite,
>0x0, // Granularity
> -  0x2000, // Min Base Address
> +  0x4000, // Min Base Address
>0xefff, // Max Base Address
>0x650, // Translate
> -  0xd000 // Length
> +  0xb000 // Length
>  )
>  QWordIO (
>ResourceProducer,
> @@ -766,10 +766,10 @@ Scope(_SB)
>Cacheable,
>ReadWrite,
>0x0, // Granularity
> -  0x3000, // Min Base Address
> +  0x4000, // Min Base Address
>0xefff, // Max Base Address
>0x750, // Translate
> -  0xc000 // Length
> +  0xb000 // Length
>  )
>  QWordIO (
>ResourceProducer,
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 06/11] Hisilicon/D05/Pcie: fix bug of size definition

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:50PM +0800, Heyi Guo wrote:
> From: huangming 
> 
> Fix bug of PcieRegion size definition and IO size definition.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D05/D05.dsc | 64 ++--
>  1 file changed, 32 insertions(+), 32 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index aa61c0e..01defe0 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -310,37 +310,37 @@
>gHisiTokenSpaceGuid.PciHb1Rb7Base|0x700a00b
>  
>gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionBaseAddress|0xa840
> -  gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionBaseAddress|0xa940
> -  gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionBaseAddress|0xa880
> -  gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionSize|0x77e
> +  gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionSize|0x77f
>gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionBaseAddress|0xab40
> -  gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionBaseAddress|0xa900
> -  gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionSize|0x2fe
> +  gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionSize|0x2ff
>gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionBaseAddress|0xb080
> -  gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionSize|0x77e
> +  gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionSize|0x77f
>gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionBaseAddress|0xac90
> -  gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionSize|0x36e
> +  gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionSize|0x36f
>gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionBaseAddress|0xb980
> -  gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionSize|0x67e
> +  gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionSize|0x67f
>gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionBaseAddress|0x400a840
> -  gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionBaseAddress|0x400a940
> -  gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x2000
> -  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xcfff
> +  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xd000
>gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionBaseAddress|0x400ab40
> -  gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x3000
> -  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xbfff
> +  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xc000
>gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionBaseAddress|0x4000
> -  gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xafff
> +  gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xb000
>gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionBaseAddress|0x408aa40
> -  gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionSize|0xbf
>gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionBaseAddress|0x408ab40
> -  gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionSize|0xbe
> +  gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionSize|0xbf
>  
>gHisiTokenSpaceGuid.PcdHb0Rb0CpuMemRegionBase|0xA840
>gHisiTokenSpaceGuid.PcdHb0Rb1CpuMemRegionBase|0xA940
> @@ -377,52 +377,52 @@
>gHisiTokenSpaceGuid.PcdHb1Rb7CpuIoRegionBase|0x408abff
>  
>gHisiTokenSpaceGuid.PcdHb0Rb0IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb0IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb0IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb1IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb1IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb1IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb2IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb2IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb2IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb3IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb3IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb3IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb4IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb4IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb4IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb5IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb5IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb5IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb6IoBase|0
> -  gHisiTokenSpaceGuid.PcdHb0Rb6IoSize|0x #64K
> +  gHisiTokenSpaceGuid.PcdHb0Rb6IoSize|0x1 #64K
>  
>gHisiTokenSpaceGuid.PcdHb0Rb7IoBase|0
> -  

Re: [edk2] [PATCH edk2-platforms v3 04/11] Hisilicon D03/D05: get firmware version from FIRMWARE_VER

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:46PM +0800, Heyi Guo wrote:
> From: Ming Huang 
> 
> Value of the environment variable FIRMWARE_VER is GIT SHA by default,
> and you can add the environment variable FIRMWARE_VER to EXTRA_OPTIONS
> at build time to specify something else, eg. "16.12-".
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D03/D03.dsc | 6 +-
>  Platform/Hisilicon/D05/D05.dsc | 6 +-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
> index 7e25ffb..fca6781 100644
> --- a/Platform/Hisilicon/D03/D03.dsc
> +++ b/Platform/Hisilicon/D03/D03.dsc
> @@ -170,7 +170,11 @@
>gHisiTokenSpaceGuid.PcdAlgSmmuBaseAddress|0xd004
>  
>  
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D03 
> UEFI 16.12 Release"
> +  !ifdef $(FIRMWARE_VER)
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
> +  !else
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build base on Hisilicon D03 UEFI 17.10 Release"
> +  !endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
>  
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 7cd5758..aa61c0e 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -188,7 +188,11 @@
>  
>gHisiTokenSpaceGuid.PcdIsMPBoot|1
>gHisiTokenSpaceGuid.PcdSocketMask|0x3
> -  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D05 
> UEFI 16.12 Release"
> +  !ifdef $(FIRMWARE_VER)
> +
> gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
> +  !else
> +gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
> build base on Hisilicon D05 UEFI 17.10 Release"
> +  !endif
>  
>gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
>  
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 02/11] Hisilicon/D03: Modify dsc and fdf file

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:42PM +0800, Heyi Guo wrote:
> 1. Add Drivers/SasPlatform;
> 2. Add Drivers/Net/SnpPlatform;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D03/D03.dsc | 5 -
>  Platform/Hisilicon/D03/D03.fdf | 5 -
>  2 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
> index afea162..7e25ffb 100644
> --- a/Platform/Hisilicon/D03/D03.dsc
> +++ b/Platform/Hisilicon/D03/D03.dsc
> @@ -418,11 +418,6 @@
>  
>Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.inf
>  
> -  #
> -  #network
> -  #
> -  Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> -
>MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
>MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
>MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> diff --git a/Platform/Hisilicon/D03/D03.fdf b/Platform/Hisilicon/D03/D03.fdf
> index b62b908..b53bdca 100644
> --- a/Platform/Hisilicon/D03/D03.fdf
> +++ b/Platform/Hisilicon/D03/D03.fdf
> @@ -242,7 +242,8 @@ READ_LOCK_STATUS   = TRUE
>#Network
>#
>  
> -  INF Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> +  INF Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
> +  INF Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
>  
>INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
>INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> @@ -271,6 +272,7 @@ READ_LOCK_STATUS   = TRUE
>#
>INF Platform/Hisilicon/D03/Drivers/Sm750Dxe/UefiSmi.inf
>  
> +  INF Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf
>INF Platform/Hisilicon/D03/Drivers/Sas/SasDxeDriver.inf
>  
>#
> @@ -278,6 +280,7 @@ READ_LOCK_STATUS   = TRUE
>#
>INF ShellPkg/Application/Shell/Shell.inf
>  
> +

This spurious whitespace change is still here. Please delete for v4.
Other than that, the patch is fine.

/
Leif

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


Re: [edk2] [PATCH edk2-platforms v3 01/11] Hisilicon/D05: Modify dsc and fdf file

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:41PM +0800, Heyi Guo wrote:
> 1. Add Drivers/SasPlatform;
> 2. Add Drivers/Net/SnpPlatform;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Platform/Hisilicon/D05/D05.dsc | 5 -
>  Platform/Hisilicon/D05/D05.fdf | 4 +++-
>  2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
> index 3cdb1b1..7cd5758 100644
> --- a/Platform/Hisilicon/D05/D05.dsc
> +++ b/Platform/Hisilicon/D05/D05.dsc
> @@ -538,11 +538,6 @@
>  
>Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
>  
> -  #
> -  #network
> -  #
> -  Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> -
>MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
>MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
>MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
> diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
> index b6d0e42..a5e6546 100644
> --- a/Platform/Hisilicon/D05/D05.fdf
> +++ b/Platform/Hisilicon/D05/D05.fdf
> @@ -247,7 +247,8 @@ READ_LOCK_STATUS   = TRUE
>#Network
>#
>  
> -  INF Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> +  INF Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
> +  INF Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
>  
>INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
>INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
> @@ -292,6 +293,7 @@ READ_LOCK_STATUS   = TRUE
>#
>INF Platform/Hisilicon/D05/Drivers/Sm750Dxe/UefiSmi.inf
>INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
> +  INF Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
>INF Platform/Hisilicon/D05/Drivers/Sas/SasDxeDriver.inf
>  
>#
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-non-osi v3 5/7] Hisilicon/D05/Sas: Add SasPlatform

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:48PM +0800, Heyi Guo wrote:
> Install protocol to enable sas port which is using and
> transmit base address info of sas port to SasDriverDxe.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi | Bin 0 -> 3424 
> bytes
>  Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf |  24 
> 

Another small piece of code - can we have an open source version?

>  2 files changed, 24 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi 
> b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi
> new file mode 100644
> index 000..d2685ab
> Binary files /dev/null and 
> b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi differ
> diff --git a/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf 
> b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
> new file mode 100644
> index 000..636be19
> --- /dev/null
> +++ b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. All rights reserved.
> +#
> +#This program and the accompanying materials
> +#are licensed and made available under the terms and conditions of the 
> BSD License
> +#which accompanies this distribution. The full text of the license may 
> be found at
> +#http://opensource.org/licenses/bsd-license.php
> +#
> +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x00010019
> +  BASE_NAME  = SasPlatform
> +  FILE_GUID  = 102D8FC9-20a4-42EB-aC14-1C98BA5b26A4
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +
> +[Binaries]

[Binaries.AARCH64]

> +  PE32|SasPlatform.efi|*
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-non-osi v3 6/7] Hisilicon/D05: Update binary file

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:51PM +0800, Heyi Guo wrote:
> Fix bug 3061: D05(before EC) boot hangs at "Need Reset";
> 
> Update binary file for edk2 upgrade.
>   1. Replace UncachedMemoryAllocationLib with DmaLib;
>   2. Remove ArmCpuLib dependenc;
>   3. Remove ConvertToPhysicalAddress;
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
>   | Bin 19552 -> 5024 bytes
>  Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi
>   | Bin 25696 -> 7680 bytes
>  Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
>   | Bin 22528 -> 5344 bytes
>  Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi  
>   | Bin 23136 -> 5280 bytes
>  Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi   
>   | Bin 15968 -> 2592 bytes
>  Platform/Hisilicon/D05/Drivers/OhciDxe/NativeOhci.efi
>   | Bin 48000 -> 23328 bytes
>  
> Platform/Hisilicon/D05/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.efi
>  | Bin 21536 -> 4032 bytes
>  Platform/Hisilicon/D05/Drivers/SFC/SFCDriver.efi 
>   | Bin 262144 -> 262144 bytes
>  Platform/Hisilicon/D05/Drivers/Sas/SasDriverDxe.efi  
>   | Bin 230912 -> 116288 bytes
>  Platform/Hisilicon/D05/Drivers/Sm750Dxe/SmiGraphicsOutput.efi
>   | Bin 35904 -> 18592 bytes
>  Platform/Hisilicon/D05/Drivers/TransferSmbiosInfo/TransSmbiosInfo.efi
>   | Bin 16576 -> 4288 bytes
>  Platform/Hisilicon/D05/Library/OemAddressMapD05/OemAddressMapD05.lib 
>   | Bin 42136 -> 52968 bytes
>  Platform/Hisilicon/D05/MemoryInitPei/MemoryInit.efi  
>   | Bin 273312 -> 152576 bytes

>  Platform/Hisilicon/D05/Sec/FVMAIN_SEC.Fv 
>   | Bin 262144 -> 262144 bytes
>  Platform/Hisilicon/D05/bl1.bin   
>   | Bin 12296 -> 14344 bytes
>  Platform/Hisilicon/D05/fip.bin   
>   | Bin 41493 -> 41493 bytes

Like for D03 - I guess this means ARM Trusted Firmware update. Can it
be a separate patch and describe the commit hash it was produced from?
Does the (bugs.linaro.org) 3061 fix also belong to these files?

/
Leif

>  Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.lib
>   | Bin 707246 -> 726884 bytes
>  
> Silicon/Hisilicon/Hi1616/Library/PlatformSysCtrlLibHi1616/PlatformSysCtrlLibHi1616.lib
>  | Bin 358602 -> 344310 bytes
>  18 files changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
> b/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi
> index 6f117e2..a0fa8c8 100644
> Binary files 
> a/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi and 
> b/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi differ
> diff --git 
> a/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi 
> b/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi
> index 139658c..9b4e23e 100644
> Binary files 
> a/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi 
> and 
> b/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.efi 
> differ
> diff --git 
> a/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> b/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
> index c3d28ec..5bf6ded 100644
> Binary files 
> a/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> and 
> b/Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> differ
> diff --git a/Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
> b/Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi
> index 96d1680..3092139 100644
> Binary files a/Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
> and b/Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi differ
> diff --git 
> a/Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi 
> b/Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi
> index 029ce97..ece5615 100644
> Binary files 
> a/Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi and 
> b/Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi differ
> diff --git a/Platform/Hisilicon/D05/Drivers/OhciDxe/NativeOhci.efi 
> b/Platform/Hisilicon/D05/Drivers/OhciDxe/NativeOhci.efi
> index dcabce2..9e7dd0e 100644
> Binary files a/Platform/Hisilicon/D05/Drivers/OhciDxe/NativeOhci.efi and 
> b/Platform/Hisilicon/D05/Drivers/OhciDxe/NativeOhci.efi differ
> diff --git 
> 

Re: [edk2] [PATCH edk2-platforms v3 05/11] Hisilicon/PciHostBridgeDxe: Assign BAR resource from PciRegionBase

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:49PM +0800, Heyi Guo wrote:
> Io BAR should be based IoBase and Mem BAR should be based PciRegionBase.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

Reviewed-by: Leif Lindholm 

> ---
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c   | 37 
> 
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 15 ++--
>  2 files changed, 35 insertions(+), 17 deletions(-)
> 
> diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c 
> b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> index a970da6..e3d3988 100644
> --- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> +++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
> @@ -1410,9 +1410,8 @@ SetResource(
>  Ptr->ResType = 1;
>  Ptr->GenFlag = 0;
>  Ptr->SpecificFlag = 0;
> -/* This is PCIE Device Bus which start address is the low 32bit of 
> mem base*/
> -Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase) +
> -(RootBridgeInstance->MemBase & 0x);
> +/* PCIE Device Iobar address should be based on IoBase */
> +Ptr->AddrRangeMin = RootBridgeInstance->IoBase;
>  Ptr->AddrRangeMax = 0;
>  Ptr->AddrTranslationOffset = \
>   (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
> EFI_RESOURCE_LESS;
> @@ -1429,9 +1428,13 @@ SetResource(
>  Ptr->GenFlag = 0;
>  Ptr->SpecificFlag = 0;
>  Ptr->AddrSpaceGranularity = 32;
> -/* This is PCIE Device Bus which start address is the low 32bit of 
> mem base*/
> -Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase) +
> - (RootBridgeInstance->MemBase & 0x);
> +/* PCIE device Bar should be based on PciRegionBase */
> +if (RootBridgeInstance->PciRegionBase > MAX_UINT32) {
> +  DEBUG((DEBUG_ERROR, "PCIE Res(TypeMem32) unsupported.\n"));
> +  return EFI_UNSUPPORTED;
> +}
> +Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase +
> +RootBridgeInstance->PciRegionBase;
>  Ptr->AddrRangeMax = 0;
>  Ptr->AddrTranslationOffset = \
>   (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
> EFI_RESOURCE_LESS;
> @@ -1448,9 +1451,13 @@ SetResource(
>  Ptr->GenFlag = 0;
>  Ptr->SpecificFlag = 6;
>  Ptr->AddrSpaceGranularity = 32;
> -/* This is PCIE Device Bus which start address is the low 32bit of 
> mem base*/
> -Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase) +
> - (RootBridgeInstance->MemBase & 0x);
> +/* PCIE device Bar should be based on PciRegionBase */
> +if (RootBridgeInstance->PciRegionBase > MAX_UINT32) {
> +  DEBUG((DEBUG_ERROR, "PCIE Res(TypePMem32) unsupported.\n"));
> +  return EFI_UNSUPPORTED;
> +}
> +Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase +
> +RootBridgeInstance->PciRegionBase;
>  Ptr->AddrRangeMax = 0;
>  Ptr->AddrTranslationOffset = \
>   (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
> EFI_RESOURCE_LESS;
> @@ -1467,9 +1474,9 @@ SetResource(
>  Ptr->GenFlag = 0;
>  Ptr->SpecificFlag = 0;
>  Ptr->AddrSpaceGranularity = 64;
> -/* This is PCIE Device Bus which start address is the low 32bit of 
> mem base*/
> -Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase) +
> - (RootBridgeInstance->MemBase & 
> 0x);
> +/* PCIE device Bar should be based on PciRegionBase */
> +Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase +
> +RootBridgeInstance->PciRegionBase;
>  Ptr->AddrRangeMax = 0;
>  Ptr->AddrTranslationOffset = \
>   (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
> EFI_RESOURCE_LESS;
> @@ -1486,9 +1493,9 @@ SetResource(
>  Ptr->GenFlag = 0;
>  Ptr->SpecificFlag = 6;
>  Ptr->AddrSpaceGranularity = 64;
> -/* This is PCIE Device Bus which start address is the low 32bit of 
> mem base*/
> -Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
> RootBridgeInstance->MemBase) +
> - (RootBridgeInstance->MemBase & 
> 0x);
> +/* PCIE device Bar should be based on PciRegionBase */
> +Ptr->AddrRangeMin = 

Re: [edk2] [PATCH edk2-non-osi v3 4/7] Hisilicon/D05/Net: Update Snp driver

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:47PM +0800, Heyi Guo wrote:
> 1. Replace SnpPV660Dxe with SnpPV600Dxe;
> 2. Add SnpPlatform:
>  Install protocol to enable nic port which are using.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi | Bin 0 -> 
> 28544 bytes
>  Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf |  24 
> +
>  Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi | Bin 56512 
> -> 0 bytes
>  Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf |  27 
> 
>  Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi | Bin 0 -> 
> 3392 bytes
>  Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf |  24 
> +
>  6 files changed, 48 insertions(+), 27 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi
> new file mode 100644
> index 000..bc7942a
> Binary files /dev/null and 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi differ
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
> new file mode 100644
> index 000..cd7c724
> --- /dev/null
> +++ b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. All rights reserved.
> +#
> +#This program and the accompanying materials
> +#are licensed and made available under the terms and conditions of the 
> BSD License
> +#which accompanies this distribution. The full text of the license may 
> be found at
> +#http://opensource.org/licenses/bsd-license.php
> +#
> +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x00010019
> +  BASE_NAME  = SnpPV600Dxe
> +  FILE_GUID  = 3247F15F-3612-4803-BD4E-4104D7EF944A
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +
> +[Binaries]

[Binaries.AARCH64]

> +  PE32|SnpPV600Dxe.efi|*
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi
> deleted file mode 100644
> index c54538f..000
> Binary files a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
> and /dev/null differ
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> deleted file mode 100644
> index 98cc3b8..000
> --- a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#/** @file
> -#
> -#Copyright (c) 2016, Hisilicon Limited. All rights reserved.
> -#Copyright (c) 2016-2017, Linaro Limited. All rights reserved.
> -#
> -#This program and the accompanying materials
> -#are licensed and made available under the terms and conditions of the 
> BSD License
> -#which accompanies this distribution. The full text of the license may 
> be found at
> -#http://opensource.org/licenses/bsd-license.php
> -#
> -#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> -#
> -#**/
> -
> -[Defines]
> -  INF_VERSION= 0x00010019
> -  BASE_NAME  = SnpPV600Dxe
> -  FILE_GUID  = 85F85FDE-FDA1-465A-B22E-488F1A6F966C
> -  MODULE_TYPE= UEFI_DRIVER
> -  VERSION_STRING = 1.0
> -
> -  ENTRY_POINT= InitializeSnpPV600Driver
> -  UNLOAD_IMAGE   = SnpPV600Unload
> -
> -[Binaries]
> -  PE32|SnpPV600Dxe.efi|*
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi
> new file mode 100644
> index 000..42c26de
> Binary files /dev/null and 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi differ
> diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf 
> b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
> new file mode 100644
> index 000..fd53a79
> --- /dev/null
> +++ b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. All rights reserved.
> +#
> +#This program and the accompanying 

Re: [edk2] [PATCH edk2-non-osi v3 3/7] Hisilicon/D03: Update binary file

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:44PM +0800, Heyi Guo wrote:
> Update binary file for edk2 upgrade.
> 1. Replace UncachedMemoryAllocationLib with DmaLib;
> 2. Remove ArmCpuLib dependenc;
> 3. Remove ConvertToPhysicalAddress;

OK, this is fine for the EDK2 bits, but:

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
>   | Bin 21696 -> 4768 bytes
>  Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
>   | Bin 22208 -> 4672 bytes
>  Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi
>   | Bin 25440 -> 6784 bytes
>  Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi  
>   | Bin 23712 -> 4896 bytes
>  Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi   
>   | Bin 18080 -> 2304 bytes
>  Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi
>   | Bin 48352 -> 21664 bytes
>  
> Platform/Hisilicon/D03/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.efi
>  | Bin 22112 -> 3712 bytes
>  Platform/Hisilicon/D03/Drivers/SFC/SFCDriver.efi 
>   | Bin 262144 -> 262144 bytes
>  Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi  
>   | Bin 208288 -> 98144 bytes
>  Platform/Hisilicon/D03/Drivers/Sm750Dxe/SmiGraphicsOutput.efi
>   | Bin 36480 -> 17728 bytes
>  Platform/Hisilicon/D03/Drivers/TransferSmbiosInfo/TransSmbiosInfo.efi
>   | Bin 21408 -> 4000 bytes
>  Platform/Hisilicon/D03/Library/OemAddressMap2P/OemAddressMap2P.lib   
>   | Bin 19486 -> 20550 bytes
>  Platform/Hisilicon/D03/MemoryInitPei/MemoryInit.efi  
>   | Bin 161280 -> 90272 bytes

>  Platform/Hisilicon/D03/Sec/FVMAIN_SEC.Fv 
>   | Bin 262144 -> 262144 bytes
>  Platform/Hisilicon/D03/bl1.bin   
>   | Bin 14336 -> 14336 bytes
>  Platform/Hisilicon/D03/fip.bin   
>   | Bin 45601 -> 62513 bytes

What is the update for the above three?
I guess this bumps the version of ARM Trusted Firmware. Can we have a
reference to the internal commit hash this is generated from?

(May make more sense as a separate patch.)

/
Leif

>  Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.lib
>   | Bin 603524 -> 587188 bytes
>  Silicon/Hisilicon/Hi1610/Library/IpmiCmdLib/IpmiCmdLib.lib   
>   | Bin 247176 -> 210280 bytes
>  Silicon/Hisilicon/Hi1610/Library/LpcLib/LpcLib.lib   
>   | Bin 13998 -> 13958 bytes
>  
> Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.lib
>  | Bin 305230 -> 297590 bytes
>  Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib  
>   | Bin 17022 -> 16942 bytes
>  21 files changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
> b/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi
> index 269243a..12640f2 100644
> Binary files 
> a/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi and 
> b/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi differ
> diff --git 
> a/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> b/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
> index c197895..d2565c8 100644
> Binary files 
> a/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> and 
> b/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
> differ
> diff --git 
> a/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi 
> b/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi
> index 6201971..0d8ff52 100644
> Binary files 
> a/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi 
> and 
> b/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi 
> differ
> diff --git a/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
> b/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi
> index 7409fcb..b85c19b 100644
> Binary files a/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
> and b/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi differ
> diff --git 
> a/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi 
> b/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi
> index a9238b1..89c4b5b 100644
> Binary files 
> a/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi and 
> 

Re: [edk2] [PATCH edk2-non-osi v3 1/7] Hisilicon/D03/Net: Update Snp driver

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:40PM +0800, Heyi Guo wrote:
> 1. Replace SnpPV660Dxe with SnpPV600Dxe;
> 2. Add SnpPlatform:
>  Install protocol to enable nic port which are using.

OK, that sort of explains what it is doing. Let's discuss a bit more
during Connect. Two comments below.

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 
> ---
>  Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi | Bin 0 -> 
> 26688 bytes
>  Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf |  24 
> +
>  Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi | Bin 56832 
> -> 0 bytes
>  Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf |  27 
> 
>  Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi | Bin 0 -> 
> 3040 bytes
>  Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf |  24 
> +

This SnpPlatform.efi looks like a very simple piece of code. Could it
be made open source?

>  6 files changed, 48 insertions(+), 27 deletions(-)
> 
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi
> new file mode 100644
> index 000..8ce6a6d
> Binary files /dev/null and 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi differ
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
> new file mode 100644
> index 000..cd7c724
> --- /dev/null
> +++ b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. All rights reserved.
> +#
> +#This program and the accompanying materials
> +#are licensed and made available under the terms and conditions of the 
> BSD License
> +#which accompanies this distribution. The full text of the license may 
> be found at
> +#http://opensource.org/licenses/bsd-license.php
> +#
> +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x00010019
> +  BASE_NAME  = SnpPV600Dxe
> +  FILE_GUID  = 3247F15F-3612-4803-BD4E-4104D7EF944A
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +
> +[Binaries]
> +  PE32|SnpPV600Dxe.efi|*
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi
> deleted file mode 100644
> index eb69403..000
> Binary files a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
> and /dev/null differ
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> deleted file mode 100644
> index 204ef17..000
> --- a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
> +++ /dev/null
> @@ -1,27 +0,0 @@
> -#/** @file
> -#
> -#Copyright (c) 2016, Hisilicon Limited. All rights reserved.
> -#Copyright (c) 2016-2017, Linaro Limited. All rights reserved.
> -#
> -#This program and the accompanying materials
> -#are licensed and made available under the terms and conditions of the 
> BSD License
> -#which accompanies this distribution. The full text of the license may 
> be found at
> -#http://opensource.org/licenses/bsd-license.php
> -#
> -#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> -#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> -#
> -#**/
> -
> -[Defines]
> -  INF_VERSION= 0x00010005
> -  BASE_NAME  = SnpPV600Dxe
> -  FILE_GUID  = 92D37768-571C-48d9-BEF5-9744AE2FDAF4
> -  MODULE_TYPE= UEFI_DRIVER
> -  VERSION_STRING = 1.0
> -
> -  ENTRY_POINT= InitializeSnpPV600Driver
> -  UNLOAD_IMAGE   = SnpPV600Unload
> -
> -[Binaries]
> -  PE32|SnpPV600Dxe.efi|*
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi
> new file mode 100644
> index 000..5e7d8bd
> Binary files /dev/null and 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi differ
> diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf 
> b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
> new file mode 100644
> index 000..fd53a79
> --- /dev/null
> +++ b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#

Re: [edk2] [PATCH edk2-non-osi v3 2/7] Hisilicon/D03/Sas: Add SasPlatform

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:43PM +0800, Heyi Guo wrote:
> Install protocol to enable sas port which is using and
> transmit base address info of sas port to SasDriverDxe.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ming Huang 

On the whole, I'm OK with this - but:

1) This looks like a very simple piece of code, at a low risk to
   reveal anything confidential about Hisilicon IP. Can this be
   made open source?

> ---
>  Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.efi | Bin 0 -> 3040 
> bytes
>  Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf |  24 
> 
>  2 files changed, 24 insertions(+)
> 
> diff --git a/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.efi 
> b/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.efi
> new file mode 100644
> index 000..4255641
> Binary files /dev/null and 
> b/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.efi differ
> diff --git a/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf 
> b/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf
> new file mode 100644
> index 000..636be19
> --- /dev/null
> +++ b/Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf
> @@ -0,0 +1,24 @@
> +#/** @file
> +#
> +#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
> +#Copyright (c) 2017, Linaro Limited. All rights reserved.
> +#
> +#This program and the accompanying materials
> +#are licensed and made available under the terms and conditions of the 
> BSD License
> +#which accompanies this distribution. The full text of the license may 
> be found at
> +#http://opensource.org/licenses/bsd-license.php
> +#
> +#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +#**/
> +
> +[Defines]
> +  INF_VERSION= 0x00010019
> +  BASE_NAME  = SasPlatform
> +  FILE_GUID  = 102D8FC9-20a4-42EB-aC14-1C98BA5b26A4
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +
> +[Binaries]

2) [Binaries.AARCH64]

> +  PE32|SasPlatform.efi|*
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [RFC 0/6] Create central repository for boilerplate configuration

2017-09-21 Thread Yao, Jiewen
Hi Leif
It is good to see such configuration.

Here is some of my thought:

1) We have similar idea. But there is one key difference is that we do not use 
MACRO, but use PCD to control feature selection.

For example, we defined 
  gPlatformModuleTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE|BOOLEAN|0xF0A4
  gPlatformModuleTokenSpaceGuid.PcdTpm2Enable  |FALSE|BOOLEAN|0xF0A5
  gPlatformModuleTokenSpaceGuid.PcdPerformanceEnable   |FALSE|BOOLEAN|0xF0A6
in 
https://github.com/tianocore/edk2-platforms/blob/devel-MinPlatform/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec

And they are used in 
https://github.com/tianocore/edk2-platforms/blob/devel-MinPlatform/Platform/Intel/MinPlatformPkg/Include/Fdf/CoreDxeInclude.fdf

I suggest we consider using PCD for configuration.

2) I do not suggest we use configuration for library, if this library only has 
one instance.
For example:
+  BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+  IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf

If no module need this library, this library will be ignored directly.
We can always leave BaseCryptLib there. No impact.

3) For below NULL library, we need put configuration around the NULL library 
instance, instead of the module. As such we may add more NULL instance, such as 
DxeTpm2MeasureBootLib.

+!if $(CONFIG_SECURE_BOOT_ENABLE) == TRUE
+  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
+
+  
NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf
+  }

To

  MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {

!if gSecurityTokenSpaceGuid.PcdUefiSecureBootEnable == TRUE
  
NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf
!endif
!if gSecurityTokenSpaceGuid.PcdTpm2Enable == TRUE
  NULL|SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf
!endif
  }


Thank you
Yao Jiewen



> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
> Lindholm
> Sent: Thursday, September 21, 2017 1:28 AM
> To: edk2-devel@lists.01.org
> Cc: Kinney, Michael D ; Justen, Jordan L
> ; Laszlo Ersek ; Andrew Fish
> ; Ard Biesheuvel 
> Subject: [edk2] [RFC 0/6] Create central repository for boilerplate 
> configuration
> 
> An awful lot of platform configuration is just repeated verbatim for
> every platform. This is my first stab at eliminating some of this
> redundancy.
> 
> I have additional bits as work in progress, but before I sink too much
> time into it, I would like to try to gather feedback on this approach
> (all the way down to directory structure).
> 
> This first round deals with basic network support and Secure Boot
> requirements.
> 
> Leif Lindholm (6):
>   ConfigPkg: add new package for holding common config fragments
>   ArmVirtPkg: use ConfigPkg for common network items
>   OvmfPkg: use ConfigPkg for common network items
>   ConfigPkg: add common Security settings
>   ArmVirtPkg: use ConfigPkg for common security items
>   OvmfPkg: use ConfigPkg for common security items
> 
>  ArmVirtPkg/ArmVirt.dsc.inc   | 25 ++
>  ArmVirtPkg/ArmVirtQemu.dsc   | 46 +++---
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 24 ++
>  ArmVirtPkg/ArmVirtQemuKernel.dsc | 46 +++---
>  ConfigPkg/Network/Network.dsc.inc| 92
> 
>  ConfigPkg/Network/Network.fdf.inc| 47 ++
>  ConfigPkg/Security/Security.dsc.inc  | 67 ++
>  ConfigPkg/Security/Security.fdf.inc  | 17 +++
>  OvmfPkg/OvmfPkgIa32.dsc  | 92 
> 
>  OvmfPkg/OvmfPkgIa32.fdf  | 37 +--
>  OvmfPkg/OvmfPkgIa32X64.dsc   | 90 ---
>  OvmfPkg/OvmfPkgIa32X64.fdf   | 37 +--
>  OvmfPkg/OvmfPkgX64.dsc   | 92
> 
>  OvmfPkg/OvmfPkgX64.fdf   | 37 +--
>  14 files changed, 276 insertions(+), 473 deletions(-)
>  create mode 100644 ConfigPkg/Network/Network.dsc.inc
>  create mode 100644 ConfigPkg/Network/Network.fdf.inc
>  create mode 100644 ConfigPkg/Security/Security.dsc.inc
>  create mode 100644 ConfigPkg/Security/Security.fdf.inc
> 
> --
> 2.11.0
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of UDF logical partition

2017-09-21 Thread Wu, Hao A
One small comment, within function PartitionInstallUdfChildHandles():

  ...
  //
  // Install partition child handle for UDF file system
  //
  Status = PartitionInstallChildHandle (
...
);
  if (!EFI_ERROR (Status)) {  <- Is this a typo? "if (EFI_ERROR (Status)) 
{"  
Status = EFI_NOT_FOUND;
  }
  

Best Regards,
Hao Wu


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Paulo
> Alcantara
> Sent: Thursday, September 21, 2017 2:16 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu; Laszlo Ersek; Dong, Eric; Zeng, Star
> Subject: [edk2] [PATCH v3 2/2] MdeModulePkg/PartitionDxe: Fix creation of
> UDF logical partition
> 
> Do not reserve entire block device size for an UDF file system -
> instead, reserve the appropriate space (UDF logical volume space) for
> it.
> 
> Additionally, only create a logical partition for UDF logical volumes
> that are currently supported by EDK2 UDF file system implementation. For
> instance, an UDF volume with a single LVD and a single Physical (Type 1)
> Partition will be supported.
> 
> Cc: Eric Dong 
> Cc: Ruiyu Ni 
> Cc: Star Zeng 
> Cc: Laszlo Ersek 
> Reported-by: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Paulo Alcantara 
> ---
>  MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c| 363 ++--
>  MdeModulePkg/Universal/Disk/UdfDxe/File.c |  16 +-
>  MdeModulePkg/Universal/Disk/UdfDxe/FileSystemOperations.c | 627
> 
>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.c  |   7 -
>  MdeModulePkg/Universal/Disk/UdfDxe/Udf.h  | 158 ++---
>  5 files changed, 606 insertions(+), 565 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
> b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
> index 609f56cef6..572ba7a81a 100644
> --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
> +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Udf.c
> @@ -64,11 +64,12 @@ FindAnchorVolumeDescriptorPointer (
>OUT  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  *AnchorPoint
>)
>  {
> -  EFI_STATUS  Status;
> -  UINT32  BlockSize;
> -  EFI_LBA EndLBA;
> -  EFI_LBA DescriptorLBAs[4];
> -  UINTN   Index;
> +  EFI_STATUS  Status;
> +  UINT32  BlockSize;
> +  EFI_LBA EndLBA;
> +  EFI_LBA DescriptorLBAs[4];
> +  UINTN   Index;
> +  UDF_DESCRIPTOR_TAG  *DescriptorTag;
> 
>BlockSize = BlockIo->Media->BlockSize;
>EndLBA = BlockIo->Media->LastBlock;
> @@ -88,10 +89,13 @@ FindAnchorVolumeDescriptorPointer (
>  if (EFI_ERROR (Status)) {
>return Status;
>  }
> +
> +DescriptorTag = >DescriptorTag;
> +
>  //
>  // Check if read LBA has a valid AVDP descriptor.
>  //
> -if (IS_AVDP (AnchorPoint)) {
> +if (DescriptorTag->TagIdentifier == UdfAnchorVolumeDescriptorPointer) {
>return EFI_SUCCESS;
>  }
>}
> @@ -102,23 +106,18 @@ FindAnchorVolumeDescriptorPointer (
>  }
> 
>  /**
> -  Check if block device supports a valid UDF file system as specified by OSTA
> -  Universal Disk Format Specification 2.60.
> +  Find UDF volume identifiers in a Volume Recognition Sequence.
> 
> -  @param[in]   BlockIo  BlockIo interface.
> -  @param[in]   DiskIo   DiskIo interface.
> +  @param[in]  BlockIo BlockIo interface.
> +  @param[in]  DiskIo  DiskIo interface.
> 
> -  @retval EFI_SUCCESS  UDF file system found.
> -  @retval EFI_UNSUPPORTED  UDF file system not found.
> -  @retval EFI_NO_MEDIA The device has no media.
> -  @retval EFI_DEVICE_ERROR The device reported an error.
> -  @retval EFI_VOLUME_CORRUPTED The file system structures are corrupted.
> -  @retval EFI_OUT_OF_RESOURCES The scan was not successful due to lack of
> -   resources.
> +  @retval EFI_SUCCESS UDF volume identifiers were found.
> +  @retval EFI_NOT_FOUND   UDF volume identifiers were not found.
> +  @retval other   Failed to perform disk I/O.
> 
>  **/
>  EFI_STATUS
> -SupportUdfFileSystem (
> +FindUdfVolumeIdentifiers (
>IN EFI_BLOCK_IO_PROTOCOL  *BlockIo,
>IN EFI_DISK_IO_PROTOCOL   *DiskIo
>)
> @@ -128,7 +127,6 @@ SupportUdfFileSystem (
>UINT64EndDiskOffset;
>CDROM_VOLUME_DESCRIPTOR   VolDescriptor;
>CDROM_VOLUME_DESCRIPTOR   TerminatingVolDescriptor;
> -  UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER  AnchorPoint;
> 
>ZeroMem ((VOID *), sizeof
> (CDROM_VOLUME_DESCRIPTOR));
> 
> @@ -167,7 +165,7 @@ SupportUdfFileSystem (
>  (CompareMem ((VOID *),
>   (VOID *),
>   sizeof (CDROM_VOLUME_DESCRIPTOR)) == 0)) {
> -  return EFI_UNSUPPORTED;
> +  return EFI_NOT_FOUND;
>  }

Re: [edk2] [PATCH edk2-platforms v3 00/11] Update D03/D05 binary for edk2 update and bug fix.

2017-09-21 Thread Leif Lindholm
On Thu, Sep 21, 2017 at 06:59:39PM +0800, Heyi Guo wrote:
> Code can also be found in github:
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: rp-1710-platforms-v3rp-1710-osi-v3

This is looking a lot better, thanks.
But it could be useful to have a separate cover letter for the
edk2-non-osi patches.

> Note: If occurs BIOS boot hang up issue, please revert below commit to fix:
>   "2f03dc8"

Can you give more information?
2f03dc8 is "Silicon/Hisilicon: switch to NonDiscoverable driver for
EHCI".

/
Leif

> Chenhui Sun (1):
>   Hisilicon/D03: Disable the function of PerfTuning
> 
> Heyi Guo (4):
>   Hisilicon/D05: Modify dsc and fdf file
>   Hisilicon/D03: Modify dsc and fdf file
>   Hisilicon: Fix the drivers use the same GUID issue
>   Hisilicon/PciHostBridgeDxe: Assign BAR resource from PciRegionBase
> 
> Ming Huang (4):
>   Hisilicon D03/D05: get firmware version from FIRMWARE_VER
>   D05/ACPI: Disable D05 SAS0 and SAS2
>   D05/ACPI: Modify I2C device
>   Hisilicon D03/D05: Enlarge iATU for RP with ARI capable device.
> 
> huangming (2):
>   Hisilicon/D05/Pcie: fix bug of size definition
>   D05/PCIe: Modify PcieRegionBase of secondary chip
> 
>  Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf  
> |  2 +-
>  Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf 
> |  2 +-
>  Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
> |  2 +-
>  Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf  
> |  2 +-
>  Platform/Hisilicon/D03/D03.dsc  
> | 13 ++-
>  Platform/Hisilicon/D03/D03.fdf  
> |  5 +-
>  Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf
> |  2 +-
>  Platform/Hisilicon/D05/D05.dsc  
> | 83 +
>  Platform/Hisilicon/D05/D05.fdf  
> |  4 +-
>  Platform/Hisilicon/D05/EarlyConfigPeim/EarlyConfigPeimD05.inf   
> |  2 +-
>  Platform/Hisilicon/D05/Library/OemMiscLibD05/OemMiscLibD05.inf  
> |  2 +-
>  Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
> |  2 +-
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c  
> | 38 
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h  
> |  7 ++
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
> | 94 +++-
>  Silicon/Hisilicon/Hi1610/Drivers/IoInitDxe/IoInitDxe.inf
> |  2 +-
>  Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf   
> |  2 +-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl  
> | 20 +
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl  
> |  8 +-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl  
> | 10 +++
>  Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf 
> |  2 +-
>  Silicon/Hisilicon/Library/Dw8250SerialPortLib/Dw8250SerialPortLib.inf   
> |  2 +-
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.inf 
> |  2 +-
>  Silicon/Hisilicon/Library/I2CLib/I2CLibRuntime.inf  
> |  2 +-
>  24 files changed, 205 insertions(+), 105 deletions(-)
> 
> -- 
> 1.9.1
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH edk2-platforms v3 00/11] Update D03/D05 binary for edk2 update and bug fix.

2017-09-21 Thread graeme . gregory
All ACPI changes apart from the small comment I had on I2C one

Reviewed-by: Graeme Gregory 

On Thu, Sep 21, 2017 at 06:59:39PM +0800, Heyi Guo wrote:
> Code can also be found in github:
> https://github.com/hisilicon/OpenPlatformPkg.git
> branch: rp-1710-platforms-v3rp-1710-osi-v3
> 
> Note: If occurs BIOS boot hang up issue, please revert below commit to fix:
>   "2f03dc8"
> 
> Chenhui Sun (1):
>   Hisilicon/D03: Disable the function of PerfTuning
> 
> Heyi Guo (4):
>   Hisilicon/D05: Modify dsc and fdf file
>   Hisilicon/D03: Modify dsc and fdf file
>   Hisilicon: Fix the drivers use the same GUID issue
>   Hisilicon/PciHostBridgeDxe: Assign BAR resource from PciRegionBase
> 
> Ming Huang (4):
>   Hisilicon D03/D05: get firmware version from FIRMWARE_VER
>   D05/ACPI: Disable D05 SAS0 and SAS2
>   D05/ACPI: Modify I2C device
>   Hisilicon D03/D05: Enlarge iATU for RP with ARI capable device.
> 
> huangming (2):
>   Hisilicon/D05/Pcie: fix bug of size definition
>   D05/PCIe: Modify PcieRegionBase of secondary chip
> 
>  Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf  
> |  2 +-
>  Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf 
> |  2 +-
>  Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
> |  2 +-
>  Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf  
> |  2 +-
>  Platform/Hisilicon/D03/D03.dsc  
> | 13 ++-
>  Platform/Hisilicon/D03/D03.fdf  
> |  5 +-
>  Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf
> |  2 +-
>  Platform/Hisilicon/D05/D05.dsc  
> | 83 +
>  Platform/Hisilicon/D05/D05.fdf  
> |  4 +-
>  Platform/Hisilicon/D05/EarlyConfigPeim/EarlyConfigPeimD05.inf   
> |  2 +-
>  Platform/Hisilicon/D05/Library/OemMiscLibD05/OemMiscLibD05.inf  
> |  2 +-
>  Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf
> |  2 +-
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c  
> | 38 
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h  
> |  7 ++
>  Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c
> | 94 +++-
>  Silicon/Hisilicon/Hi1610/Drivers/IoInitDxe/IoInitDxe.inf
> |  2 +-
>  Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf   
> |  2 +-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl  
> | 20 +
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl  
> |  8 +-
>  Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl  
> | 10 +++
>  Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf 
> |  2 +-
>  Silicon/Hisilicon/Library/Dw8250SerialPortLib/Dw8250SerialPortLib.inf   
> |  2 +-
>  Silicon/Hisilicon/Library/I2CLib/I2CLib.inf 
> |  2 +-
>  Silicon/Hisilicon/Library/I2CLib/I2CLibRuntime.inf  
> |  2 +-
>  24 files changed, 205 insertions(+), 105 deletions(-)
> 
> -- 
> 1.9.1
> 


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


Re: [edk2] Shell input redirection question

2017-09-21 Thread Jim.Dailey
The shell's pci command was not written to read from standard input. It
expects all its input on the command line.

I would say in general that if you execute a command and pass it no
parameters, and it then prompts you in some way for input, then that
command will likely accept input redirected from a file.

If you execute pci without any parameters, it simply lists all the
devices in the system and terminates, so it clearly is not prepared to
read from standard input (or a redirected file).

It is strictly up to whomever writes a program/command whether they do
so in a manner that allows it to accept input from standard input. For
example, I have written a grep utility for the shell that expects one or
more filenames to search to be on the command line; however, if there
are no filenames on the command line, the utility searches standard
input.

Regards,
Jim

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Tiger Liu
Sent: Thursday, September 21, 2017 1:11 AM
To: edk2-devel@lists.01.org
Subject: [edk2] Shell input redirection question

Hi, experts:
I have a question about input redirection in Shell environment.

Take pci command as sample.
I wrote a txt file(file name is : inputsample.txt), its content is:
00 00 01 -i
00 00 02 –i

It means I just wanted to dump D0F1/D0F2’s config space.

Then, I use this command sequence in shell :
pci 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] SNP transmit print

2017-09-21 Thread Udit Kumar
I think these error prints should be check against Status 

Regards
Udit

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Meenakshi Aggarwal
> Sent: Thursday, September 21, 2017 3:36 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] SNP transmit print
> 
> Hi,
> 
> 
> While performing tftp using PCI interface, below message is coming
> continuously:
> 
> Snp->undi.transmit()  8000h:4h
> 
> Snp->undi.transmit()  8000h:4h
> [==> ]   34812 Kb
> Snp->undi.transmit()  8000h:4h
> 
> Snp->undi.transmit()  8000h:4h
> 
> Snp->undi.transmit()  8000h:4h
> 
> Snp->undi.transmit()  8000h:4h
> 
> 
> It is coming from file "MdeModulePkg/Universal/Network/SnpDxe/Transmit.c"
> 
>   DEBUG (
> (EFI_D_ERROR,
> "\nSnp->undi.transmit()  %xh:%xh\n",
> Snp->Cdb.StatFlags,
> Snp->Cdb.StatCode)
> );
> 
> 
> I want to know if it is really an error message because tftp and ping are 
> working
> perfectly, but this error message is coming.
> 
> 
> Thanks,
> Meenakshi
> 
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH edk2-platforms v3 09/11] D05/ACPI: Disable D05 SAS0 and SAS2

2017-09-21 Thread Heyi Guo
From: Ming Huang 

There are no interface from SAS0 and SAS2 controller on D05,
so SAS0 and SAS2 can't be use.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl 
b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
index 93beb95..6455130 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl
@@ -88,6 +88,11 @@ Scope(_SB)
   Store(0x7, CLK)
   Sleep(1)
 }
+
+   Method (_STA, 0, NotSerialized)
+   {
+ Return (0x0)
+   }
   }
 
   Device(SAS1) {
@@ -239,6 +244,11 @@ Scope(_SB)
   Store(0x7, CLK)
   Sleep(1)
 }
+
+   Method (_STA, 0, NotSerialized)
+   {
+ Return (0x0)
+   }
   }
 
 }
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 04/11] Hisilicon D03/D05: get firmware version from FIRMWARE_VER

2017-09-21 Thread Heyi Guo
From: Ming Huang 

Value of the environment variable FIRMWARE_VER is GIT SHA by default,
and you can add the environment variable FIRMWARE_VER to EXTRA_OPTIONS
at build time to specify something else, eg. "16.12-".

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D03/D03.dsc | 6 +-
 Platform/Hisilicon/D05/D05.dsc | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
index 7e25ffb..fca6781 100644
--- a/Platform/Hisilicon/D03/D03.dsc
+++ b/Platform/Hisilicon/D03/D03.dsc
@@ -170,7 +170,11 @@
   gHisiTokenSpaceGuid.PcdAlgSmmuBaseAddress|0xd004
 
 
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D03 UEFI 
16.12 Release"
+  !ifdef $(FIRMWARE_VER)
+gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
+  !else
+gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
build base on Hisilicon D03 UEFI 17.10 Release"
+  !endif
 
   gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
 
diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 7cd5758..aa61c0e 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -188,7 +188,11 @@
 
   gHisiTokenSpaceGuid.PcdIsMPBoot|1
   gHisiTokenSpaceGuid.PcdSocketMask|0x3
-  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Hisilicon D05 UEFI 
16.12 Release"
+  !ifdef $(FIRMWARE_VER)
+gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"$(FIRMWARE_VER)"
+  !else
+gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString|L"Development 
build base on Hisilicon D05 UEFI 17.10 Release"
+  !endif
 
   gHisiTokenSpaceGuid.PcdBiosVersionString|L"10.01.01T18"
 
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 05/11] Hisilicon/PciHostBridgeDxe: Assign BAR resource from PciRegionBase

2017-09-21 Thread Heyi Guo
Io BAR should be based IoBase and Mem BAR should be based PciRegionBase.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c   | 37 

 Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c | 15 ++--
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c 
b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
index a970da6..e3d3988 100644
--- a/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
+++ b/Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c
@@ -1410,9 +1410,8 @@ SetResource(
 Ptr->ResType = 1;
 Ptr->GenFlag = 0;
 Ptr->SpecificFlag = 0;
-/* This is PCIE Device Bus which start address is the low 32bit of mem 
base*/
-Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase) +
-(RootBridgeInstance->MemBase & 0x);
+/* PCIE Device Iobar address should be based on IoBase */
+Ptr->AddrRangeMin = RootBridgeInstance->IoBase;
 Ptr->AddrRangeMax = 0;
 Ptr->AddrTranslationOffset = \
  (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
EFI_RESOURCE_LESS;
@@ -1429,9 +1428,13 @@ SetResource(
 Ptr->GenFlag = 0;
 Ptr->SpecificFlag = 0;
 Ptr->AddrSpaceGranularity = 32;
-/* This is PCIE Device Bus which start address is the low 32bit of mem 
base*/
-Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase) +
- (RootBridgeInstance->MemBase & 0x);
+/* PCIE device Bar should be based on PciRegionBase */
+if (RootBridgeInstance->PciRegionBase > MAX_UINT32) {
+  DEBUG((DEBUG_ERROR, "PCIE Res(TypeMem32) unsupported.\n"));
+  return EFI_UNSUPPORTED;
+}
+Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase +
+RootBridgeInstance->PciRegionBase;
 Ptr->AddrRangeMax = 0;
 Ptr->AddrTranslationOffset = \
  (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
EFI_RESOURCE_LESS;
@@ -1448,9 +1451,13 @@ SetResource(
 Ptr->GenFlag = 0;
 Ptr->SpecificFlag = 6;
 Ptr->AddrSpaceGranularity = 32;
-/* This is PCIE Device Bus which start address is the low 32bit of mem 
base*/
-Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase) +
- (RootBridgeInstance->MemBase & 0x);
+/* PCIE device Bar should be based on PciRegionBase */
+if (RootBridgeInstance->PciRegionBase > MAX_UINT32) {
+  DEBUG((DEBUG_ERROR, "PCIE Res(TypePMem32) unsupported.\n"));
+  return EFI_UNSUPPORTED;
+}
+Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase +
+RootBridgeInstance->PciRegionBase;
 Ptr->AddrRangeMax = 0;
 Ptr->AddrTranslationOffset = \
  (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
EFI_RESOURCE_LESS;
@@ -1467,9 +1474,9 @@ SetResource(
 Ptr->GenFlag = 0;
 Ptr->SpecificFlag = 0;
 Ptr->AddrSpaceGranularity = 64;
-/* This is PCIE Device Bus which start address is the low 32bit of mem 
base*/
-Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase) +
- (RootBridgeInstance->MemBase & 
0x);
+/* PCIE device Bar should be based on PciRegionBase */
+Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase +
+RootBridgeInstance->PciRegionBase;
 Ptr->AddrRangeMax = 0;
 Ptr->AddrTranslationOffset = \
  (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
EFI_RESOURCE_LESS;
@@ -1486,9 +1493,9 @@ SetResource(
 Ptr->GenFlag = 0;
 Ptr->SpecificFlag = 6;
 Ptr->AddrSpaceGranularity = 64;
-/* This is PCIE Device Bus which start address is the low 32bit of mem 
base*/
-Ptr->AddrRangeMin = (RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase) +
- (RootBridgeInstance->MemBase & 
0x);
+/* PCIE device Bar should be based on PciRegionBase */
+Ptr->AddrRangeMin = RootBridgeInstance->ResAllocNode[Index].Base - 
RootBridgeInstance->MemBase +
+RootBridgeInstance->PciRegionBase;
 Ptr->AddrRangeMax = 0;
 Ptr->AddrTranslationOffset = \
  (ResStatus == ResAllocated) ? EFI_RESOURCE_SATISFIED : 
EFI_RESOURCE_LESS;
diff --git 

[edk2] [PATCH edk2-non-osi v3 5/7] Hisilicon/D05/Sas: Add SasPlatform

2017-09-21 Thread Heyi Guo
Install protocol to enable sas port which is using and
transmit base address info of sas port to SasDriverDxe.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi | Bin 0 -> 3424 
bytes
 Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf |  24 

 2 files changed, 24 insertions(+)

diff --git a/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi 
b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi
new file mode 100644
index 000..d2685ab
Binary files /dev/null and 
b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.efi differ
diff --git a/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf 
b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
new file mode 100644
index 000..636be19
--- /dev/null
+++ b/Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
@@ -0,0 +1,24 @@
+#/** @file
+#
+#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
+#Copyright (c) 2017, Linaro Limited. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x00010019
+  BASE_NAME  = SasPlatform
+  FILE_GUID  = 102D8FC9-20a4-42EB-aC14-1C98BA5b26A4
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+[Binaries]
+  PE32|SasPlatform.efi|*
-- 
1.9.1

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


[edk2] [PATCH edk2-non-osi v3 4/7] Hisilicon/D05/Net: Update Snp driver

2017-09-21 Thread Heyi Guo
1. Replace SnpPV660Dxe with SnpPV600Dxe;
2. Add SnpPlatform:
 Install protocol to enable nic port which are using.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi | Bin 0 -> 
28544 bytes
 Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf |  24 
+
 Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi | Bin 56512 -> 
0 bytes
 Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf |  27 

 Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi | Bin 0 -> 3392 
bytes
 Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf |  24 
+
 6 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi
new file mode 100644
index 000..bc7942a
Binary files /dev/null and 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi differ
diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
new file mode 100644
index 000..cd7c724
--- /dev/null
+++ b/Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
@@ -0,0 +1,24 @@
+#/** @file
+#
+#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
+#Copyright (c) 2017, Linaro Limited. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x00010019
+  BASE_NAME  = SnpPV600Dxe
+  FILE_GUID  = 3247F15F-3612-4803-BD4E-4104D7EF944A
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+[Binaries]
+  PE32|SnpPV600Dxe.efi|*
diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi
deleted file mode 100644
index c54538f..000
Binary files a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
and /dev/null differ
diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
deleted file mode 100644
index 98cc3b8..000
--- a/Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
+++ /dev/null
@@ -1,27 +0,0 @@
-#/** @file
-#
-#Copyright (c) 2016, Hisilicon Limited. All rights reserved.
-#Copyright (c) 2016-2017, Linaro Limited. All rights reserved.
-#
-#This program and the accompanying materials
-#are licensed and made available under the terms and conditions of the BSD 
License
-#which accompanies this distribution. The full text of the license may be 
found at
-#http://opensource.org/licenses/bsd-license.php
-#
-#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-#
-#**/
-
-[Defines]
-  INF_VERSION= 0x00010019
-  BASE_NAME  = SnpPV600Dxe
-  FILE_GUID  = 85F85FDE-FDA1-465A-B22E-488F1A6F966C
-  MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.0
-
-  ENTRY_POINT= InitializeSnpPV600Driver
-  UNLOAD_IMAGE   = SnpPV600Unload
-
-[Binaries]
-  PE32|SnpPV600Dxe.efi|*
diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi
new file mode 100644
index 000..42c26de
Binary files /dev/null and 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.efi differ
diff --git a/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf 
b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
new file mode 100644
index 000..fd53a79
--- /dev/null
+++ b/Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
@@ -0,0 +1,24 @@
+#/** @file
+#
+#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
+#Copyright (c) 2017, Linaro Limited. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#

[edk2] [PATCH edk2-platforms v3 08/11] Hisilicon/D03: Disable the function of PerfTuning

2017-09-21 Thread Heyi Guo
From: Chenhui Sun 

The PerTuning function is not stable, it will cause the
3008/3108 crash, disable this function first.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chenhui Sun 
---
 Platform/Hisilicon/D03/D03.dsc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
index fca6781..ac880d9 100644
--- a/Platform/Hisilicon/D03/D03.dsc
+++ b/Platform/Hisilicon/D03/D03.dsc
@@ -112,7 +112,7 @@
   #  It could be set FALSE to save size.
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
   gHisiTokenSpaceGuid.PcdIsItsSupported|TRUE
-  gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|TRUE
+  gHisiTokenSpaceGuid.PcdIsPciPerfTuningEnable|FALSE
 
 [PcdsFixedAtBuild.common]
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"D03"
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 03/11] Hisilicon: Fix the drivers use the same GUID issue

2017-09-21 Thread Heyi Guo
The drivers build from separate sources, their GUID should
be different.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo 
Reviewed-by: Leif Lindholm 
---
 Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf  | 
2 +-
 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf | 
2 +-
 Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf| 
2 +-
 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf  | 
2 +-
 Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf| 
2 +-
 Platform/Hisilicon/D05/EarlyConfigPeim/EarlyConfigPeimD05.inf   | 
2 +-
 Platform/Hisilicon/D05/Library/OemMiscLibD05/OemMiscLibD05.inf  | 
2 +-
 Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf| 
2 +-
 Silicon/Hisilicon/Hi1610/Drivers/IoInitDxe/IoInitDxe.inf| 
2 +-
 Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf   | 
2 +-
 Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf | 
2 +-
 Silicon/Hisilicon/Library/Dw8250SerialPortLib/Dw8250SerialPortLib.inf   | 
2 +-
 Silicon/Hisilicon/Library/I2CLib/I2CLib.inf | 
2 +-
 Silicon/Hisilicon/Library/I2CLib/I2CLibRuntime.inf  | 
2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf 
b/Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf
index 5506a58..3f3f81c 100644
--- a/Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf
+++ b/Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = EarlyConfigPeim
-  FILE_GUID  = A181AD33-E64A-4084-A54A-A69DF1FB0ABF
+  FILE_GUID  = ECAE8400-9CCE-4BA5-9B44-74CAABE4DA79
   MODULE_TYPE= PEIM
   VERSION_STRING = 1.0
   ENTRY_POINT= EarlyConfigEntry
diff --git a/Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf 
b/Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf
index c952414..e881899 100644
--- a/Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf
+++ b/Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = FdtUpdateLib
-  FILE_GUID  = 02CF1727-E697-47fc-8CC2-5DCB81B26DD9
+  FILE_GUID  = 0F9ADE24-46B4-4506-8802-60C519B56133
   MODULE_TYPE= BASE
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = FdtUpdateLib
diff --git a/Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf 
b/Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
index 4d2dbba..ab3b62b 100644
--- a/Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
+++ b/Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = PlatformPciLib
-  FILE_GUID  = 61b7276a-fc67-11e5-82fd-47ea9896dd5d
+  FILE_GUID  = 128F1E1E-A921-4277-A796-A4A47B96B7D2
   MODULE_TYPE= BASE
   VERSION_STRING = 1.0
 
diff --git a/Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf 
b/Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf
index df5adf1..4c5955f 100644
--- a/Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf
+++ b/Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = OemNicConfig
-  FILE_GUID  = 3A23A929-1F38-4d04-8A01-38AD993EB2CE
+  FILE_GUID  = BF422A22-CA90-4C34-95B9-3D147AF09E70
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
   ENTRY_POINT= OemNicConfigEntry
diff --git a/Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf 
b/Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf
index 9569b91..2d9d53d 100755
--- a/Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf
+++ b/Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = FdtUpdateLib
-  FILE_GUID  = 02CF1727-E697-47fc-8CC2-5DCB81B26DD9
+  FILE_GUID  = B80B9FF1-FAB9-4BE5-B602-5ABAA6B7A3D4
   MODULE_TYPE= BASE
   VERSION_STRING = 1.0
   LIBRARY_CLASS  = FdtUpdateLib
diff --git 

[edk2] [PATCH edk2-platforms v3 07/11] D05/PCIe: Modify PcieRegionBase of secondary chip

2017-09-21 Thread Heyi Guo
From: huangming 

On D05 PCIe now, 2p NA PCIe2 and 2p NB PCIe0's pci domain addresses are
0x2000 and 0x3000 based. These addresses overlap with the DDR
memory range 0-1G. In this situation, on the inbound direction, our pcie
will drop the DDR address access that are located in the pci range window
and lead to a dataflow error.

Modify 2p NA PCIe2 and 2p NB PCIe0's pci domain addresses to 0x4000
and decrease PciRegion Size accordingly.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D05/D05.dsc | 12 ++--
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl |  8 
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 01defe0..64101a7 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -329,12 +329,12 @@
   gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionBaseAddress|0x400a940
   gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbf
-  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x2000
-  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xd000
+  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x4000
+  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xb000
   gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionBaseAddress|0x400ab40
   gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbf
-  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x3000
-  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xc000
+  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x4000
+  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xb000
   gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionBaseAddress|0x4000
   gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xb000
   gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionBaseAddress|0x408aa40
@@ -352,9 +352,9 @@
   gHisiTokenSpaceGuid.PcdHb0Rb7CpuMemRegionBase|0x8B980
   gHisiTokenSpaceGuid.PcdHb1Rb0CpuMemRegionBase|0x400A840
   gHisiTokenSpaceGuid.PcdHb1Rb1CpuMemRegionBase|0x400A940
-  gHisiTokenSpaceGuid.PcdHb1Rb2CpuMemRegionBase|0x6502000
+  gHisiTokenSpaceGuid.PcdHb1Rb2CpuMemRegionBase|0x6504000
   gHisiTokenSpaceGuid.PcdHb1Rb3CpuMemRegionBase|0x400AB40
-  gHisiTokenSpaceGuid.PcdHb1Rb4CpuMemRegionBase|0x7503000
+  gHisiTokenSpaceGuid.PcdHb1Rb4CpuMemRegionBase|0x7504000
   gHisiTokenSpaceGuid.PcdHb1Rb5CpuMemRegionBase|0x7904000
   gHisiTokenSpaceGuid.PcdHb1Rb6CpuMemRegionBase|0x408AA40
   gHisiTokenSpaceGuid.PcdHb1Rb7CpuMemRegionBase|0x408AB40
diff --git a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl 
b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
index 79267e5..55c7f50 100644
--- a/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
+++ b/Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl
@@ -646,10 +646,10 @@ Scope(_SB)
   Cacheable,
   ReadWrite,
   0x0, // Granularity
-  0x2000, // Min Base Address
+  0x4000, // Min Base Address
   0xefff, // Max Base Address
   0x650, // Translate
-  0xd000 // Length
+  0xb000 // Length
 )
 QWordIO (
   ResourceProducer,
@@ -766,10 +766,10 @@ Scope(_SB)
   Cacheable,
   ReadWrite,
   0x0, // Granularity
-  0x3000, // Min Base Address
+  0x4000, // Min Base Address
   0xefff, // Max Base Address
   0x750, // Translate
-  0xc000 // Length
+  0xb000 // Length
 )
 QWordIO (
   ResourceProducer,
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 06/11] Hisilicon/D05/Pcie: fix bug of size definition

2017-09-21 Thread Heyi Guo
From: huangming 

Fix bug of PcieRegion size definition and IO size definition.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D05/D05.dsc | 64 ++--
 1 file changed, 32 insertions(+), 32 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index aa61c0e..01defe0 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -310,37 +310,37 @@
   gHisiTokenSpaceGuid.PciHb1Rb7Base|0x700a00b
 
   gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionBaseAddress|0xa840
-  gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb0Rb0PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionBaseAddress|0xa940
-  gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb0Rb1PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionBaseAddress|0xa880
-  gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionSize|0x77e
+  gHisiTokenSpaceGuid.PcdHb0Rb2PciRegionSize|0x77f
   gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionBaseAddress|0xab40
-  gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb0Rb3PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionBaseAddress|0xa900
-  gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionSize|0x2fe
+  gHisiTokenSpaceGuid.PcdHb0Rb4PciRegionSize|0x2ff
   gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionBaseAddress|0xb080
-  gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionSize|0x77e
+  gHisiTokenSpaceGuid.PcdHb0Rb5PciRegionSize|0x77f
   gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionBaseAddress|0xac90
-  gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionSize|0x36e
+  gHisiTokenSpaceGuid.PcdHb0Rb6PciRegionSize|0x36f
   gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionBaseAddress|0xb980
-  gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionSize|0x67e
+  gHisiTokenSpaceGuid.PcdHb0Rb7PciRegionSize|0x67f
   gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionBaseAddress|0x400a840
-  gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb1Rb0PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionBaseAddress|0x400a940
-  gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb1Rb1PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionBaseAddress|0x2000
-  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xcfff
+  gHisiTokenSpaceGuid.PcdHb1Rb2PciRegionSize|0xd000
   gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionBaseAddress|0x400ab40
-  gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb1Rb3PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionBaseAddress|0x3000
-  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xbfff
+  gHisiTokenSpaceGuid.PcdHb1Rb4PciRegionSize|0xc000
   gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionBaseAddress|0x4000
-  gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xafff
+  gHisiTokenSpaceGuid.PcdHb1Rb5PciRegionSize|0xb000
   gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionBaseAddress|0x408aa40
-  gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb1Rb6PciRegionSize|0xbf
   gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionBaseAddress|0x408ab40
-  gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionSize|0xbe
+  gHisiTokenSpaceGuid.PcdHb1Rb7PciRegionSize|0xbf
 
   gHisiTokenSpaceGuid.PcdHb0Rb0CpuMemRegionBase|0xA840
   gHisiTokenSpaceGuid.PcdHb0Rb1CpuMemRegionBase|0xA940
@@ -377,52 +377,52 @@
   gHisiTokenSpaceGuid.PcdHb1Rb7CpuIoRegionBase|0x408abff
 
   gHisiTokenSpaceGuid.PcdHb0Rb0IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb0IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb0IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb1IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb1IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb1IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb2IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb2IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb2IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb3IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb3IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb3IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb4IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb4IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb4IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb5IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb5IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb5IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb6IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb6IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb6IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb0Rb7IoBase|0
-  gHisiTokenSpaceGuid.PcdHb0Rb7IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb0Rb7IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb1Rb0IoBase|0
-  gHisiTokenSpaceGuid.PcdHb1Rb0IoSize|0x #64K
+  gHisiTokenSpaceGuid.PcdHb1Rb0IoSize|0x1 #64K
 
   gHisiTokenSpaceGuid.PcdHb1Rb1IoBase|0
-  

[edk2] [PATCH edk2-non-osi v3 7/7] Hisilicon: Fix the drivers use the same GUID issue

2017-09-21 Thread Heyi Guo
The drivers build from separate sources, their GUID should
be different.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo 
Reviewed-by: Leif Lindholm 
---
 Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
| 2 +-
 Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
| 2 +-
 Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
| 2 +-
 Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf   
| 2 +-
 Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf  
| 2 +-
 Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.inf  
| 2 +-
 Platform/Hisilicon/D05/Drivers/IpmiMiscOpDxe/IpmiMiscOpDxe.inf 
| 2 +-
 Platform/Hisilicon/D05/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.inf 
| 2 +-
 Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
| 2 +-
 Platform/Hisilicon/D05/Drivers/OhciDxe/OhciDxe.inf 
| 2 +-
 
Platform/Hisilicon/D05/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.inf
 | 2 +-
 Platform/Hisilicon/D05/Drivers/SFC/SfcDxeDriver.inf
| 2 +-
 Platform/Hisilicon/D05/Drivers/Sas/SasDxeDriver.inf
| 2 +-
 Platform/Hisilicon/D05/Drivers/Sm750Dxe/UefiSmi.inf
| 2 +-
 Platform/Hisilicon/D05/Drivers/TransferSmbiosInfo/TransSmbiosInfo.inf  
| 2 +-
 Platform/Hisilicon/D05/Library/OemAddressMapD05/OemAddressMapD05.inf   
| 2 +-
 Platform/Hisilicon/D05/MemoryInitPei/MemoryInitPeim.inf
| 2 +-
 Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.inf  
| 2 +-
 Silicon/Hisilicon/Hi1610/Library/LpcLib/LpcLib.inf 
| 2 +-
 
Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.inf
 | 2 +-
 Silicon/Hisilicon/Hi1616/Library/Hi1616Serdes/Hi1616SerdesLib.inf  
| 2 +-
 
Silicon/Hisilicon/Pv660/Library/PlatformSysCtrlLibPv660/PlatformSysCtrlLibPv660.inf
| 2 +-
 Silicon/Hisilicon/Pv660/Library/Pv660Serdes/Pv660SerdesLib.inf 
| 2 +-
 23 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
index 8376bbd..8b9ee1d 100644
--- a/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
+++ b/Platform/Hisilicon/D02/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
@@ -17,7 +17,7 @@
 [Defines]
   INF_VERSION= 0x00010019
   BASE_NAME  = SnpPV600Dxe
-  FILE_GUID  = 3246F154-3612-4803-BD4E-4104D7EF944A
+  FILE_GUID  = 1AB373EB-2CD7-4D5C-9C39-D31845B67F5E
   MODULE_TYPE= UEFI_DRIVER
   VERSION_STRING = 1.0
 
diff --git a/Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf 
b/Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
index e10275a..02a4d7f 100644
--- a/Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
+++ b/Platform/Hisilicon/D02/Drivers/SFC/SfcDxeDriver.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = SFCDriver
-  FILE_GUID  = FC5651CA-55D8-4fd2-B6D3-A284D993ABA2
+  FILE_GUID  = 02C6BAAE-6E43-4910-8084-60D5045729A0
   MODULE_TYPE= DXE_DRIVER
   VERSION_STRING = 1.0
   ENTRY_POINT= SFCInitialize
diff --git a/Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf 
b/Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
index c221de9..0095c82 100644
--- a/Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
+++ b/Platform/Hisilicon/D02/MemoryInitPei/MemoryInitPeim.inf
@@ -18,7 +18,7 @@
 [Defines]
   INF_VERSION= 0x00010005
   BASE_NAME  = MemoryInit
-  FILE_GUID  = c61ef796-b50d-4f98-9f78-4f6f79d800d5
+  FILE_GUID  = A311058D-0993-4C05-A3EC-16CC0801C1A0
   MODULE_TYPE= PEIM
   VERSION_STRING = 1.0
 
diff --git a/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf 
b/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
index 20e2f05..1a2bd01 100644
--- a/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
+++ b/Platform/Hisilicon/D05/Drivers/GetInfoFromBmc/GetInfoFromBmc.inf
@@ -16,7 +16,7 @@
 [Defines]
   INF_VERSION= 0x00010019
   BASE_NAME  = GetInfoFromBmc
-  FILE_GUID  = 43B59C81-9C5F-4021-B0F2-947DB839B781
+  

[edk2] [PATCH edk2-non-osi v3 3/7] Hisilicon/D03: Update binary file

2017-09-21 Thread Heyi Guo
Update binary file for edk2 upgrade.
1. Replace UncachedMemoryAllocationLib with DmaLib;
2. Remove ArmCpuLib dependenc;
3. Remove ConvertToPhysicalAddress;

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi   
| Bin 21696 -> 4768 bytes
 Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi  
| Bin 22208 -> 4672 bytes
 Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi  
| Bin 25440 -> 6784 bytes
 Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi
| Bin 23712 -> 4896 bytes
 Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi 
| Bin 18080 -> 2304 bytes
 Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi  
| Bin 48352 -> 21664 bytes
 
Platform/Hisilicon/D03/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.efi
 | Bin 22112 -> 3712 bytes
 Platform/Hisilicon/D03/Drivers/SFC/SFCDriver.efi   
| Bin 262144 -> 262144 bytes
 Platform/Hisilicon/D03/Drivers/Sas/SasDriverDxe.efi
| Bin 208288 -> 98144 bytes
 Platform/Hisilicon/D03/Drivers/Sm750Dxe/SmiGraphicsOutput.efi  
| Bin 36480 -> 17728 bytes
 Platform/Hisilicon/D03/Drivers/TransferSmbiosInfo/TransSmbiosInfo.efi  
| Bin 21408 -> 4000 bytes
 Platform/Hisilicon/D03/Library/OemAddressMap2P/OemAddressMap2P.lib 
| Bin 19486 -> 20550 bytes
 Platform/Hisilicon/D03/MemoryInitPei/MemoryInit.efi
| Bin 161280 -> 90272 bytes
 Platform/Hisilicon/D03/Sec/FVMAIN_SEC.Fv   
| Bin 262144 -> 262144 bytes
 Platform/Hisilicon/D03/bl1.bin 
| Bin 14336 -> 14336 bytes
 Platform/Hisilicon/D03/fip.bin 
| Bin 45601 -> 62513 bytes
 Silicon/Hisilicon/Hi1610/Library/Hi1610Serdes/Hi1610SerdesLib.lib  
| Bin 603524 -> 587188 bytes
 Silicon/Hisilicon/Hi1610/Library/IpmiCmdLib/IpmiCmdLib.lib 
| Bin 247176 -> 210280 bytes
 Silicon/Hisilicon/Hi1610/Library/LpcLib/LpcLib.lib 
| Bin 13998 -> 13958 bytes
 
Silicon/Hisilicon/Hi1610/Library/PlatformSysCtrlLibHi1610/PlatformSysCtrlLibHi1610.lib
 | Bin 305230 -> 297590 bytes
 Silicon/Hisilicon/Hi1610/Library/Uart/LpcSerialPortLib/LpcSerialPortLib.lib
| Bin 17022 -> 16942 bytes
 21 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
b/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi
index 269243a..12640f2 100644
Binary files a/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi 
and b/Platform/Hisilicon/D03/Drivers/GetInfoFromBmc/GetInfoFromBmc.efi differ
diff --git 
a/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
b/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi
index c197895..d2565c8 100644
Binary files 
a/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi and 
b/Platform/Hisilicon/D03/Drivers/Ipmi/IpmiInterfacePei/IpmiInterfacePei.efi 
differ
diff --git 
a/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi 
b/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi
index 6201971..0d8ff52 100644
Binary files 
a/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi and 
b/Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.efi 
differ
diff --git a/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi 
b/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi
index 7409fcb..b85c19b 100644
Binary files a/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi and 
b/Platform/Hisilicon/D03/Drivers/IpmiMiscOpDxe/IpmiMiscOp.efi differ
diff --git a/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi 
b/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi
index a9238b1..89c4b5b 100644
Binary files 
a/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi and 
b/Platform/Hisilicon/D03/Drivers/IpmiWatchdogDxe/IpmiWatchdogDxe.efi differ
diff --git a/Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi 
b/Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi
index 0a0d9d5..e1970fd 100644
Binary files a/Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi and 
b/Platform/Hisilicon/D03/Drivers/OhciDxe/NativeOhci.efi differ
diff --git 
a/Platform/Hisilicon/D03/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.efi
 
b/Platform/Hisilicon/D03/Drivers/ReportPciePlugDidVidToBmc/ReportPciePlugDidVidToBmc.efi
index 

[edk2] [PATCH edk2-platforms v3 02/11] Hisilicon/D03: Modify dsc and fdf file

2017-09-21 Thread Heyi Guo
1. Add Drivers/SasPlatform;
2. Add Drivers/Net/SnpPlatform;

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D03/D03.dsc | 5 -
 Platform/Hisilicon/D03/D03.fdf | 5 -
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/Platform/Hisilicon/D03/D03.dsc b/Platform/Hisilicon/D03/D03.dsc
index afea162..7e25ffb 100644
--- a/Platform/Hisilicon/D03/D03.dsc
+++ b/Platform/Hisilicon/D03/D03.dsc
@@ -418,11 +418,6 @@
 
   Platform/Hisilicon/D03/Drivers/Ipmi/ipmiInterfaceDxe/IpmiInterfaceDxe.inf
 
-  #
-  #network
-  #
-  Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
-
   MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
   MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
diff --git a/Platform/Hisilicon/D03/D03.fdf b/Platform/Hisilicon/D03/D03.fdf
index b62b908..b53bdca 100644
--- a/Platform/Hisilicon/D03/D03.fdf
+++ b/Platform/Hisilicon/D03/D03.fdf
@@ -242,7 +242,8 @@ READ_LOCK_STATUS   = TRUE
   #Network
   #
 
-  INF Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
+  INF Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
+  INF Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
 
   INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
   INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
@@ -271,6 +272,7 @@ READ_LOCK_STATUS   = TRUE
   #
   INF Platform/Hisilicon/D03/Drivers/Sm750Dxe/UefiSmi.inf
 
+  INF Platform/Hisilicon/D03/Drivers/SasPlatform/SasPlatform.inf
   INF Platform/Hisilicon/D03/Drivers/Sas/SasDxeDriver.inf
 
   #
@@ -278,6 +280,7 @@ READ_LOCK_STATUS   = TRUE
   #
   INF ShellPkg/Application/Shell/Shell.inf
 
+
   #
   # Bds
   #
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 01/11] Hisilicon/D05: Modify dsc and fdf file

2017-09-21 Thread Heyi Guo
1. Add Drivers/SasPlatform;
2. Add Drivers/Net/SnpPlatform;

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D05/D05.dsc | 5 -
 Platform/Hisilicon/D05/D05.fdf | 4 +++-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/Platform/Hisilicon/D05/D05.dsc b/Platform/Hisilicon/D05/D05.dsc
index 3cdb1b1..7cd5758 100644
--- a/Platform/Hisilicon/D05/D05.dsc
+++ b/Platform/Hisilicon/D05/D05.dsc
@@ -538,11 +538,6 @@
 
   Platform/Hisilicon/D05/Drivers/Ipmi/IpmiInterfaceDxe/IpmiInterfaceDxe.inf
 
-  #
-  #network
-  #
-  Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
-
   MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
   MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
   MdeModulePkg/Universal/Network/DpcDxe/DpcDxe.inf
diff --git a/Platform/Hisilicon/D05/D05.fdf b/Platform/Hisilicon/D05/D05.fdf
index b6d0e42..a5e6546 100644
--- a/Platform/Hisilicon/D05/D05.fdf
+++ b/Platform/Hisilicon/D05/D05.fdf
@@ -247,7 +247,8 @@ READ_LOCK_STATUS   = TRUE
   #Network
   #
 
-  INF Platform/Hisilicon/D05/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
+  INF Platform/Hisilicon/D05/Drivers/Net/SnpPlatform/SnpPlatform.inf
+  INF Platform/Hisilicon/D05/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
 
   INF MdeModulePkg/Universal/Network/ArpDxe/ArpDxe.inf
   INF MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Dxe.inf
@@ -292,6 +293,7 @@ READ_LOCK_STATUS   = TRUE
   #
   INF Platform/Hisilicon/D05/Drivers/Sm750Dxe/UefiSmi.inf
   INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+  INF Platform/Hisilicon/D05/Drivers/SasPlatform/SasPlatform.inf
   INF Platform/Hisilicon/D05/Drivers/Sas/SasDxeDriver.inf
 
   #
-- 
1.9.1

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


[edk2] [PATCH edk2-platforms v3 00/11] Update D03/D05 binary for edk2 update and bug fix.

2017-09-21 Thread Heyi Guo
Code can also be found in github:
https://github.com/hisilicon/OpenPlatformPkg.git
branch: rp-1710-platforms-v3rp-1710-osi-v3

Note: If occurs BIOS boot hang up issue, please revert below commit to fix:
  "2f03dc8"

Chenhui Sun (1):
  Hisilicon/D03: Disable the function of PerfTuning

Heyi Guo (4):
  Hisilicon/D05: Modify dsc and fdf file
  Hisilicon/D03: Modify dsc and fdf file
  Hisilicon: Fix the drivers use the same GUID issue
  Hisilicon/PciHostBridgeDxe: Assign BAR resource from PciRegionBase

Ming Huang (4):
  Hisilicon D03/D05: get firmware version from FIRMWARE_VER
  D05/ACPI: Disable D05 SAS0 and SAS2
  D05/ACPI: Modify I2C device
  Hisilicon D03/D05: Enlarge iATU for RP with ARI capable device.

huangming (2):
  Hisilicon/D05/Pcie: fix bug of size definition
  D05/PCIe: Modify PcieRegionBase of secondary chip

 Platform/Hisilicon/D02/EarlyConfigPeim/EarlyConfigPeim.inf  |  
2 +-
 Platform/Hisilicon/D02/FdtUpdateLibD02/FdtUpdateLib.inf |  
2 +-
 Platform/Hisilicon/D02/Library/PlatformPciLib/PlatformPciLib.inf|  
2 +-
 Platform/Hisilicon/D02/OemNicConfigD02/OemNicConfigD02.inf  |  
2 +-
 Platform/Hisilicon/D03/D03.dsc  | 
13 ++-
 Platform/Hisilicon/D03/D03.fdf  |  
5 +-
 Platform/Hisilicon/D03/Library/FdtUpdateLib/FdtUpdateLib.inf|  
2 +-
 Platform/Hisilicon/D05/D05.dsc  | 
83 +
 Platform/Hisilicon/D05/D05.fdf  |  
4 +-
 Platform/Hisilicon/D05/EarlyConfigPeim/EarlyConfigPeimD05.inf   |  
2 +-
 Platform/Hisilicon/D05/Library/OemMiscLibD05/OemMiscLibD05.inf  |  
2 +-
 Platform/Hisilicon/D05/Library/PlatformPciLib/PlatformPciLib.inf|  
2 +-
 Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.c  | 
38 
 Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciHostBridge.h  |  
7 ++
 Silicon/Hisilicon/Drivers/PciHostBridgeDxe/PciRootBridgeIo.c| 
94 +++-
 Silicon/Hisilicon/Hi1610/Drivers/IoInitDxe/IoInitDxe.inf|  
2 +-
 Silicon/Hisilicon/Hi1610/Drivers/PcieInit1610/PcieInitDxe.inf   |  
2 +-
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05I2c.asl  | 
20 +
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Pci.asl  |  
8 +-
 Silicon/Hisilicon/Hi1616/D05AcpiTables/Dsdt/D05Sas.asl  | 
10 +++
 Silicon/Hisilicon/Library/DS3231RealTimeClockLib/DS3231RealTimeClockLib.inf |  
2 +-
 Silicon/Hisilicon/Library/Dw8250SerialPortLib/Dw8250SerialPortLib.inf   |  
2 +-
 Silicon/Hisilicon/Library/I2CLib/I2CLib.inf |  
2 +-
 Silicon/Hisilicon/Library/I2CLib/I2CLibRuntime.inf  |  
2 +-
 24 files changed, 205 insertions(+), 105 deletions(-)

-- 
1.9.1

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


[edk2] [PATCH edk2-non-osi v3 1/7] Hisilicon/D03/Net: Update Snp driver

2017-09-21 Thread Heyi Guo
1. Replace SnpPV660Dxe with SnpPV600Dxe;
2. Add SnpPlatform:
 Install protocol to enable nic port which are using.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ming Huang 
---
 Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi | Bin 0 -> 
26688 bytes
 Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf |  24 
+
 Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi | Bin 56832 -> 
0 bytes
 Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf |  27 

 Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi | Bin 0 -> 3040 
bytes
 Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf |  24 
+
 6 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi
new file mode 100644
index 000..8ce6a6d
Binary files /dev/null and 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.efi differ
diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
new file mode 100644
index 000..cd7c724
--- /dev/null
+++ b/Platform/Hisilicon/D03/Drivers/Net/SnpPV600Dxe/SnpPV600Dxe.inf
@@ -0,0 +1,24 @@
+#/** @file
+#
+#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
+#Copyright (c) 2017, Linaro Limited. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#**/
+
+[Defines]
+  INF_VERSION= 0x00010019
+  BASE_NAME  = SnpPV600Dxe
+  FILE_GUID  = 3247F15F-3612-4803-BD4E-4104D7EF944A
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+[Binaries]
+  PE32|SnpPV600Dxe.efi|*
diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi
deleted file mode 100644
index eb69403..000
Binary files a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.efi 
and /dev/null differ
diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
deleted file mode 100644
index 204ef17..000
--- a/Platform/Hisilicon/D03/Drivers/Net/SnpPV660Dxe/SnpPV600Dxe.inf
+++ /dev/null
@@ -1,27 +0,0 @@
-#/** @file
-#
-#Copyright (c) 2016, Hisilicon Limited. All rights reserved.
-#Copyright (c) 2016-2017, Linaro Limited. All rights reserved.
-#
-#This program and the accompanying materials
-#are licensed and made available under the terms and conditions of the BSD 
License
-#which accompanies this distribution. The full text of the license may be 
found at
-#http://opensource.org/licenses/bsd-license.php
-#
-#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-#WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
-#
-#**/
-
-[Defines]
-  INF_VERSION= 0x00010005
-  BASE_NAME  = SnpPV600Dxe
-  FILE_GUID  = 92D37768-571C-48d9-BEF5-9744AE2FDAF4
-  MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.0
-
-  ENTRY_POINT= InitializeSnpPV600Driver
-  UNLOAD_IMAGE   = SnpPV600Unload
-
-[Binaries]
-  PE32|SnpPV600Dxe.efi|*
diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi
new file mode 100644
index 000..5e7d8bd
Binary files /dev/null and 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.efi differ
diff --git a/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf 
b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
new file mode 100644
index 000..fd53a79
--- /dev/null
+++ b/Platform/Hisilicon/D03/Drivers/Net/SnpPlatform/SnpPlatform.inf
@@ -0,0 +1,24 @@
+#/** @file
+#
+#Copyright (c) 2017, Hisilicon Limited. All rights reserved.
+#Copyright (c) 2017, Linaro Limited. All rights reserved.
+#
+#This program and the accompanying materials
+#are licensed and made available under the terms and conditions of the BSD 
License
+#which accompanies this distribution. The full text of the license may be 
found at
+#http://opensource.org/licenses/bsd-license.php
+#
+#THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#

[edk2] NVME DXE Driver and PATA SS

2017-09-21 Thread david moheban
Its been reported by various hardware modding enthusiasts that when they insert 
the Nvme edk2 driver into an Asus Ami based bios rom (could be other vendors as 
well) that after its insertion the system will say there is a 'PATA SS' device 
present in the boot menu however after Windows has been installed onto the NVME 
Drive the 'Windows boot Manager' shows up in the boot menu as well. So the PATA 
SS descripter maybe a misidentification of the device type?? 

You can read various user reports at this forum:
http://www.win-raid.com/t871f16-Guide-How-to-get-full-NVMe-support-for-all-Systems-with-an-AMI-UEFI-BIOS-147.html


Thank you

Sent from my iPad

> On Sep 20, 2017, at 11:05 PM, Wu, Hao A  wrote:
> 
> Hi,
> 
> Could you help to provide more information on the firmware which you are
> using? Is it built by yourself or provided by vender?
> 
> As far as I know, the edk2 NVME driver only manages the devices, it will
> not create boot options for them. It's for the BDS-related modules to
> create boot options for discovered devices.
> 
> 
> Best Regards,
> Hao Wu
> 
>> -Original Message-
>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of david
>> moheban
>> Sent: Thursday, September 21, 2017 12:38 AM
>> To: edk2-devel@lists.01.org
>> Subject: [edk2] NVME DXE Driver and PATA SS
>> 
>> Hi,
>> 
>> Is the PATA SS message that comes up in the bios boot menu when you insert
>> the NVME Express DXE driver from Edk2 into one's firmware by design or a
>> side-effect of the system not identifying the new device correctly?
>> 
>> Thank you
>> ___
>> 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


  1   2   >