This is now mainly focused on FVP, although some changes affect TC2 and Juno as well. However, the switch to DtPlatformDxe, which is the primary purpose of this series, is only implemented for FVP.
Note that the full functionality is only enabled when building with DT_SUPPORT=TRUE, in which case the platform is built with a bunch of DTB images built in, and a menu option that allows choosing between ACPI and DT (which does require working non-volatile storage). Without DT support, the platform is essentially ACPI only, unless a DTB is supplied to the OS via one of the available out-of-band mechanisms.
Ard Biesheuvel (6): Platforms/VExpress: remove unused logo PCD Platforms/VExpress: remove unused StatusCode references Platforms/VExpress: get rid of Tiano compression Platforms/VExpress: remove BdsLib library class resolutions Platforms/FVP: add DtPlatformDtbLoaderLib implementation Platforms/FVP-AArch64: switch to simpler DT platform driver
Platforms/ARM/Juno/ArmJuno.dsc | 8 ++ Platforms/ARM/Juno/ArmJuno.fdf | 9 -- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 13 +- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf | 16 --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 33 ++--- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 54 ++------ Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 24 +--- Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c | 134 ++++++++++++++++++++ Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf | 39 ++++++ 9 files changed, 221 insertions(+), 109 deletions(-) create mode 100644 Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c create mode 100644 Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
This file and associated PCD are no longer used by our BDS code, so remove them.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf | 7 ------- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 7 ------- 2 files changed, 14 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf index 90746158351e..5c3a2316cb68 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf @@ -175,13 +175,6 @@ FvNameGuid = 73dcb643-3862-4904-9076-a94af1890243 INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf INF MdeModulePkg/Application/UiApp/UiApp.inf
- # - # TianoCore logo (splash screen) - # - FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) { - SECTION RAW = MdeModulePkg/Logo/Logo.bmp - } - # FV Filesystem INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 2ace4d8e04c3..81966d2c3bce 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -167,13 +167,6 @@ FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf INF MdeModulePkg/Application/UiApp/UiApp.inf
- # - # TianoCore logo (splash screen) - # - FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) { - SECTION RAW = MdeModulePkg/Logo/Logo.bmp - } - # FV Filesystem INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
We never use the status code facility, so remove the libraries and other references to it.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 1 - Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 1 - Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 11 ++--------- 3 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index c5fc61c4f3cb..b866fe6d65cc 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -208,7 +208,6 @@ ArmPlatformPkg/PlatformPei/PlatformPeim.inf ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf ArmPkg/Drivers/CpuPei/CpuPei.inf - IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf Nt32Pkg/BootModePei/BootModePei.inf MdeModulePkg/Universal/Variable/Pei/VariablePei.inf MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 81966d2c3bce..fbf8e9b30c0e 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -229,7 +229,6 @@ READ_LOCK_STATUS = TRUE INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf INF ArmPkg/Drivers/CpuPei/CpuPei.inf INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf - INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf !endif diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index fdd5341971b7..aed889747b2e 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -155,6 +155,8 @@ CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
+ ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf + [LibraryClasses.common.SEC] ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf
@@ -182,7 +184,6 @@ MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf @@ -197,7 +198,6 @@ MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf @@ -214,14 +214,12 @@ HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
[LibraryClasses.common.DXE_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf @@ -234,12 +232,10 @@ HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
# UiApp dependencies - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
[LibraryClasses.common.UEFI_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf @@ -249,7 +245,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigRuntimeLib/ArmVExpressSysConfigRuntimeLib.inf !if $(SECURE_BOOT_ENABLE) == TRUE @@ -366,8 +361,6 @@ # DEBUG_ERROR 0x80000000 // Error gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
- gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 - gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|"" gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07 gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000
There are some references to Tiano compression and to libraries that implement it, but we never use it. So get rid of it.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/Juno/ArmJuno.fdf | 9 --------- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf | 9 --------- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 9 --------- Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 5 ----- 4 files changed, 32 deletions(-)
diff --git a/Platforms/ARM/Juno/ArmJuno.fdf b/Platforms/ARM/Juno/ArmJuno.fdf index 53a3bd2420ce..7de995a255b1 100644 --- a/Platforms/ARM/Juno/ArmJuno.fdf +++ b/Platforms/ARM/Juno/ArmJuno.fdf @@ -323,15 +323,6 @@ READ_LOCK_STATUS = TRUE UI STRING="$(MODULE_NAME)" Optional }
-[Rule.Common.PEIM.TIANOCOMPRESSED] - FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { - PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING="$(MODULE_NAME)" Optional - } - } - [Rule.Common.DXE_CORE] FILE DXE_CORE = $(NAMED_GUID) { PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf index 5c3a2316cb68..1903389c8edd 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf @@ -265,15 +265,6 @@ READ_LOCK_STATUS = TRUE UI STRING="$(MODULE_NAME)" Optional }
-[Rule.Common.PEIM.TIANOCOMPRESSED] - FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { - PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING="$(MODULE_NAME)" Optional - } - } - [Rule.Common.DXE_CORE] FILE DXE_CORE = $(NAMED_GUID) { PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index fbf8e9b30c0e..262515150dd9 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -286,15 +286,6 @@ READ_LOCK_STATUS = TRUE UI STRING="$(MODULE_NAME)" Optional }
-[Rule.Common.PEIM.TIANOCOMPRESSED] - FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { - PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING="$(MODULE_NAME)" Optional - } - } - [Rule.Common.DXE_CORE] FILE DXE_CORE = $(NAMED_GUID) { PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index aed889747b2e..9dfe2ac9e440 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -186,7 +186,6 @@ PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf @@ -201,7 +200,6 @@ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
PeiServicesTablePointerLib|ArmPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf @@ -215,7 +213,6 @@ MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
@@ -226,7 +223,6 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
[LibraryClasses.common.UEFI_APPLICATION] - UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf @@ -236,7 +232,6 @@ DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
[LibraryClasses.common.UEFI_DRIVER] - UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
ArmHwDxe and ArmFvpDxe no longer require a BdsLib library class resolution, so remove the explicit ones from the various .DSCs.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 5 +---- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc index ae91a78d2dd8..55640837ba7c 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc @@ -244,10 +244,7 @@ # # Platform # - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf { - <LibraryClasses> - BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf - } + ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf
# # Filesystems diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index b866fe6d65cc..5b19184b061e 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -291,10 +291,7 @@ # # Platform Driver # - ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf { - <LibraryClasses> - BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf - } + ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
In preparation of switching to DtPlatformDxe to supply the device tree image to the OS, add an implementation of DtPlatformDtbLoaderLib that loads the correct version from an FV.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c | 134 ++++++++++++++++++++ Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf | 39 ++++++ 2 files changed, 173 insertions(+)
diff --git a/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c b/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c new file mode 100644 index 000000000000..3a5613c83709 --- /dev/null +++ b/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c @@ -0,0 +1,134 @@ +/** @file +* +* Copyright (c) 2017, Linaro, Ltd. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the BSD License +* which accompanies this distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* +**/ + +#include <PiDxe.h> + +#include <Library/ArmGicLib.h> +#include <Library/BaseLib.h> +#include <Library/DebugLib.h> +#include <Library/DxeServicesLib.h> +#include <Library/IoLib.h> +#include <Library/MemoryAllocationLib.h> + +#include "ArmPlatform.h" + +typedef enum { + ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, + ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, + ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, + ARM_FVP_FOUNDATION_GICV2, + ARM_FVP_FOUNDATION_GICV2_LEGACY, + ARM_FVP_FOUNDATION_GICV3, + ARM_FVP_UNKNOWN, +} ARM_VEXPRESS_PLATFORM_ID; + +ARM_VEXPRESS_PLATFORM_ID +GetPlatformId ( + VOID + ) +{ + UINT32 SysId; + UINT32 FvpSysId; + UINT32 VariantSysId; + ARM_GIC_ARCH_REVISION GicRevision; + + SysId = MmioRead32 (ARM_VE_SYS_ID_REG); + + // Remove the GIC variant to identify if we are running on the FVP Base or + // Foundation models + FvpSysId = SysId & (ARM_FVP_SYS_ID_HBI_MASK | ARM_FVP_SYS_ID_PLAT_MASK ); + // Extract the variant from the SysId + VariantSysId = SysId & ARM_FVP_SYS_ID_VARIANT_MASK; + + if (FvpSysId == ARM_FVP_BASE_BOARD_SYS_ID) { + if (VariantSysId == ARM_FVP_GIC_VE_MMAP) { + // FVP Base Model with legacy GIC memory map -- no longer supported + return ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY; + } else { + GicRevision = ArmGicGetSupportedArchRevision (); + + if (GicRevision == ARM_GIC_ARCH_REVISION_2) { + // FVP Base Model with GICv2 support + return ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2; + } else { + // FVP Base Model with GICv3 support + return ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3; + } + } + } else if (FvpSysId == ARM_FVP_FOUNDATION_BOARD_SYS_ID) { + if (VariantSysId == ARM_FVP_GIC_VE_MMAP) { + // FVP Foundation Model with legacy GIC memory map -- no longer supported + return ARM_FVP_FOUNDATION_GICV2_LEGACY; + } else { + GicRevision = ArmGicGetSupportedArchRevision (); + + if (GicRevision == ARM_GIC_ARCH_REVISION_2) { + // FVP Foundation Model with GICv2 + return ARM_FVP_FOUNDATION_GICV2; + } else { + // FVP Foundation Model with GICv3 + return ARM_FVP_FOUNDATION_GICV3; + } + } + } + return ARM_FVP_UNKNOWN; +} + +/** + Return a pool allocated copy of the DTB image that is appropriate for + booting the current platform via DT. + + @param[out] Dtb Pointer to the DTB copy + @param[out] DtbSize Size of the DTB copy + + @retval EFI_SUCCESS Operation completed successfully + @retval EFI_NOT_FOUND No suitable DTB image could be located + @retval EFI_OUT_OF_RESOURCES No pool memory available + +**/ +EFI_STATUS +EFIAPI +DtPlatformLoadDtb ( + OUT VOID **Dtb, + OUT UINTN *DtbSize + ) +{ + EFI_STATUS Status; + VOID *OrigDtb; + VOID *CopyDtb; + UINTN OrigDtbSize; + ARM_VEXPRESS_PLATFORM_ID PlatformId; + + PlatformId = GetPlatformId (); + ASSERT (PlatformId < ARM_FVP_UNKNOWN); + if (PlatformId >= ARM_FVP_UNKNOWN) { + return EFI_NOT_FOUND; + } + + Status = GetSectionFromAnyFv (&gDtPlatformDefaultDtbFileGuid, + EFI_SECTION_RAW, (UINTN)PlatformId, &OrigDtb, &OrigDtbSize); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + CopyDtb = AllocateCopyPool (OrigDtbSize, OrigDtb); + if (CopyDtb == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + *Dtb = CopyDtb; + *DtbSize = OrigDtbSize; + + return EFI_SUCCESS; +} diff --git a/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf b/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf new file mode 100644 index 000000000000..5012101fe8db --- /dev/null +++ b/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf @@ -0,0 +1,39 @@ +/** @file +* +* Copyright (c) 2017, Linaro, Ltd. All rights reserved. +* +* This program and the accompanying materials +* are licensed and made available under the terms and conditions of the BSD License +* which accompanies this distribution. The full text of the license may be found at +* http://opensource.org/licenses/bsd-license.php +* +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +* +**/ + +[Defines] + INF_VERSION = 0x00010019 + BASE_NAME = ArmVExpressDtPlatformDtbLoaderLib + FILE_GUID = 050d6041-1508-4ae7-a69f-250155ccb567 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = DtPlatformDtbLoaderLib|DXE_DRIVER + +[Sources] + ArmVExpressDtPlatformDtbLoaderLib.c + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + +[LibraryClasses] + ArmGicLib + BaseLib + DxeServicesLib + IoLib + MemoryAllocationLib + +[Guids] + gDtPlatformDefaultDtbFileGuid
Replace the elaborate but awkward FdtPlatformDxe with the new DtPlatformDxe, which supports embedded DTBs only. This is sufficient for virtually all use cases, and if it is not, there are various way to override the device tree binary presented to the OS.
As a bonus, this driver makes ACPI and DT mutually exclusive - this can be configured via the setup screen.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- Platforms/ARM/Juno/ArmJuno.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 27 ++++++++------ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 37 ++++++-------------- Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 8 ----- 5 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc index 6adb33c76087..4ff2246822e6 100644 --- a/Platforms/ARM/Juno/ArmJuno.dsc +++ b/Platforms/ARM/Juno/ArmJuno.dsc @@ -340,6 +340,14 @@ NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf }
+ # + # FDT installation + # + EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { + <LibraryClasses> + BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf + } + [Components.AARCH64] # # EBC diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc index 55640837ba7c..d1cfc719837c 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc @@ -284,3 +284,11 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } + + # + # FDT installation + # + EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { + <LibraryClasses> + BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf + } diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index 5b19184b061e..1e95971cddfd 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -35,6 +35,7 @@ DEFINE EDK2_SKIP_PEICORE=1 !endif
+ DT_SUPPORT = FALSE
!include OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
@@ -58,6 +59,8 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf !endif
+ DtPlatformDtbLoaderLib|OpenPlatformPkg/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf + [LibraryClasses.common.SEC] ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf @@ -172,15 +175,6 @@ # the entire FVP address space can be covered by 36 bit VAs gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|36
-[PcdsDynamicDefault.common] - # - # The size of a dynamic PCD of the (VOID*) type can not be increased at run - # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128 - # character "empty" string, to allow to be able to set FDT text device paths - # up to 128 characters long. - # - gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L" " - ################################################################################ # # Components Section - list of all EDK II Modules needed by this Platform @@ -261,7 +255,13 @@ # # ACPI Support # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf { +!if $(DT_SUPPORT) == TRUE + <LibraryClasses> + NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf +!endif + } + MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf OpenPlatformPkg/Platforms/ARM/VExpress/AcpiTables/AcpiTables.inf
@@ -314,3 +314,10 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf } + +!if $(DT_SUPPORT) == TRUE + # + # FDT installation + # + EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf +!endif diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 262515150dd9..7b2397417534 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -170,35 +170,20 @@ FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 # FV Filesystem INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
+!if $(DT_SUPPORT) == TRUE # # FDT installation # - # The UEFI driver is at the end of the list of the driver to be dispatched - # after the device drivers (eg: Ethernet) to ensure we have support for them. - INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf - -!ifdef $(DTB_DIR) - # - # Embed flattened device tree (FDT) images for all known - # variants of this platform - # - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2) { - $(DTB_DIR)/fvp-base-gicv2-psci.dtb - } - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy) { - $(DTB_DIR)/fvp-base-gicv2legacy-psci.dtb - } - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3) { - $(DTB_DIR)/fvp-base-gicv3-psci.dtb - } - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2) { - $(DTB_DIR)/fvp-foundation-gicv2-psci.dtb - } - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy) { - $(DTB_DIR)/fvp-foundation-gicv2legacy-psci.dtb - } - FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3) { - $(DTB_DIR)/fvp-foundation-gicv3-psci.dtb + INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf + + # builtin device tree binaries -- order matches ARM_VEXPRESS_PLATFORM_ID + FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 { + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2-psci.dtb + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2legacy-psci.dtb + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv3-psci.dtb + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2-psci.dtb + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2legacy-psci.dtb + SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv3-psci.dtb } !endif
diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index 9dfe2ac9e440..8c4de54c8875 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -491,14 +491,6 @@ MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# - # FDT installation - # - EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf { - <LibraryClasses> - BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf - } - - # # UEFI application (Shell Embedded Boot Loader) # ShellPkg/Application/Shell/Shell.inf {
On Mon, Apr 10, 2017 at 05:22:08PM +0100, Ard Biesheuvel wrote:
Replace the elaborate but awkward FdtPlatformDxe with the new DtPlatformDxe, which supports embedded DTBs only.
So, this is technically correct (which as we all know is the best kind of correct), but then the first two hunks actually insert new references to FdtPlatformDxe.
What this code actually does is replaces FdtPlatformDxe with DtPlatformDxe in the common include files and makes the FdtPlatformDxe/DtPlatformDxe selection platform specific.
So, suggested change: "Replace the elaborate but awkward FdtPlatformDxe with the new DtPlatformDxe, which supports embedded DTBs only, for FVP platforms. This is done by removing the FdtPlatformDxe reference from ArmVExpress.dsc.inc and making it a platform-specific decision."
With that (or something like it) folded in - for the series: Reviewed-by: Leif Lindholm leif.lindholm@linaro.org
This is sufficient for virtually all use cases, and if it is not, there are various way to override the device tree binary presented to the OS.
As a bonus, this driver makes ACPI and DT mutually exclusive - this can be configured via the setup screen.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org
Platforms/ARM/Juno/ArmJuno.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 8 +++++ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 27 ++++++++------ Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 37 ++++++-------------- Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 8 ----- 5 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc index 6adb33c76087..4ff2246822e6 100644 --- a/Platforms/ARM/Juno/ArmJuno.dsc +++ b/Platforms/ARM/Juno/ArmJuno.dsc @@ -340,6 +340,14 @@ NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf }
- #
- # FDT installation
- #
- EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
- }
[Components.AARCH64] # # EBC diff --git a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc index 55640837ba7c..d1cfc719837c 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc @@ -284,3 +284,11 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf }
- #
- # FDT installation
- #
- EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
- }
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc index 5b19184b061e..1e95971cddfd 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc @@ -35,6 +35,7 @@ DEFINE EDK2_SKIP_PEICORE=1 !endif
- DT_SUPPORT = FALSE
!include OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -58,6 +59,8 @@ FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf !endif
- DtPlatformDtbLoaderLib|OpenPlatformPkg/Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
[LibraryClasses.common.SEC] ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf @@ -172,15 +175,6 @@ # the entire FVP address space can be covered by 36 bit VAs gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|36 -[PcdsDynamicDefault.common]
- #
- # The size of a dynamic PCD of the (VOID*) type can not be increased at run
- # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128
- # character "empty" string, to allow to be able to set FDT text device paths
- # up to 128 characters long.
- #
- gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L" "
################################################################################ # # Components Section - list of all EDK II Modules needed by this Platform @@ -261,7 +255,13 @@ # # ACPI Support #
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf {
+!if $(DT_SUPPORT) == TRUE
<LibraryClasses>
- NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf
+!endif
- }
- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf OpenPlatformPkg/Platforms/ARM/VExpress/AcpiTables/AcpiTables.inf
@@ -314,3 +314,10 @@ NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerUiLib.inf }
+!if $(DT_SUPPORT) == TRUE
- #
- # FDT installation
- #
- EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
+!endif diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf index 262515150dd9..7b2397417534 100644 --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf @@ -170,35 +170,20 @@ FvNameGuid = 87940482-fc81-41c3-87e6-399cf85ac8a0 # FV Filesystem INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf +!if $(DT_SUPPORT) == TRUE # # FDT installation #
- # The UEFI driver is at the end of the list of the driver to be dispatched
- # after the device drivers (eg: Ethernet) to ensure we have support for them.
- INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
-!ifdef $(DTB_DIR)
- #
- # Embed flattened device tree (FDT) images for all known
- # variants of this platform
- #
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2) {
- $(DTB_DIR)/fvp-base-gicv2-psci.dtb
- }
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy) {
- $(DTB_DIR)/fvp-base-gicv2legacy-psci.dtb
- }
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3) {
- $(DTB_DIR)/fvp-base-gicv3-psci.dtb
- }
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2) {
- $(DTB_DIR)/fvp-foundation-gicv2-psci.dtb
- }
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy) {
- $(DTB_DIR)/fvp-foundation-gicv2legacy-psci.dtb
- }
- FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3) {
- $(DTB_DIR)/fvp-foundation-gicv3-psci.dtb
- INF EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformDxe.inf
- # builtin device tree binaries -- order matches ARM_VEXPRESS_PLATFORM_ID
- FILE FREEFORM = 25462CDA-221F-47DF-AC1D-259CFAA4E326 {
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2-psci.dtb
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv2legacy-psci.dtb
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-base-gicv3-psci.dtb
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2-psci.dtb
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv2legacy-psci.dtb
- SECTION RAW = OpenPlatformPkg/Platforms/ARM/VExpress/DeviceTree/fvp-foundation-gicv3-psci.dtb }
!endif diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc index 9dfe2ac9e440..8c4de54c8875 100644 --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc @@ -491,14 +491,6 @@ MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf #
- # FDT installation
- #
- EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf {
<LibraryClasses>
BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
- }
- # # UEFI application (Shell Embedded Boot Loader) # ShellPkg/Application/Shell/Shell.inf {
-- 2.9.3
On 11 April 2017 at 19:32, Leif Lindholm leif.lindholm@linaro.org wrote:
On Mon, Apr 10, 2017 at 05:22:08PM +0100, Ard Biesheuvel wrote:
Replace the elaborate but awkward FdtPlatformDxe with the new DtPlatformDxe, which supports embedded DTBs only.
So, this is technically correct (which as we all know is the best kind of correct), but then the first two hunks actually insert new references to FdtPlatformDxe.
What this code actually does is replaces FdtPlatformDxe with DtPlatformDxe in the common include files and makes the FdtPlatformDxe/DtPlatformDxe selection platform specific.
So, suggested change: "Replace the elaborate but awkward FdtPlatformDxe with the new DtPlatformDxe, which supports embedded DTBs only, for FVP platforms. This is done by removing the FdtPlatformDxe reference from ArmVExpress.dsc.inc and making it a platform-specific decision."
With that (or something like it) folded in - for the series: Reviewed-by: Leif Lindholm leif.lindholm@linaro.org
Both parts pushed to edk2 and opp, respectively.
On 10 April 2017 at 17:22, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
This is now mainly focused on FVP, although some changes affect TC2 and Juno as well. However, the switch to DtPlatformDxe, which is the primary purpose of this series, is only implemented for FVP.
Note that the full functionality is only enabled when building with DT_SUPPORT=TRUE, in which case the platform is built with a bunch of DTB images built in, and a menu option that allows choosing between ACPI and DT (which does require working non-volatile storage). Without DT support, the platform is essentially ACPI only, unless a DTB is supplied to the OS via one of the available out-of-band mechanisms.
I'm not 100% convinced that disabling device tree by default is the right thing to do. But at the same time, it's not my call and I don't boot anything interesting using FVP anyway, so I don't mind.
For the limited amount of stuff I need working, this all works fine on FVP Foundation & AEMv8, TC2 and Juno R0/1/2.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
Ard Biesheuvel (6): Platforms/VExpress: remove unused logo PCD Platforms/VExpress: remove unused StatusCode references Platforms/VExpress: get rid of Tiano compression Platforms/VExpress: remove BdsLib library class resolutions Platforms/FVP: add DtPlatformDtbLoaderLib implementation Platforms/FVP-AArch64: switch to simpler DT platform driver
Platforms/ARM/Juno/ArmJuno.dsc | 8 ++ Platforms/ARM/Juno/ArmJuno.fdf | 9 -- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.dsc | 13 +- Platforms/ARM/VExpress/ArmVExpress-CTA15-A7.fdf | 16 --- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc | 33 ++--- Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf | 54 ++------ Platforms/ARM/VExpress/ArmVExpress.dsc.inc | 24 +--- Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c | 134 ++++++++++++++++++++ Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf | 39 ++++++ 9 files changed, 221 insertions(+), 109 deletions(-) create mode 100644 Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.c create mode 100644 Platforms/ARM/VExpress/Library/ArmVExpressDtPlatformDtbLoaderLib/ArmVExpressDtPlatformDtbLoaderLib.inf
-- 2.9.3
On 11 April 2017 at 18:00, Ryan Harkin ryan.harkin@linaro.org wrote:
On 10 April 2017 at 17:22, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
This is now mainly focused on FVP, although some changes affect TC2 and Juno as well. However, the switch to DtPlatformDxe, which is the primary purpose of this series, is only implemented for FVP.
Note that the full functionality is only enabled when building with DT_SUPPORT=TRUE, in which case the platform is built with a bunch of DTB images built in, and a menu option that allows choosing between ACPI and DT (which does require working non-volatile storage). Without DT support, the platform is essentially ACPI only, unless a DTB is supplied to the OS via one of the available out-of-band mechanisms.
I'm not 100% convinced that disabling device tree by default is the right thing to do. But at the same time, it's not my call and I don't boot anything interesting using FVP anyway, so I don't mind.
DT_SUPPORT=TRUE will give you a build that defaults to device tree. Otherwise, you will get a build that defaults to ACPI.
For the limited amount of stuff I need working, this all works fine on FVP Foundation & AEMv8, TC2 and Juno R0/1/2.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
Thanks! I take it this is with the two serieses combined?
On 11 April 2017 at 18:03, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
On 11 April 2017 at 18:00, Ryan Harkin ryan.harkin@linaro.org wrote:
On 10 April 2017 at 17:22, Ard Biesheuvel ard.biesheuvel@linaro.org wrote:
This is now mainly focused on FVP, although some changes affect TC2 and Juno as well. However, the switch to DtPlatformDxe, which is the primary purpose of this series, is only implemented for FVP.
Note that the full functionality is only enabled when building with DT_SUPPORT=TRUE, in which case the platform is built with a bunch of DTB images built in, and a menu option that allows choosing between ACPI and DT (which does require working non-volatile storage). Without DT support, the platform is essentially ACPI only, unless a DTB is supplied to the OS via one of the available out-of-band mechanisms.
I'm not 100% convinced that disabling device tree by default is the right thing to do. But at the same time, it's not my call and I don't boot anything interesting using FVP anyway, so I don't mind.
DT_SUPPORT=TRUE will give you a build that defaults to device tree. Otherwise, you will get a build that defaults to ACPI.
I'm sure it's fine.
For the limited amount of stuff I need working, this all works fine on FVP Foundation & AEMv8, TC2 and Juno R0/1/2.
Tested-by: Ryan Harkin ryan.harkin@linaro.org
Thanks! I take it this is with the two serieses combined?
Yes :-) I should have said. I've sent a Tested-by for that series also.