[edk2] [PATCH 1/3] ArmVirtPkg/ArmVirtQemu: drop ARM BDS and make Intel BDS the default

2015-08-04 Thread Ard Biesheuvel
ARM BDS support in ArmVirtQemu has been broken since SVN r17969
(ArmPkg/BdsLib: Remove Linux loader from BdsLib) dated July 14th.

Instead of fixing this, let's get rid of the ARM BDS and LinuxLoader
altogether: they violate both the UEFI spec and the arm64 Linux boot
protocol, and lack the level of integration with the QEMU command
line that the Intel BDS has when running under ArmVirtPkg or OvmfPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
---
 ArmVirtPkg/ArmVirt.dsc.inc |  5 +--
 ArmVirtPkg/ArmVirtQemu.dsc | 32 ++--
 ArmVirtPkg/ArmVirtQemu.fdf |  6 
 3 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 8c54242b597b..ced45c8194bc 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -106,8 +106,7 @@ [LibraryClasses.common]
   DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
   
DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf
 
-  # BDS Libraries
-  BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
+  # Flattened Device Tree (FDT) access library
   FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
 
   # PCI Libraries
@@ -279,8 +278,6 @@ [PcdsFeatureFlag.common]
   gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
 
 [PcdsFixedAtBuild.common]
-  gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|ARM Virtualization Platform
-
   gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|100
   gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|100
   gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|100
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
index c199cac72cfd..5a644090be7c 100644
--- a/ArmVirtPkg/ArmVirtQemu.dsc
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
@@ -57,13 +57,11 @@ [LibraryClasses.common]
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
   NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
 
-!if $(INTEL_BDS) == TRUE
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
   GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
   PlatformBdsLib|ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
   
CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
   QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
-!endif
 
 [LibraryClasses.common.UEFI_DRIVER]
   UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
@@ -99,8 +97,6 @@ [PcdsFeatureFlag.common]
   gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE
 
 [PcdsFixedAtBuild.common]
-  gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|QEMU
-
   gArmPlatformTokenSpaceGuid.PcdCoreCount|1
 !if $(ARCH) == AARCH64
   gArmTokenSpaceGuid.PcdVFPEnabled|1
@@ -127,29 +123,11 @@ [PcdsFixedAtBuild.common]
   ## PL011 - Serial Terminal
   gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400
 
-  #
-  # ARM OS Loader
-  #
-  gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|LLinux (EFI stub) on 
virtio31:hd0:part0
-  
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|LVenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A)/HD(1,MBR,0x,0x3F,0x19FC0)/Image
-  gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|root=/dev/vda2 
console=ttyAMA0 earlycon uefi_debug
-
-  #
-  # Settings for ARM BDS -- use the serial console (ConIn  ConOut).
-  #
-!if $(TTY_TERMINAL) == TRUE
-  
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)
-  
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)
-  ## Terminal Type - TTYTERM, consistent with ConOut/ConIn Device Path.
+  ## Default Terminal Type
   ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
+!if $(TTY_TERMINAL) == TRUE
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
 !else
-  
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()
-  
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()
-  ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
-  ## When Intel BDS is enabled, the above ConOut/ConIn device path is useless,
-  ## but we still use VT100 terminal type when TTY_TERMINAL is not TRUE.
-  ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
   gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
 !endif
   gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
@@ -175,10 +153,8 @@ [PcdsFixedAtBuild.common]
   # initial location of the device tree blob passed by QEMU -- base of DRAM
   gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x4000
 
-!if $(INTEL_BDS) == TRUE
   

Re: [edk2] [PATCH 1/3] ArmVirtPkg/ArmVirtQemu: drop ARM BDS and make Intel BDS the default

2015-08-04 Thread Laszlo Ersek
On 08/04/15 17:21, Ard Biesheuvel wrote:
 ARM BDS support in ArmVirtQemu has been broken since SVN r17969
 (ArmPkg/BdsLib: Remove Linux loader from BdsLib) dated July 14th.
 
 Instead of fixing this, let's get rid of the ARM BDS and LinuxLoader
 altogether: they violate both the UEFI spec and the arm64 Linux boot
 protocol, and lack the level of integration with the QEMU command
 line that the Intel BDS has when running under ArmVirtPkg or OvmfPkg.
 
 Contributed-under: TianoCore Contribution Agreement 1.0
 Signed-off-by: Ard Biesheuvel ard.biesheu...@linaro.org
 ---
  ArmVirtPkg/ArmVirt.dsc.inc |  5 +--
  ArmVirtPkg/ArmVirtQemu.dsc | 32 ++--
  ArmVirtPkg/ArmVirtQemu.fdf |  6 
  3 files changed, 3 insertions(+), 40 deletions(-)
 
 diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
 index 8c54242b597b..ced45c8194bc 100644
 --- a/ArmVirtPkg/ArmVirt.dsc.inc
 +++ b/ArmVirtPkg/ArmVirt.dsc.inc
 @@ -106,8 +106,7 @@ [LibraryClasses.common]
DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf

 DebugAgentTimerLib|EmbeddedPkg/Library/DebugAgentTimerLibNull/DebugAgentTimerLibNull.inf
  
 -  # BDS Libraries
 -  BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
 +  # Flattened Device Tree (FDT) access library
FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
  
# PCI Libraries
 @@ -279,8 +278,6 @@ [PcdsFeatureFlag.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
  
  [PcdsFixedAtBuild.common]
 -  gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|ARM Virtualization Platform
 -
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|100
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|100
gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|100
 diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
 index c199cac72cfd..5a644090be7c 100644
 --- a/ArmVirtPkg/ArmVirtQemu.dsc
 +++ b/ArmVirtPkg/ArmVirtQemu.dsc
 @@ -57,13 +57,11 @@ [LibraryClasses.common]
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
  
 -!if $(INTEL_BDS) == TRUE
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf

 GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf

 PlatformBdsLib|ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf

 CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
 -!endif
  
  [LibraryClasses.common.UEFI_DRIVER]
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
 @@ -99,8 +97,6 @@ [PcdsFeatureFlag.common]
gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE
  
  [PcdsFixedAtBuild.common]
 -  gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|QEMU
 -
gArmPlatformTokenSpaceGuid.PcdCoreCount|1
  !if $(ARCH) == AARCH64
gArmTokenSpaceGuid.PcdVFPEnabled|1
 @@ -127,29 +123,11 @@ [PcdsFixedAtBuild.common]
## PL011 - Serial Terminal
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400
  
 -  #
 -  # ARM OS Loader
 -  #
 -  gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|LLinux (EFI stub) on 
 virtio31:hd0:part0
 -  
 gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|LVenHw(837DCA9E-E874-4D82-B29A-23FE0E23D1E2,003E000A)/HD(1,MBR,0x,0x3F,0x19FC0)/Image
 -  gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|root=/dev/vda2 
 console=ttyAMA0 earlycon uefi_debug
 -
 -  #
 -  # Settings for ARM BDS -- use the serial console (ConIn  ConOut).
 -  #
 -!if $(TTY_TERMINAL) == TRUE
 -  
 gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)
 -  
 gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenMsg(7D916D80-5BB1-458C-A48F-E25FDD51EF94)
 -  ## Terminal Type - TTYTERM, consistent with ConOut/ConIn Device Path.
 +  ## Default Terminal Type
## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
 +!if $(TTY_TERMINAL) == TRUE
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
  !else
 -  
 gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()
 -  
 gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|LVenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenVt100()
 -  ## Terminal Type - VT100, consistent with ConOut/ConIn Device Path.
 -  ## When Intel BDS is enabled, the above ConOut/ConIn device path is 
 useless,
 -  ## but we still use VT100 terminal type when TTY_TERMINAL is not TRUE.
 -  ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
  !endif
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
 @@ -175,10 +153,8 @@ [PcdsFixedAtBuild.common]
# initial location of the device tree blob passed by QEMU -- base of DRAM