[edk2] [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

2016-04-19 Thread Lee Leahy
Copy the driver from MdeModulePkg/Universal/SerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/SerialDxe/SerialDxe.inf  |  55 +++
 CorebootModulePkg/SerialDxe/SerialDxe.uni  |  21 +
 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni |  19 +
 CorebootModulePkg/SerialDxe/SerialIo.c | 528 +
 4 files changed, 623 insertions(+)
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.inf
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.inf 
b/CorebootModulePkg/SerialDxe/SerialDxe.inf
new file mode 100644
index 000..8489e06
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.inf
@@ -0,0 +1,55 @@
+## @file
+#  Serial driver that layers on top of a Serial Port Library instance.
+#
+#  Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = SerialDxe
+  MODULE_UNI_FILE= SerialDxe.uni
+  FILE_GUID  = D3987D4B-971A-435F-8CAF-4967EB627241
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+  ENTRY_POINT= SerialDxeInitialize
+
+[Sources.common]
+  SerialIo.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  CorebootModulePkg/CorebootModulePkg.dec
+
+[LibraryClasses]
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+  DebugLib
+  PcdLib
+  PlatformHookLib
+  SerialPortLib
+
+[Protocols]
+  gEfiSerialIoProtocolGuid  ## PRODUCES
+  gEfiDevicePathProtocolGuid## PRODUCES
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES
+
+[Depex]
+  TRUE
+
+[UserExtensions.TianoCore."ExtraFiles"]
+  SerialDxeExtra.uni
diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.uni 
b/CorebootModulePkg/SerialDxe/SerialDxe.uni
new file mode 100644
index 000..e2daf27
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.uni
@@ -0,0 +1,21 @@
+// /** @file
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
+//
+// This program and the accompanying materials
+// are licensed and made available under the terms and conditions of the BSD 
License
+// which accompanies this distribution. The full text of the license may be 
found at
+// http://opensource.org/licenses/bsd-license.php
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "Serial driver that 
layers on top of a Serial Port Library instance"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Serial driver that 
layers on top of a Serial Port Library instance."
+
diff --git a/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni 
b/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
new file mode 100644
index 000..3790487
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
@@ -0,0 +1,19 @@
+// /** @file
+// SerialDxe Localized Strings and Content
+//
+// Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.
+//
+// This program and the accompanying materials
+// are licensed and made available under the terms and conditions of the BSD 
License
+// which accompanies this distribution. The full text of the license may be 
found at
+// http://opensource.org/licenses/bsd-license.php
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+//
+// **/
+
+#string STR_PROPERTIES_MODULE_NAME 
+#language en-US 
+"SerialDxe Driver"
+
+
diff --git a/CorebootModulePkg/SerialDxe/SerialIo.c 
b/CorebootModulePkg/SerialDxe/SerialIo.c
new file mode 100644
index 000..171eb46
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialIo.c
@@ -0,0 +1,528 @@
+/** @file
+  Serial driver that layers on top of a Ser

[edk2] [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled devices

2016-04-19 Thread Lee Leahy
Skip non-bridge devices which are not enabled either for memory or I/O
access.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c 
b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
index ca300cf..3802424 100644
--- a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
+++ b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
@@ -227,6 +227,15 @@ Returns:
   if (!EFI_ERROR (Status)) {
 
 //
+// Skip non-bridge devices which are not enabled
+//
+if (((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE
+  | EFI_PCI_COMMAND_MEMORY_SPACE)) == 0)
+  && (!(IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci {
+  continue;
+}
+
+//
 // Collect all the information about the PCI device discovered
 //
 Status = PciSearchDevice (
-- 
1.9.1

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


[edk2] [PATCH 05/12] CorebootPayloadPkg: Make shell selectable

2016-04-19 Thread Lee Leahy
Add all of the shell options from ShellBinPkg including building the
shell from source.

Test: Use -DSHELL_TYPE=BUILD_SHELL command line options to build the
shell from source.  Run the result on Galileo Gen2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkg.fdf| 24 +---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 78 ++--
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 78 ++--
 3 files changed, 162 insertions(+), 18 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf 
b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index e28f732..804eeed 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
@@ -153,16 +153,20 @@ INF 
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 #
 # Shell
 #
-#!if $(ARCH) == IA32
-#INF  RuleOverride = BINARY USE = IA32 ShellBinPkg/UefiShell/UefiShell.inf
-#!else
-#INF  RuleOverride = BINARY USE = X64 ShellBinPkg/UefiShell/UefiShell.inf
-#!endif
-#
-!if $(ARCH) == IA32
-INF  RuleOverride = BINARY USE = IA32 EdkShellBinPkg/FullShell/FullShell.inf
-!else
-INF  RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf
+!if $(SHELL_TYPE) == BUILD_SHELL
+INF ShellPkg/Application/Shell/Shell.inf
+!endif
+
+!if $(SHELL_TYPE) == FULL_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) EdkShellBinPkg/FullShell/FullShell.inf
+!endif
+
+!if $(SHELL_TYPE) == MIN_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) 
ShellBinPkg/MinUefiShell/MinUefiShell.inf
+!endif
+
+!if $(SHELL_TYPE) == UEFI_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) ShellBinPkg/UefiShell/UefiShell.inf
 !endif
 
 FILE FREEFORM= PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 42c2d20..88790e9 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -32,7 +32,12 @@
   
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
-  
+
+  #
+  # Shell options: [BUILD_SHELL, FULL_BIN, MIN_BIN, NONE, UEFI]
+  #
+  DEFINE SHELL_TYPE  = FULL_BIN
+
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS   = -DMDEPKG_NDEBUG
   GCC:RELEASE_*_*_CC_FLAGS   = -DMDEPKG_NDEBUG
@@ -361,6 +366,71 @@
   # Framebuffer Gop 
   #
   CorebootPayloadPkg/FbGop/FbGop.inf
-  
- 
- 
+
+  #--
+  #  Build the shell
+  #--
+
+!if $(SHELL_TYPE) == BUILD_SHELL
+
+[PcdsFixedAtBuild]
+  ## This flag is used to control initialization of the shell library
+  #  This should be FALSE for compiling the shell application itself only.
+  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+
+  #
+  # Shell Lib
+  #
+[LibraryClasses]
+  
BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+
+[Components.IA32]
+  ShellPkg/Application/Shell/Shell.inf {
+
+#--
+#  Basic commands
+#--
+
+
+  
NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+
+#--
+#  Networking commands
+#--
+
+
+  
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
+  NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf
+
+#--
+#  Performance command
+#--
+
+
+  NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf
+
+#--
+#  Support libraries
+#--
+
+
+  DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+  
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+  NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+  ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
+  
ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.

[edk2] [PATCH 06/12] CorebootPayloadPkg: Make debug serial PCDs patchable

2016-04-19 Thread Lee Leahy
Make the debug serial PCDs patchable in module.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 16 +---
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 16 +---
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 88790e9..d5f4fb1 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -203,13 +203,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
-!if $(SOURCE_DEBUG_ENABLE)
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
-!else
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x1
@@ -221,6 +214,15 @@
 !endif
 
 [PcdsPatchableInModule.common]
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
+!if $(SOURCE_DEBUG_ENABLE)
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+
+!endif
+
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
 
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index ef9f349..db6c97d 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -204,13 +204,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
-!if $(SOURCE_DEBUG_ENABLE)
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
-!else
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x1
@@ -223,6 +216,15 @@
 !endif
 
 [PcdsPatchableInModule.common]
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
+
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
+!if $(SOURCE_DEBUG_ENABLE)
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+!endif
+
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
 
-- 
1.9.1

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


[edk2] [PATCH 07/12] CorebootPayloadPkg: Make serial I/O configurable

2016-04-19 Thread Lee Leahy
Allow the serial port configuration to be overriden from the command
line.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 59 +++-
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 58 ++-
 2 files changed, 114 insertions(+), 3 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index d5f4fb1..df6f9c1 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -34,6 +34,40 @@
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
   #
+  # Serial port set up
+  #
+  DEFINE BAUD_RATE= 115200
+  DEFINE SERIAL_CLOCK_RATE= 1843200
+  DEFINE SERIAL_LINE_CONTROL  = 3 # 8-bits, no parity
+  DEFINE SERIAL_HARDWARE_FLOW_CONTROL = FALSE
+  DEFINE SERIAL_DETECT_CABLE  = FALSE
+  DEFINE SERIAL_FIFO_CONTROL  = 7 # Enable FIFO
+  DEFINE SERIAL_EXTENDED_TX_FIFO_SIZE = 16
+  DEFINE UART_DEFAULT_BAUD_RATE   = $(BAUD_RATE)
+  DEFINE UART_DEFAULT_DATA_BITS   = 8
+  DEFINE UART_DEFAULT_PARITY  = 1
+  DEFINE UART_DEFAULT_STOP_BITS   = 1
+  DEFINE DEFAULT_TERMINAL_TYPE= 0
+
+  #
+  #  typedef struct {
+  #UINT16  VendorId;  ///< Vendor ID to match the PCI device.  The 
value 0x terminates the list of entries.
+  #UINT16  DeviceId;  ///< Device ID to match the PCI device
+  #UINT32  ClockRate; ///< UART clock rate.  Set to 0 for default 
clock rate of 1843200 Hz
+  #UINT64  Offset;///< The byte offset into to the BAR
+  #UINT8   BarIndex;  ///< Which BAR to get the UART base address
+  #UINT8   RegisterStride;///< UART register stride in bytes.  Set to 
0 for default register stride of 1 byte.
+  #UINT16  ReceiveFifoDepth;  ///< UART receive FIFO depth in bytes. Set 
to 0 for a default FIFO depth of 16 bytes.
+  #UINT16  TransmitFifoDepth; ///< UART transmit FIFO depth in bytes. Set 
to 0 for a default FIFO depth of 16 bytes.
+  #UINT8   Reserved[2];
+  #  } PCI_SERIAL_PARAMETER;
+  #
+  # Vendor  Device  Prog Interface 1, BAR #0, Offset 0, Stride = 1, 
Clock 1843200 (0x1c2000)
+  #
+  #   [Vendor]   [Device]  
[ClockRate---]  [Offset---] [Bar] [Stride] [RxFifo] 
[TxFifo]   [Rsvd]   [Vendor]
+  DEFINE PCI_SERIAL_PARAMETERS= {0x00,0x00, 0x00,0x00, 
0x0,0x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00,0x01, 0x0,0x0, 
0x0,0x0, 0x0,0x0, 0xff,0xff}
+
+  #
   # Shell options: [BUILD_SHELL, FULL_BIN, MIN_BIN, NONE, UEFI]
   #
   DEFINE SHELL_TYPE  = FULL_BIN
@@ -220,11 +254,32 @@
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
 !else
   gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
-
 !endif
 
+  #
+  # The following parameters are set by Library/PlatformHookLib
+  #
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1
+
+  #
+  # Enable these parameters to be set on the command line
+  #
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|$(SERIAL_CLOCK_RATE)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|$(SERIAL_LINE_CONTROL)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|$(SERIAL_HARDWARE_FLOW_CONTROL)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|$(SERIAL_DETECT_CABLE)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|$(SERIAL_FIFO_CONTROL)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|$(SERIAL_EXTENDED_TX_FIFO_SIZE)
+
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(UART_DEFAULT_BAUD_RATE)
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|$(UART_DEFAULT_DATA_BITS)
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|$(UART_DEFAULT_PARITY)
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|$(UART_DEFAULT_STOP_BITS)
+  gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|$(DEFAULT_TERMINAL_TYPE)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAMETERS)
 
 

 #
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index db6c97d..67b70f0 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -34,6 +34,40 @@
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
   #
+  # Serial port set up
+  #
+  DEFINE BAUD_RATE= 115200
+  DEFINE SERIAL_CLOCK_RATE= 1843200
+  DEFINE SERIAL_LINE_CONTROL  = 3 #

[edk2] [PATCH 08/12] CorebootPayloadPkg: Use serial drivers with PlatformHookLib

2016-04-19 Thread Lee Leahy
Use the serial drivers which update the serial PCDs from
PlatformHookLib.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkg.fdf|  3 ++-
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 11 ++-
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc |  9 +
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf 
b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index 804eeed..a386d50 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
@@ -112,11 +112,12 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
 #
 INF 
CorebootModulePkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
 INF CorebootModulePkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf 
+INF CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
 
 #
 # ISA Support
 #
-INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
+INF CorebootModulePkg/SerialDxe/SerialDxe.inf
 
 #
 # Console Support
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index df6f9c1..4bdd91b 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -158,7 +158,7 @@
   
SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf
   
PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf
   PlatformBdsLib|CorebootPayloadPkg/Library/PlatformBdsLib/PlatformBdsLib.inf
-  
+
   #
   # Misc
   #
@@ -381,7 +381,8 @@
   #
   
CorebootModulePkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
   CorebootModulePkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf 
-  
+  CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
+
   #
   # SCSI/ATA/IDE/DISK Support
   #
@@ -404,12 +405,12 @@
   MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
-  
+
   #
   # ISA Support
   #
-  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
-  
+  CorebootModulePkg/SerialDxe/SerialDxe.inf
+
   #
   # Console Support
   #
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index 67b70f0..382b21a 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -384,7 +384,8 @@
   #  
   
CorebootModulePkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf
   CorebootModulePkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf 
-  
+  CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
+
   #
   # SCSI/ATA/IDE/DISK Support
   #
@@ -407,12 +408,12 @@
   MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
-  
+
   #
   # ISA Support
   #
-  MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
-  
+  CorebootModulePkg/SerialDxe/SerialDxe.inf
+
   #
   # Console Support
   #
-- 
1.9.1

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


[edk2] [PATCH 11/12] CorebootPayloadPkg/PlatformHelperLib: Remove unreferenced function

2016-04-19 Thread Lee Leahy
Remove the PlatformFlashEraseWrite function which is not used within
CorebootPayloadPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 .../Include/Library/PlatformHelperLib.h|  38 +-
 .../Library/PlatformHelperLib/PlatformHelperDxe.c  | 141 -
 2 files changed, 1 insertion(+), 178 deletions(-)

diff --git a/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h 
b/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
index a6cc863..28dc096 100644
--- a/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
+++ b/QuarkPlatformPkg/Include/Library/PlatformHelperLib.h
@@ -1,7 +1,7 @@
 /** @file
 PlatformHelperLib function prototype definitions.
 
-Copyright (c) 2013 Intel Corporation.
+Copyright (c) 2013 - 2016 Intel Corporation.
 
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
@@ -106,42 +106,6 @@ PlatformFlashLockPolicy (
   IN CONST BOOLEANPreBootPolicy
   );
 
-/**
-  Erase and Write to platform flash.
-
-  Routine accesses one flash block at a time, each access consists
-  of an erase followed by a write of FLASH_BLOCK_SIZE. One or both
-  of DoErase & DoWrite params must be TRUE.
-
-  Limitations:-
-CpuWriteAddress must be aligned to FLASH_BLOCK_SIZE.
-DataSize must be a multiple of FLASH_BLOCK_SIZE.
-
-  @param   Smst   If != NULL then InSmm and use to locate
-  SpiProtocol.
-  @param   CpuWriteAddressAddress in CPU memory map of flash region.
-  @param   Data   The buffer containing the data to be written.
-  @param   DataSize   Amount of data to write.
-  @param   DoEraseEarse each block.
-  @param   DoWriteWrite to each block.
-
-  @retval  EFI_SUCCESSOperation successful.
-  @retval  EFI_NOT_READY  Required resources not setup.
-  @retval  EFI_INVALID_PARAMETER  Invalid parameter.
-  @retval  Others Unexpected error happened.
-
-**/
-EFI_STATUS
-EFIAPI
-PlatformFlashEraseWrite (
-  IN  VOID  *Smst,
-  IN  UINTN CpuWriteAddress,
-  IN  UINT8 *Data,
-  IN  UINTN DataSize,
-  IN  BOOLEAN   DoErase,
-  IN  BOOLEAN   DoWrite
-  );
-
 /** Check if System booted with recovery Boot Stage1 image.
 
   @retval  TRUEIf system booted with recovery Boot Stage1 image.
diff --git a/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperDxe.c 
b/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperDxe.c
index 18dbd8b..441f760 100644
--- a/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperDxe.c
+++ b/QuarkPlatformPkg/Library/PlatformHelperLib/PlatformHelperDxe.c
@@ -325,147 +325,6 @@ PlatformFlashLockPolicy (
   }
 }
 
-/**
-  Erase and Write to platform flash.
-
-  Routine accesses one flash block at a time, each access consists
-  of an erase followed by a write of FLASH_BLOCK_SIZE. One or both
-  of DoErase & DoWrite params must be TRUE.
-
-  Limitations:-
-CpuWriteAddress must be aligned to FLASH_BLOCK_SIZE.
-DataSize must be a multiple of FLASH_BLOCK_SIZE.
-
-  @param   Smst   If != NULL then InSmm and use to locate
-  SpiProtocol.
-  @param   CpuWriteAddressAddress in CPU memory map of flash region.
-  @param   Data   The buffer containing the data to be written.
-  @param   DataSize   Amount of data to write.
-  @param   DoEraseEarse each block.
-  @param   DoWriteWrite to each block.
-
-  @retval  EFI_SUCCESSOperation successful.
-  @retval  EFI_NOT_READY  Required resources not setup.
-  @retval  EFI_INVALID_PARAMETER  Invalid parameter.
-  @retval  Others Unexpected error happened.
-
-**/
-EFI_STATUS
-EFIAPI
-PlatformFlashEraseWrite (
-  IN  VOID  *Smst,
-  IN  UINTN CpuWriteAddress,
-  IN  UINT8 *Data,
-  IN  UINTN DataSize,
-  IN  BOOLEAN   DoErase,
-  IN  BOOLEAN   DoWrite
-  )
-{
-  EFI_STATUSStatus;
-  UINT64CpuBaseAddress;
-  SPI_INIT_INFO *SpiInfo;
-  UINT8 *WriteBuf;
-  UINTN Index;
-  UINTN SpiWriteAddress;
-  EFI_SPI_PROTOCOL  *SpiProtocol;
-
-  if (!DoErase && !DoWrite) {
-return EFI_INVALID_PARAMETER;
-  }
-  if (DoWrite && Data == NULL) {
-return EFI_INVALID_PARAMETER;
-  }
-  if ((CpuWriteAddress % FLASH_BLOCK_SIZE) != 0) {
-return EFI_INVALID_PARAMETER;
-  }
-  if ((DataSize % FLASH_BLOCK_SIZ

[edk2] [PATCH 09/12] CorebootPayloadPkg/PlatformBdsLib: Pass more serial parameters

2016-04-19 Thread Lee Leahy
Pass the serial port baudrate, register stride, input clock rate and
ID from coreboot to CorebootPayloadPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/Include/Coreboot.h   |  3 ++
 CorebootModulePkg/Include/Library/CbParseLib.h | 12 --
 CorebootModulePkg/Library/CbParseLib/CbParseLib.c  | 42 ++--
 .../Library/PlatformBdsLib/BdsPlatform.c   |  7 +++-
 .../Library/PlatformBdsLib/PlatformBdsLib.inf  |  6 +++
 .../Library/PlatformHookLib/PlatformHookLib.c  | 46 +-
 .../Library/PlatformHookLib/PlatformHookLib.inf| 11 --
 7 files changed, 107 insertions(+), 20 deletions(-)

diff --git a/CorebootModulePkg/Include/Coreboot.h 
b/CorebootModulePkg/Include/Coreboot.h
index f2f18be..74109b6 100644
--- a/CorebootModulePkg/Include/Coreboot.h
+++ b/CorebootModulePkg/Include/Coreboot.h
@@ -165,6 +165,9 @@ struct cb_serial {
   UINT32 type;
   UINT32 baseaddr;
   UINT32 baud;
+  UINT32 regwidth;
+  UINT32 input_hertz;
+  UINT32 id;
 };
 
 #define CB_TAG_CONSOLE   0x00010
diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h 
b/CorebootModulePkg/Include/Library/CbParseLib.h
index 170375b..3243a16 100644
--- a/CorebootModulePkg/Include/Library/CbParseLib.h
+++ b/CorebootModulePkg/Include/Library/CbParseLib.h
@@ -113,7 +113,10 @@ CbParseFadtInfo (
 
   @param  pRegBase   Pointer to the base address of serial port 
registers
   @param  pRegAccessType Pointer to the access type of serial port 
registers
+  @param  pRegWidth  Pointer to the register width in bytes
   @param  pBaudrate  Pointer to the serial port baudrate
+  @param  pInputHertzPointer to the input clock frequency
+  @param  pIdPointer to the serial port ID
 
   @retval RETURN_SUCCESS Successfully find the serial port information.
   @retval RETURN_NOT_FOUND   Failed to find the serial port information .
@@ -121,9 +124,12 @@ CbParseFadtInfo (
 **/
 RETURN_STATUS
 CbParseSerialInfo (
-  IN UINT32* pRegBase,
-  IN UINT32* pRegAccessType,
-  IN UINT32* pBaudrate
+  OUT UINT32 *pRegBase,
+  OUT UINT32 *pRegAccessType,
+  OUT UINT32 *pRegWidth,
+  OUT UINT32 *pBaudrate,
+  OUT UINT32 *pInputHertz,
+  OUT UINT32 *pId
   );
 
 /**
diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c 
b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
index 377abf3..962bcf5 100644
--- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
+++ b/CorebootModulePkg/Library/CbParseLib/CbParseLib.c
@@ -216,8 +216,8 @@ FindCbMemTable (
 *pMemTableSize = Entries[Idx].size;
   }
 
-  DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size 0x%x\n",
-TableId, *pMemTable, Entries[Idx].size));
+  DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size 0x%x\n",
+TableId, *pMemTable, Entries[Idx].size));
   return RETURN_SUCCESS;
 }
   }
@@ -479,15 +479,15 @@ CbParseFadtInfo (
   DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg));
 }
 
-//
-// Verify values for proper operation
-//
-ASSERT(Fadt->Pm1aCntBlk != 0);
-ASSERT(Fadt->PmTmrBlk != 0);
-ASSERT(Fadt->ResetReg.Address != 0);
-ASSERT(Fadt->Pm1aEvtBlk != 0);
-ASSERT(Fadt->Gpe0Blk != 0);
-
+//
+// Verify values for proper operation
+//
+ASSERT(Fadt->Pm1aCntBlk != 0);
+ASSERT(Fadt->PmTmrBlk != 0);
+ASSERT(Fadt->ResetReg.Address != 0);
+ASSERT(Fadt->Pm1aEvtBlk != 0);
+ASSERT(Fadt->Gpe0Blk != 0);
+
 return RETURN_SUCCESS;
   }
 }
@@ -541,7 +541,10 @@ CbParseFadtInfo (
 
   @param  pRegBase   Pointer to the base address of serial port 
registers
   @param  pRegAccessType Pointer to the access type of serial port 
registers
+  @param  pRegWidth  Pointer to the register width in bytes
   @param  pBaudrate  Pointer to the serial port baudrate
+  @param  pInputHertzPointer to the input clock frequency
+  @param  pIdPointer to the serial port ID
 
   @retval RETURN_SUCCESS Successfully find the serial port information.
   @retval RETURN_NOT_FOUND   Failed to find the serial port information .
@@ -551,7 +554,10 @@ RETURN_STATUS
 CbParseSerialInfo (
   OUT UINT32  *pRegBase,
   OUT UINT32  *pRegAccessType,
-  OUT UINT32  *pBaudrate
+  OUT UINT32  *pRegWidth,
+  OUT UINT32  *pBaudrate,
+  OUT UINT32  *pInputHertz,
+  OUT UINT32  *pId
   )
 {
   struct cb_serial*CbSerial;
@@ -569,6 +575,10 @@ CbParseSerialInfo (
 *pRegBase = CbSerial->baseaddr;
   }
 
+  if (pRegWidth != NULL) {
+*pRegWidth = CbSerial->regwidth;
+  }
+
   if (pRegAccessType != NULL) {
 *pRegAccessType = CbSerial->type;
   }
@@ -577,6 +587,14 @@ CbParseSerialInfo (
 *pBaudrate = CbSerial->baud;
   }
 
+  if (pInputHertz != NULL) {
+

[edk2] [PATCH 10/12] CorebootPayloadPkg: Allow MaxLogicalProcessorNumber to be changed

2016-04-19 Thread Lee Leahy
Add a define and use it with MaxLogicalProcessorNumber to enable this
PCD to be changed via the command line.  Quark needs to set this value
to one during the builds.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 7 +++
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 7 +++
 2 files changed, 14 insertions(+)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 4bdd91b..cd66ebb 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -34,6 +34,11 @@
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
   #
+  # CPU options
+  #
+  DEFINE MAX_LOGICAL_PROCESSORS  = 64
+
+  #
   # Serial port set up
   #
   DEFINE BAUD_RATE= 115200
@@ -281,6 +286,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|$(DEFAULT_TERMINAL_TYPE)
   
gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAMETERS)
 
+  
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICAL_PROCESSORS)
+
 

 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index 382b21a..f050b94 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -34,6 +34,11 @@
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
 
   #
+  # CPU options
+  #
+  DEFINE MAX_LOGICAL_PROCESSORS  = 64
+
+  #
   # Serial port set up
   #
   DEFINE BAUD_RATE= 115200
@@ -284,6 +289,8 @@
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|$(DEFAULT_TERMINAL_TYPE)
   
gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAMETERS)
 
+  
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICAL_PROCESSORS)
+
 

 #
 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
-- 
1.9.1

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


[edk2] [PATCH] QuarkSocPkg/SDControllerDxe: Add EFIAPI to SetHighSpeedMode

2016-04-19 Thread Lee Leahy
Fix 64-bit build error detected with GCC4.8 due to inconsistent routine
declaration and implementation.  Add EFIAPI to fix the build error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 QuarkSocPkg/QuarkSouthCluster/Sdio/Dxe/SDControllerDxe/SDController.c | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/QuarkSocPkg/QuarkSouthCluster/Sdio/Dxe/SDControllerDxe/SDController.c 
b/QuarkSocPkg/QuarkSouthCluster/Sdio/Dxe/SDControllerDxe/SDController.c
index 18e85c8..2b5dbe6 100644
--- a/QuarkSocPkg/QuarkSouthCluster/Sdio/Dxe/SDControllerDxe/SDController.c
+++ b/QuarkSocPkg/QuarkSouthCluster/Sdio/Dxe/SDControllerDxe/SDController.c
@@ -244,6 +244,7 @@ GetErrorReason (
   @return EFI_SUCCESS
 **/
 EFI_STATUS
+EFIAPI
 SetHighSpeedMode (
   IN  EFI_SD_HOST_IO_PROTOCOL*This,
   IN  BOOLEANEnable
-- 
1.9.1

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


[edk2] [PATCH] QuarkPlatformPkg: Move baud rate setting to top of .dsc file

2016-04-19 Thread Lee Leahy
Move the baud rate setting to the top of the .dsc file.  Use a single
setting for each board.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 QuarkPlatformPkg/Quark.dsc| 25 -
 QuarkPlatformPkg/QuarkMin.dsc | 25 -
 2 files changed, 24 insertions(+), 26 deletions(-)

diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc
index c87bb17..2b8038e 100644
--- a/QuarkPlatformPkg/Quark.dsc
+++ b/QuarkPlatformPkg/Quark.dsc
@@ -46,6 +46,16 @@
   DEFINE GALILEO  = GEN2
 
   #
+  # Specify the maximum baud rate for the board
+  #
+!if $(GALILEO) == GEN1
+  DEFINE BAUD_RATE = 460800
+!endif
+!if $(GALILEO) == GEN2
+  DEFINE BAUD_RATE = 921600
+!endif
+
+  #
   # TPM 1.2 Hardware.  Options are [NONE, LPC, ATMEL_I2C, INFINEON_I2C]
   #
   DEFINE TPM_12_HARDWARE  = NONE
@@ -342,12 +352,7 @@
 !endif
   gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0x18
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
-!if $(GALILEO) == GEN1
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|460800
-!endif
-!if $(GALILEO) == GEN2
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|921600
-!endif
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(BAUD_RATE)
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
@@ -382,14 +387,8 @@
 
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x9000B000
-!if $(GALILEO) == GEN1
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|460800
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
-!endif
-!if $(GALILEO) == GEN2
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|921600
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|0x03
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x07
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|FALSE
diff --git a/QuarkPlatformPkg/QuarkMin.dsc b/QuarkPlatformPkg/QuarkMin.dsc
index f8a656e..7d89767 100644
--- a/QuarkPlatformPkg/QuarkMin.dsc
+++ b/QuarkPlatformPkg/QuarkMin.dsc
@@ -40,6 +40,16 @@
   DEFINE PERFORMANCE_ENABLE  = FALSE
   DEFINE LOGGING = FALSE
 
+  #
+  # Specify the maximum baud rate for the board
+  #
+!if $(GALILEO) == GEN1
+  DEFINE BAUD_RATE = 460800
+!endif
+!if $(GALILEO) == GEN2
+  DEFINE BAUD_RATE = 921600
+!endif
+
   !if $(TARGET) == "DEBUG"
 DEFINE LOGGING = TRUE
   !endif
@@ -311,12 +321,7 @@
 !endif
   gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0x18
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000
-!if $(GALILEO) == GEN1
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|460800
-!endif
-!if $(GALILEO) == GEN2
-  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|921600
-!endif
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(BAUD_RATE)
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|8
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|1
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|1
@@ -351,14 +356,8 @@
 
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x9000B000
-!if $(GALILEO) == GEN1
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|460800
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE)
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
-!endif
-!if $(GALILEO) == GEN2
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|921600
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|0x03
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|0x07
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|FALSE
-- 
1.9.1

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


Re: [edk2] [PATCH] ShellPkg: Support connect a device handle recursively with '-r'.

2016-04-19 Thread Carsey, Jaben
I am confused.

It looks like the code change is that "-r" requires ...GetCount() >2 where it 
used to be >1.  Why?  I didn't think that recursive searching required both 
DeviceHandle and DriverHandle to be on the command line...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Monday, April 18, 2016 1:18 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Support connect a device handle
> recursively with '-r'.
> Importance: High
> 
> This patch make Shell 'connect' a device handle recursively with
> '-r' option.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> index 5d61c2f..dd3d4a6 100644
> --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> @@ -2,7 +2,7 @@
>Main file for connect shell Driver1 function.
> 
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
> +  Copyright (c) 2010 - 2016, 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
> @@ -452,9 +452,10 @@ ShellCommandRunConnect (
>  //
>  Count = (gInReconnect?0x4:0x3);
>  if ((ShellCommandLineGetCount(Package) > Count)
> -  ||((ShellCommandLineGetFlag(Package, L"-r") ||
> ShellCommandLineGetFlag(Package, L"-c")) &&
> ShellCommandLineGetCount(Package)>1)
> +  ||(ShellCommandLineGetFlag(Package, L"-c") &&
> ShellCommandLineGetCount(Package)>1)
> +  ||(ShellCommandLineGetFlag(Package, L"-r") &&
> ShellCommandLineGetCount(Package)>2)
>||(ShellCommandLineGetFlag(Package, L"-r") &&
> ShellCommandLineGetFlag(Package, L"-c") )
> - ){
> +){
>//
>// error for too many parameters
>//
> --
> 2.7.1.windows.2
> 
> ___
> 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 02/12] CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

2016-04-19 Thread Ma, Maurice
Hi, Lee,

For this change,  could you let us know why you decided to copy the 
PciSioSerialDxe over to the CorebootModulePkg ?
I am wondering why the current driver in MdeModulePkg cannot be reused.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:29 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 02/12] CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Bus/Pci/PciSioSerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciSioSerialDxe/ComponentName.c  |  288 +
 .../PciSioSerialDxe/PciSioSerialDxe.inf|   82 ++
 .../PciSioSerialDxe/PciSioSerialDxe.uni|   21 +
 .../PciSioSerialDxe/PciSioSerialDxeExtra.uni   |   18 +
 CorebootModulePkg/PciSioSerialDxe/Serial.c | 1248 ++
 CorebootModulePkg/PciSioSerialDxe/Serial.h |  789 
 CorebootModulePkg/PciSioSerialDxe/SerialIo.c   | 1320 
 7 files changed, 3766 insertions(+)
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/ComponentName.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.h
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/PciSioSerialDxe/ComponentName.c 
b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
new file mode 100644
index 000..994dc84
--- /dev/null
+++ b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
@@ -0,0 +1,288 @@
+/** @file
+  UEFI Component Name and Name2 protocol for Isa serial driver.
+
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include "Serial.h"
+
+//
+// EFI Component Name Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  
gPciSioSerialComponentName = {
+  SerialComponentNameGetDriverName,
+  SerialComponentNameGetControllerName,
+  "eng"
+};
+
+//
+// EFI Component Name 2 Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL 
gPciSioSerialComponentName2 = {
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SerialComponentNameGetDriverName,
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) 
SerialComponentNameGetControllerName,
+  "en"
+};
+
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE 
mSerialDriverNameTable[] = {
+  {
+"eng;en",
+L"PCI SIO Serial Driver"
+  },
+  {
+NULL,
+NULL
+  }
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mSioSerialPortName[] = L"SIO Serial Port 
#%d";
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mPciSerialPortName[] = L"PCI Serial Port 
#%d";
+
+/**
+  Retrieves a Unicode string that is the user readable name of the driver.
+
+  This function retrieves the user readable name of a driver in the form of a
+  Unicode string. If the driver specified by This has a user readable name in
+  the language specified by Language, then a pointer to the driver name is
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
+  by This does not support the language specified by Language,
+  then EFI_UNSUPPORTED is returned.
+
+  @param  This[in]  A pointer to the EFI_COMPONENT_NAME2_PROTOCOL 
or
+EFI_COMPONENT_NAME_PROTOCOL instance.
+
+  @param  Language[in]  A pointer to a Null-terminated ASCII string
+array indicating the language. This is the
+language of the driver name that the caller is
+requesting, and it must match one of the
+languages specified in SupportedLanguages. The
+number of languages supported by a driver is up
+to the driver writer. Language is specified
+in RFC 4646 or ISO 639-2 language code format.
+
+  @param  DriverName[out]   A pointer to the Unicode string to return.
+This Unicode string is the name of the
+driver specified by This in the language
+specified by Language.
+
+  @ret

Re: [edk2] [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

2016-04-19 Thread Ma, Maurice
Hi, Lee,

I have the same question as previous patch.   
Please let us know why the driver in MdeModulePkg does not fit your needs.   
If it is only for PCD initialization,  we might consider using PcdsDynamic type 
and set them in platform driver instead.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:30 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Universal/SerialDxe.  Add PlatformHookLib to 
the Library section of the .inf file to adjust the PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/SerialDxe/SerialDxe.inf  |  55 +++
 CorebootModulePkg/SerialDxe/SerialDxe.uni  |  21 +
 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni |  19 +
 CorebootModulePkg/SerialDxe/SerialIo.c | 528 +
 4 files changed, 623 insertions(+)
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.inf
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.inf 
b/CorebootModulePkg/SerialDxe/SerialDxe.inf
new file mode 100644
index 000..8489e06
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.inf
@@ -0,0 +1,55 @@
+## @file
+#  Serial driver that layers on top of a Serial Port Library instance.
+#
+#  Copyright (c) 2008 - 2015, Intel Corporation. All rights 
+reserved. #  This program and the accompanying materials #  are 
+licensed and made available under the terms and conditions of the BSD 
+License #  which accompanies this distribution.  The full text of the 
+license may be found at #  
+http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" 
+BASIS, #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = SerialDxe
+  MODULE_UNI_FILE= SerialDxe.uni
+  FILE_GUID  = D3987D4B-971A-435F-8CAF-4967EB627241
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+  ENTRY_POINT= SerialDxeInitialize
+
+[Sources.common]
+  SerialIo.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  CorebootModulePkg/CorebootModulePkg.dec
+
+[LibraryClasses]
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+  DebugLib
+  PcdLib
+  PlatformHookLib
+  SerialPortLib
+
+[Protocols]
+  gEfiSerialIoProtocolGuid  ## PRODUCES
+  gEfiDevicePathProtocolGuid## PRODUCES
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES
+
+[Depex]
+  TRUE
+
+[UserExtensions.TianoCore."ExtraFiles"]
+  SerialDxeExtra.uni
diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.uni 
b/CorebootModulePkg/SerialDxe/SerialDxe.uni
new file mode 100644
index 000..e2daf27
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.uni
@@ -0,0 +1,21 @@
+// /** @file
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Copyright (c) 2008 - 2015, Intel Corporation. All rights 
+reserved. // // This program and the accompanying materials // are 
+licensed and made available under the terms and conditions of the BSD 
+License // which accompanies this distribution. The full text of the 
+license may be found at // 
+http://opensource.org/licenses/bsd-license.php
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" 
+BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "Serial driver that 
layers on top of a Serial Port Library instance"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Serial driver that 
layers on top of a Serial Port Library instance."
+
diff --git a/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni 
b/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
new file mode 100644
index 000..3790487
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
@@ -0,0 +1,19 @@
+// /** @file
+// SerialDxe Localized Strings and Content // // Copyright (c) 2008 - 
+2015, Intel Corporation. All rights reserved. // // This program 
+and the accompanying materials // are licensed and made available under 
+the terms and conditions of the BSD License // which accompanies this 
+distribution. The full text of the license may be found at // 
+http://opensource.org/licenses/bsd-license.php
+

Re: [edk2] [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled devices

2016-04-19 Thread Ma, Maurice
Hi, Lee,

Do we assume all PCI devices will be enabled in  the command registers in 
coreboot before transitioning to the UEFI payload ?
How about those PCI devices with command register disabled but with PCI BARs 
programmed ?   If we skip them, then the resource will not be collected by the 
PciBus driver.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:30 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled 
devices

Skip non-bridge devices which are not enabled either for memory or I/O access.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c 
b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
index ca300cf..3802424 100644
--- a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
+++ b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
@@ -227,6 +227,15 @@ Returns:
   if (!EFI_ERROR (Status)) {
 
 //
+// Skip non-bridge devices which are not enabled
+//
+if (((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE
+  | EFI_PCI_COMMAND_MEMORY_SPACE)) == 0)
+  && (!(IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci {
+  continue;
+}
+
+//
 // Collect all the information about the PCI device discovered
 //
 Status = PciSearchDevice (
--
1.9.1

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


Re: [edk2] [PATCH 02/12] CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

2016-04-19 Thread Leahy, Leroy P
Hi Maurice,

Quark uses a PCI serial port, not the legacy serial port.  As such, I need to 
pass parameters from coreboot to the PCI serial driver.  This requires the use 
of PlatformHelperLib which requires that I modify the .inf file and rebuild the 
serial driver.

Lee Leahy
(425) 881-4919
Intel Corporation
Suite 125
2700 - 156th Ave NE
Bellevue, WA 98007-6554

-Original Message-
From: Ma, Maurice 
Sent: Tuesday, April 19, 2016 2:33 PM
To: Leahy, Leroy P 
Cc: edk2-devel@lists.01.org; Agyeman, Prince 
Subject: RE: [PATCH 02/12] CorebootModulePkg/PciSioSerialDxe: Use 
PlatformHookLib

Hi, Lee,

For this change,  could you let us know why you decided to copy the 
PciSioSerialDxe over to the CorebootModulePkg ?
I am wondering why the current driver in MdeModulePkg cannot be reused.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:29 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 02/12] CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Bus/Pci/PciSioSerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciSioSerialDxe/ComponentName.c  |  288 +
 .../PciSioSerialDxe/PciSioSerialDxe.inf|   82 ++
 .../PciSioSerialDxe/PciSioSerialDxe.uni|   21 +
 .../PciSioSerialDxe/PciSioSerialDxeExtra.uni   |   18 +
 CorebootModulePkg/PciSioSerialDxe/Serial.c | 1248 ++
 CorebootModulePkg/PciSioSerialDxe/Serial.h |  789 
 CorebootModulePkg/PciSioSerialDxe/SerialIo.c   | 1320 
 7 files changed, 3766 insertions(+)
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/ComponentName.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.h
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/PciSioSerialDxe/ComponentName.c 
b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
new file mode 100644
index 000..994dc84
--- /dev/null
+++ b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
@@ -0,0 +1,288 @@
+/** @file
+  UEFI Component Name and Name2 protocol for Isa serial driver.
+
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include "Serial.h"
+
+//
+// EFI Component Name Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  
gPciSioSerialComponentName = {
+  SerialComponentNameGetDriverName,
+  SerialComponentNameGetControllerName,
+  "eng"
+};
+
+//
+// EFI Component Name 2 Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL 
gPciSioSerialComponentName2 = {
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SerialComponentNameGetDriverName,
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) 
SerialComponentNameGetControllerName,
+  "en"
+};
+
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE 
mSerialDriverNameTable[] = {
+  {
+"eng;en",
+L"PCI SIO Serial Driver"
+  },
+  {
+NULL,
+NULL
+  }
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mSioSerialPortName[] = L"SIO Serial Port 
#%d";
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mPciSerialPortName[] = L"PCI Serial Port 
#%d";
+
+/**
+  Retrieves a Unicode string that is the user readable name of the driver.
+
+  This function retrieves the user readable name of a driver in the form of a
+  Unicode string. If the driver specified by This has a user readable name in
+  the language specified by Language, then a pointer to the driver name is
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
+  by This does not support the language specified by Language,
+  then EFI_UNSUPPORTED is returned.
+
+  @param  This[in]  A pointer to the EFI_COMPONENT_NAME2_PROTOCOL 
or
+EFI_COMPONENT_NAME_PROTOCOL instance.
+
+  @param  Language[in]  A pointer to a Null-terminated ASCII string
+array indicating the language. This is the
+language of the driver name that the caller is
+requesting, and it must match one of the
+ 

Re: [edk2] [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

2016-04-19 Thread Leahy, Leroy P
Hi Maurice,

This driver is being built with PlatformHelperLib to pass the serial port 
configuration from coreboot.  The .inf file is modified and the driver is being 
rebuilt.

Lee Leahy
(425) 881-4919
Intel Corporation
Suite 125
2700 - 156th Ave NE
Bellevue, WA 98007-6554


-Original Message-
From: Ma, Maurice 
Sent: Tuesday, April 19, 2016 2:36 PM
To: Leahy, Leroy P 
Cc: edk2-devel@lists.01.org; Agyeman, Prince 
Subject: RE: [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

Hi, Lee,

I have the same question as previous patch.   
Please let us know why the driver in MdeModulePkg does not fit your needs.   
If it is only for PCD initialization,  we might consider using PcdsDynamic type 
and set them in platform driver instead.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P
Sent: Tuesday, April 19, 2016 1:30 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 03/12] CorebootModulePkg/SerialDxe: Use PlatformHookLib

Copy the driver from MdeModulePkg/Universal/SerialDxe.  Add PlatformHookLib to 
the Library section of the .inf file to adjust the PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/SerialDxe/SerialDxe.inf  |  55 +++
 CorebootModulePkg/SerialDxe/SerialDxe.uni  |  21 +
 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni |  19 +
 CorebootModulePkg/SerialDxe/SerialIo.c | 528 +
 4 files changed, 623 insertions(+)
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.inf
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxe.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/SerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.inf 
b/CorebootModulePkg/SerialDxe/SerialDxe.inf
new file mode 100644
index 000..8489e06
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.inf
@@ -0,0 +1,55 @@
+## @file
+#  Serial driver that layers on top of a Serial Port Library instance.
+#
+#  Copyright (c) 2008 - 2015, Intel Corporation. All rights 
+reserved. #  This program and the accompanying materials #  are 
+licensed and made available under the terms and conditions of the BSD 
+License #  which accompanies this distribution.  The full text of the 
+license may be found at # 
+http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" 
+BASIS, #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = SerialDxe
+  MODULE_UNI_FILE= SerialDxe.uni
+  FILE_GUID  = D3987D4B-971A-435F-8CAF-4967EB627241
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+
+  ENTRY_POINT= SerialDxeInitialize
+
+[Sources.common]
+  SerialIo.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  CorebootModulePkg/CorebootModulePkg.dec
+
+[LibraryClasses]
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+  DebugLib
+  PcdLib
+  PlatformHookLib
+  SerialPortLib
+
+[Protocols]
+  gEfiSerialIoProtocolGuid  ## PRODUCES
+  gEfiDevicePathProtocolGuid## PRODUCES
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity   ## CONSUMES
+  gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits ## CONSUMES
+
+[Depex]
+  TRUE
+
+[UserExtensions.TianoCore."ExtraFiles"]
+  SerialDxeExtra.uni
diff --git a/CorebootModulePkg/SerialDxe/SerialDxe.uni 
b/CorebootModulePkg/SerialDxe/SerialDxe.uni
new file mode 100644
index 000..e2daf27
--- /dev/null
+++ b/CorebootModulePkg/SerialDxe/SerialDxe.uni
@@ -0,0 +1,21 @@
+// /** @file
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Serial driver that layers on top of a Serial Port Library instance.
+//
+// Copyright (c) 2008 - 2015, Intel Corporation. All rights 
+reserved. // // This program and the accompanying materials // are 
+licensed and made available under the terms and conditions of the BSD 
+License // which accompanies this distribution. The full text of the 
+license may be found at // 
+http://opensource.org/licenses/bsd-license.php
+// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" 
+BASIS, // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "Serial driver that 
layers on top of a Serial Port Library instance"
+
+#string STR_MODULE_DESCRIPTION  #language en-US "Serial driver that 
layers on top of a Serial Port Library instance."
+
diff --git a/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni 
b/CorebootModulePkg/SerialDxe/SerialDxeExtra.uni
new file mode 100644
index 000..3

Re: [edk2] [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled devices

2016-04-19 Thread Leahy, Leroy P
HI Maurice,

Coreboot only assigns resources to devices which are enabled.  If the device is 
set to OFF in the mainboard/.../devicetree.cb file then no resources are 
assigned and the device is left disabled.  This is the issue that I am running 
into which is causing PciBusNoEnumerationDxe to fail.

Lee Leahy
(425) 881-4919
Intel Corporation
Suite 125
2700 - 156th Ave NE
Bellevue, WA 98007-6554


-Original Message-
From: Ma, Maurice 
Sent: Tuesday, April 19, 2016 2:51 PM
To: Leahy, Leroy P 
Cc: edk2-devel@lists.01.org; Agyeman, Prince 
Subject: RE: [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip 
disabled devices

Hi, Lee,

Do we assume all PCI devices will be enabled in  the command registers in 
coreboot before transitioning to the UEFI payload ?
How about those PCI devices with command register disabled but with PCI BARs 
programmed ?   If we skip them, then the resource will not be collected by the 
PciBus driver.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:30 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 04/12] CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled 
devices

Skip non-bridge devices which are not enabled either for memory or I/O access.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c 
b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
index ca300cf..3802424 100644
--- a/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
+++ b/CorebootModulePkg/PciBusNoEnumerationDxe/PciEnumeratorSupport.c
@@ -227,6 +227,15 @@ Returns:
   if (!EFI_ERROR (Status)) {
 
 //
+// Skip non-bridge devices which are not enabled
+//
+if (((Pci.Hdr.Command & (EFI_PCI_COMMAND_IO_SPACE
+  | EFI_PCI_COMMAND_MEMORY_SPACE)) == 0)
+  && (!(IS_PCI_BRIDGE (&Pci) || IS_CARDBUS_BRIDGE (&Pci {
+  continue;
+}
+
+//
 // Collect all the information about the PCI device discovered
 //
 Status = PciSearchDevice (
--
1.9.1

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


Re: [edk2] [PATCH 05/12] CorebootPayloadPkg: Make shell selectable

2016-04-19 Thread Ma, Maurice
Hi, Lee,

Did you try 64 bit build with this change?It might have issue.

For 32 bit build, the ARCH variable will be set to "IA32" in DSC.It will 
have no issue to use:
INF  RuleOverride = BINARY USE = $(ARCH)  
ShellBinPkg/UefiShell/UefiShell.inf
However for 64 bit payload, the ARCH variable will be set to  "IA32 X64". And I 
believe it will cause some syntax error during the DSC/FDF parsing.   

Please confirm it on your side.

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:30 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 05/12] CorebootPayloadPkg: Make shell selectable

Add all of the shell options from ShellBinPkg including building the shell from 
source.

Test: Use -DSHELL_TYPE=BUILD_SHELL command line options to build the shell from 
source.  Run the result on Galileo Gen2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkg.fdf| 24 +---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 78 ++--
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 78 ++--
 3 files changed, 162 insertions(+), 18 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf 
b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
index e28f732..804eeed 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf
+++ b/CorebootPayloadPkg/CorebootPayloadPkg.fdf
@@ -153,16 +153,20 @@ INF 
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 #
 # Shell
 #
-#!if $(ARCH) == IA32
-#INF  RuleOverride = BINARY USE = IA32 ShellBinPkg/UefiShell/UefiShell.inf
-#!else
-#INF  RuleOverride = BINARY USE = X64 ShellBinPkg/UefiShell/UefiShell.inf
-#!endif
-#
-!if $(ARCH) == IA32
-INF  RuleOverride = BINARY USE = IA32 EdkShellBinPkg/FullShell/FullShell.inf
-!else
-INF  RuleOverride = BINARY USE = X64 EdkShellBinPkg/FullShell/FullShell.inf
+!if $(SHELL_TYPE) == BUILD_SHELL
+INF ShellPkg/Application/Shell/Shell.inf
+!endif
+
+!if $(SHELL_TYPE) == FULL_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) 
+EdkShellBinPkg/FullShell/FullShell.inf
+!endif
+
+!if $(SHELL_TYPE) == MIN_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) 
+ShellBinPkg/MinUefiShell/MinUefiShell.inf
+!endif
+
+!if $(SHELL_TYPE) == UEFI_BIN
+INF  RuleOverride = BINARY USE = $(ARCH) 
+ShellBinPkg/UefiShell/UefiShell.inf
 !endif
 
 FILE FREEFORM= PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 42c2d20..88790e9 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -32,7 +32,12 @@
   
   DEFINE SECURE_BOOT_ENABLE  = FALSE
   DEFINE SOURCE_DEBUG_ENABLE = FALSE
-  
+
+  #
+  # Shell options: [BUILD_SHELL, FULL_BIN, MIN_BIN, NONE, UEFI]  #
+  DEFINE SHELL_TYPE  = FULL_BIN
+
 [BuildOptions]
   GCC:*_UNIXGCC_*_CC_FLAGS   = -DMDEPKG_NDEBUG
   GCC:RELEASE_*_*_CC_FLAGS   = -DMDEPKG_NDEBUG
@@ -361,6 +366,71 @@
   # Framebuffer Gop 
   #
   CorebootPayloadPkg/FbGop/FbGop.inf
-  
- 
- 
+
+  #--
+  #  Build the shell
+  #--
+
+!if $(SHELL_TYPE) == BUILD_SHELL
+
+[PcdsFixedAtBuild]
+  ## This flag is used to control initialization of the shell library
+  #  This should be FALSE for compiling the shell application itself only.
+  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+
+  #
+  # Shell Lib
+  #
+[LibraryClasses]
+  
+BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCo
+mmandLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+  FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+
+[Components.IA32]
+  ShellPkg/Application/Shell/Shell.inf {
+
+#--
+#  Basic commands
+#--
+
+
+  
NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
+  
NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
+  
+ NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comman
+ dsLib.inf
+
+#--
+#  Networking commands
+#--
+
+
+  
NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
+  
+ NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.
+ inf
+
+#--
+#  Performance command
+#--
+
+
+  NULL|ShellPkg/Library/UefiDpLib/Ue

Re: [edk2] [PATCH 06/12] CorebootPayloadPkg: Make debug serial PCDs patchable

2016-04-19 Thread Ma, Maurice
This patch looks good to me.  
Reviewed-by: Maurice Ma 

Thanks
Maurice

-Original Message-
From: Leahy, Leroy P 
Sent: Tuesday, April 19, 2016 1:31 PM
To: edk2-devel@lists.01.org; Ma, Maurice; Agyeman, Prince; Leahy, Leroy P
Subject: [PATCH 06/12] CorebootPayloadPkg: Make debug serial PCDs patchable

Make the debug serial PCDs patchable in module.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc| 16 +---
 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 16 +---
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
index 88790e9..d5f4fb1 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc
@@ -203,13 +203,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
-!if $(SOURCE_DEBUG_ENABLE)
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
-!else
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x1
@@ -221,6 +214,15 @@
 !endif
 
 [PcdsPatchableInModule.common]
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
+!if $(SOURCE_DEBUG_ENABLE)
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+
+!endif
+
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
 
diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc 
b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
index ef9f349..db6c97d 100644
--- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
+++ b/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc
@@ -204,13 +204,6 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
 
 [PcdsFixedAtBuild]
-  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
-!if $(SOURCE_DEBUG_ENABLE)
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
-!else
-  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
-!endif
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x1
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000
   gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x1
@@ -223,6 +216,15 @@
 !endif
 
 [PcdsPatchableInModule.common]
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7
+
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x804F
+!if $(SOURCE_DEBUG_ENABLE)
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+!endif
+
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x03F8
 
-- 
1.9.1

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


Re: [edk2] OVMF: hang when booting Linux via GRUB after driver allocates 2GB above 4GB

2016-04-19 Thread Bruce Cran

On 4/19/16 6:04 AM, Laszlo Ersek wrote:


Bruce, could you please test this? If 742563777e8d is indeed the
solution, I will file an RHBZ (for the RHEL kernel) to backport it.



Laszlo, I've just verified that 742563777e8d does indeed fix the 
problem: that kernel successfully boots after the memory allocation, 
whereas 3625c2c234ef66acf21a72d (the commit before it) just reboots. I 
checked that _without_ the memory allocation, that kernel also boots fine).


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


[edk2] [PATCH v2 2/2] OvmfPkg: Modify fdf files due to RamDiskDxe driver's adding ASL code

2016-04-19 Thread Hao Wu
The RamDiskDxe driver in MdeModulePkg now will sometimes report a NVDIMM
Root Device using ASL code which is put in a Secondary System Description
Table (SSDT) according to the ACPI 6.1 spec.

Locating the SSDT requires modifying the fdf files in OvmfPkg.

Cc: Laszlo Ersek 
Cc: Jordan Justen 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu 
---
 OvmfPkg/OvmfPkgIa32.fdf| 12 +++-
 OvmfPkg/OvmfPkgIa32X64.fdf | 12 +++-
 OvmfPkg/OvmfPkgX64.fdf | 12 +++-
 3 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 93a51a5..bbb201d 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -239,7 +239,7 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
-INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+INF  RuleOverride = DRIVER_ACPITABLE 
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
@@ -446,6 +446,16 @@ FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
 VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+[Rule.Common.DXE_DRIVER.DRIVER_ACPITABLE]
+  FILE DRIVER = $(NAMED_GUID) {
+DXE_DEPEX DXE_DEPEX Optional   $(INF_OUTPUT)/$(MODULE_NAME).depex
+PE32  PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
+RAW ACPI  Optional|.acpi
+RAW ASL   Optional|.aml
+UISTRING="$(MODULE_NAME)" Optional
+VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
+  }
+
 [Rule.Common.DXE_RUNTIME_DRIVER]
   FILE DRIVER = $(NAMED_GUID) {
 DXE_DEPEXDXE_DEPEX Optional  $(INF_OUTPUT)/$(MODULE_NAME).depex
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index aad16a6..152b449 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -239,7 +239,7 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
-INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+INF  RuleOverride = DRIVER_ACPITABLE 
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
@@ -446,6 +446,16 @@ FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
 VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+[Rule.Common.DXE_DRIVER.DRIVER_ACPITABLE]
+  FILE DRIVER = $(NAMED_GUID) {
+DXE_DEPEX DXE_DEPEX Optional   $(INF_OUTPUT)/$(MODULE_NAME).depex
+PE32  PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
+RAW ACPI  Optional|.acpi
+RAW ASL   Optional|.aml
+UISTRING="$(MODULE_NAME)" Optional
+VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
+  }
+
 [Rule.Common.DXE_RUNTIME_DRIVER]
   FILE DRIVER = $(NAMED_GUID) {
 DXE_DEPEXDXE_DEPEX Optional  $(INF_OUTPUT)/$(MODULE_NAME).depex
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 387b808..1cf87cc 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -239,7 +239,7 @@ INF  MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
 INF  MdeModulePkg/Universal/PrintDxe/PrintDxe.inf
 INF  MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
 INF  MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
-INF  MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+INF  RuleOverride = DRIVER_ACPITABLE 
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
 INF  MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
 INF  MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
@@ -446,6 +446,16 @@ FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
 VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
   }
 
+[Rule.Common.DXE_DRIVER.DRIVER_ACPITABLE]
+  FILE DRIVER = $(NAMED_GUID) {
+DXE_DEPEX DXE_DEPEX Optional   $(INF_OUTPUT)/$(MODULE_NAME).depex
+PE32  PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
+RAW ACPI  Optional|.acpi
+RAW ASL   Optional|.aml
+UISTRING="$(MODULE_NAME)" Optional
+VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
+  }
+
 [Rule.Common.DXE_RUNTIME_DRIVER]
   FILE DRIVER = $(NAMED_GUID) {
 DXE_DEPEXDXE_DEPEX Opt

[edk2] [PATCH v2 0/2] Report ACPI NFIT for reserved memory RAM disks

2016-04-19 Thread Hao Wu
Changes compared with V1:
1. Instead of creating a new NFIT for each registered reserved memory RAM
   disk, new cotent of the NFIT is appended to the existing one.

2. Report an NVDIMM root device in the \SB scope if there is no NFIT in
   the ACPI table.

3. Modify FDF files in OvmfPkg to make sure the report of the NVDIMM root
   device will be done correctly.

Hao Wu (2):
  MdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM
disks
  OvmfPkg: Modify fdf files due to RamDiskDxe driver's adding ASL code

 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl |  44 ++
 .../Universal/Disk/RamDiskDxe/RamDiskDxe.inf   |  12 +
 .../Universal/Disk/RamDiskDxe/RamDiskImpl.h|   6 +
 .../Universal/Disk/RamDiskDxe/RamDiskProtocol.c| 520 +
 OvmfPkg/OvmfPkgIa32.fdf|  12 +-
 OvmfPkg/OvmfPkgIa32X64.fdf |  12 +-
 OvmfPkg/OvmfPkgX64.fdf |  12 +-
 7 files changed, 615 insertions(+), 3 deletions(-)
 create mode 100644 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl

-- 
1.9.5.msysgit.0

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


[edk2] [PATCH v2 1/2] MdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM disks

2016-04-19 Thread Hao Wu
The RamDiskDxe now will report RAM disks with reserved memory type to NFIT
in the ACPI table.

This commit will also make sure that an NVDIMM root device exists in the
\SB scope before reporting any RAM disk to NFIT.

To properly report the NVDIMM root device, one will modify the RamDiskDxe
item listed in FDF files with:

INF  RuleOverride = DRIVER_ACPITABLE
MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf

Also the following rule should be added to FDF files as well:

[Rule.Common.DXE_DRIVER.DRIVER_ACPITABLE]
  FILE DRIVER = $(NAMED_GUID) {
DXE_DEPEX DXE_DEPEX Optional$(INF_OUTPUT)/$(MODULE_NAME).depex
PE32  PE32  $(INF_OUTPUT)/$(MODULE_NAME).efi
RAW ACPI  Optional|.acpi
RAW ASL   Optional|.aml
UISTRING="$(MODULE_NAME)" Optional
VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
  }

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu 
---
 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl |  44 ++
 .../Universal/Disk/RamDiskDxe/RamDiskDxe.inf   |  12 +
 .../Universal/Disk/RamDiskDxe/RamDiskImpl.h|   6 +
 .../Universal/Disk/RamDiskDxe/RamDiskProtocol.c| 520 +
 4 files changed, 582 insertions(+)
 create mode 100644 MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl

diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl
new file mode 100644
index 000..115dca0
--- /dev/null
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDisk.asl
@@ -0,0 +1,44 @@
+/** @file
+  The definition block in ACPI table for NVDIMM root device.
+
+Copyright (c) 2016, Intel Corporation. All rights reserved.
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+DefinitionBlock (
+  "RamDisk.aml",
+  "SSDT",
+  2,
+  "INTEL ",
+  "RamDisk ",
+  0x1000
+  )
+{
+  Scope (\_SB)
+  {
+Device (NVDR)
+{
+  //
+  // Define _HID, "ACPI0012" NVDIMM Root Device
+  //
+  Name (_HID, "ACPI0012")
+
+  //
+  // Readable name of this device
+  //
+  Name (_STR, Unicode ("NVDIMM Root Device"))
+
+  Method (_STA, 0)
+  {
+Return (0x0f)
+  }
+}
+  }
+}
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
index 9fe3599..d1eb429 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDxe.inf
@@ -39,6 +39,7 @@
   RamDiskHii.vfr
   RamDiskHiiStrings.uni
   RamDiskNVData.h
+  RamDisk.asl
 
 [Packages]
   MdePkg/MdePkg.dec
@@ -57,6 +58,8 @@
   FileExplorerLib
   DevicePathLib
   PrintLib
+  PcdLib
+  DxeServicesLib
 
 [Guids]
   gEfiIfrTianoGuid   ## PRODUCES## 
GUID  # HII opcode
@@ -73,6 +76,15 @@
   gEfiBlockIoProtocolGuid## PRODUCES
   gEfiBlockIo2ProtocolGuid   ## PRODUCES
   gEfiSimpleFileSystemProtocolGuid   ## SOMETIMES_CONSUMES
+  gEfiAcpiTableProtocolGuid  ## SOMETIMES_CONSUMES
+  gEfiAcpiSdtProtocolGuid## SOMETIMES_CONSUMES
+
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId   ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision  ## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId## 
SOMETIMES_CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision  ## 
SOMETIMES_CONSUMES
 
 [Depex]
   gEfiHiiConfigRoutingProtocolGuid  AND
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
index 0b9a4f9..b144f19 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.h
@@ -28,14 +28,19 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
+#include 
 
 #include "RamDiskNVData.h"
 
@@ -96,6 +101,7 @@ typedef struct {
   EFI_GUIDTypeGuid;
   UINT16  InstanceNumber;
   RAM_DISK_CREATE_METHOD  CreateMethod;
+  BOOLEAN InNfit;
 
   LIST_ENTRY  ThisInstance;
 } RAM_DISK_PRIVATE_DATA;
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskProtocol.c 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskPro

Re: [edk2] [PATCH] ShellPkg: Support connect a device handle recursively with '-r'.

2016-04-19 Thread Qiu, Shumin
Hi Jaben,
'ShellCommandLineGetCount' return the count of value parameters including the 
command name and excluding the flags.
So if we execute the command 'connect 1E -r' in Shell. The count return from 
'ShellCommandLineGetCount' is 2
The first one is 'connect' and the second one is '1E'. The 1E is DeviceHandle.

-Shumin

From: Carsey, Jaben
Sent: Wednesday, April 20, 2016 5:00 AM
To: Qiu, Shumin; edk2-devel@lists.01.org
Cc: Qiu, Shumin; Carsey, Jaben
Subject: RE: [edk2] [PATCH] ShellPkg: Support connect a device handle 
recursively with '-r'.

I am confused.

It looks like the code change is that "-r" requires ...GetCount() >2 where it 
used to be >1.  Why?  I didn't think that recursive searching required both 
DeviceHandle and DriverHandle to be on the command line...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Qiu Shumin
> Sent: Monday, April 18, 2016 1:18 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben mailto:jaben.car...@intel.com>>; 
> Qiu, Shumin
> mailto:shumin@intel.com>>
> Subject: [edk2] [PATCH] ShellPkg: Support connect a device handle
> recursively with '-r'.
> Importance: High
>
> This patch make Shell 'connect' a device handle recursively with '-r'
> option.
>
> Cc: Jaben Carsey mailto:jaben.car...@intel.com>>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin mailto:shumin@intel.com>>
> ---
>  ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> index 5d61c2f..dd3d4a6 100644
> --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Connect.c
> @@ -2,7 +2,7 @@
>Main file for connect shell Driver1 function.
>
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2010 - 2014, Intel Corporation. All rights
> reserved.
> +  Copyright (c) 2010 - 2016, 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 @@ -452,9 +452,10 @@ ShellCommandRunConnect (
>  //
>  Count = (gInReconnect?0x4:0x3);
>  if ((ShellCommandLineGetCount(Package) > Count)
> -  ||((ShellCommandLineGetFlag(Package, L"-r") ||
> ShellCommandLineGetFlag(Package, L"-c")) &&
> ShellCommandLineGetCount(Package)>1)
> +  ||(ShellCommandLineGetFlag(Package, L"-c") &&
> ShellCommandLineGetCount(Package)>1)
> +  ||(ShellCommandLineGetFlag(Package, L"-r") &&
> ShellCommandLineGetCount(Package)>2)
>||(ShellCommandLineGetFlag(Package, L"-r") &&
> ShellCommandLineGetFlag(Package, L"-c") )
> - ){
> +){
>//
>// error for too many parameters
>//
> --
> 2.7.1.windows.2
>
> ___
> 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] [staging/HTTPS-TLS][PATCH] Readme.MD: Add Readme for HTTPS-TLS branch

2016-04-19 Thread Jiaxin Wu
Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Cc: El-Haj-Mahmoud Samer 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 Readme.MD | 44 
 1 file changed, 44 insertions(+)
 create mode 100644 Readme.MD

diff --git a/Readme.MD b/Readme.MD
new file mode 100644
index 000..573593e
--- /dev/null
+++ b/Readme.MD
@@ -0,0 +1,44 @@
+This branch is used to develop the HTTPS boot feature including TLS and 
related libraries.
+
+The branch owner:
+Jiaxin Wu < jiaxin...@intel.com >
+
+## Feature Introduction
+The security of HTTPS boot is that of the underlying TLS. In simple terms, 
HTTPS boot refers to the use of HTTP boot over TLS session. **TlsDxe** driver 
takes advantage of OpenSLL library, including **BaseCryptLib** and new wrapped 
**TlsLib**, And also, **OpensslTlsLib** module is required to enable 
'openssl/ssl' function. **HttpDxe** driver in this branch consumes TlsDxe 
driver to support HTTPS feature. The HTTP instance can be able to determine 
whether to use HTTP or HTTPS feature by according to the different schemes 
("http://"; or "https://";) in the boot file URI.
+
+
+ Related Protocols
+The following protocols are related to HTTPS boot:
+```
+HTTP Service Binding Protocol
+HTTP Protocol
+HTTP Utilities Protocol
+TLS Service Binding Protocol
+TLS Protocol
+TLS Configuration Protocol
+```
+
+ Related Modules
+The following modules are related to HTTPS boot:
+```
+MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+NetworkPkg/HttpDxe/HttpDxe.inf
+NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+CryptoPkg/Library/OpensslLib/OpensslLib.inf
+CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
+CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+CryptoPkg/Library/TlsLib/TlsLib.inf
+NetworkPkg/TlsDxe/TlsDxe.inf
+```
+
+ HTTPS Authentication
+Currently, HTTPS boot feature only support server authentication with an 
unauthenticated client mode [RFC5246](https://tools.ietf.org/html/rfc5246). To 
support this mode, server CA certificate is required by Client. Private 
variable is used to configure this CA certificate. **EFI_SIGNATURE_LIST** 
format is used for this variable. In sum, the Server CA certificate must be 
configured first to enable HTTPS boot feature. The variable name and GUID are 
defined as below.
+```
+#define EFI_TLS_CA_CERTIFICATE_GUID \
+  { \
+0xfd2340D0, 0x3dab, 0x4349, { 0xa6, 0xc7, 0x3b, 0x4f, 0x12, 0xb4, 0x8e, 
0xae } \
+  }
+
+#define EFI_TLS_CA_CERTIFICATE_VARIABLE  L"TlsCaCertificate"
+```
-- 
1.9.5.msysgit.1

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


Re: [edk2] [staging/HTTPS-TLS][PATCH] Readme.MD: Add Readme for HTTPS-TLS branch

2016-04-19 Thread El-Haj-Mahmoud, Samer
Reviewed-by: Samer El-Haj-Mahmoud 



-Original Message-
From: Jiaxin Wu [jiaxin...@intel.com]
Received: Tuesday, 19 Apr 2016, 9:58PM
To: edk2-devel@lists.01.org [edk2-devel@lists.01.org]
CC: Ye Ting [ting...@intel.com]; Fu Siyuan [siyuan...@intel.com]; Long Qin 
[qin.l...@intel.com]; El-Haj-Mahmoud, Samer [samer.el-haj-mahm...@hpe.com]
Subject: [staging/HTTPS-TLS][PATCH] Readme.MD: Add Readme for HTTPS-TLS branch

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Cc: El-Haj-Mahmoud Samer 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 Readme.MD | 44 
 1 file changed, 44 insertions(+)
 create mode 100644 Readme.MD

diff --git a/Readme.MD b/Readme.MD
new file mode 100644
index 000..573593e
--- /dev/null
+++ b/Readme.MD
@@ -0,0 +1,44 @@
+This branch is used to develop the HTTPS boot feature including TLS and 
related libraries.
+
+The branch owner:
+Jiaxin Wu < jiaxin...@intel.com >
+
+## Feature Introduction
+The security of HTTPS boot is that of the underlying TLS. In simple terms, 
HTTPS boot refers to the use of HTTP boot over TLS session. **TlsDxe** driver 
takes advantage of OpenSLL library, including **BaseCryptLib** and new wrapped 
**TlsLib**, And also, **OpensslTlsLib** module is required to enable 
'openssl/ssl' function. **HttpDxe** driver in this branch consumes TlsDxe 
driver to support HTTPS feature. The HTTP instance can be able to determine 
whether to use HTTP or HTTPS feature by according to the different schemes 
("http://"; or "https://";) in the boot file URI.
+
+
+ Related Protocols
+The following protocols are related to HTTPS boot:
+```
+HTTP Service Binding Protocol
+HTTP Protocol
+HTTP Utilities Protocol
+TLS Service Binding Protocol
+TLS Protocol
+TLS Configuration Protocol
+```
+
+ Related Modules
+The following modules are related to HTTPS boot:
+```
+MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf
+NetworkPkg/HttpBootDxe/HttpBootDxe.inf
+NetworkPkg/HttpDxe/HttpDxe.inf
+NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
+CryptoPkg/Library/OpensslLib/OpensslLib.inf
+CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
+CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
+CryptoPkg/Library/TlsLib/TlsLib.inf
+NetworkPkg/TlsDxe/TlsDxe.inf
+```
+
+ HTTPS Authentication
+Currently, HTTPS boot feature only support server authentication with an 
unauthenticated client mode [RFC5246](https://tools.ietf.org/html/rfc5246). To 
support this mode, server CA certificate is required by Client. Private 
variable is used to configure this CA certificate. **EFI_SIGNATURE_LIST** 
format is used for this variable. In sum, the Server CA certificate must be 
configured first to enable HTTPS boot feature. The variable name and GUID are 
defined as below.
+```
+#define EFI_TLS_CA_CERTIFICATE_GUID \
+  { \
+0xfd2340D0, 0x3dab, 0x4349, { 0xa6, 0xc7, 0x3b, 0x4f, 0x12, 0xb4, 0x8e, 
0xae } \
+  }
+
+#define EFI_TLS_CA_CERTIFICATE_VARIABLE  L"TlsCaCertificate"
+```
--
1.9.5.msysgit.1

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


[edk2] [staging/HTTPS-TLS][PATCH 1/3] NetworkPkg: Provide an UI to support TLS authentication

2016-04-19 Thread Jiaxin Wu
This patch provides an UI to support TLS authentication.

EFI_SIGNATURE_LIST format is used for 'TlsCaCertificate'
variable. So, TLS supports multiple certificate configuration.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 NetworkPkg/Include/Guid/TlsAuthConfigHii.h |   25 +
 NetworkPkg/NetworkPkg.dec  |4 +
 NetworkPkg/NetworkPkg.dsc  |2 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c |  135 ++
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf   |   72 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni   |   21 +
 .../TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni |   19 +
 .../TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni   |   39 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c| 1843 
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h|  288 +++
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h  |   49 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr   |  152 ++
 12 files changed, 2649 insertions(+)
 create mode 100644 NetworkPkg/Include/Guid/TlsAuthConfigHii.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr

diff --git a/NetworkPkg/Include/Guid/TlsAuthConfigHii.h 
b/NetworkPkg/Include/Guid/TlsAuthConfigHii.h
new file mode 100644
index 000..9d21426
--- /dev/null
+++ b/NetworkPkg/Include/Guid/TlsAuthConfigHii.h
@@ -0,0 +1,25 @@
+/** @file
+  GUIDs used as HII FormSet and HII Package list GUID in TlsAuthConfigDxe 
driver. 
+  
+Copyright (c) 2016, 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 that 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 __TLS_AUTH_CONFIG_HII_GUID_H__
+#define __TLS_AUTH_CONFIG_HII_GUID_H__
+
+#define TLS_AUTH_CONFIG_GUID \
+  { \
+0xb0eae4f8, 0x9a04, 0x4c6d, { 0xa7, 0x48, 0x79, 0x3d, 0xaa, 0xf, 0x65, 
0xdf } \
+  }
+
+extern EFI_GUID gTlsAuthConfigGuid;
+
+#endif
diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index 268188a..065b603 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -38,10 +38,14 @@
   gIScsiConfigGuid  = { 0x4b47d616, 0xa8d6, 0x4552, { 0x9d, 0x44, 
0xcc, 0xad, 0x2e, 0xf, 0x4c, 0xf9}}
 
   # Include/Guid/HttpBootConfigHii.h
   gHttpBootConfigGuid   = { 0x4d20583a, 0x7765, 0x4e7a, { 0x8a, 0x67, 
0xdc, 0xde, 0x74, 0xee, 0x3e, 0xc5 }}
 
+  # Include/Guid/TlsAuthConfigHii.h
+  gTlsAuthConfigGuid  = { 0xb0eae4f8, 0x9a04, 0x4c6d, { 0xa7, 0x48, 
0x79, 0x3d, 0xaa, 0xf, 0x65, 0xdf }}
+  
+
 [PcdsFeatureFlag]
   ## Indicates if the IPsec IKEv2 Certificate Authentication feature is 
enabled or not.
   #   TRUE  - Certificate Authentication feature is enabled.
   #   FALSE - Does not support Certificate Authentication.
   # @Prompt Enable IPsec IKEv2 Certificate Authentication.
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index 2712a6a..5d693b9 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -51,10 +51,11 @@
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   OpensslTlsLib|CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
   TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
  
   FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
+  FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
   SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
 
 [LibraryClasses.common.UEFI_DRIVER]
   DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
 
@@ -106,10 +107,11 @@
   NetworkPkg/DnsDxe/DnsDxe.inf
   NetworkPkg/HttpDxe/HttpDxe.inf
   NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
   NetworkPkg/HttpBootDxe/HttpBootDxe.inf
   NetworkPkg/TlsDxe/TlsDxe.inf
+  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 
   NetworkPkg/Application/IfConfig6/IfConfig6.inf
   NetworkPkg/Application/IpsecConfig/IpSecConfig.inf
   Netwo

[edk2] [staging/HTTPS-TLS][PATCH 3/3] Readme.MD: Add content for TlsAuthConfigDxe

2016-04-19 Thread Jiaxin Wu
Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Cc: El-Haj-Mahmoud Samer 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 Readme.MD | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Readme.MD b/Readme.MD
index 573593e..64c696d 100644
--- a/Readme.MD
+++ b/Readme.MD
@@ -28,10 +28,11 @@ NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 CryptoPkg/Library/OpensslLib/OpensslLib.inf
 CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
 CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
 CryptoPkg/Library/TlsLib/TlsLib.inf
 NetworkPkg/TlsDxe/TlsDxe.inf
+NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 ```
 
  HTTPS Authentication
 Currently, HTTPS boot feature only support server authentication with an 
unauthenticated client mode [RFC5246](https://tools.ietf.org/html/rfc5246). To 
support this mode, server CA certificate is required by Client. Private 
variable is used to configure this CA certificate. **EFI_SIGNATURE_LIST** 
format is used for this variable. In sum, the Server CA certificate must be 
configured first to enable HTTPS boot feature. The variable name and GUID are 
defined as below.
 ```
@@ -40,5 +41,6 @@ Currently, HTTPS boot feature only support server 
authentication with an unauthe
 0xfd2340D0, 0x3dab, 0x4349, { 0xa6, 0xc7, 0x3b, 0x4f, 0x12, 0xb4, 0x8e, 
0xae } \
   }
 
 #define EFI_TLS_CA_CERTIFICATE_VARIABLE  L"TlsCaCertificate"
 ```
+**TlsAuthConfigDxe** is a temporary driver to provide an UI to support the 
required certificate configuration.
-- 
1.9.5.msysgit.1

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


[edk2] [staging/HTTPS-TLS][PATCH 0/3] Provide an UI to support TLS authentication

2016-04-19 Thread Jiaxin Wu
Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 

Jiaxin Wu (3):
  NetworkPkg: Provide an UI to support tls authentication.
  Nt32Pkg: Add TlsAuthConfigDxe module
  Readme.MD: Add content for TlsAuthConfigDxe

 NetworkPkg/Include/Guid/TlsAuthConfigHii.h |   25 +
 NetworkPkg/NetworkPkg.dec  |4 +
 NetworkPkg/NetworkPkg.dsc  |2 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c |  135 ++
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf   |   72 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni   |   21 +
 .../TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni |   19 +
 .../TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni   |   39 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c| 1843 
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h|  288 +++
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h  |   49 +
 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr   |  152 ++
 Nt32Pkg/Nt32Pkg.dsc|1 +
 Nt32Pkg/Nt32Pkg.fdf|1 +
 Readme.MD  |2 +
 15 files changed, 2653 insertions(+)
 create mode 100644 NetworkPkg/Include/Guid/TlsAuthConfigHii.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h
 create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr

-- 
1.9.5.msysgit.1

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


[edk2] [staging/HTTPS-TLS][PATCH 2/3] Nt32Pkg: Add TlsAuthConfigDxe module

2016-04-19 Thread Jiaxin Wu
This patch is used to add TlsAuthConfigDxe module.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Long Qin 
Cc: El-Haj-Mahmoud Samer 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 Nt32Pkg/Nt32Pkg.dsc | 1 +
 Nt32Pkg/Nt32Pkg.fdf | 1 +
 2 files changed, 2 insertions(+)

diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc
index 9259333..aa58a80 100644
--- a/Nt32Pkg/Nt32Pkg.dsc
+++ b/Nt32Pkg/Nt32Pkg.dsc
@@ -450,10 +450,11 @@
   NetworkPkg/HttpDxe/HttpDxe.inf
   NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf

 !if $(HTTPS_BOOT_ENABLE) == TRUE
   NetworkPkg/TlsDxe/TlsDxe.inf
+  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 !endif
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf {
 
   NULL|MdeModulePkg/Library/BmpImageDecoderLib/BmpImageDecoderLib.inf
diff --git a/Nt32Pkg/Nt32Pkg.fdf b/Nt32Pkg/Nt32Pkg.fdf
index 55dd69e..5313cff 100644
--- a/Nt32Pkg/Nt32Pkg.fdf
+++ b/Nt32Pkg/Nt32Pkg.fdf
@@ -262,10 +262,11 @@ INF  NetworkPkg/HttpBootDxe/HttpBootDxe.inf
 INF  NetworkPkg/DnsDxe/DnsDxe.inf
 INF  NetworkPkg/HttpDxe/HttpDxe.inf
 INF  NetworkPkg/HttpUtilitiesDxe/HttpUtilitiesDxe.inf
 !if $(HTTPS_BOOT_ENABLE) == TRUE
 INF  NetworkPkg/TlsDxe/TlsDxe.inf
+INF  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
 !endif
 
 

 #
 # FILE statements are provided so that a platform integrator can include
-- 
1.9.5.msysgit.1

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


Re: [edk2] [staging/HTTPS-TLS][PATCH 0/3] Provide an UI to support TLS authentication

2016-04-19 Thread Wu, Jiaxin
Hi Samer,

I also provide a UI config driver to support TLS certificate configuration, 
this may be helpful to you. Please help to review it.

Thanks
Jiaxin

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Wednesday, April 20, 2016 11:08 AM
> To: edk2-devel@lists.01.org
> Cc: Ye, Ting ; Fu, Siyuan ; Long,
> Qin 
> Subject: [edk2] [staging/HTTPS-TLS][PATCH 0/3] Provide an UI to support TLS
> authentication
> 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Cc: Long Qin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> 
> Jiaxin Wu (3):
>   NetworkPkg: Provide an UI to support tls authentication.
>   Nt32Pkg: Add TlsAuthConfigDxe module
>   Readme.MD: Add content for TlsAuthConfigDxe
> 
>  NetworkPkg/Include/Guid/TlsAuthConfigHii.h |   25 +
>  NetworkPkg/NetworkPkg.dec  |4 +
>  NetworkPkg/NetworkPkg.dsc  |2 +
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c |  135 ++
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf   |   72 +
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni   |   21 +
>  .../TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni |   19 +
>  .../TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni   |   39 +
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c| 1843
> 
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h|  288 +++
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h  |   49 +
>  NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr   |  152 ++
>  Nt32Pkg/Nt32Pkg.dsc|1 +
>  Nt32Pkg/Nt32Pkg.fdf|1 +
>  Readme.MD  |2 +
>  15 files changed, 2653 insertions(+)
>  create mode 100644 NetworkPkg/Include/Guid/TlsAuthConfigHii.h
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.c
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.uni
>  create mode 100644
> NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeExtra.uni
>  create mode 100644
> NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigNvData.h
>  create mode 100644 NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigVfr.vfr
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] MdeModulePkg RamDiskDxe: Fix wrong HII behavior for more than 8 RAM disks

2016-04-19 Thread Hao Wu
The RamDiskDxe driver originally uses a variable-length HII varstore to
retrieve the HII checkbox status of each registered RAM disk.

However, HII does not support the variable-length varstore feature.
Therefore, only the checkbox status for the first 8 RAM disks are tracked
for the following definition of HII varstore structure considering the
alignment:

typedef struct {
  UINT64Size;
  UINT8 RamDiskList[0];
  } RAM_DISK_CONFIGURATION;

This commit uses the private data of each registered RAM disks to track
the HII checkbox status instead to resolve the issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu 
---
 .../Universal/Disk/RamDiskDxe/RamDiskDriver.c  |  1 -
 .../Universal/Disk/RamDiskDxe/RamDiskImpl.c| 47 ++
 .../Universal/Disk/RamDiskDxe/RamDiskImpl.h|  5 +--
 .../Universal/Disk/RamDiskDxe/RamDiskNVData.h  | 11 +++--
 .../Universal/Disk/RamDiskDxe/RamDiskProtocol.c|  2 -
 5 files changed, 37 insertions(+), 29 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
index 7d068b2..290f4bf 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c
@@ -32,7 +32,6 @@ EFI_RAM_DISK_PROTOCOL  mRamDiskProtocol = {
 // RamDiskDxe driver maintains a list of registered RAM disks.
 //
 LIST_ENTRY  RegisteredRamDisks;
-UINTN   ListEntryNum;
 
 
 /**
diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c 
b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
index 29dcbf7..f402440 100644
--- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
+++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskImpl.c
@@ -193,7 +193,6 @@ UnregisterAllRamDisks (
 
   FreePool (PrivateData->DevicePath);
   FreePool (PrivateData);
-  ListEntryNum--;
 }
   }
 }
@@ -263,7 +262,7 @@ RamDiskExtractConfig (
   // Convert buffer data to  by helper function BlockToConfig()
   //
   ConfigPrivate = RAM_DISK_CONFIG_PRIVATE_FROM_THIS (This);
-  BufferSize = sizeof (RAM_DISK_CONFIGURATION) + ListEntryNum;
+  BufferSize = sizeof (RAM_DISK_CONFIGURATION);
   Configuration = AllocateZeroPool (BufferSize);
   if (Configuration == NULL) {
 return EFI_OUT_OF_RESOURCES;
@@ -557,8 +556,14 @@ UpdateMainForm (
 
   Index = 0;
   EFI_LIST_FOR_EACH (Entry, &RegisteredRamDisks) {
-PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
-String  = RamDiskStr;
+PrivateData  = RAM_DISK_PRIVATE_FROM_THIS (Entry);
+PrivateData->CheckBoxId  = (EFI_QUESTION_ID)
+   (MAIN_CHECKBOX_QUESTION_ID_START + Index);
+//
+// CheckBox is unchecked by default.
+//
+PrivateData->CheckBoxChecked = FALSE;
+String   = RamDiskStr;
 
 UnicodeSPrint (
   String,
@@ -574,12 +579,12 @@ UpdateMainForm (
 
 HiiCreateCheckBoxOpCode (
   StartOpCodeHandle,
-  (EFI_QUESTION_ID) (MAIN_CHECKBOX_QUESTION_ID_START + Index),
-  RAM_DISK_CONFIGURATION_VARSTORE_ID,
-  (UINT16) (RAM_DISK_LIST_VAR_OFFSET + Index),
+  PrivateData->CheckBoxId,
+  0,
+  0,
   StringId,
   STRING_TOKEN (STR_RAM_DISK_LIST_HELP),
-  0,
+  EFI_IFR_FLAG_CALLBACK,
   0,
   NULL
   );
@@ -634,7 +639,6 @@ RamDiskCallback (
   )
 {
   EFI_STATUS  Status;
-  UINTN   Index;
   RAM_DISK_PRIVATE_DATA   *PrivateData;
   RAM_DISK_CONFIG_PRIVATE_DATA*ConfigPrivate;
   RAM_DISK_CONFIGURATION  *Configuration;
@@ -679,7 +683,7 @@ RamDiskCallback (
   //
   // Get Browser data
   //
-  Configuration = AllocateZeroPool (sizeof (RAM_DISK_CONFIGURATION) + 
ListEntryNum);
+  Configuration = AllocateZeroPool (sizeof (RAM_DISK_CONFIGURATION));
   if (Configuration == NULL) {
 return EFI_OUT_OF_RESOURCES;
   }
@@ -689,7 +693,7 @@ RamDiskCallback (
   HiiGetBrowserData (
 &gRamDiskFormSetGuid,
 mRamDiskStorageName,
-sizeof (RAM_DISK_CONFIGURATION) + ListEntryNum,
+sizeof (RAM_DISK_CONFIGURATION),
 (UINT8 *) Configuration
 );
 
@@ -742,11 +746,9 @@ RamDiskCallback (
   //
   // Remove the selected RAM disks
   //
-  Index = 0;
   EFI_LIST_FOR_EACH_SAFE (Entry, NextEntry, &RegisteredRamDisks) {
-if (Configuration->RamDiskList[Index++] != 0) {
-  PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
-
+PrivateData = RAM_DISK_PRIVATE_FROM_THIS (Entry);
+if (PrivateData->CheckBoxChecked) {
   RamDiskUnregister (
 (EFI_DEVICE_PATH_PROTOCOL *) PrivateData->DevicePath
 );
@@ -756,7 +758,6 @@ RamDiskCallback (
   UpdateMainForm (ConfigPrivate);
 
   *ActionRequest = EFI_BROWSER_ACTION_REQUEST_FORM_APPLY;
-  ZeroMem (Configuration->RamDiskList, ListEntryNum);
   break;
 
 case CREATE_RAW_SUBMIT_QUESTION_ID:
@@ -781,6

[edk2] KeyEnroll Utility source code

2016-04-19 Thread Vinod Mudaliar
HI ,

 I am looking for KeyEnroll utiltiy source code.
I tried searching for it in edk2 github, but could not find it.

Thank you,

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


[edk2] [PATCH] ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

2016-04-19 Thread Ard Biesheuvel
When combining UEFI firmware built from Tianocore with ARM Trusted
Firmware running in EL3, it is the responsibility of ATF that only
a single core enters the UEFI firmware in EL2, and the remaining cores
are released directly to the OS via PSCI SMC calls.

In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
but the UniCore flavor currently checks the CPU identification registers
directly, and refuses to proceed if the boot CPU is part of a MpCore
system.

So drop the ASSERT()'s that implement this check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPlatformPkg/PrePi/MainUniCore.c | 5 -
 ArmPlatformPkg/PrePi/PrePi.c   | 2 --
 2 files changed, 7 deletions(-)

diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c 
b/ArmPlatformPkg/PrePi/MainUniCore.c
index 49b02338ebc2..11b9f462bb48 100644
--- a/ArmPlatformPkg/PrePi/MainUniCore.c
+++ b/ArmPlatformPkg/PrePi/MainUniCore.c
@@ -21,11 +21,6 @@ PrimaryMain (
   IN  UINT64StartTimeStamp
   )
 {
-  DEBUG_CODE_BEGIN();
-// On MPCore system, PeiMpCore.inf should be used instead of PeiUniCore.inf
-ASSERT(ArmIsMpCore() == 0);
-  DEBUG_CODE_END();
-
   PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
 
   // We must never return
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 8740b2a9e84d..36928c65a73b 100644
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -183,8 +183,6 @@ CEntryPoint (
 {
   UINT64   StartTimeStamp;
 
-  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
-
   // Initialize the platform specific controllers
   ArmPlatformInitialize (MpId);
 
-- 
2.5.0

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


Re: [edk2] GenFw error 3000 when using prebuilt *.a lib

2016-04-19 Thread Gao, Liming
Michael:
  I check GenFw logic. If no symbols, it will impact the relocation in the 
converted PE COFF image. I suggest you continue to check why the generated ELF 
image misses symbols.  

Thanks
Liming
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Michael Zimmermann
> Sent: Sunday, April 17, 2016 10:35 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] GenFw error 3000 when using prebuilt *.a lib
> 
> Hi,
> 
> I included a prebuilt lib in my application by defining a usual Library
> using the .a file as the source and adding the following build rule:
> 
> [Prebuilt-Static-Library-File]
> 
> *.a
> 
> 
> $(OUTPUT_DIR)(+)$(MODULE_NAME).lib
> 
> 
> $(CP) ${src} ${dst}
> 
> when my application links against that lib it compiles to a dll just fine,
> but GenFw throws this error:
> 
> "GenFw" -e UEFI_APPLICATION -o PATH.efi PATH.dll
> GenFw: ERROR 3000: Invalid
>   PATH.dll: Bad definition for symbol ''@0 or unsupported symbol
> type.  For example, absolute and undefined symbols are not supported.
> 
> "readelf -s" indeed shows me some symbols without names, but so it does
> for
> edk2-compiled sources, apparently, they get stripped later which doesn't
> seem to work for the prebuilt lib.
> 
> I've added the following flags, when externally compiling my prebuilt lib,
> but it didn't help:
> -fshort-wchar -fno-short-enums -funsigned-char -ffunction-sections
> -fdata-sections -Os -mabi=aapcs -mword-relocations
> 
> I am compiling in Linux using a ARM gcc cross compiler.
> 
> Michael
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH v2 2/6] CryptoPkg: Add OpensslTlsLib module to enable 'openssl\ssl'

2016-04-19 Thread Jiaxin Wu
v2:
* The latest version commit in CryptoPkg is in conflict with
this fix. So, this update resolve the conflict issue.
* Remove NULL 'time' parameter fix and make it as a standalone
commit.
* Update OpensslTlsLib implementation.
* convert OpensslTlsLib.uni from UTF-16 to UTF-8.

This patch is used to add OpensslTlsLib module to enable
'openssl\ssl' function.

Cc: Long Qin 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 CryptoPkg/CryptoPkg.dsc|   1 +
 CryptoPkg/Include/OpenSslSupport.h |  11 ++-
 CryptoPkg/Library/OpensslLib/Install.cmd   |   1 +
 CryptoPkg/Library/OpensslLib/Install.sh|   1 +
 CryptoPkg/Library/OpensslLib/OpensslLib.inf|   1 +
 CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf | 110 +
 CryptoPkg/Library/OpensslLib/OpensslTlsLib.uni |  21 +
 7 files changed, 145 insertions(+), 1 deletion(-)
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslTlsLib.uni

diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 5ae0e67..bb7f082 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -48,10 +48,11 @@
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
   
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
 
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  OpensslTlsLib|CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
   # This library provides the instrinsic functions generate by a given 
compiler.
diff --git a/CryptoPkg/Include/OpenSslSupport.h 
b/CryptoPkg/Include/OpenSslSupport.h
index 239ae8b..13c73b5 100644
--- a/CryptoPkg/Include/OpenSslSupport.h
+++ b/CryptoPkg/Include/OpenSslSupport.h
@@ -1,9 +1,9 @@
 /** @file
   Root include file to support building OpenSSL Crypto Library.
 
-Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
 http://opensource.org/licenses/bsd-license.php
 
@@ -116,10 +116,12 @@ typedef UINT32 ino_t;
 typedef UINT32 dev_t;
 typedef UINT16 nlink_t;
 typedef intpid_t;
 typedef void   *DIR;
 typedef void   __sighandler_t (int);
+typedef UINT8  __uint8_t;
+typedef UINT8  sa_family_t;
 
 //
 // Structures from EFI Application Toolkit required to buiild Open SSL
 //
 struct tm {
@@ -170,10 +172,16 @@ struct stat {
   UINT32   st_gen;  /* file generation number */
   INT32st_lspare;
   INT64st_qspare[2];
 };
 
+struct sockaddr {
+  __uint8_t sa_len; /* total length */
+  sa_family_t sa_family;/* address family */
+  charsa_data[14];  /* actually longer; address value */
+};
+
 //
 // Externs from EFI Application Toolkit required to buiild Open SSL
 //
 extern int errno;
 
@@ -270,8 +278,9 @@ extern FILE  *stdout;
 #define strchr(str,ch)ScanMem8((VOID 
*)(str),AsciiStrSize(str),(UINT8)ch)
 #define abort()   ASSERT (FALSE)
 #define assert(expression)
 #define localtime(timer)  NULL
 #define gmtime_r(timer,result)(result = NULL)
+#define gettimeofday(tvp,tz)  do { (tvp)->tv_sec = time(NULL); 
(tvp)->tv_usec = 0; } while (0)
 #define atoi(nptr)AsciiStrDecimalToUintn(nptr)
 
 #endif
diff --git a/CryptoPkg/Library/OpensslLib/Install.cmd 
b/CryptoPkg/Library/OpensslLib/Install.cmd
index 51e5414..e5a5f0d 100755
--- a/CryptoPkg/Library/OpensslLib/Install.cmd
+++ b/CryptoPkg/Library/OpensslLib/Install.cmd
@@ -6,10 +6,11 @@ copy crypto\crypto.hinclude\openssl
 copy crypto\opensslv.h  include\openssl
 copy crypto\opensslconf.h   include\openssl
 copy crypto\ebcdic.hinclude\openssl
 copy crypto\symhacks.h  include\openssl
 copy crypto\ossl_typ.h  include\openssl
+copy crypto\o_dir.h include
 copy crypto\objects\objects.h   include\openssl
 copy crypto\objects\obj_mac.h   include\openssl
 copy crypto\md4\md4.h   include\openssl
 copy crypto\md5\md5.h   include\openssl
 copy crypto\sha\sha.h   include\openssl
diff --git a/CryptoPkg/Library/OpensslLib/Install.sh 
b/CryptoPkg/Library/OpensslLib/Install.sh
index 06f1dcd..4ff1d39 100755
--- a/CryptoPkg/Library/OpensslLib/Install.sh
+++ b/CryptoPkg/Library/OpensslLib/Install.sh
@@ -8,10 +8,11 @@ cp crypto/crypto.hinclud

Re: [edk2] Request HTTPS branch in edk2-staging

2016-04-19 Thread Wu, Jiaxin
I would like to attach this feature branch "Readme.MD" file first before the 
new branch created.  And also update one of the request patch since the latest 
version commit in CryptoPkg is in conflict with this fix. The patch subject is  
<[Patch 2/6] CryptoPkg: Add OpensslTlsLib module to enable 'openssl\ssl'>. See 
attached email.

If no objection,  the branch will be created and named to "HTTPS-TLS".

Thanks.
Jiaxin

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of El-
> Haj-Mahmoud, Samer
> Sent: Friday, April 15, 2016 12:44 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Request HTTPS branch in edk2-staging
> 
> I would like to request the creation of a feature branch under
> https://github.com/tianocore/edk2-staging for the development of the
> HTTPs/TLS feature.
> 
> The patches (attached) were sent to EDK2 dev list (first patches were on 2/24)
> with multiple reviews. Yet, the code is not committed to EDK2. This is
> understandable because the feature may not be ready yet.
> 
> We have some additional changes we would like to make (to fix bugs and
> enhance the implementation), and would like to do this in the feature branch.
> 
> Thanks,
> --Samer
--- Begin Message ---
v2:
* The latest version commit in CryptoPkg is in conflict with
this fix. So, this update resolve the conflict issue.
* Remove NULL 'time' parameter fix and make it as a standalone
commit.
* Update OpensslTlsLib implementation.
* convert OpensslTlsLib.uni from UTF-16 to UTF-8.

This patch is used to add OpensslTlsLib module to enable
'openssl\ssl' function.

Cc: Long Qin 
Cc: Ye Ting 
Cc: Fu Siyuan 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 CryptoPkg/CryptoPkg.dsc|   1 +
 CryptoPkg/Include/OpenSslSupport.h |  11 ++-
 CryptoPkg/Library/OpensslLib/Install.cmd   |   1 +
 CryptoPkg/Library/OpensslLib/Install.sh|   1 +
 CryptoPkg/Library/OpensslLib/OpensslLib.inf|   1 +
 CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf | 110 +
 CryptoPkg/Library/OpensslLib/OpensslTlsLib.uni |  21 +
 7 files changed, 145 insertions(+), 1 deletion(-)
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf
 create mode 100644 CryptoPkg/Library/OpensslLib/OpensslTlsLib.uni

diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 5ae0e67..bb7f082 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -48,10 +48,11 @@
   
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
   
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf

   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
+  OpensslTlsLib|CryptoPkg/Library/OpensslLib/OpensslTlsLib.inf

 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # It is not possible to prevent the ARM compiler for generic intrinsic 
functions.
   # This library provides the instrinsic functions generate by a given 
compiler.
diff --git a/CryptoPkg/Include/OpenSslSupport.h 
b/CryptoPkg/Include/OpenSslSupport.h
index 239ae8b..13c73b5 100644
--- a/CryptoPkg/Include/OpenSslSupport.h
+++ b/CryptoPkg/Include/OpenSslSupport.h
@@ -1,9 +1,9 @@
 /** @file
   Root include file to support building OpenSSL Crypto Library.

-Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials
 are licensed and made available under the terms and conditions of the BSD 
License
 which accompanies this distribution.  The full text of the license may be 
found at
 http://opensource.org/licenses/bsd-license.php

@@ -116,10 +116,12 @@ typedef UINT32 ino_t;
 typedef UINT32 dev_t;
 typedef UINT16 nlink_t;
 typedef intpid_t;
 typedef void   *DIR;
 typedef void   __sighandler_t (int);
+typedef UINT8  __uint8_t;
+typedef UINT8  sa_family_t;

 //
 // Structures from EFI Application Toolkit required to buiild Open SSL
 //
 struct tm {
@@ -170,10 +172,16 @@ struct stat {
   UINT32   st_gen;  /* file generation number */
   INT32st_lspare;
   INT64st_qspare[2];
 };

+struct sockaddr {
+  __uint8_t sa_len; /* total length */
+  sa_family_t sa_family;/* address family */
+  charsa_data[14];  /* actually longer; address value */
+};
+
 //
 // Externs from EFI Application Toolkit required to buiild Open SSL
 //
 extern int errno;

@@ -270,8 +278,9 @@ extern FILE  *stdout;
 #define strchr(str,ch)ScanMem8((VOID 
*)(str),AsciiStrSize(str),(UINT8)ch)
 #define abort()   ASSERT (FALSE)
 #define assert(expression)
 #define localtime(timer)  NULL
 #define gmtime_r(timer,result)(result = NULL)
+#define gettimeofday(tvp,tz)   

Re: [edk2] [patch] NetworkPkg: refine codes of iSCSI driver.

2016-04-19 Thread Ye, Ting
Suggest to update below comment for EFI_ACCESS_DENIED from
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
To:
:  The protocol could not be removed from the handle since its interfaces are 
being used.

Other parts are good to me.

Reviewed-by: Ye Ting  

Thanks,
Ting

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang 
Lubo
Sent: Monday, April 18, 2016 4:13 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [edk2] [patch] NetworkPkg: refine codes of iSCSI driver.

Add error handling logic in DriverBingingStop function, it may return error 
status when invoking the UninstallProtocolInterface.

Cc: Fu Siyuan 
Cc: Ye Ting 
Cc: Wu Jiaxin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 NetworkPkg/IScsiDxe/IScsiDriver.c | 20 
 NetworkPkg/IScsiDxe/IScsiMisc.c   | 25 +
 NetworkPkg/IScsiDxe/IScsiMisc.h   |  9 ++---
 3 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c 
b/NetworkPkg/IScsiDxe/IScsiDriver.c
index 51ce169..cdc818f 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -1,9 +1,9 @@
 /** @file
   The entry point of IScsi driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -321,11 +321,13 @@ IScsiSupported (
   @retval EFI_SUCCESThis driver was started.
   @retval EFI_ALREADY_STARTED   This driver is already running on this device.
   @retval EFI_INVALID_PARAMETER Any input parameter is invalid.
   @retval EFI_NOT_FOUND There is no sufficient information to establish
 the iScsi session.
-  @retval EFI_DEVICE_ERROR  Failed to get TCP connection device path.  

+  @retval EFI_DEVICE_ERROR  Failed to get TCP connection device path.
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
 
 **/
 EFI_STATUS
 IScsiStart (
   IN EFI_HANDLE   Image,
@@ -861,11 +863,14 @@ IScsiStart (
 IScsiRemoveNic (ExistPrivate->Controller);
 if (ExistPrivate->Session != NULL) {
   IScsiSessionAbort (ExistPrivate->Session);
 }
 
-IScsiCleanDriverData (ExistPrivate);
+Status = IScsiCleanDriverData (ExistPrivate);
+if (EFI_ERROR (Status)) {
+  goto ON_ERROR;
+}
   }
 } else {
   //
   // Use the attempt in earlier order as boot selected in single path mode.
   //
@@ -961,10 +966,13 @@ ON_ERROR:
 if NumberOfChildren is 0.
   @param[in]  IpVersion IP_VERSION_4 or IP_VERSION_6.
   
   @retval EFI_SUCCESS   The device was stopped.
   @retval EFI_DEVICE_ERROR  The device could not be stopped due to a 
device error.
+  @retval EFI_INVALID_PARAMETER Child handle is NULL.
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
 
 **/
 EFI_STATUS
 EFIAPI
 IScsiStop (
@@ -1103,11 +,15 @@ IScsiStop (
 
   if (Private->Session != NULL) {
 IScsiSessionAbort (Private->Session);
   }
 
-  IScsiCleanDriverData (Private);
+  Status = IScsiCleanDriverData (Private);
+
+  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   return EFI_SUCCESS;
 }
 
 /**
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c 
index 5fc25a0..2406717 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -1,9 +1,9 @@
 /** @file
   Miscellaneous routines for iSCSI driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -855,26 +855,32 @@ IScsiCreateDriverData (
 
 
 /**
   Clean the iSCSI driver data.
 
-  @param[in]  Private The iSCSI driver data.
+  @param[in]  Private The iSCSI driver data.
+
+  @retval EFI_SUCCES  The clean operation is successful.
+  @retval Others  Other errors as indicated.
 
 **/
-VOID
+EFI_STATUS
 IScsiCleanDriverData (
   IN ISCSI_DRIVER_DATA  *Private
   )
 {
   EF

Re: [edk2] [patch] MdeModulePkg: refine codes of iSCSI driver.

2016-04-19 Thread Ye, Ting
Same comment for this patch for MdeModulePkg:

Suggest to update below comment for EFI_ACCESS_DENIED from
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
To:
:  The protocol could not be removed from the handle since its interfaces are 
being used.

Other parts are good to me.

Reviewed-by: Ye Ting  

Thanks,
Ting

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang 
Lubo
Sent: Monday, April 18, 2016 4:12 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [edk2] [patch] MdeModulePkg: refine codes of iSCSI driver.

Add error handling logic in DriverBingingStop function, it may return error 
status when invoking the UninstallProtocolInterface.

Cc: Fu Siyuan 
Cc: Ye Ting 
Cc: Wu Jiaxin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 .../Universal/Network/IScsiDxe/IScsiDriver.c   | 11 +--
 .../Universal/Network/IScsiDxe/IScsiMisc.c | 38 ++
 .../Universal/Network/IScsiDxe/IScsiMisc.h |  9 +++--
 3 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c 
b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index e55bee8..74379e1 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,9 +1,9 @@
 /** @file
   The entry point of IScsi driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -337,10 +337,14 @@ ON_ERROR:
   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be 
NULL 
 if NumberOfChildren is 0.Not used.
 
   @retval EFI_SUCCESS   The device was stopped.
   @retval EFI_DEVICE_ERROR  The device could not be stopped due to a 
device error.
+  @retval EFI_INVALID_PARAMETER Child handle is NULL.
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
+
 **/
 EFI_STATUS
 EFIAPI
 IScsiDriverBindingStop (
   IN EFI_DRIVER_BINDING_PROTOCOL  *This, @@ -449,11 +453,14 @@ 
IScsiDriverBindingStop (
   // Update the iSCSI Boot Firware Table.
   //
   IScsiPublishIbft ();
 
   IScsiSessionAbort (&Private->Session);
-  IScsiCleanDriverData (Private);
+  Status = IScsiCleanDriverData (Private);  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   return EFI_SUCCESS;
 }
 
 /**
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c 
b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
index ebd9f5b..bb48d8c 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
@@ -1,9 +1,9 @@
 /** @file
   Miscellaneous routines for iSCSI driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -585,38 +585,50 @@ IScsiCreateDriverData (  }
 
 /**
   Clean the iSCSI driver data.
 
-  @param[in]  Private The iSCSI driver data.
+  @param[in]  Private The iSCSI driver data.
+
+  @retval EFI_SUCCES  The clean operation is successful.
+  @retval Others  Other errors as indicated.
+
 **/
-VOID
+EFI_STATUS
 IScsiCleanDriverData (
   IN ISCSI_DRIVER_DATA  *Private
   )
 {
+  EFI_STATUS Status;
+
   if (Private->DevicePath != NULL) {
-gBS->UninstallProtocolInterface (
-  Private->ExtScsiPassThruHandle,
-  &gEfiDevicePathProtocolGuid,
-  Private->DevicePath
-  );
+Status = gBS->UninstallProtocolInterface (
+Private->ExtScsiPassThruHandle,
+&gEfiDevicePathProtocolGuid,
+Private->DevicePath
+);
+if (EFI_ERROR (Status)) {
+  goto EXIT;
+}
 
 FreePool (Private->DevicePath);
   }
 
   if (Private->ExtScsiPassThruHandle != NULL) {
-gBS->UninstallProtocolInterface (
-  Private->ExtScsiPassThruHandle,
-  &gEfiExtScsiPassThruProtocolGuid,
-  &Private->IScsiExtScsiPassThru
-  );
+Status = gBS->UninstallProtocolInterface (
+Private->ExtScsiPassThruHandle,
+&gEfiExt

Re: [edk2] [patch] MdeModulePkg: refine codes of iSCSI driver.

2016-04-19 Thread Zhang, Lubo
Thank you for your series comments,  will update them while checking in.

Thanks
Lubo 

-Original Message-
From: Ye, Ting 
Sent: Tuesday, April 19, 2016 5:02 PM
To: Zhang, Lubo ; edk2-devel@lists.01.org
Cc: Fu, Siyuan ; Wu, Jiaxin 
Subject: RE: [edk2] [patch] MdeModulePkg: refine codes of iSCSI driver.

Same comment for this patch for MdeModulePkg:

Suggest to update below comment for EFI_ACCESS_DENIED from
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
To:
:  The protocol could not be removed from the handle since its interfaces are 
being used.

Other parts are good to me.

Reviewed-by: Ye Ting  

Thanks,
Ting

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Zhang 
Lubo
Sent: Monday, April 18, 2016 4:12 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jiaxin 

Subject: [edk2] [patch] MdeModulePkg: refine codes of iSCSI driver.

Add error handling logic in DriverBingingStop function, it may return error 
status when invoking the UninstallProtocolInterface.

Cc: Fu Siyuan 
Cc: Ye Ting 
Cc: Wu Jiaxin 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo 
---
 .../Universal/Network/IScsiDxe/IScsiDriver.c   | 11 +--
 .../Universal/Network/IScsiDxe/IScsiMisc.c | 38 ++
 .../Universal/Network/IScsiDxe/IScsiMisc.h |  9 +++--
 3 files changed, 40 insertions(+), 18 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c 
b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index e55bee8..74379e1 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,9 +1,9 @@
 /** @file
   The entry point of IScsi driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -337,10 +337,14 @@ ON_ERROR:
   @param[in]  ChildHandleBuffer An array of child handles to be freed. May be 
NULL 
 if NumberOfChildren is 0.Not used.
 
   @retval EFI_SUCCESS   The device was stopped.
   @retval EFI_DEVICE_ERROR  The device could not be stopped due to a 
device error.
+  @retval EFI_INVALID_PARAMETER Child handle is NULL.
+  @retval EFI_ACCESS_DENIED The interface was not removed because the 
interface is
+still being used by a driver.
+
 **/
 EFI_STATUS
 EFIAPI
 IScsiDriverBindingStop (
   IN EFI_DRIVER_BINDING_PROTOCOL  *This, @@ -449,11 +453,14 @@ 
IScsiDriverBindingStop (
   // Update the iSCSI Boot Firware Table.
   //
   IScsiPublishIbft ();
 
   IScsiSessionAbort (&Private->Session);
-  IScsiCleanDriverData (Private);
+  Status = IScsiCleanDriverData (Private);  if (EFI_ERROR (Status)) {
+return Status;
+  }
 
   return EFI_SUCCESS;
 }
 
 /**
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c 
b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
index ebd9f5b..bb48d8c 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
@@ -1,9 +1,9 @@
 /** @file
   Miscellaneous routines for iSCSI driver.
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.
 This program and the accompanying materials  are licensed and made available 
under the terms and conditions of the BSD License  which accompanies this 
distribution.  The full text of the license may be found at  
http://opensource.org/licenses/bsd-license.php
 
@@ -585,38 +585,50 @@ IScsiCreateDriverData (  }
 
 /**
   Clean the iSCSI driver data.
 
-  @param[in]  Private The iSCSI driver data.
+  @param[in]  Private The iSCSI driver data.
+
+  @retval EFI_SUCCES  The clean operation is successful.
+  @retval Others  Other errors as indicated.
+
 **/
-VOID
+EFI_STATUS
 IScsiCleanDriverData (
   IN ISCSI_DRIVER_DATA  *Private
   )
 {
+  EFI_STATUS Status;
+
   if (Private->DevicePath != NULL) {
-gBS->UninstallProtocolInterface (
-  Private->ExtScsiPassThruHandle,
-  &gEfiDevicePathProtocolGuid,
-  Private->DevicePath
-  );
+Status = gBS->UninstallProtocolInterface (
+Private->ExtScsiPassThruHandle,
+&gEfiDevicePathProtocolGuid,
+Private->DevicePath
+);
+if (EFI_ERROR (Status)) {
+  goto EXIT;
+}
 
 FreePool (Private->DevicePath);
   }
 
   if (Private->ExtScsiPassThruHandle != NULL) {

Re: [edk2] [Patch] BaseTools: Add mixed PCD support feature

2016-04-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Yonghong Zhu
> Sent: Tuesday, April 12, 2016 11:10 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [Patch] BaseTools: Add mixed PCD support feature
> 
> Problem statement:
> The current build system requires that a PCD must use the same access
> method for all modules. A Binary Module may use a different PCD access
> method than: 1.A source tree build it is integrated into. 2.Other Binary
> Modules in platform build that use the same PCD.
> 
> Solution:
> 1. Source build:
> No change. PCDs must use the same access method for building all Source
> Modules.
> 2. Mixed Source & Binary Builds or Binary Only Builds:
> 1) Source Modules - No changes
> 2) Module that is interpreted as a Binary Module
> a.DSC file may optionally override default value of PatchableInModule
> PCDs in scope of Binary Module.
> b.DSC file must declare DynamicEx PCD subtype for all DynamicEx PCDs
> from Binary Modules.
> c.FDF file must list Binary Module INF
> 
> Build update:
> 1. PCDs in a binary module are permitted to use the PatchableInModule
> or DynamicEx access methods (the Binary INF clearly identifies the PCD
> access method for each PCD). The build must support binary modules that
> use the same or different PCD access method than the Source INFs or
> other Binary INFs.
> 2. Build report list PCDs that have mixed PCD access methods.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Yonghong Zhu 
> ---
>  BaseTools/Source/Python/AutoGen/AutoGen.py | 205
> +++--
>  BaseTools/Source/Python/AutoGen/GenC.py| 122 ++--
>  BaseTools/Source/Python/AutoGen/GenPcdDb.py|  22 ++-
>  BaseTools/Source/Python/Common/GlobalData.py   |   5 +
>  BaseTools/Source/Python/Common/VpdInfoFile.py  |  15 +-
>  .../Source/Python/Workspace/WorkspaceCommon.py |  13 +-
>  .../Source/Python/Workspace/WorkspaceDatabase.py   |  57 +-
>  BaseTools/Source/Python/build/BuildReport.py   |   8 +
>  8 files changed, 360 insertions(+), 87 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
> b/BaseTools/Source/Python/AutoGen/AutoGen.py
> index f29d368..70e2720 100644
> --- a/BaseTools/Source/Python/AutoGen/AutoGen.py
> +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
> @@ -411,10 +411,133 @@ class WorkspaceAutoGen(AutoGen):
>  PcdItem.DefaultValue = NewValue
> 
>  if (TokenCName, TokenSpaceGuidCName) in PcdSet:
>  PcdSet[(TokenCName, TokenSpaceGuidCName)] = NewValue
> 
> +SourcePcdDict = {'DynamicEx':[],
> 'PatchableInModule':[],'Dynamic':[],'FixedAtBuild':[]}
> +BinaryPcdDict = {'DynamicEx':[], 'PatchableInModule':[]}
> +SourcePcdDict_Keys = SourcePcdDict.keys()
> +BinaryPcdDict_Keys = BinaryPcdDict.keys()
> +
> +# generate the SourcePcdDict and BinaryPcdDict
> +for BuildData in PGen.BuildDatabase._CACHE_.values():
> +if BuildData.Arch != Arch:
> +continue
> +if BuildData.MetaFile.Ext == '.inf':
> +for key in BuildData.Pcds:
> +if BuildData.Pcds[key].Pending:
> +if key in Platform.Pcds:
> +PcdInPlatform = Platform.Pcds[key]
> +if PcdInPlatform.Type not in [None, '']:
> +BuildData.Pcds[key].Type = 
> PcdInPlatform.Type
> +
> +if BuildData.MetaFile in Platform.Modules:
> +PlatformModule =
> Platform.Modules[str(BuildData.MetaFile)]
> +if key in PlatformModule.Pcds:
> +PcdInPlatform = PlatformModule.Pcds[key]
> +if PcdInPlatform.Type not in [None, '']:
> +BuildData.Pcds[key].Type = 
> PcdInPlatform.Type
> +
> +if 'DynamicEx' in BuildData.Pcds[key].Type:
> +if BuildData.IsBinaryModule:
> +if (BuildData.Pcds[key].TokenCName,
> BuildData.Pcds[key].TokenSpaceGuidCName) not in
> BinaryPcdDict['DynamicEx']:
> +
> BinaryPcdDict['DynamicEx'].append((BuildData.Pcds[key].TokenCName,
> BuildData.Pcds[key].TokenSpaceGuidCName))
> +else:
> +if (BuildData.Pcds[key].TokenCName,
> BuildData.Pcds[key].TokenSpaceGuidCName) not in
> SourcePcdDict['DynamicEx']:
> +
> SourcePcdDict['DynamicEx'].append((BuildData.Pcds[key].TokenCName,
> BuildData.Pcds[key].TokenSpaceGuidCName))
> +
> +elif 'PatchableInModule' in BuildData.Pcds[key].Type:
> +if BuildData.MetaFile.Ext == '.inf':
> 

Re: [edk2] [PATCH v2 0/2] Get default value from CallBack function for OrderedList

2016-04-19 Thread Gao, Liming
Reviewed-by: Liming Gao 

> -Original Message-
> From: Bi, Dandan
> Sent: Monday, April 18, 2016 3:47 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming; Dong, Eric
> Subject: [PATCH v2 0/2] Get default value from CallBack function for
> OrderedList
> 
> For a question, it can retrive default value from Callback() function.
> For OrderedList question, the value is stored in a buffer, not in
> HiiValue. So when calling Callback() function to get default value for
> OrderedList, it need to pass the buffer, not the HiiValue.
> Patch 1 is to enahnce the SetupBrowser to fix the issue described above.
> Patch 2 is to add a sample case for orderedlist to get default value
> through Callback() function.
> 
> Notes:
>   V2:
>   - Refine the sample case in patch 2.
> 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi 
> 
> Dandan Bi (2):
>   MdeModulePkg/SetupBrowserDxe: Get default from callback for
> orderedList
>   MdeModulePkg/DriverSampleDxe: Add a sample case
> 
>  .../Universal/DriverSampleDxe/DriverSample.c   | 53
> +-
>  .../Universal/DriverSampleDxe/NVDataStruc.h|  1 +
>  MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 13 +-
>  MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 10 +++-
>  4 files changed, 74 insertions(+), 3 deletions(-)
> 
> --
> 1.9.5.msysgit.1

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


[edk2] UEFI HTTP Boot Device Path and DNS

2016-04-19 Thread Michael Chang
Background (And also Question):
The PXE Base Code Protocol is no longer produced if selecting to boot from UEFI
HTTP device from boot menu. Does anyone here know why or is it's just a problem
of my environment (I'm using OVMF from openSUSE) ? 

That made the work to support it in grub2 more complicated than it should be,
becuase it has to extract DHCP information from dhcp packets cached in
EFI_PXE_BASE_CODE_MODE structure to setup it's own network interface. That's
how it works before for TFTP, and at that time booted TFTP device path seems to
provide meaningless values.

Question:
Now that we have to get it work by taking another approach to obtain the DHCP
information from the booted (HTTP) URI device path if the PXE BC protocol
cannot be located. But then we also bumped into another issue that DNS
infomation is missing from within the device path nodes like
(MAC(..)/IPv4(...)/URI(..)) so that server name in URI cannot work but can only
use IP address (v4 or v6). Is this a spec issue or intended to leave behind DNS
info ? 

Could anyone please help to provide more insights ?

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


Re: [edk2] [PATCH v2] OvmfPkg: AcpiPlatformDxe: Don't enable unsupported PCI attributes

2016-04-19 Thread Laszlo Ersek
On 04/18/16 22:17, Jordan Justen wrote:
> Reviewed-by: Jordan Justen 

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

Commit 90bb4c577d055e7ac6f0488b21885f65617eec82.

Thank you for the contribution, Volker!
Laszlo

> On 2016-04-18 12:51:30, Volker Rümelin wrote:
>> Current code in PciEnableDecoding tries to unconditionally enable
>> EFI_PCI_IO_ATTRIBUTE_IO and EFI_PCI_IO_ATTRIBUTE_MEMORY even if they
>> are unsupported attributes. This fails on devices which don't
>> support both attributes.
>>
>> This patch masks out unsupported attributes.
>>
>> Information to reproduce the bug.
>>
>> Host lspci -s :04:00.0 -vnn:
>> 04:00.0 USB controller [0c03]: Renesas Technology Corp. uPD720201 USB
>> 3.0 Host Controller [1912:0014] (rev 03) (prog-if 30 [XHCI])
>> Flags: fast devsel, IRQ 19
>> Memory at ef90 (64-bit, non-prefetchable) [size=8K]
>> Capabilities: [50] Power Management version 3
>> Capabilities: [70] MSI: Enable- Count=1/8 Maskable- 64bit+
>> Capabilities: [90] MSI-X: Enable- Count=8 Masked-
>> Capabilities: [a0] Express Endpoint, MSI 00
>> Capabilities: [100] Advanced Error Reporting
>> Capabilities: [150] Latency Tolerance Reporting
>> Kernel driver in use: pci-stub
>> Kernel modules: xhci_pci
>>
>> libvirt xml:
>> 
>>   
>>   
>> 
>>   
>>   >function='0'/>
>> 
>>
>> OVMF debug log with additional DEBUG statement:
>> OnRootBridgesConnected: root bridges have been connected, installing
>> ACPI tables
>> Select Item: 0x19
>> EnablePciDecoding: GetLocation: D=:00:00.0
>> OrigAttr=4000 SuppAttr=E700
>> EnablePciDecoding: GetLocation: D=:00:10.0
>> OrigAttr=4000 SuppAttr=E700
>> EnablePciDecoding: GetLocation: D=:00:11.0
>> OrigAttr=4000 SuppAttr=E600
>> EnablePciDecoding: EfiPciIoAttributeOperationEnable: Unsupported
>> Select Item: 0x28
>> Select Item: 0x19
>> Select Item: 0x2A
>> Select Item: 0x19
>> Select Item: 0x27
>> InstallQemuFwCfgTables: installed 6 tables
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Volker Rümelin 
>> ---
>>
>> Changes since v1:
>> - Cosmetic changes from Laszlo's feedback
>>
>>  OvmfPkg/AcpiPlatformDxe/PciDecoding.c | 16 ++--
>>  1 file changed, 14 insertions(+), 2 deletions(-)
>>
>> diff --git a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c 
>> b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
>> index 3b9b12c..d63b57e 100644
>> --- a/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
>> +++ b/OvmfPkg/AcpiPlatformDxe/PciDecoding.c
>> @@ -89,6 +89,7 @@ EnablePciDecoding (
>>  
>>for (Idx = 0; Idx < NoHandles; ++Idx) {
>>  EFI_PCI_IO_PROTOCOL *PciIo;
>> +UINT64  Attributes;
>>  
>>  //
>>  // Look up PciIo on the handle and stash it
>> @@ -110,11 +111,22 @@ EnablePciDecoding (
>>  }
>>  
>>  //
>> +// Retrieve supported attributes
>> +//
>> +Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationSupported, 
>> 0,
>> +  &Attributes);
>> +if (EFI_ERROR (Status)) {
>> +  DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationSupported: %r\n",
>> +__FUNCTION__, Status));
>> +  goto RestoreAttributes;
>> +}
>> +
>> +//
>>  // Enable IO and MMIO decoding
>>  //
>> +Attributes &= EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY;
>>  Status = PciIo->Attributes (PciIo, EfiPciIoAttributeOperationEnable,
>> -  EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY,
>> -  NULL);
>> +  Attributes, NULL);
>>  if (EFI_ERROR (Status)) {
>>DEBUG ((EFI_D_WARN, "%a: EfiPciIoAttributeOperationEnable: %r\n",
>>  __FUNCTION__, Status));
>> -- 
>> 1.8.4.5
>>

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


Re: [edk2] OVMF: hang when booting Linux via GRUB after driver allocates 2GB above 4GB

2016-04-19 Thread Laszlo Ersek
On 04/18/16 23:23, Matt Fleming wrote:
> On Mon, 18 Apr, at 04:33:42PM, Laszlo Ersek wrote:
>>
>> I think at this point I'll copy Matt :) , and ask you to reproduce
>> the issue with a fresh upstream kernel (most recent Linux release,
>> or even fresh git). If it reproduces, then it's an upstream kernel
>> bug I think; if it doesn't reproduce, then please report an RHBZ
>> about it.
> 
> This sounds very much like the bug that was fixed in commit
> 742563777e8d ("x86/mm/pat: Avoid truncation when converting
> cpa->numpages to address"). Which might explain why Bruce can't
> reproduce it with v4.5.

Right, that commit looks like the fix! Thanks, Matt!

> Bruce, if you wanted to confirm that you could try booting
> before/after that commit and seeing if the issue is reproducible/not
> reproducible.

Bruce, could you please test this? If 742563777e8d is indeed the
solution, I will file an RHBZ (for the RHEL kernel) to backport it.

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


Re: [edk2] Request HTTPS branch in edk2-staging

2016-04-19 Thread El-Haj-Mahmoud, Samer
Looks good. No objection here

Reviewed-by: Samer El-Haj-Mahmoud 



-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Wu, 
Jiaxin
Sent: Tuesday, April 19, 2016 3:55 AM
To: El-Haj-Mahmoud, Samer ; 
edk2-devel@lists.01.org
Subject: Re: [edk2] Request HTTPS branch in edk2-staging

I would like to attach this feature branch "Readme.MD" file first before the 
new branch created.  And also update one of the request patch since the latest 
version commit in CryptoPkg is in conflict with this fix. The patch subject is  
<[Patch 2/6] CryptoPkg: Add OpensslTlsLib module to enable 'openssl\ssl'>. See 
attached email.

If no objection,  the branch will be created and named to "HTTPS-TLS".

Thanks.
Jiaxin

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
> El- Haj-Mahmoud, Samer
> Sent: Friday, April 15, 2016 12:44 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Request HTTPS branch in edk2-staging
> 
> I would like to request the creation of a feature branch under 
> https://github.com/tianocore/edk2-staging for the development of the 
> HTTPs/TLS feature.
> 
> The patches (attached) were sent to EDK2 dev list (first patches were 
> on 2/24) with multiple reviews. Yet, the code is not committed to 
> EDK2. This is understandable because the feature may not be ready yet.
> 
> We have some additional changes we would like to make (to fix bugs and 
> enhance the implementation), and would like to do this in the feature branch.
> 
> Thanks,
> --Samer
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] StdLib: add __noreturn attribute to __assert

2016-04-19 Thread Daryl McDaniel
Michael,

In your patch, you use GCC's __noreturn attribute at the end of the line.  Does 
GCC have a version of this that precedes the
declaration?

Since use of noreturn would apply in a significant number of cases, I was 
hoping to be able to produce a NORETURN macro to be used
at the beginning of declarations (in order to be able to use 
__declspec(noreturn) for MSVC).  I think I remember seeing something
like attribute(noreturn) used in GCC code.  Do you know if this form really 
exists?

Otherwise, it has to be put in a conditional compilation block on a 
case-by-case basis.

I am afraid that your patch, as is, can not be applied since it would break 
VC++ builds.


NACK by Daryl McDaniel 

Daryl McDaniel

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Michael
> Zimmermann
> Sent: Sunday, April 10, 2016 12:24 AM
> To: edk2-devel@lists.01.org
> Cc: Jaben Carsey (Intel) ; Daryl McDaniel  li...@mc2research.org>
> Subject: Re: [edk2] [PATCH] StdLib: add __noreturn attribute to __assert
> 
> I guess it's time to send a reminder for this patch :)
> 
> MIchael
> 
> On Tue, Feb 9, 2016 at 3:27 AM, Daryl McDaniel 
> wrote:
> 
> > Michael,
> >
> > Thanks for the report and clear references.
> > I'll add this to the list of StdLib work.
> >
> > Also, thanks for the reminder about '__declspec(noreturn)'.
> >
> > Daryl McDaniel
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > Michael
> > > Zimmermann
> > > Sent: Monday, February 08, 2016 8:42 AM
> > > To: Andrew Fish 
> > > Cc: edk2-devel@lists.01.org 
> > > Subject: Re: [edk2] [PATCH] StdLib: add __noreturn attribute to __assert
> > >
> > > it is StdLib specific and other functions like abort are using it
> > already.
> > > from StdLib/Include/sys/EfiCdefs.h:
> > > #if __GNUC_PREREQ__(2, 7)
> > > #define __unused  __attribute__((__unused__))
> > > #define __noreturn  __attribute__((__noreturn__))
> > > #else
> > > #define __unused  /* delete */
> > > #define __noreturn  /* delete */
> > > #endif
> > >
> > > do other compilers(VC?) really don't need this or should we treat it as
> > not
> > > being implemented?
> > > This page shows that there's sth. called '__declspec(noreturn)':
> > > https://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx
> > > but obviously there are even more compilers than just gcc and vc.
> > >
> > > On Mon, Feb 8, 2016 at 5:32 PM, Andrew Fish  wrote:
> > >
> > > >
> > > > > On Feb 8, 2016, at 4:15 AM, Michael Zimmermann <
> > sigmaepsilo...@gmail.com>
> > > > wrote:
> > > > >
> > > > > this prevents warnings like 'control reaches end of non-void
> > function'.
> > > > >
> > > > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > > > Signed-off-by: M1cha 
> > > > > ---
> > > > > StdLib/Include/assert.h | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/StdLib/Include/assert.h b/StdLib/Include/assert.h
> > > > > index ece4f27..8369f25 100644
> > > > > --- a/StdLib/Include/assert.h
> > > > > +++ b/StdLib/Include/assert.h
> > > > > @@ -52,7 +52,7 @@ __BEGIN_DECLS
> > > > >   the application was launched from.
> > > > > **/
> > > > > extern void
> > > > > -__assert(const char *file, const char *func, int line, const char
> > > > > *failedexpr);
> > > > > +__assert(const char *file, const char *func, int line, const char
> > > > > *failedexpr) __noreturn;
> > > > >
> > > >
> > > > Is __noreturn in the C standard or is it compiler specific?
> > > >
> > > > Thanks,
> > > >
> > > > Andrew Fish
> > > >
> > > > > __END_DECLS
> > > > >
> > > > > --
> > > > > 2.7.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
> >
> >
> ___
> 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 5/5] ArmPkg/ArmDmaLib: do not remap arbitrary memory regions as uncached

2016-04-19 Thread Ard Biesheuvel
In the DmaMap () operation, if the region to be mapped happens to be
aligned to the Cache Writeback Granule (CWG) (whose value is typically
64 or 128 bytes and 2 KB maximum), we remap the memory as uncached.

Since remapping memory occurs at page granularity, while the buffer and the
CWG may be much smaller, there is no telling what other memory we affect
by doing this, especially since the operation is not reverted in DmaUnmap().

So remove the remapping call.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 6 --
 1 file changed, 6 deletions(-)

diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 7e518ed3b83e..83f4d38a8a60 100644
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -137,12 +137,6 @@ DmaMap (
 
 // Flush the Data Cache (should not have any effect if the memory region 
is uncached)
 gCpu->FlushDataCache (gCpu, *DeviceAddress, *NumberOfBytes, 
EfiCpuFlushTypeWriteBackInvalidate);
-
-if ((Operation == MapOperationBusMasterRead) || (Operation == 
MapOperationBusMasterCommonBuffer)) {
-  // In case the buffer is used for instance to send command to a PCI 
controller, we must ensure the memory is uncached
-  Status = gDS->SetMemorySpaceAttributes (*DeviceAddress & ~(BASE_4KB - 
1), ALIGN_VALUE (*NumberOfBytes, BASE_4KB), EFI_MEMORY_WC);
-  ASSERT_EFI_ERROR (Status);
-}
   }
 
   Map->HostAddress   = (UINTN)HostAddress;
-- 
2.5.0

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


[edk2] [PATCH 2/5] ArmPkg/ArmDmaLib: consistently use 'gCacheAlignment - 1' as alignment mask

2016-04-19 Thread Ard Biesheuvel
We manage to use both an AND operation with 'gCacheAlignment - 1' and a
modulo operation with 'gCacheAlignment' in the same compound if statement.
Since gCacheAlignment is a global of which the compiler cannot guarantee
that it is a power of two, simply use the AND version, and use it against
the bitwise OR of the two values to be tested.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 1e6b288b10b9..834afdba10ef 100644
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -92,8 +92,7 @@ DmaMap (
 
   *Mapping = Map;
 
-  if UINTN)HostAddress & (gCacheAlignment - 1)) != 0) ||
-  ((*NumberOfBytes % gCacheAlignment) != 0)) {
+  if UINTN)HostAddress | *NumberOfBytes) & (gCacheAlignment - 1)) != 0) {
 
 // Get the cacheability of the region
 Status = gDS->GetMemorySpaceDescriptor (*DeviceAddress, &GcdDescriptor);
-- 
2.5.0

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


[edk2] [PATCH 3/5] ArmPkg/ArmDmaLib: interpret GCD attributes as a bit field

2016-04-19 Thread Ard Biesheuvel
Comparing a GCD attribute field directly against EFI_MEMORY_UC and
EFI_MEMORY_WT is incorrect, since it may have other bits set as well
which are not related to the cacheability of the region. So instead,
test explicitly against the flags EFI_MEMORY_WB and EFI_MEMORY_WT,
which must be set if the region may be mapped with cacheable attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 834afdba10ef..7f6598318a91 100644
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -101,9 +101,7 @@ DmaMap (
 }
 
 // If the mapped buffer is not an uncached buffer
-if ( (GcdDescriptor.Attributes != EFI_MEMORY_WC) &&
- (GcdDescriptor.Attributes != EFI_MEMORY_UC) )
-{
+if ((GcdDescriptor.Attributes & (EFI_MEMORY_WB | EFI_MEMORY_WT)) != 0) {
   //
   // If the buffer does not fill entire cache lines we must double buffer 
into
   // uncached memory. Device (PCI) address becomes uncached page.
-- 
2.5.0

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


[edk2] [PATCH 4/5] ArmPkg/ArmDmaLib: reject consistent DMA mappings of cached memory

2016-04-19 Thread Ard Biesheuvel
DmaMap () operations of type MapOperationBusMasterCommonBuffer should
return a mapping that is coherent between the CPU and the device. For
this reason, the API only allows DmaMap () to be called with this operation
type if the memory to be mapped was allocated by DmaAllocateBuffer (),
which in this implementation guarantees the coherency by using uncached
mappings on the CPU side.

This means that, if we encounter a cached mapping in DmaMap () with this
operation type, the code is either broken, or someone is violating the
API, but simply proceeding with a double buffer makes no sense at all,
and can only cause problems.

So instead, actively reject this operation type for cached memory mappings.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 7f6598318a91..7e518ed3b83e 100644
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -103,6 +103,18 @@ DmaMap (
 // If the mapped buffer is not an uncached buffer
 if ((GcdDescriptor.Attributes & (EFI_MEMORY_WB | EFI_MEMORY_WT)) != 0) {
   //
+  // Operations of type MapOperationBusMasterCommonBuffer are only allowed
+  // on uncached buffers.
+  //
+  if (Operation == MapOperationBusMasterCommonBuffer) {
+DEBUG ((EFI_D_ERROR,
+  "%a: Operation type 'MapOperationBusMasterCommonBuffer' is only 
supported\n"
+  "on memory regions that were allocated using DmaAllocateBuffer ()\n",
+  __FUNCTION__));
+return EFI_UNSUPPORTED;
+  }
+
+  //
   // If the buffer does not fill entire cache lines we must double buffer 
into
   // uncached memory. Device (PCI) address becomes uncached page.
   //
@@ -112,7 +124,7 @@ DmaMap (
 return Status;
   }
 
-  if ((Operation == MapOperationBusMasterRead) || (Operation == 
MapOperationBusMasterCommonBuffer)) {
+  if (Operation == MapOperationBusMasterRead) {
 CopyMem (Buffer, HostAddress, *NumberOfBytes);
   }
 
@@ -168,7 +180,9 @@ DmaUnmap (
   Map = (MAP_INFO_INSTANCE *)Mapping;
 
   if (Map->DoubleBuffer) {
-if ((Map->Operation == MapOperationBusMasterWrite) || (Map->Operation == 
MapOperationBusMasterCommonBuffer)) {
+ASSERT (Map->Operation != MapOperationBusMasterCommonBuffer);
+
+if (Map->Operation == MapOperationBusMasterWrite) {
   CopyMem ((VOID *)(UINTN)Map->HostAddress, (VOID 
*)(UINTN)Map->DeviceAddress, Map->NumberOfBytes);
 }
 
-- 
2.5.0

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


[edk2] [PATCH 1/5] ArmPkg/ArmDmaLib: deal with NULL return value of UncachedAllocatePages ()

2016-04-19 Thread Ard Biesheuvel
The allocation function UncachedAllocatePages () may return NULL, in
which case our implementation of DmaAllocateBuffer () should return
EFI_OUT_OF_RESOURCES rather than silently ignoring the NULL value and
returning EFI_SUCCESS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
index 54a49a18d302..1e6b288b10b9 100644
--- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
+++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
@@ -216,6 +216,8 @@ DmaAllocateBuffer (
   OUT VOID **HostAddress
   )
 {
+  VOID*Allocation;
+
   if (HostAddress == NULL) {
 return EFI_INVALID_PARAMETER;
   }
@@ -226,13 +228,19 @@ DmaAllocateBuffer (
   // We used uncached memory to keep coherency
   //
   if (MemoryType == EfiBootServicesData) {
-*HostAddress = UncachedAllocatePages (Pages);
+Allocation = UncachedAllocatePages (Pages);
   } else if (MemoryType == EfiRuntimeServicesData) {
-*HostAddress = UncachedAllocateRuntimePages (Pages);
+Allocation = UncachedAllocateRuntimePages (Pages);
   } else {
 return EFI_INVALID_PARAMETER;
   }
 
+  if (Allocation == NULL) {
+return EFI_OUT_OF_RESOURCES;
+  }
+
+  *HostAddress = Allocation;
+
   return EFI_SUCCESS;
 }
 
-- 
2.5.0

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


[edk2] [PATCH 1/3] Platforms/ARM/Juno: Fix IO window translate offset in PCIe root complex

2016-04-19 Thread Sudeep Holla
XPress-RICH3 PCIe driver initialises the root complex with the same
source and target address for IO window which makes translate offset 0.

This patch fixes the translate offset for the IO window in Juno PCIe
root complex ACPI table.

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Signed-off-by: Sudeep Holla 
---
 Platforms/ARM/Juno/AcpiTables/AcpiSsdtRootPci.asl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platforms/ARM/Juno/AcpiTables/AcpiSsdtRootPci.asl 
b/Platforms/ARM/Juno/AcpiTables/AcpiSsdtRootPci.asl
index 800d2cb3b2fb..ab5041db731a 100644
--- a/Platforms/ARM/Juno/AcpiTables/AcpiSsdtRootPci.asl
+++ b/Platforms/ARM/Juno/AcpiTables/AcpiSsdtRootPci.asl
@@ -109,7 +109,7 @@ DefinitionBlock("SsdtPci.aml", "SSDT", 1, "ARMLTD", 
"ARM-JUNO", EFI_ACPI_ARM_OEM
0x, 
// Granularity
0x5f80, 
// Min Base Address
0x5fff, 
// Max Base Address
-   0x5f80, 
// Translate
+   0x, 
// Translate
0x0080  
// Length
)
}) // Name(RBUF)
-- 
1.9.1

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


[edk2] [PATCH 2/3] Platforms/ARM/Juno: limit ACPI support to v5.0 and higher

2016-04-19 Thread Sudeep Holla
The ACPI spec predates the AARCH64 architecture by 5 versions, so there
is no point in supporting anything below v5.0. So set the PCD that
controls the ACPI table generation to the appropriate value.

Based on the commit e0692789058e ("ArmVirtPkg/ArmVirtQemu: limit ACPI
support to v5.0 and higher") in the upstream TianoCore by Ard Biesheuvel

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Signed-off-by: Sudeep Holla 
---
 Platforms/ARM/Juno/ArmJuno.dsc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc
index aef4c2167a1e..d961fd41be18 100644
--- a/Platforms/ARM/Juno/ArmJuno.dsc
+++ b/Platforms/ARM/Juno/ArmJuno.dsc
@@ -173,6 +173,8 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
   gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 
0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
 
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
+
 [PcdsPatchableInModule]
   # Console Resolution (Full HD)
   gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|1920
-- 
1.9.1

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


[edk2] [PATCH 3/3] Platforms/ARM/Juno: Add support for ACPI 6.0 LPI(Low Power Idle) states

2016-04-19 Thread Sudeep Holla
ACPI 6.0 introduced LPI(Low Power Idle) states that provides an alternate
method to describe processor idle states.

LPI extensions leverages the processor container device(again introduced
in ACPI 6.0) allowing to express which parts of the system are affected
by a given LPI state. It defines the local power states for each node
in a hierarchical processor topology. The OSPM can use _LPI object to
select a local power state for each level of processor hierarchy in the
system.

This patch adds LPI support on Juno.

Contributed-under: TianoCore Contribution Agreement 1.0
Cc: Ard Biesheuvel 
Cc: Leif Lindholm 
Signed-off-by: Sudeep Holla 
---
 Platforms/ARM/Juno/AcpiTables/Dsdt.asl | 232 ++---
 1 file changed, 213 insertions(+), 19 deletions(-)

diff --git a/Platforms/ARM/Juno/AcpiTables/Dsdt.asl 
b/Platforms/ARM/Juno/AcpiTables/Dsdt.asl
index c80f46a4ce64..3247e6b12aa5 100644
--- a/Platforms/ARM/Juno/AcpiTables/Dsdt.asl
+++ b/Platforms/ARM/Juno/AcpiTables/Dsdt.asl
@@ -19,29 +19,223 @@ DefinitionBlock("DsdtTable.aml", "DSDT", 1, "ARMLTD", 
"ARM-JUNO", EFI_ACPI_ARM_O
 //
 // A57x2-A53x4 Processor declaration
 //
-Device(CPU0) { // A53-0: Cluster 1, Cpu 0
-  Name(_HID, "ACPI0007")
-  Name(_UID, 0)
+Method (_OSC, 4, Serialized)  { // _OSC: Operating System Capabilities
+  CreateDWordField (Arg3, 0x00, STS0)
+  CreateDWordField (Arg3, 0x04, CAP0)
+  If ((Arg0 == ToUUID ("0811b06e-4a27-44f9-8d60-3cbbc22e7b48") /* 
Platform-wide Capabilities */)) {
+If (!(Arg1 == One)) {
+  STS0 &= ~0x1F
+  STS0 |= 0x0A
+} Else {
+  If ((CAP0 & 0x100)) {
+CAP0 &= ~0x100 /* No support for OS Initiated LPI */
+STS0 &= ~0x1F
+STS0 |= 0x12
+  }
+}
+  } Else {
+STS0 &= ~0x1F
+STS0 |= 0x06
+  }
+  Return (Arg3)
 }
-Device(CPU1) { // A53-1: Cluster 1, Cpu 1
-  Name(_HID, "ACPI0007")
+Device (CLU0) { // Cluster0 state
+  Name(_HID, "ACPI0010")
   Name(_UID, 1)
+  Name (_LPI, Package() {
+0, // Version
+0, // Level Index
+1, // Count
+Package() { // Power Gating state for Cluster
+  2500, // Min residency (uS)
+  1150, // Wake latency (uS)
+  1, // Flags
+  1, // Arch Context Flags
+  100, //Residency Counter Frequency
+  0, // No Parent State
+  0x0100, // Integer Entry method
+  ResourceTemplate() { // Null Residency Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  ResourceTemplate() { // Null Usage Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  "CluPwrDn"
+},
+  })
+  Name(PLPI, Package() {
+0, // Version
+1, // Level Index
+2, // Count
+Package() { // WFI for CPU
+  1, // Min residency (uS)
+  1, // Wake latency (uS)
+  1, // Flags
+  0, // Arch Context Flags
+  100, //Residency Counter Frequency
+  0, // No parent state
+  ResourceTemplate () {
+// Register Entry method
+Register (FFixedHW,
+  0x20,   // Bit Width
+  0x00,   // Bit Offset
+  0x, // Address
+  0x03,   // Access Size
+  )
+  },
+  ResourceTemplate() { // Null Residency Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  ResourceTemplate() { // Null Usage Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  "WFI",
+},
+Package() { // Power Gating state for CPU
+  150, // Min residency (uS)
+  350, // Wake latency (uS)
+  1, // Flags
+  1, // Arch Context Flags
+  100, //Residency Counter Frequency
+  1, // Parent node can be in any state
+  ResourceTemplate () {
+// Register Entry method
+Register (FFixedHW,
+  0x20,   // Bit Width
+  0x00,   // Bit Offset
+  0x0001, // Address
+  0x03,   // Access Size
+  )
+  },
+  ResourceTemplate() { // Null Residency Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  ResourceTemplate() { // Null Usage Counter
+Register (SystemMemory, 0, 0, 0, 0)
+  },
+  "CorePwrDn"
+},
+  })
+  Device(CPU0) { // A57-0: Cluster 0, Cpu 0
+Name(_HID, "ACPI0007")
+Name(_UID, 4)
+Method (_LPI, 0, NotSerialized) {
+  return(PLPI)
+}
+  }
+  Device(CPU1) { // A57-1: Cluster 0, Cpu 1
+Name(_HID, "ACPI0007")
+Name(_UID, 5)
+Method (_LPI, 0, NotSerialized) {
+  return(PLPI)
+}
+  }
 }
-   

Re: [edk2] [PATCH 5/5] ArmPkg/ArmDmaLib: do not remap arbitrary memory regions as uncached

2016-04-19 Thread Ard Biesheuvel
On 19 April 2016 at 16:55, Ard Biesheuvel  wrote:
> In the DmaMap () operation, if the region to be mapped happens to be
> aligned to the Cache Writeback Granule (CWG) (whose value is typically
> 64 or 128 bytes and 2 KB maximum), we remap the memory as uncached.
>
> Since remapping memory occurs at page granularity, while the buffer and the
> CWG may be much smaller, there is no telling what other memory we affect
> by doing this, especially since the operation is not reverted in DmaUnmap().
>
> So remove the remapping call.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPkg/Library/ArmDmaLib/ArmDmaLib.c | 6 --
>  1 file changed, 6 deletions(-)
>
> diff --git a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c 
> b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
> index 7e518ed3b83e..83f4d38a8a60 100644
> --- a/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
> +++ b/ArmPkg/Library/ArmDmaLib/ArmDmaLib.c
> @@ -137,12 +137,6 @@ DmaMap (
>
>  // Flush the Data Cache (should not have any effect if the memory region 
> is uncached)
>  gCpu->FlushDataCache (gCpu, *DeviceAddress, *NumberOfBytes, 
> EfiCpuFlushTypeWriteBackInvalidate);
> -
> -if ((Operation == MapOperationBusMasterRead) || (Operation == 
> MapOperationBusMasterCommonBuffer)) {
> -  // In case the buffer is used for instance to send command to a PCI 
> controller, we must ensure the memory is uncached
> -  Status = gDS->SetMemorySpaceAttributes (*DeviceAddress & ~(BASE_4KB - 
> 1), ALIGN_VALUE (*NumberOfBytes, BASE_4KB), EFI_MEMORY_WC);
> -  ASSERT_EFI_ERROR (Status);
> -}
>}
>
>Map->HostAddress   = (UINTN)HostAddress;

Actually, I have a better fix for this (or a followup patch on top)

The problem here is that a misbehaving client of this code may attempt
to create a consistent DMA mapping of a region that happens to be
aligned sufficiently to the CWG, in which case we never check if the
mapping is cached or not. Instead, we should always check if a mapping
is cached, and reject consistent mappings rather than remap them as
uncached on the fly (like above) without regard of what else may be
affected.

Unfortunately, it is difficult for me to test these changes, and I am
quite sure they will break something somewhere, or these dodgy things
would not have been added in the first place.
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] .bss section is being combined with the .data section in GCC linker script

2016-04-19 Thread Stephen Polkowski

Hello,

Could someone explain why the .bss section is being combined with the
.data section in the GCC linker script in the EDK2?  This will force all
uninitialized variables to take space in the output .efi file.  This
seems really wasteful.

GccBase.lds

/*
 * The alignment of the .data section should be less than or equal to
 * the alignment of the .text section. This ensures that the relative
 * offset between these sections is the same in the ELF and the PE/COFF
 * versions of this binary.
 */

.data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {
 *(.data .data.* .gnu.linkonce.d.*)
 *(.bss .bss.*)
}


At first I thought that the PE COFF file format couldn't support an
uninitialized data section, but this isn't the case.   Then, I thought
the UEFI designers just overlooked the issue.  However, I noticed that
the LoadImage() code in BasePeCoff.c will ZERO out the remaining data in
a section if its raw size is less than its virtual size.

//
// If raw size is less then virt size, zero fill the remaining
//

if (Size < Section->Misc.VirtualSize) {
  ZeroMem (Base + Size, Section->Misc.VirtualSize - Size);
}

If it is true that the UEFI LoadImage() routine will zero the end of a
section, then the GenFw executable could create a .bss section with a
raw size of 4 and a virtual size the equals the true size of the bss.
Another option is that GenFw could merge the .bss section to the end of
the .data section.  Again, the raw size could equal the .data section
size and the virtual size could equal the size of both .data and .bss
sections combined.

I wonder how much space could be saved if the UEFI executables had a
.bss section?


Thanks,

Stephen 



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


Re: [edk2] [Patch] ShellPkg: Enhance ping to select the interface automatically

2016-04-19 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 



> -Original Message-
> From: Wu, Jiaxin
> Sent: Monday, April 18, 2016 6:52 PM
> To: edk2-devel@lists.01.org
> Cc: David Van Arnem ; Bhupesh Sharma
> ; Carsey, Jaben ; Ye,
> Ting ; Fu, Siyuan 
> Subject: [Patch] ShellPkg: Enhance ping to select the interface automatically
> Importance: High
> 
> This patch is used to support no source IP specified case
> while multiple NICs existed in the platform. The command
> will select the first both connected and configured interface
> automatically.
> 
> Cc: David Van Arnem 
> Cc: Bhupesh Sharma 
> Cc: Jaben Carsey 
> Cc: Ye Ting 
> Cc: Fu Siyuan 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  .../Library/UefiShellNetwork1CommandsLib/Ping.c| 224 
> -
>  1 file changed, 127 insertions(+), 97 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> index 13bcdde..6b05884 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
> @@ -874,20 +874,24 @@ PingCreateIpInstance (
>  {
>EFI_STATUS   Status;
>UINTNHandleIndex;
>UINTNHandleNum;
>EFI_HANDLE   *HandleBuffer;
> +  BOOLEAN  UnspecifiedSrc;
> +  BOOLEAN  MediaPresent;
>EFI_SERVICE_BINDING_PROTOCOL *EfiSb;
>VOID *IpXCfg;
>EFI_IP6_CONFIG_DATA  Ip6Config;
>EFI_IP4_CONFIG_DATA  Ip4Config;
>VOID *IpXInterfaceInfo;
>UINTNIfInfoSize;
>EFI_IPv6_ADDRESS *Addr;
>UINTNAddrIndex;
> 
>HandleBuffer  = NULL;
> +  UnspecifiedSrc= FALSE;
> +  MediaPresent  = TRUE;
>EfiSb = NULL;
>IpXInterfaceInfo  = NULL;
>IfInfoSize= 0;
> 
>//
> @@ -923,139 +927,165 @@ PingCreateIpInstance (
>ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV),
> gShellNetwork1HiiHandle, L"ping", mSrcString);
>Status = EFI_INVALID_PARAMETER;
>goto ON_ERROR;
>  }
>}
> +
> +  if (Private->IpChoice == PING_IP_CHOICE_IP6 ? NetIp6IsUnspecifiedAddr
> ((EFI_IPv6_ADDRESS*)&Private->SrcAddress) : \
> +  PingNetIp4IsUnspecifiedAddr ((EFI_IPv4_ADDRESS*)&Private-
> >SrcAddress)) {
> +//
> +// SrcAddress is unspecified. So, both connected and configured interface
> will be automatic selected.
> +//
> +UnspecifiedSrc = TRUE;
> +  }
> +
>//
>// For each ip6 protocol, check interface addresses list.
>//
>for (HandleIndex = 0; HandleIndex < HandleNum; HandleIndex++) {
> -
>  EfiSb = NULL;
>  IpXInterfaceInfo  = NULL;
>  IfInfoSize= 0;
> 
> +if (UnspecifiedSrc) {
> +  //
> +  // Check media.
> +  //
> +  NetLibDetectMedia (HandleBuffer[HandleIndex], &MediaPresent);
> +  if (!MediaPresent) {
> +//
> +// Skip this one.
> +//
> +continue;
> +  }
> +}
> +
>  Status = gBS->HandleProtocol (
>  HandleBuffer[HandleIndex],
>  Private->IpChoice ==
> PING_IP_CHOICE_IP6?&gEfiIp6ServiceBindingProtocolGuid:&gEfiIp4ServiceBi
> ndingProtocolGuid,
>  (VOID **) &EfiSb
>  );
>  if (EFI_ERROR (Status)) {
>goto ON_ERROR;
>  }
> 
> -if (Private->IpChoice == PING_IP_CHOICE_IP6?NetIp6IsUnspecifiedAddr
> ((EFI_IPv6_ADDRESS*)&Private->SrcAddress):PingNetIp4IsUnspecifiedAddr
> ((EFI_IPv4_ADDRESS*)&Private->SrcAddress)) {
> -  //
> -  // No need to match interface address.
> -  //
> -  break;
> +//
> +// Ip6config protocol and ip6 service binding protocol are installed
> +// on the same handle.
> +//
> +Status = gBS->HandleProtocol (
> +HandleBuffer[HandleIndex],
> +Private->IpChoice ==
> PING_IP_CHOICE_IP6?&gEfiIp6ConfigProtocolGuid:&gEfiIp4Config2ProtocolGu
> id,
> +(VOID **) &IpXCfg
> +);
> +
> +if (EFI_ERROR (Status)) {
> +  goto ON_ERROR;
> +}
> +//
> +// Get the interface information size.
> +//
> +if (Private->IpChoice == PING_IP_CHOICE_IP6) {
> +  Status = ((EFI_IP6_CONFIG_PROTOCOL*)IpXCfg)->GetData (
> + IpXCfg,
> + Ip6ConfigDataTypeInterfaceInfo,
> + &IfInfoSize,
> + NULL
> + );
>  } else {
> -  //
> -  // Ip6config protocol and ip6 service binding protocol are installed
> -  // on the same handle.
> -  //
> -  Status = gBS->HandleProtocol (
> -  HandleBuffer[Handl

Re: [edk2] [PATCH] StdLib: add __noreturn attribute to __assert

2016-04-19 Thread Michael Zimmermann
Hi

it doesn't break building with VC++ because __noreturn isn't from GCC, it's
from edk2.
https://github.com/tianocore/edk2/blob/master/StdLib/Include/sys/EfiCdefs.h#L211

Michael

On Tue, Apr 19, 2016 at 4:21 PM, Daryl McDaniel 
wrote:

> Michael,
>
> In your patch, you use GCC's __noreturn attribute at the end of the line.
> Does GCC have a version of this that precedes the
> declaration?
>
> Since use of noreturn would apply in a significant number of cases, I was
> hoping to be able to produce a NORETURN macro to be used
> at the beginning of declarations (in order to be able to use
> __declspec(noreturn) for MSVC).  I think I remember seeing something
> like attribute(noreturn) used in GCC code.  Do you know if this form
> really exists?
>
> Otherwise, it has to be put in a conditional compilation block on a
> case-by-case basis.
>
> I am afraid that your patch, as is, can not be applied since it would
> break VC++ builds.
>
>
> NACK by Daryl McDaniel 
>
> Daryl McDaniel
>
> > -Original Message-
> > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Michael
> > Zimmermann
> > Sent: Sunday, April 10, 2016 12:24 AM
> > To: edk2-devel@lists.01.org
> > Cc: Jaben Carsey (Intel) ; Daryl McDaniel  > li...@mc2research.org>
> > Subject: Re: [edk2] [PATCH] StdLib: add __noreturn attribute to __assert
> >
> > I guess it's time to send a reminder for this patch :)
> >
> > MIchael
> >
> > On Tue, Feb 9, 2016 at 3:27 AM, Daryl McDaniel <
> edk2-li...@mc2research.org>
> > wrote:
> >
> > > Michael,
> > >
> > > Thanks for the report and clear references.
> > > I'll add this to the list of StdLib work.
> > >
> > > Also, thanks for the reminder about '__declspec(noreturn)'.
> > >
> > > Daryl McDaniel
> > >
> > > > -Original Message-
> > > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf
> Of
> > > Michael
> > > > Zimmermann
> > > > Sent: Monday, February 08, 2016 8:42 AM
> > > > To: Andrew Fish 
> > > > Cc: edk2-devel@lists.01.org 
> > > > Subject: Re: [edk2] [PATCH] StdLib: add __noreturn attribute to
> __assert
> > > >
> > > > it is StdLib specific and other functions like abort are using it
> > > already.
> > > > from StdLib/Include/sys/EfiCdefs.h:
> > > > #if __GNUC_PREREQ__(2, 7)
> > > > #define __unused  __attribute__((__unused__))
> > > > #define __noreturn  __attribute__((__noreturn__))
> > > > #else
> > > > #define __unused  /* delete */
> > > > #define __noreturn  /* delete */
> > > > #endif
> > > >
> > > > do other compilers(VC?) really don't need this or should we treat it
> as
> > > not
> > > > being implemented?
> > > > This page shows that there's sth. called '__declspec(noreturn)':
> > > > https://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx
> > > > but obviously there are even more compilers than just gcc and vc.
> > > >
> > > > On Mon, Feb 8, 2016 at 5:32 PM, Andrew Fish  wrote:
> > > >
> > > > >
> > > > > > On Feb 8, 2016, at 4:15 AM, Michael Zimmermann <
> > > sigmaepsilo...@gmail.com>
> > > > > wrote:
> > > > > >
> > > > > > this prevents warnings like 'control reaches end of non-void
> > > function'.
> > > > > >
> > > > > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > > > > Signed-off-by: M1cha 
> > > > > > ---
> > > > > > StdLib/Include/assert.h | 2 +-
> > > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/StdLib/Include/assert.h b/StdLib/Include/assert.h
> > > > > > index ece4f27..8369f25 100644
> > > > > > --- a/StdLib/Include/assert.h
> > > > > > +++ b/StdLib/Include/assert.h
> > > > > > @@ -52,7 +52,7 @@ __BEGIN_DECLS
> > > > > >   the application was launched from.
> > > > > > **/
> > > > > > extern void
> > > > > > -__assert(const char *file, const char *func, int line, const
> char
> > > > > > *failedexpr);
> > > > > > +__assert(const char *file, const char *func, int line, const
> char
> > > > > > *failedexpr) __noreturn;
> > > > > >
> > > > >
> > > > > Is __noreturn in the C standard or is it compiler specific?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Andrew Fish
> > > > >
> > > > > > __END_DECLS
> > > > > >
> > > > > > --
> > > > > > 2.7.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
> > >
> > >
> > ___
> > 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] ArmPlatformPkg: fixups for 64-bit mailbox pointers

2016-04-19 Thread Duran, Leo
Leif,
Please see my reply below.
Leo.

> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Monday, April 18, 2016 5:39 AM
> To: Ard Biesheuvel 
> Cc: Duran, Leo ; edk2-devel@lists.01.org
> Subject: Re: [PATCH] ArmPlatformPkg: fixups for 64-bit mailbox pointers
> 
> On Thu, Mar 24, 2016 at 11:33:22PM +0100, Ard Biesheuvel wrote:
> > On 24 March 2016 at 21:30, Leo Duran  wrote:
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Leo Duran 
> > > ---
> > >  ArmPlatformPkg/PrePeiCore/MainMPCore.c | 10 --
> > >  ArmPlatformPkg/PrePi/MainMPCore.c  | 10 --
> > >  2 files changed, 16 insertions(+), 4 deletions(-)
> > >
> >
> >
> > ArmPlatformPkg/ArmVExpressPkg/Include/VExpressMotherBoard.h has
> the
> > following defines
> >
> > #define ARM_VE_SYS_FLAGS_SET_REG
> > (ARM_VE_BOARD_PERIPH_BASE + 0x00030)
> > #define ARM_VE_SYS_FLAGS_CLR_REG
> > (ARM_VE_BOARD_PERIPH_BASE + 0x00034)
> > #define ARM_VE_SYS_FLAGS_NV_REG
> > (ARM_VE_BOARD_PERIPH_BASE + 0x00038)
> >
> > and is used on Juno as well as the older 32-bit archs. I don't know if
> > this is dead code now that PSCI is implemented by ARM trusted
> > firmware, and so we never bring up the secondaries in UEFI. But I
> > would like Leif's take on this when he gets back, since writing 64-bit
> > values is clearly not correct either in this particular case.
> 
> Yeah, these remain 32-bit also on Juno.
> 
> Moreover, only user I see of this module in public code is FVP
> (OpenPlatformPkg), which should probably be investigated.
> 
> Leo: do you actually need PrePeiCoreMPCore in the current version of your
> platform code?
> 

Leif,
The "mailbox" signaling is used to support MP-boot in scenarios where PSCI may 
not be enabled.
(E.g., boot core uses mailbox to park AP cores in a "pen", and from there the 
OS claims them via FDT's "spin-table" or ACPI's "Parked Address".)

Note that the ARM_CORE_INFO structure defines Mailbox[Set/Get/Clear]Address as 
EFI_PHYSICAL_ADDRESS, which of course can be 64-bit.
Leo.

> /
> Leif
> 
> > > diff --git a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> > > b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> > > index fa544c7..8309f62 100644
> > > --- a/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> > > +++ b/ArmPlatformPkg/PrePeiCore/MainMPCore.c
> > > @@ -80,13 +80,19 @@ SecondaryMain (
> > >ASSERT (Index != ArmCoreCount);
> > >
> > >// Clear Secondary cores MailBox
> > > -  MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > ArmCoreInfoTable[Index].MailboxClearValue);
> > > +  if (sizeof(UINTN) == sizeof(UINT64))
> > > +MmioWrite64 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > + ArmCoreInfoTable[Index].MailboxClearValue);
> > > +  else
> > > +MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > + ArmCoreInfoTable[Index].MailboxClearValue);
> > >
> > >do {
> > >  ArmCallWFI ();
> > >
> > >  // Read the Mailbox
> > > -SecondaryEntryAddr = MmioRead32
> (ArmCoreInfoTable[Index].MailboxGetAddress);
> > > +if (sizeof(UINTN) == sizeof(UINT64))
> > > +  SecondaryEntryAddr = MmioRead64
> (ArmCoreInfoTable[Index].MailboxGetAddress);
> > > +else
> > > +  SecondaryEntryAddr = MmioRead32
> > > + (ArmCoreInfoTable[Index].MailboxGetAddress);
> > >
> > >  // Acknowledge the interrupt and send End of Interrupt signal.
> > >  AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet32
> > > (PcdGicInterruptInterfaceBase), &InterruptId); diff --git
> > > a/ArmPlatformPkg/PrePi/MainMPCore.c
> > > b/ArmPlatformPkg/PrePi/MainMPCore.c
> > > index 603f4bb..d7e2352 100644
> > > --- a/ArmPlatformPkg/PrePi/MainMPCore.c
> > > +++ b/ArmPlatformPkg/PrePi/MainMPCore.c
> > > @@ -79,13 +79,19 @@ SecondaryMain (
> > >ASSERT (Index != ArmCoreCount);
> > >
> > >// Clear Secondary cores MailBox
> > > -  MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > ArmCoreInfoTable[Index].MailboxClearValue);
> > > +  if (sizeof(UINTN) == sizeof(UINT64))
> > > +MmioWrite64 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > + ArmCoreInfoTable[Index].MailboxClearValue);
> > > +  else
> > > +MmioWrite32 (ArmCoreInfoTable[Index].MailboxClearAddress,
> > > + ArmCoreInfoTable[Index].MailboxClearValue);
> > >
> > >do {
> > >  ArmCallWFI ();
> > >
> > >  // Read the Mailbox
> > > -SecondaryEntryAddr = MmioRead32
> (ArmCoreInfoTable[Index].MailboxGetAddress);
> > > +if (sizeof(UINTN) == sizeof(UINT64))
> > > +  SecondaryEntryAddr = MmioRead64
> (ArmCoreInfoTable[Index].MailboxGetAddress);
> > > +else
> > > +  SecondaryEntryAddr = MmioRead32
> > > + (ArmCoreInfoTable[Index].MailboxGetAddress);
> > >
> > >  // Acknowledge the interrupt and send End of Interrupt signal.
> > >  AcknowledgeInterrupt = ArmGicAcknowledgeInterrupt (PcdGet32
> > > (PcdGicInterruptInterfaceBase), &InterruptId);
> > > --
> > > 1.9.1
> > >
___
edk2-deve

Re: [edk2] OVMF: hang when booting Linux via GRUB after driver allocates 2GB above 4GB

2016-04-19 Thread Bruce Cran

On 4/19/2016 6:04 AM, Laszlo Ersek wrote:


Bruce, could you please test this? If 742563777e8d is indeed the
solution, I will file an RHBZ (for the RHEL kernel) to backport it.


Will do. Thanks for all your work on this!

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


Re: [edk2] [PATCH] MdeModulePkg/UefiBootManagerLib: API BmIsValidLoadOptionVariableName

2016-04-19 Thread El-Haj-Mahmoud, Samer
Reviewed-by: Samer El-Haj-Mahmoud 

Ray, Feng, Star,

Can you please help review and commit this change?

-Original Message-
From: Palmer, Thomas 
Sent: Monday, April 4, 2016 2:52 PM
To: edk2-devel@lists.01.org
Cc: El-Haj-Mahmoud, Samer ; feng.t...@intel.com; 
star.z...@intel.com; ruiyu...@intel.com; Palmer, Thomas 
Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: API 
BmIsValidLoadOptionVariableName

Redfine the BmIsValidLoadOptionVariableName function to allow public use. 
Change name to EfiBootManagerIsValidLoadOptionVariableName to match naming 
scheme. Check that VariableName is never NULL and allow OptionType and 
OptionNumber to be optional.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer 
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h  | 23 -
 .../Library/UefiBootManagerLib/BmLoadOption.c  | 38 ++
 2 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index afb4271..e3555b5 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,7 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
 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 @@ -731,4 +731,25 
@@ EFIAPI  EfiBootManagerProcessLoadOption (
   EFI_BOOT_MANAGER_LOAD_OPTION   *LoadOption
   );
+
+/**
+  Check whether the VariableName is a valid load option variable name
+  and return the load option type and option number.
+
+  @param VariableName The name of the load option variable.
+  @param OptionType   Return the load option type.
+  @param OptionNumber Return the load option number.
+
+  @retval TRUE  The variable name is valid; The load option type and
+load option number is returned.
+  @retval FALSE The variable name is NOT valid.
+**/
+BOOLEAN
+EFIAPI
+EfiBootManagerIsValidLoadOptionVariableName (
+  IN CHAR16 *VariableName,
+  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType   OPTIONAL,
+  OUT UINT16*OptionNumber OPTIONAL
+  );
+
 #endif
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 696e995..8201255 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -2,7 +2,7 @@
   Load option library functions which relate with creating and processing load 
options.
 
 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
 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 @@ -775,16 +775,21 
@@ BmValidateOption (
   @retval FALSE The variable name is NOT valid.
 **/
 BOOLEAN
-BmIsValidLoadOptionVariableName (
+EFIAPI
+EfiBootManagerIsValidLoadOptionVariableName (
   IN CHAR16 *VariableName,
-  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType,
-  OUT UINT16*OptionNumber
+  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType   OPTIONAL,
+  OUT UINT16*OptionNumber OPTIONAL
   )
 {
   UINTN VariableNameLen;
   UINTN Index;
   UINTN Uint;
 
+  if (VariableName == NULL) {
+return FALSE;
+  }
+
   VariableNameLen = StrLen (VariableName);
 
   if (VariableNameLen <= 4) {
@@ -803,14 +808,19 @@ BmIsValidLoadOptionVariableName (
 return FALSE;
   }
 
-  *OptionType = (EFI_BOOT_MANAGER_LOAD_OPTION_TYPE) Index;
-  *OptionNumber = 0;
-  for (Index = VariableNameLen - 4; Index < VariableNameLen; Index++) {
-Uint = BmCharToUint (VariableName[Index]);
-if (Uint == -1) {
-  break;
-} else {
-  *OptionNumber = (UINT16) Uint + *OptionNumber * 0x10;
+  if (OptionType != NULL) {
+*OptionType = (EFI_BOOT_MANAGER_LOAD_OPTION_TYPE) Index;  }
+
+  if (OptionNumber != NULL) {
+*OptionNumber = 0;
+for (Index = VariableNameLen - 4; Index < VariableNameLen; Index++) {
+  Uint = BmCharToUint (VariableName[Index]);
+  if (Uint == -1) {
+break;
+  } else {
+*OptionNumber = (UINT16) Uint + *OptionNumber * 0x10;
+  }
 }
   }
 
@@ -853,7 +863,7 @@ EfiBootManagerVariableToLoadOptionEx 

Re: [edk2] [PATCH] MdeModulePkg/UefiBootManagerLib: API BmIsValidLoadOptionVariableName

2016-04-19 Thread El-Haj-Mahmoud, Samer
Never mind, I just saw this was committed in 
3dc5c1ae5c7575ba2d1714b40692b36fca56c120

Thanks!
--Samer


-Original Message-
From: El-Haj-Mahmoud, Samer 
Sent: Tuesday, April 19, 2016 2:39 PM
To: Palmer, Thomas ; edk2-devel@lists.01.org
Cc: feng.t...@intel.com; star.z...@intel.com; ruiyu...@intel.com; 
El-Haj-Mahmoud, Samer 
Subject: RE: [PATCH] MdeModulePkg/UefiBootManagerLib: API 
BmIsValidLoadOptionVariableName

Reviewed-by: Samer El-Haj-Mahmoud 

Ray, Feng, Star,

Can you please help review and commit this change?

-Original Message-
From: Palmer, Thomas
Sent: Monday, April 4, 2016 2:52 PM
To: edk2-devel@lists.01.org
Cc: El-Haj-Mahmoud, Samer ; feng.t...@intel.com; 
star.z...@intel.com; ruiyu...@intel.com; Palmer, Thomas 
Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: API 
BmIsValidLoadOptionVariableName

Redfine the BmIsValidLoadOptionVariableName function to allow public use. 
Change name to EfiBootManagerIsValidLoadOptionVariableName to match naming 
scheme. Check that VariableName is never NULL and allow OptionType and 
OptionNumber to be optional.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Thomas Palmer 
---
 MdeModulePkg/Include/Library/UefiBootManagerLib.h  | 23 -
 .../Library/UefiBootManagerLib/BmLoadOption.c  | 38 ++
 2 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/MdeModulePkg/Include/Library/UefiBootManagerLib.h 
b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
index afb4271..e3555b5 100644
--- a/MdeModulePkg/Include/Library/UefiBootManagerLib.h
+++ b/MdeModulePkg/Include/Library/UefiBootManagerLib.h
@@ -2,7 +2,7 @@
   Provide Boot Manager related library APIs.
 
 Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
 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 @@ -731,4 +731,25 
@@ EFIAPI  EfiBootManagerProcessLoadOption (
   EFI_BOOT_MANAGER_LOAD_OPTION   *LoadOption
   );
+
+/**
+  Check whether the VariableName is a valid load option variable name
+  and return the load option type and option number.
+
+  @param VariableName The name of the load option variable.
+  @param OptionType   Return the load option type.
+  @param OptionNumber Return the load option number.
+
+  @retval TRUE  The variable name is valid; The load option type and
+load option number is returned.
+  @retval FALSE The variable name is NOT valid.
+**/
+BOOLEAN
+EFIAPI
+EfiBootManagerIsValidLoadOptionVariableName (
+  IN CHAR16 *VariableName,
+  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType   OPTIONAL,
+  OUT UINT16*OptionNumber OPTIONAL
+  );
+
 #endif
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c 
b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
index 696e995..8201255 100644
--- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
+++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c
@@ -2,7 +2,7 @@
   Load option library functions which relate with creating and processing load 
options.
 
 Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.
-(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
 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 @@ -775,16 +775,21 
@@ BmValidateOption (
   @retval FALSE The variable name is NOT valid.
 **/
 BOOLEAN
-BmIsValidLoadOptionVariableName (
+EFIAPI
+EfiBootManagerIsValidLoadOptionVariableName (
   IN CHAR16 *VariableName,
-  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType,
-  OUT UINT16*OptionNumber
+  OUT EFI_BOOT_MANAGER_LOAD_OPTION_TYPE *OptionType   OPTIONAL,
+  OUT UINT16*OptionNumber OPTIONAL
   )
 {
   UINTN VariableNameLen;
   UINTN Index;
   UINTN Uint;
 
+  if (VariableName == NULL) {
+return FALSE;
+  }
+
   VariableNameLen = StrLen (VariableName);
 
   if (VariableNameLen <= 4) {
@@ -803,14 +808,19 @@ BmIsValidLoadOptionVariableName (
 return FALSE;
   }
 
-  *OptionType = (EFI_BOOT_MANAGER_LOAD_OPTION_TYPE) Index;
-  *OptionNumber = 0;
-  for (Index = VariableNameLen - 4; Index < VariableNameLen; Index++) {
-Uint = BmCharToUint (VariableName[Index]);
-if (Uint == -1) {
-  break;
-} else {
-  *OptionNumber = (UINT16) Uint + *OptionNumber * 0x10;
+  if (OptionType != NULL) {
+*OptionType = (E

[edk2] [PATCH 02/12] CorebootModulePkg/PciSioSerialDxe: Use PlatformHookLib

2016-04-19 Thread Lee Leahy
Copy the driver from MdeModulePkg/Bus/Pci/PciSioSerialDxe.  Add
PlatformHookLib to the Library section of the .inf file to adjust the
PCDs for the UART.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy 
---
 CorebootModulePkg/PciSioSerialDxe/ComponentName.c  |  288 +
 .../PciSioSerialDxe/PciSioSerialDxe.inf|   82 ++
 .../PciSioSerialDxe/PciSioSerialDxe.uni|   21 +
 .../PciSioSerialDxe/PciSioSerialDxeExtra.uni   |   18 +
 CorebootModulePkg/PciSioSerialDxe/Serial.c | 1248 ++
 CorebootModulePkg/PciSioSerialDxe/Serial.h |  789 
 CorebootModulePkg/PciSioSerialDxe/SerialIo.c   | 1320 
 7 files changed, 3766 insertions(+)
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/ComponentName.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.inf
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxe.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/PciSioSerialDxeExtra.uni
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.c
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/Serial.h
 create mode 100644 CorebootModulePkg/PciSioSerialDxe/SerialIo.c

diff --git a/CorebootModulePkg/PciSioSerialDxe/ComponentName.c 
b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
new file mode 100644
index 000..994dc84
--- /dev/null
+++ b/CorebootModulePkg/PciSioSerialDxe/ComponentName.c
@@ -0,0 +1,288 @@
+/** @file
+  UEFI Component Name and Name2 protocol for Isa serial driver.
+
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include "Serial.h"
+
+//
+// EFI Component Name Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  
gPciSioSerialComponentName = {
+  SerialComponentNameGetDriverName,
+  SerialComponentNameGetControllerName,
+  "eng"
+};
+
+//
+// EFI Component Name 2 Protocol
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL 
gPciSioSerialComponentName2 = {
+  (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SerialComponentNameGetDriverName,
+  (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) 
SerialComponentNameGetControllerName,
+  "en"
+};
+
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE 
mSerialDriverNameTable[] = {
+  {
+"eng;en",
+L"PCI SIO Serial Driver"
+  },
+  {
+NULL,
+NULL
+  }
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mSioSerialPortName[] = L"SIO Serial Port 
#%d";
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 mPciSerialPortName[] = L"PCI Serial Port 
#%d";
+
+/**
+  Retrieves a Unicode string that is the user readable name of the driver.
+
+  This function retrieves the user readable name of a driver in the form of a
+  Unicode string. If the driver specified by This has a user readable name in
+  the language specified by Language, then a pointer to the driver name is
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
+  by This does not support the language specified by Language,
+  then EFI_UNSUPPORTED is returned.
+
+  @param  This[in]  A pointer to the EFI_COMPONENT_NAME2_PROTOCOL 
or
+EFI_COMPONENT_NAME_PROTOCOL instance.
+
+  @param  Language[in]  A pointer to a Null-terminated ASCII string
+array indicating the language. This is the
+language of the driver name that the caller is
+requesting, and it must match one of the
+languages specified in SupportedLanguages. The
+number of languages supported by a driver is up
+to the driver writer. Language is specified
+in RFC 4646 or ISO 639-2 language code format.
+
+  @param  DriverName[out]   A pointer to the Unicode string to return.
+This Unicode string is the name of the
+driver specified by This in the language
+specified by Language.
+
+  @retval EFI_SUCCESS   The Unicode string for the Driver specified by
+This and the language specified by Language was
+returned in DriverName.
+
+  @retval EFI_INVALID_PARAMETER Language is NULL.
+
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.
+
+  @retval EFI_UNSUPPORTED   The driver specified by This does not support
+the language specified