Before removing Juno and FVP from ArmPlatformPkg, it has been noted that we should copy latest developments from EDK2 to OpenPlatformPkg to make sure there is not functionalilty lost.
With the patches I manually copied over, I tried to keep the original author using the "--author" param, hopefully this translates across git send-email.
The following 4 patches are copied from EDK2:
[PATCH 1/5] ArmPlatformPkg/FVP: use 'auto' alignment and FIXED [PATCH 2/5] ArmPlatformPkg: Link separated VarCheckUefiLib NULL class [PATCH 3/5] ArmPlatformPkg/FVP: unify support for Foundation and Base [PATCH 4/5] ArmVExpressPkg/ArmVExpress-FVP-AArch64: run GICv3 in v3
And this one it not copied from EDK2: [PATCH 5/5] Platforms/ARM: Add optional GICv3 with v2 Legacy support
From: Ard Biesheuvel ard.biesheuvel@linaro.org
This commit is a direct copy of the changes from this commit applied to Tianocore EDK2 [1]:
commit 16d11eed2933e2ef3d611cba2453b9d6484a83e4 Author: Ard Biesheuvel ard.biesheuvel@linaro.org Date: Mon Aug 10 07:55:10 2015 +0000
ArmPlatformPkg/FVP: use 'auto' alignment and FIXED placement for XIP modules
Now that GenFw correctly propagates the minimum alignment of the ELF input sections to the PE/COFF binary, we can simply select 'auto' alignment in the FDF Rule section instead of tweaking it by hand.
Also add the FIXED FFS attribute to the module types that may execute in place. This enables a newly added optimization in GenFfs that strips redundant padding, preventing excessive waste of FV space if the section alignment is considerable (i.e., 2 KB or 4 KB)
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org Reviewed-by: Leif Lindholm leif.lindholm@linaro.org Tested-by: Leif Lindholm leif.lindholm@linaro.org
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18196 6f19259b-4bc3-4df7-8a09-765794883524
[1] http://sourceforge.net/p/tianocore/edk2/ci/16d11eed2933e2ef3d611cba2453b9d64...
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 05cd173..63bd09a 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -345,20 +345,20 @@ READ_LOCK_STATUS = TRUE ############################################################################
[Rule.Common.SEC] - FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED { - TE TE Align = 4K $(INF_OUTPUT)/$(MODULE_NAME).efi + FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED FIXED { + TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi }
[Rule.Common.PEI_CORE] - FILE PEI_CORE = $(NAMED_GUID) { - TE TE Align = 8 $(INF_OUTPUT)/$(MODULE_NAME).efi + FILE PEI_CORE = $(NAMED_GUID) FIXED { + TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING ="$(MODULE_NAME)" Optional }
[Rule.Common.PEIM] - FILE PEIM = $(NAMED_GUID) { + FILE PEIM = $(NAMED_GUID) FIXED { PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - TE TE Align = 8 $(INF_OUTPUT)/$(MODULE_NAME).efi + TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi UI STRING="$(MODULE_NAME)" Optional }
From: Star Zeng star.zeng@intel.com
This commit is a direct copy of the changes from this commit applied to Tianocore EDK2 [1]:
commit e820fe36c4867667a267ab4df41dff682b35c2d0 Author: Star Zeng star.zeng@intel.com Date: Tue Aug 25 03:03:52 2015 +0000
ArmPlatformPkg: Link separated VarCheckUefiLib NULL class library instance
Cc: Leif Lindholm leif.lindholm@linaro.org Cc: Ard Biesheuvel ard.biesheuvel@linaro.org Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng star.zeng@intel.com Reviewed-by: Ard Biesheuvel ard.biesheuvel@linaro.org
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18291 6f19259b-4bc3-4df7-8a09-765794883524
The Juno part of this change had already been committed, so I only applied the FVP and A15 RTSM portions.
[1] http://sourceforge.net/p/tianocore/edk2/ci/e820fe36c4867667a267ab4df41dff682...
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 5 ++++- Platforms/ARM/VExpress/ArmVExpress-RTSM-A15_MPCore.dsc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index c566d4d..1b4114d 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -270,7 +270,10 @@ MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf !endif MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + <LibraryClasses> + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf diff --git a/Platforms/ARM/VExpress/ArmVExpress-RTSM-A15_MPCore.dsc b/Platforms/ARM/VExpress/ArmVExpress-RTSM-A15_MPCore.dsc index b0a4268..c85493b 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-RTSM-A15_MPCore.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-RTSM-A15_MPCore.dsc @@ -241,7 +241,10 @@ MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + <LibraryClasses> + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
From: Ard Biesheuvel ard.biesheuvel@linaro.org
This commit is a direct copy of the changes from this commit applied to Tianocore EDK2 [1]:
commit 0ad3e6d4a6578e8714e7735d1b9d0b51e6999fcc Author: Ard Biesheuvel ard.biesheuvel@linaro.org Date: Tue Aug 25 13:11:25 2015 +0000
ArmPlatformPkg/FVP: unify support for Foundation and Base models
Now that the PL180 and PL111 drivers know how to behave when executed on the Foundation model (which does not emulate the hardware), we can remove the ARM_FOUNDATION_FVP ifdefs and produce a single build that runs on both the Foundation model and the Base model.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org Reviewed-by: Leif Lindholm leif.lindholm@linaro.org
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18309 6f19259b-4bc3-4df7-8a09-765794883524
[1] http://sourceforge.net/p/tianocore/edk2/ci/0ad3e6d4a6578e8714e7735d1b9d0b51e...
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 13 ------------- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 4 ---- 2 files changed, 17 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index 1b4114d..470b938 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -45,9 +45,7 @@
ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf -!ifndef ARM_FOUNDATION_FVP LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf -!endif
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
@@ -89,14 +87,9 @@ gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ARM-FVP"
-!ifndef ARM_FOUNDATION_FVP # Up to 8 cores on Base models. This works fine if model happens to have less. gArmPlatformTokenSpaceGuid.PcdCoreCount|8 gArmPlatformTokenSpaceGuid.PcdClusterCount|2 -!else - # Up to 4 cores on Foundation models. This works fine if model happens to have less. - gArmPlatformTokenSpaceGuid.PcdCoreCount|4 -!endif
# # NV Storage PCDs. Use base of 0x0C000000 for NOR1 @@ -153,14 +146,12 @@ ## PL031 RealTimeClock gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x1C170000
-!ifndef ARM_FOUNDATION_FVP ## PL111 Versatile Express Motherboard controller gArmPlatformTokenSpaceGuid.PcdPL111LcdBase|0x1C1F0000
## PL180 MMC/SD card controller gArmPlatformTokenSpaceGuid.PcdPL180SysMciRegAddress|0x1C010048 gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000 -!endif
# # ARM General Interrupt Controller @@ -302,9 +293,7 @@ ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf !endif ArmPkg/Drivers/TimerDxe/TimerDxe.inf -!ifndef ARM_FOUNDATION_FVP ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf -!endif ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
# SMBIOS Support @@ -316,13 +305,11 @@ # ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
-!ifndef ARM_FOUNDATION_FVP # # Multimedia Card Interface # EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf -!endif
# # Platform Driver diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 63bd09a..e3ff0cc 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -173,9 +173,7 @@ FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 !else INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf !endif -!ifndef ARM_FOUNDATION_FVP INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf -!endif INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
# @@ -191,13 +189,11 @@ FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 INF FatBinPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-!ifndef ARM_FOUNDATION_FVP # # Multimedia Card Interface # INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf -!endif
# # SMBIOS Support
From: Ard Biesheuvel ard.biesheuvel@linaro.org
commit 660aaec3118b0763ee4fcd83b936bf15ffcf23a9 Author: Ard Biesheuvel ard.biesheuvel@linaro.org Date: Tue Dec 15 13:08:56 2015 +0000
ArmVExpressPkg/ArmVExpress-FVP-AArch64: run GICv3 in v3 mode
After fixing ArmGicEnableDistributor() in a previous patch, there is no longer a reason to run the GICv3 in v2 mode, so remove the PCD override.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org Reviewed-by: Leif Lindholm leif.lindholm@linaro.org
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19275 6f19259b-4bc3-4df7-8a09-765794883524
[1] http://sourceforge.net/p/tianocore/edk2/ci/660aaec3118b0763ee4fcd83b936bf15f...
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index 470b938..b14aeb0 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -77,12 +77,6 @@ # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
- # Force the UEFI GIC driver to use GICv2 legacy mode. To use - # GICv3 without GICv2 legacy in UEFI, the ARM Trusted Firmware needs - # to configure the Non-Secure interrupts in the GIC Redistributors - # which is not supported at the moment. - gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE - [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ARM-FVP"
GICv3 with v2 legacy support was removed, but this patch adds it back in conditionally.
The default continues to use GICv3 natively unless specifically requested at build time by defining "ARM_FVP_GICV3_WITH_V2_LEGACY".
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index b14aeb0..194133a 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -77,6 +77,14 @@ # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
+!ifdef ARM_FVP_GICV3_WITH_V2_LEGACY + # Force the UEFI GIC driver to use GICv2 legacy mode. To use + # GICv3 without GICv2 legacy in UEFI, the ARM Trusted Firmware needs + # to configure the Non-Secure interrupts in the GIC Redistributors + # which is not supported at the moment. + gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE +!endif + [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ARM-FVP"
On 18 January 2016 at 18:50, Ryan Harkin ryan.harkin@linaro.org wrote:
GICv3 with v2 legacy support was removed, but this patch adds it back in conditionally.
The default continues to use GICv3 natively unless specifically requested at build time by defining "ARM_FVP_GICV3_WITH_V2_LEGACY".
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org
Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index b14aeb0..194133a 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -77,6 +77,14 @@ # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
+!ifdef ARM_FVP_GICV3_WITH_V2_LEGACY
- # Force the UEFI GIC driver to use GICv2 legacy mode. To use
- # GICv3 without GICv2 legacy in UEFI, the ARM Trusted Firmware needs
- # to configure the Non-Secure interrupts in the GIC Redistributors
- # which is not supported at the moment.
The patches all look fine to me, but could we get rid of this comment? If this was ever true, the main reason it did not work before was a bug in the driver on the EDK2 side.
Thanks, Ard.
- gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE
+!endif
[PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ARM-FVP" -- 2.1.4
On 21 January 2016 at 08:07, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
On 18 January 2016 at 18:50, Ryan Harkin ryan.harkin@linaro.org wrote:
GICv3 with v2 legacy support was removed, but this patch adds it back in conditionally.
The default continues to use GICv3 natively unless specifically requested at build time by defining "ARM_FVP_GICV3_WITH_V2_LEGACY".
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ryan Harkin ryan.harkin@linaro.org
Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index b14aeb0..194133a 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -77,6 +77,14 @@ # It could be set FALSE to save size. gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
+!ifdef ARM_FVP_GICV3_WITH_V2_LEGACY
- # Force the UEFI GIC driver to use GICv2 legacy mode. To use
- # GICv3 without GICv2 legacy in UEFI, the ARM Trusted Firmware needs
- # to configure the Non-Secure interrupts in the GIC Redistributors
- # which is not supported at the moment.
The patches all look fine to me, but could we get rid of this comment? If this was ever true, the main reason it did not work before was a bug in the driver on the EDK2 side.
Sure, I'll remove it.
You're right that it's no longer true, but it used to be. That's the reason why I'm stuck in the dark ages using GICv2 legacy support.
Thanks, Ard.
- gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE
+!endif
[PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ARM-FVP" -- 2.1.4