]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/ArmVExpressDxe: Load FDT into the EFI Configuration Table
authorRonald Cron <Ronald.Cron@arm.com>
Thu, 26 Feb 2015 10:54:39 +0000 (10:54 +0000)
committeroliviermartin <oliviermartin@Edk2>
Thu, 26 Feb 2015 10:54:39 +0000 (10:54 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16937 6f19259b-4bc3-4df7-8a09-765794883524

33 files changed:
ArmPkg/ArmPkg.dsc
ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc
ArmPlatformPkg/ArmPlatformPkg.dsc
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/AArch64/ArmFvpDxeAArch64.c
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/Arm/ArmFvpDxeArm.c
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.c
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.c
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmVExpressInternal.h
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec
ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc
EmbeddedPkg/EmbeddedPkg.dsc
EmbeddedPkg/Library/FdtLoadLib/FdtConfigurationTable.c [deleted file]
EmbeddedPkg/Library/FdtLoadLib/FdtLoadLib.inf [deleted file]

index be5126ccefd9205aa56f1aad06322c968a79f5e7..6959fde22c12f3570d9f25b548eb8935da31107a 100644 (file)
@@ -2,7 +2,7 @@
 # ARM processor package.\r
 #\r
 # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>\r
-# Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>\r
+# Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #    This program and the accompanying materials\r
 #    are licensed and made available under the terms and conditions of the BSD License\r
index 66a9797a1c0381ed2b005df14142261628354002..9d14a3e7577d57e981928be8d049ae5a30898562 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
index 81402da5b3033625b5e824859d728611480a51a0..ada59bdeb869ae34bb85058e0c791f3f5c802fac 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
index 2a6a5b755af66b6566a8a2974c1e4b06ec8be58d..be58e6bfc39930d018884ea3f3a8b790ad9c3f07 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
index 521f4ed8132c8aca315bd5a2d3fe4bd138cf3c89..e765617d692619d3b3bc497a733e200c3dbe0b40 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-CTA15-A7"\r
   # Ethernet (SMSC LAN9118)\r
   gEmbeddedTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x1A000000\r
 \r
+  #\r
+  # Define the device path to the FDT for the platform\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x0E800000,0x0E803000)"\r
+\r
   #\r
   # ARM OS Loader\r
   #\r
index 323be8a43cdb207014b20bb8e942abd928c3c40d..7390db30b9f56b7f0da05cbbdbd92b08d050e33b 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2012-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 \r
 [FD.ARM_VEXPRESS_CTA15A7_EFI]\r
 BaseAddress   = 0xB0000000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in remapped DRAM.\r
-Size          = 0x000B8000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device\r
+Size          = 0x000C0000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the FLASH Device\r
 ErasePolarity = 1\r
 BlockSize     = 0x00001000\r
-NumBlocks     = 0xB8\r
+NumBlocks     = 0xC0\r
 \r
-0x00000000|0x000B8000\r
+0x00000000|0x000C0000\r
 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize\r
 FV = FVMAIN_COMPACT\r
 \r
@@ -104,6 +104,11 @@ READ_LOCK_STATUS   = TRUE
   #\r
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # Multimedia Card Interface\r
   #\r
@@ -174,6 +179,11 @@ READ_LOCK_STATUS   = TRUE
   # FV Filesystem\r
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf\r
 \r
+  # Example to add a Device Tree to the Firmware Volume\r
+  #FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3) {\r
+  #  SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/vexpress-v2p-ca15_a7.dtb\r
+  #}\r
+\r
 [FV.FVMAIN_COMPACT]\r
 FvBaseAddress      = 0xB0000000\r
 FvForceRebase      = TRUE\r
index 83774798a034471a03e8c4671f38a83e0203780b..e23dc6d0de891ce2dc112df9d413ac9c077ff264 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"\r
   gArmTokenSpaceGuid.PcdGicDistributorBase|0x1e001000\r
   gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1e000100\r
 \r
+  #\r
+  # Define the device path to the FDT for the platform\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x46800000,0x46803000)"\r
+\r
   #\r
   # ARM OS Loader\r
   #\r
index d3d6ba14cfcea33d23bac44d16172360afce353c..a2a4add74dd738f48f731f83b536fd52c7e01c56 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -194,6 +194,11 @@ READ_LOCK_STATUS   = TRUE
   # Versatile Express FileSystem\r
   INF ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # Multimedia Card Interface\r
   #\r
@@ -243,6 +248,11 @@ READ_LOCK_STATUS   = TRUE
   # FV Filesystem\r
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf\r
 \r
+  # Example to add a Device Tree to the Firmware Volume\r
+  #FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA9x4) {\r
+  #  SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/vexpress-v2p-ca9.dtb\r
+  #}\r
+\r
 [FV.FVMAIN_COMPACT]\r
 FvAlignment        = 8\r
 ERASE_POLARITY     = 1\r
index 685b5047bbf643b506c5e927f3ad4ed7b5141d08..f0c99dae9474993a00038886c7a24fae0193e283 100644 (file)
@@ -56,6 +56,9 @@
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf\r
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   # to configure the Non-Secure interrupts in the GIC Redistributors\r
   # which is not supported at the moment.\r
   gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE\r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
 \r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform"\r
   # Set tick frequency value to 100Mhz\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
+\r
 ################################################################################\r
 #\r
 # Components Section - list of all EDK II Modules needed by this Platform\r
index 80acb9508f092f2f2f7a639322a22ca1e65a3fe5..1c709771b5716f77460943de1ae08c817f7f56b7 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -124,7 +124,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -186,6 +191,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
index 78f40779bd035509fd28962352c37bd442fbd10b..6c8498077792e39fda5a57578391d7cee0b11f88 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -51,6 +51,9 @@
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf\r
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
   #\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
 \r
 ################################################################################\r
 #\r
index 547f8cf99993e8fe95c0d592f811ddeb93ad2ef6..e7871903285c6d8a62def0c443ce0da86491999c 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -110,7 +110,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -187,6 +192,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
@@ -201,6 +211,11 @@ READ_LOCK_STATUS   = TRUE
   # FV Filesystem\r
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf\r
 \r
+  # Example to add a Device Tree to the Firmware Volume\r
+  #FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1) {\r
+  #  SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca15x1.dtb\r
+  #}\r
+\r
 [FV.FVMAIN_COMPACT]\r
 FvAlignment        = 8\r
 ERASE_POLARITY     = 1\r
index 2a81c85c6f527d9545f464de7f37d1da8a9d6ad2..0021a0a2354bacf34721876d8b786bb825396395 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -51,6 +51,9 @@
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf\r
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
   #\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
 \r
 ################################################################################\r
 #\r
index b2be83ba886d7af7f09454b86ed63605ed9e25c7..f62ae424e6bb37a5092614397d8f12d9dd83ded3 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -110,7 +110,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -187,6 +192,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
@@ -201,6 +211,11 @@ READ_LOCK_STATUS   = TRUE
   # FV Filesystem\r
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf\r
 \r
+  # Example to add a Device Tree to the Firmware Volume\r
+  #FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4) {\r
+  #  SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca15x4.dtb\r
+  #}\r
+\r
 [FV.FVMAIN_COMPACT]\r
 FvAlignment        = 8\r
 ERASE_POLARITY     = 1\r
index 0923a1e3b62d2b15db70f02c0fda061f8b316a8b..a13f443712a27448257c6b66a3d8fee9691bb52b 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -53,6 +53,9 @@
   # Uncomment to turn on GDB stub in SEC.\r
   #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
   #\r
   gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x1E00A000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
+\r
 ################################################################################\r
 #\r
 # Components Section - list of all EDK II Modules needed by this Platform\r
index a46d341e997d8af1d0a8a4985b3f6e553aec83f2..f0182bb532a5ccc175a04e48c2a267f92e03d36b 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -110,7 +110,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -173,6 +178,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
@@ -187,6 +197,11 @@ READ_LOCK_STATUS   = TRUE
   # FV Filesystem\r
   INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf\r
 \r
+  # Example to add a Device Tree to the Firmware Volume\r
+  #FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4) {\r
+  #  SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca9x4.dtb\r
+  #}\r
+\r
 [FV.FVMAIN_COMPACT]\r
 FvAlignment        = 8\r
 ERASE_POLARITY     = 1\r
index 725ce203ad85b2f5d785c203ceb74dfab350b566..c05043533d0a3b9cfe7372e99855c36e52606fdc 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -50,6 +50,9 @@
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressFoundationSecLib.inf\r
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressFoundationLibSec.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   #  It could be set FALSE to save size.\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Foundation Model"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmFoundation"\r
   # Set model tick to 100Mhz. This depends a lot on workstation performance.\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
+\r
 ################################################################################\r
 #\r
 # Components Section - list of all EDK II Modules needed by this Platform\r
index b971d4eb3613b2af93bb90a095fb0211b668a752..7db45d2cf38a22ec93bf1e6030025aab60f7d948 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -110,7 +110,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -160,6 +165,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
index b2ffd37d730a1ef3ec6ddae61457c9ff9a37e9bf..4d4c62555c8bf4659123923f1476898eaf61e2eb 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2013, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -49,6 +49,9 @@
   ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf\r
   ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf\r
 \r
+[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]\r
+  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf\r
+\r
 [BuildOptions]\r
   GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM\r
 \r
   # This PCD ensures the secondary cores are parked into the AArch64 Linux parking protocol.\r
   gArmTokenSpaceGuid.PcdArmLinuxSpinTable|TRUE\r
 \r
+  #\r
+  # FDT installation : enable the development specific features\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE\r
+\r
 [PcdsFixedAtBuild.common]\r
   gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"\r
   gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"\r
   # Set model tick to 100Mhz. This depends a lot on workstation performance.\r
   gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
 \r
+[PcdsDynamicDefault.common]\r
+  #\r
+  # The size of a dynamic PCD of the (VOID*) type can not be increased at run\r
+  # time from its size at build time. Set the "PcdFdtDevicePaths" PCD to a 128\r
+  # character "empty" string, to allow to be able to set FDT text device paths\r
+  # up to 128 characters long.\r
+  #\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"                                                                                                                                "\r
+\r
 ################################################################################\r
 #\r
 # Components Section - list of all EDK II Modules needed by this Platform\r
index 48074c88e6f5c3826f647b3542513f2f1f01fbdf..9f940235ecd296dd9a97d04e188dfd9d9e424774 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011 - 2014, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -112,7 +112,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE\r
 READ_LOCK_STATUS   = TRUE\r
 \r
+  APRIORI DXE {\r
+    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+  }\r
+\r
   INF MdeModulePkg/Core/Dxe/DxeMain.inf\r
+  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
 \r
   #\r
   # PI DXE Drivers producing Architectural Protocols (EFI Services)\r
@@ -170,6 +175,11 @@ READ_LOCK_STATUS   = TRUE
   INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf\r
   INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf\r
 \r
+  #\r
+  # FDT installation\r
+  #\r
+  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
+\r
   #\r
   # UEFI application (Shell Embedded Boot Loader)\r
   #\r
index ddc796dc0410e9d95ba589c300502f4f340a8004..745f9025b8e7069a44427327ad8b398d132dc208 100644 (file)
   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE\r
 \r
 [Components.common]\r
+  MdeModulePkg/Universal/PCD/Dxe/Pcd.inf\r
+\r
   # Versatile Express FileSystem\r
   ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf\r
 \r
index 41d94eda1dc758df059324ce136ad586baef0293..09e859f0c5a0aa1e02891fd4e8d5d1b6df0fc93b 100644 (file)
 // model or hardware platforms).\r
 //\r
 CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {\r
-  { ARM_FVP_VEXPRESS_AEMv8x4 },\r
-  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2 },\r
-  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY },\r
-  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3 },\r
-  { ARM_FVP_FOUNDATION_GICV2 },\r
-  { ARM_FVP_FOUNDATION_GICV2_LEGACY },\r
-  { ARM_FVP_FOUNDATION_GICV3 },\r
-  { ARM_FVP_VEXPRESS_UNKNOWN }\r
+  { ARM_FVP_VEXPRESS_AEMv8x4, { 0x240d627e, 0xeb4d, 0x447d, { 0x86, 0x30, 0xf2, 0x12, 0x3b, 0xc3, 0x89, 0x3f } }, L"rtsm_ve-aemv8a.dtb" },\r
+  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, { 0xfbed0b94, 0x3c81, 0x49e4, { 0xbd, 0xec, 0xd4, 0xf4, 0xa8, 0x47, 0xeb, 0x51 } }, L"fvp-base-gicv2-psci.dtb" },\r
+  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, { 0x6d8dfd91, 0x431a, 0x4e6c, { 0x84, 0x5a, 0x15, 0xf1, 0xfc, 0x8d, 0x9b, 0xe2 } }, L"fvp-base-gicv2legacy-psci.dtb" },\r
+  { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, { 0xa8ac2953, 0xc4bb, 0x4914, { 0x87, 0xf5, 0xc5, 0x97, 0x5d, 0x7b, 0x32, 0xd1 } }, L"fvp-base-gicv3-psci.dtb" },\r
+  { ARM_FVP_FOUNDATION_GICV2, { 0x4328cb83, 0x6e50, 0x4cb8, { 0xaa, 0x8c, 0xfb, 0x7a, 0xba, 0xba, 0x37, 0xd8 } }, L"fvp-foundation-gicv2-psci.dtb" },\r
+  { ARM_FVP_FOUNDATION_GICV2_LEGACY, { 0x6af00d18, 0x6dfe, 0x45ed, { 0xa6, 0xc4, 0xb4, 0x4d, 0x57, 0xfd, 0xd8, 0xf5 } }, L"fvp-foundation-gicv2legacy-psci.dtb" },\r
+  { ARM_FVP_FOUNDATION_GICV3, { 0x4a17b7fa, 0xf052, 0x4dc1, { 0x92, 0x79, 0x43, 0x80, 0x92, 0x41, 0xf9, 0x98 } }, L"fvp-foundation-gicv3-psci.dtb" },\r
+  { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }\r
 };\r
 \r
 /**\r
index 7ac89ad90a6a52a4828098d99e822198c3bce633..5ec27a5bb942cf217488860fec966e70a665d240 100644 (file)
 // model or hardware platforms).\r
 //\r
 CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {\r
-  { ARM_FVP_VEXPRESS_A9x4 },\r
-  { ARM_FVP_VEXPRESS_A15x1 },\r
-  { ARM_FVP_VEXPRESS_A15x2 },\r
-  { ARM_FVP_VEXPRESS_A15x4 },\r
-  { ARM_FVP_VEXPRESS_UNKNOWN }\r
+  { ARM_FVP_VEXPRESS_A9x4, { 0x943f2ae9, 0x51b2, 0x48b2, { 0x82, 0xc4, 0x9a, 0xeb, 0x2c, 0x21, 0xd8, 0xe1 } }, L"rtsm_ve-cortex_a9x4.dtb" },\r
+  { ARM_FVP_VEXPRESS_A15x1, { 0x581930c3, 0x9f53, 0x4c53, { 0x91, 0x23, 0x43, 0xb8, 0x65, 0xdf, 0x3f, 0x23} }, L"rtsm_ve-cortex_a15x1.dtb" },\r
+  { ARM_FVP_VEXPRESS_A15x2, { 0x3f10b34a, 0xa310, 0x472c, { 0xac, 0xb9, 0x36, 0x0b, 0x1d, 0xb5, 0x7a, 0x8b} }, L"rtsm_ve-cortex_a15x2.dtb" },\r
+  { ARM_FVP_VEXPRESS_A15x4, { 0x9a783838, 0x8a77, 0x4cdb, { 0x82, 0xa4, 0x35, 0x91, 0x2c, 0x08, 0x8a, 0x2e} }, L"rtsm_ve-cortex_a15x4.dtb" },\r
+  { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }\r
 };\r
 \r
 /**\r
index 6a3d3503824c552a596b1b785c42dcb65ff0ec34..9a60f1d611d458a28d87e9ffe86d6d6214051c83 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,6 +16,7 @@
 \r
 #include <Library/VirtioMmioDeviceLib.h>\r
 #include <Library/ArmShellCmdLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
 \r
 #define ARM_FVP_BASE_VIRTIO_BLOCK_BASE    0x1c130000\r
 \r
@@ -49,6 +50,10 @@ VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =
   }\r
 };\r
 \r
+/**\r
+ * Generic UEFI Entrypoint for 'ArmFvpDxe' driver\r
+ * See UEFI specification for the details of the parameters\r
+ */\r
 EFI_STATUS\r
 EFIAPI\r
 ArmFvpInitialise (\r
@@ -56,7 +61,11 @@ ArmFvpInitialise (
   IN EFI_SYSTEM_TABLE   *SystemTable\r
   )\r
 {\r
-  EFI_STATUS              Status;\r
+  CONST ARM_VEXPRESS_PLATFORM* Platform;\r
+  EFI_STATUS                   Status;\r
+  CHAR16                       *TextDevicePath;\r
+  UINTN                        TextDevicePathSize;\r
+  VOID                         *Buffer;\r
 \r
   Status = gBS->InstallProtocolInterface (&ImageHandle,\r
                  &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,\r
@@ -65,6 +74,26 @@ ArmFvpInitialise (
     return Status;\r
   }\r
 \r
+  Status = ArmVExpressGetPlatform (&Platform);\r
+  if (!EFI_ERROR (Status)) {\r
+    TextDevicePathSize  = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16);\r
+    TextDevicePathSize += StrSize (Platform->FdtName);\r
+\r
+    TextDevicePath = AllocatePool (TextDevicePathSize);\r
+    if (TextDevicePath != NULL) {\r
+      StrCpy (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)));\r
+      StrCat (TextDevicePath, Platform->FdtName);\r
+      Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, TextDevicePath);\r
+      if (Buffer == NULL) {\r
+        DEBUG ((\r
+          EFI_D_ERROR,\r
+          "ArmFvpDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", EFI_BUFFER_TOO_SMALL\r
+          ));\r
+      }\r
+      FreePool (TextDevicePath);\r
+    }\r
+  }\r
+\r
   // Declare the Virtio BlockIo device\r
   Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);\r
   if (EFI_ERROR (Status)) {\r
index a69601ba122d71392bf891aa16480c8651ac08ed..01d9f5002b40dfdf1da937795de8bc39ff32e21b 100644 (file)
   ArmPkg/ArmPkg.dec\r
   ArmPlatformPkg/ArmPlatformPkg.dec\r
   ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
   OvmfPkg/OvmfPkg.dec\r
 \r
 [LibraryClasses]\r
+  PcdLib\r
   ArmShellCmdRunAxfLib\r
   ArmLib\r
   ArmPlatformLib\r
   BaseMemoryLib\r
+  MemoryAllocationLib\r
   UefiDriverEntryPoint\r
   UefiBootServicesTableLib\r
   VirtioMmioDeviceLib\r
 \r
 [LibraryClasses.AARCH64]\r
   ArmGicLib\r
+\r
+[FixedPcd]\r
+  gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase\r
+\r
+[Pcd]\r
+  gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths\r
index 66ec9963ca82b7c5bd1dd23b50d561a0db6f83be..d1b393ccabd81856c1c8c8d2124127cb1d9a29fe 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
 // model or hardware platforms).\r
 //\r
 CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {\r
-  { ARM_HW_A9x4 },\r
-  { ARM_HW_A15x2_A7x3 },\r
-  { ARM_HW_A15 },\r
-  { ARM_HW_A5 },\r
-  { ARM_FVP_VEXPRESS_UNKNOWN }\r
+  { ARM_HW_A9x4, { 0x2fd21cf6, 0xe6e8, 0x4ff2, { 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 } }, L"vexpress-v2p-ca9.dtb" },\r
+  { ARM_HW_A15x2_A7x3, { 0xd5e606eb, 0x83df, 0x4e90, { 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a } }, L"vexpress-v2p-ca15_a7.dtb" },\r
+  { ARM_HW_A15, { 0x6b8947c2, 0x4287, 0x4d91, { 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f } }, L"vexpress-v2p-ca15-tc1.dtb" },\r
+  { ARM_HW_A5, { 0xa2cc7663, 0x4d7c, 0x448a, { 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 } }, L"vexpress-v2p-ca5s.dtb" },\r
+  { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }\r
 };\r
 \r
 /**\r
@@ -49,6 +49,10 @@ ArmVExpressGetPlatform (
   return EFI_NOT_FOUND;\r
 }\r
 \r
+/**\r
+ * Generic UEFI Entrypoint for 'ArmHwDxe' driver\r
+ * See UEFI specification for the details of the parameters\r
+ */\r
 EFI_STATUS\r
 EFIAPI\r
 ArmHwInitialise (\r
index 92a193f8a0705bd3e3e560f9a754cc9e33c33c3e..952d624b459e7be9996462d4c1967c04d90a5fe9 100644 (file)
@@ -1,6 +1,6 @@
 #/** @file\r
 #\r
-#  Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -14,7 +14,7 @@
 \r
 [Defines]\r
   INF_VERSION                    = 0x00010006\r
-  BASE_NAME                      = ArmFvpDxe\r
+  BASE_NAME                      = ArmHwDxe\r
   FILE_GUID                      = fe61bb5f-1b67-4c24-b346-73db42e873e5\r
   MODULE_TYPE                    = UEFI_DRIVER\r
   VERSION_STRING                 = 1.0\r
 [Packages]\r
   ArmPkg/ArmPkg.dec\r
   ArmPlatformPkg/ArmPlatformPkg.dec\r
+  EmbeddedPkg/EmbeddedPkg.dec\r
   MdePkg/MdePkg.dec\r
 \r
 [LibraryClasses]\r
   ArmShellCmdRunAxfLib\r
+  MemoryAllocationLib\r
   UefiDriverEntryPoint\r
+\r
+[Protocols]\r
+  gEfiDevicePathProtocolGuid\r
index 075ced8e89d530d1de7cd894c15044fdd61ce0d7..41019c1198c711779142a6efb92d781f727ac043 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-  Copyright (c) 2014, ARM Ltd. All rights reserved.\r
+  Copyright (c) 2014-2015, ARM Ltd. All rights reserved.\r
 \r
   This program and the accompanying materials are licensed and made available\r
   under the terms and conditions of the BSD License which accompanies this\r
@@ -50,7 +50,10 @@ typedef enum {
 \r
 typedef struct {\r
   ARM_VEXPRESS_PLATFORM_ID  Id;\r
-  // Will be extended with platform specific information\r
+\r
+  // Flattened Device Tree (FDT) File\r
+  EFI_GUID                  FdtGuid; /// Name of the FDT when present into the FV\r
+  CONST CHAR16*             FdtName; /// Name of the FDT when present into a File System\r
 } ARM_VEXPRESS_PLATFORM;\r
 \r
 // Array that contains the list of the VExpress based platform supported by this DXE driver\r
index f54733a8a45c6caa18b19bf9b94ad146dcd47c04..e8108bc34b561efae3821fd191c11a436029dddf 100644 (file)
@@ -1,11 +1,11 @@
 #/** @file\r
 # Arm Versatile Express package.\r
 #\r
-#  Copyright (c) 2012, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2012-2015, ARM Limited. All rights reserved.\r
 #\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution.  The full text of the license may be found at\r
+#  This program and the accompanying materials are licensed and made available\r
+#  under the terms and conditions of the BSD License which accompanies this\r
+#  distribution.  The full text of the license may be found at\r
 #  http://opensource.org/licenses/bsd-license.php\r
 #\r
 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   #\r
   # For a list of mode numbers look in LcdArmVExpress.c\r
   #\r
-  gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode|3|UINT32|0x00000003\r
-  gArmVExpressTokenSpaceGuid.PcdPL111LcdVideoModeOscId|1|UINT32|0x00000004\r
-  gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId|0|UINT32|0x00000009\r
+  gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode|3|UINT32|0x00000001\r
+  gArmVExpressTokenSpaceGuid.PcdPL111LcdVideoModeOscId|1|UINT32|0x00000002\r
+  gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId|0|UINT32|0x00000003\r
 \r
   #\r
   # Device path of block device on which Fastboot will flash partitions\r
   #\r
-  gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|""|VOID*|0x00000001\r
+  gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|""|VOID*|0x00000004\r
+\r
+  # FVP platforms : install FDT from SemiHosting\r
+  gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/"|VOID*|0x00000005\r
+  # HW platforms : install FDT from NOR Flash\r
+  gArmVExpressTokenSpaceGuid.PcdHwFdtDevicePathsBase|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/"|VOID*|0x00000006\r
+\r
+  #\r
+  # ARM Versatile Express FDT Guids\r
+  #\r
+  # FVP platforms\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4|{ 0xe9, 0x2a, 0x3f, 0x94, 0xb2, 0x51, 0xb2, 0x48, 0x48, 0xb2, 0x82, 0xc4, 0x9a, 0xeb, 0x2c, 0x21, 0xd8, 0xe1 }|VOID*|0x00000007\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1|{ 0xc3, 0x30, 0x19, 0x58 0x53, 0x9f, 0x53, 0x4c, 0x4, 0xc53, 0x91, 0x23, 0x43, 0xb8, 0x65, 0xdf, 0x3f, 0x23 }|VOID*|0x00000008\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x2|{ 0x4a, 0xb3, 0x10, 0x3f 0x10, 0xa3, 0x2c, 0x47, 0xac, 0xb9, 0x36, 0x0b, 0x1d, 0xb5, 0x7a, 0x8b }|VOID*|0x00000009\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4|{ 0x38, 0x38, 0x78, 0x9a, 0x77, 0x8a, 0xdb, 0x4c, 0x82, 0xa4, 0x35, 0x91, 0x2c, 0x08, 0x8a, 0x2e }|VOID*|0x0000000A\r
+  # HW platforms\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA9x4|{ 0xf6, 0x1c, 0xd2, 0x2f, 0xe8, 0xe6, 0xf2, 0x4f, 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 }|VOID*|0x0000000B\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3|{ 0xeb, 0x06, e6, 0xd5, 0xdf, 0x83, 0x90, 0x4e, 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a }|VOID*|0x0000000C\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15|{ 0xc2, 0x47, 0x89, 0x6b, 0x87, 0x42, 0x91, 0x4d, 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f }|VOID*|0x0000000D\r
+  gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA5|{ 0x63, 0x76, 0xcc, 0xa2, 0x7c, 0x4d, 0x8a, 0x44, 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 }|VOID*|0x0000000E\r
index a1e10d7d79cb69b88fba35362c1445d82f98d458..1a82762cbcf2f1c7db1e862e5dd2f68e835a96d8 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2011-2012, ARM Limited. All rights reserved.\r
+#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
 #  Copyright (c) 2014, Linaro Limited. All rights reserved.\r
 #\r
 #  This program and the accompanying materials\r
index fc42fe5128bf6e44d77b55826349c46fc9e7c5c3..d3f8e7c507ffdd84f7123ea9d79056e7ae17ca44 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 #\r
 # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
-# Copyright (c) 2012-2014, ARM Ltd. All rights reserved.<BR>\r
+# Copyright (c) 2012-2015, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #    This program and the accompanying materials\r
 #    are licensed and made available under the terms and conditions of the BSD License\r
   EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf\r
 \r
   # FDT installation\r
-  EmbeddedPkg/Library/FdtLoadLib/FdtLoadLib.inf\r
   EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf\r
 \r
   EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf\r
diff --git a/EmbeddedPkg/Library/FdtLoadLib/FdtConfigurationTable.c b/EmbeddedPkg/Library/FdtLoadLib/FdtConfigurationTable.c
deleted file mode 100644 (file)
index a95e249..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/** @file\r
-*\r
-*  Copyright (c) 2014, ARM Limited. All rights reserved.\r
-*\r
-*  This program and the accompanying materials\r
-*  are licensed and made available under the terms and conditions of the BSD License\r
-*  which accompanies this distribution.  The full text of the license may be found at\r
-*  http://opensource.org/licenses/bsd-license.php\r
-*\r
-*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-*\r
-**/\r
-\r
-#include <PiDxe.h>\r
-#include <Library/DebugLib.h>\r
-#include <Library/FdtLoadLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-\r
-#include <Protocol/DevicePath.h>\r
-#include <Protocol/FirmwareVolume2.h>\r
-#include <Protocol/SimpleFileSystem.h>\r
-\r
-#include <Guid/Fdt.h>\r
-#include <Guid/FileInfo.h>\r
-\r
-#include <libfdt.h>\r
-\r
-//\r
-// Device path for SemiHosting\r
-//\r
-STATIC CONST struct {\r
-  VENDOR_DEVICE_PATH        Guid;\r
-  EFI_DEVICE_PATH_PROTOCOL  End;\r
-} mSemihostingDevicePath = {\r
-  {\r
-    { HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH), 0 } },\r
-    { 0xC5B9C74A, 0x6D72, 0x4719, { 0x99, 0xAB, 0xC5, 0x9F, 0x19, 0x90, 0x91, 0xEB } }\r
-  },\r
-  { END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 } }\r
-};\r
-\r
-\r
-/**\r
-  This function declares the passed FDT into the UEFI Configuration Table\r
-\r
-  @param FdtBlob    Base address of the Fdt Blob in System Memory\r
-  @param FdtSize    Size of the Fdt Blob in System Memory\r
-\r
-  @return EFI_SUCCESS           Fdt Blob was successfully installed into the configuration table\r
-  @return !EFI_SUCCESS          Error returned by BS.InstallConfigurationTable()\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-InstallFdtIntoConfigurationTable (\r
-  IN VOID* FdtBlob,\r
-  IN UINTN FdtSize\r
-  )\r
-{\r
-  EFI_STATUS Status;\r
-\r
-  // Check the FDT header is valid. We only make this check in DEBUG mode in case the FDT header change on\r
-  // production device and this ASSERT() becomes not valid.\r
-  ASSERT (fdt_check_header (FdtBlob) == 0);\r
-\r
-  // Ensure the Size of the Device Tree is smaller than the size of the read file\r
-  ASSERT ((UINTN)fdt_totalsize (FdtBlob) <= FdtSize);\r
-\r
-  // Install the FDT into the Configuration Table\r
-  Status = gBS->InstallConfigurationTable (&gFdtTableGuid, FdtBlob);\r
-\r
-  return Status;\r
-}\r
-\r
-\r
-/**\r
-  Load and Install FDT from Semihosting\r
-\r
-  @param Filename   Name of the file to load from semihosting\r
-\r
-  @return EFI_SUCCESS           Fdt Blob was successfully installed into the configuration table\r
-                                from semihosting\r
-  @return EFI_NOT_FOUND         Fail to locate the file in semihosting\r
-  @return EFI_OUT_OF_RESOURCES  Fail to allocate memory to contain the blob\r
-**/\r
-EFI_STATUS\r
-InstallFdtFromSemihosting (\r
-  IN  CONST CHAR16*   FileName\r
-  )\r
-{\r
-  EFI_STATUS                       Status;\r
-  EFI_DEVICE_PATH*                 Remaining;\r
-  EFI_HANDLE                       Handle;\r
-  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SemihostingFs;\r
-  EFI_FILE_PROTOCOL               *Fs;\r
-  EFI_FILE_PROTOCOL               *File;\r
-  EFI_PHYSICAL_ADDRESS             FdtBase;\r
-  EFI_FILE_INFO                   *FileInfo;\r
-  UINTN                            FdtSize;\r
-  UINTN                            FileInfoSize;\r
-\r
-  // Ensure the Semihosting driver is initialized\r
-  Remaining = (EFI_DEVICE_PATH*)&mSemihostingDevicePath;\r
-  // The LocateDevicePath() function locates all devices on DevicePath that support Protocol and returns\r
-  // the handle to the device that is closest to DevicePath. On output, the device path pointer is modified\r
-  // to point to the remaining part of the device path\r
-  Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &Remaining, &Handle);\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT_EFI_ERROR (Status);\r
-    return Status;\r
-  }\r
-\r
-  // Recursive = FALSE: We do not want to start the whole device tree\r
-  Status = gBS->ConnectController (Handle, NULL, Remaining, FALSE);\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  // Locate the FileSystem\r
-  Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **)&SemihostingFs);\r
-  if (EFI_ERROR (Status)) {\r
-    ASSERT_EFI_ERROR (Status);\r
-    return Status;\r
-  }\r
-\r
-  // Try to Open the volume and get root directory\r
-  Status = SemihostingFs->OpenVolume (SemihostingFs, &Fs);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_WARN, "Warning: Fail to open semihosting filesystem that should contain FDT file.\n"));\r
-    return Status;\r
-  }\r
-\r
-  File = NULL;\r
-  Status = Fs->Open (Fs, &File, (CHAR16*)FileName, EFI_FILE_MODE_READ, 0);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((EFI_D_WARN, "Warning: Fail to load FDT file '%s'.\n", FileName));\r
-    Fs->Close (Fs);\r
-    return Status;\r
-  }\r
-\r
-  FileInfoSize = 0;\r
-  File->GetInfo (File, &gEfiFileInfoGuid, &FileInfoSize, NULL);\r
-  FileInfo = AllocatePool (FileInfoSize);\r
-  if (FileInfo == NULL) {\r
-    Status = EFI_OUT_OF_RESOURCES;\r
-    goto CLOSE_FILES;\r
-  }\r
-  Status = File->GetInfo (File, &gEfiFileInfoGuid, &FileInfoSize, FileInfo);\r
-  if (EFI_ERROR (Status)) {\r
-    FreePool (FileInfo);\r
-    goto CLOSE_FILES;\r
-  }\r
-\r
-  // Get the file size\r
-  FdtSize = FileInfo->FileSize;\r
-  FreePool (FileInfo);\r
-\r
-  // The FDT blob is attached to the Configuration Table. It is recommended to load it as Runtime Service Data\r
-  // to prevent the kernel to overwrite its data\r
-  Status = gBS->AllocatePages (AllocateAnyPages, EfiRuntimeServicesData, EFI_SIZE_TO_PAGES (FdtSize), &FdtBase);\r
-  if (!EFI_ERROR (Status)) {\r
-    Status = File->Read (File, &FdtSize, (VOID*)(UINTN)(FdtBase));\r
-    if (EFI_ERROR (Status)) {\r
-      gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));\r
-    } else {\r
-      // Install the FDT as part of the UEFI Configuration Table\r
-      Status = InstallFdtIntoConfigurationTable ((VOID*)(UINTN)FdtBase, FdtSize);\r
-      if (EFI_ERROR (Status)) {\r
-        gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));\r
-      }\r
-    }\r
-  }\r
-\r
-CLOSE_FILES:\r
-  File->Close (File);\r
-  Fs->Close (Fs);\r
-  return Status;\r
-}\r
-\r
-/**\r
-  Load and Install FDT from Firmware Volume\r
-\r
-  @param Filename   Guid of the FDT blob to load from firmware volume\r
-\r
-  @return EFI_SUCCESS           Fdt Blob was successfully installed into the configuration table\r
-                                from firmware volume\r
-  @return EFI_NOT_FOUND         Fail to locate the file in firmware volume\r
-  @return EFI_OUT_OF_RESOURCES  Fail to allocate memory to contain the blob\r
-**/\r
-EFI_STATUS\r
-InstallFdtFromFv (\r
-  IN  CONST EFI_GUID *FileName\r
-  )\r
-{\r
-  EFI_STATUS                    Status;\r
-  EFI_HANDLE                    *HandleBuffer;\r
-  UINTN                         NumberOfHandles;\r
-  UINT32                        FvStatus;\r
-  UINTN                         Index;\r
-  EFI_FIRMWARE_VOLUME2_PROTOCOL *FvInstance;\r
-  INTN                          SectionInstance;\r
-  UINTN                         FdtSize;\r
-  VOID*                         FdtBlob;\r
-  EFI_PHYSICAL_ADDRESS          FdtBase;\r
-\r
-  FvStatus        = 0;\r
-  SectionInstance = 0;\r
-\r
-  // Locate all the Firmware Volume protocols.\r
-  Status = gBS->LocateHandleBuffer (\r
-                   ByProtocol,\r
-                   &gEfiFirmwareVolume2ProtocolGuid,\r
-                   NULL,\r
-                   &NumberOfHandles,\r
-                   &HandleBuffer\r
-                   );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  // Looking for FV that contains the FDT blob\r
-  for (Index = 0; Index < NumberOfHandles; Index++) {\r
-    //\r
-    // Get the protocol on this handle\r
-    // This should not fail because of LocateHandleBuffer\r
-    //\r
-    Status = gBS->HandleProtocol (\r
-                     HandleBuffer[Index],\r
-                     &gEfiFirmwareVolume2ProtocolGuid,\r
-                     (VOID**) &FvInstance\r
-                     );\r
-    if (EFI_ERROR (Status)) {\r
-      goto FREE_HANDLE_BUFFER;\r
-    }\r
-\r
-    while (Status == EFI_SUCCESS) {\r
-      // FdtBlob must be allocated by ReadSection\r
-      FdtBlob = NULL;\r
-\r
-      // See if it contains the FDT file\r
-      Status = FvInstance->ReadSection (\r
-                        FvInstance,\r
-                        FileName,\r
-                        EFI_SECTION_RAW,\r
-                        SectionInstance,\r
-                        &FdtBlob,\r
-                        &FdtSize,\r
-                        &FvStatus\r
-                        );\r
-      if (!EFI_ERROR (Status)) {\r
-        // When the FDT blob is attached to the Configuration Table it is recommended to load it as Runtime Service Data\r
-        // to prevent the kernel to overwrite its data\r
-        Status = gBS->AllocatePages (AllocateAnyPages, EfiRuntimeServicesData, EFI_SIZE_TO_PAGES (FdtSize), &FdtBase);\r
-        if (EFI_ERROR (Status)) {\r
-          goto FREE_HANDLE_BUFFER;\r
-        }\r
-\r
-        // Copy the FDT to the Runtime memory\r
-        gBS->CopyMem ((VOID*)(UINTN)FdtBase, FdtBlob, FdtSize);\r
-        // Free the buffer allocated by FvInstance->ReadSection()\r
-        gBS->FreePool (FdtBlob);\r
-\r
-        // Install the FDT as part of the UEFI Configuration Table\r
-        Status = InstallFdtIntoConfigurationTable ((VOID*)(UINTN)FdtBase, FdtSize);\r
-        if (EFI_ERROR (Status)) {\r
-          gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));\r
-        }\r
-        break;\r
-      }\r
-    }\r
-  }\r
-\r
-FREE_HANDLE_BUFFER:\r
-  // Free any allocated buffers\r
-  gBS->FreePool (HandleBuffer);\r
-\r
-  return Status;\r
-}\r
diff --git a/EmbeddedPkg/Library/FdtLoadLib/FdtLoadLib.inf b/EmbeddedPkg/Library/FdtLoadLib/FdtLoadLib.inf
deleted file mode 100644 (file)
index a50aa36..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#/* @file\r
-#  Copyright (c) 2014, Linaro Limited. All rights reserved.\r
-#\r
-#  This program and the accompanying materials\r
-#  are licensed and made available under the terms and conditions of the BSD License\r
-#  which accompanies this distribution.  The full text of the license may be found at\r
-#  http://opensource.org/licenses/bsd-license.php\r
-#\r
-#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-#\r
-#*/\r
-\r
-[Defines]\r
-  INF_VERSION                    = 0x00010005\r
-  BASE_NAME                      = FdtLoadLib\r
-  FILE_GUID                      = F00298C1-BBC3-445F-8906-AAEAFE7729A4\r
-  MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
-  LIBRARY_CLASS                  = FdtLoadLib\r
-\r
-#\r
-# The following information is for reference only and not required by the build tools.\r
-#\r
-#  VALID_ARCHITECTURES           = ARM AARCH64\r
-#\r
-\r
-[Sources]\r
-  FdtConfigurationTable.c\r
-\r
-[Packages]\r
-  MdePkg/MdePkg.dec\r
-  EmbeddedPkg/EmbeddedPkg.dec\r
-\r
-[LibraryClasses]\r
-  FdtLib\r
-\r
-[Protocols]\r
-  gEfiDevicePathProtocolGuid\r
-  gEfiSimpleFileSystemProtocolGuid\r
-  gEfiFirmwareVolume2ProtocolGuid\r
-\r
-[Guids]\r
-  gEfiFileInfoGuid\r
-  gFdtTableGuid\r