ArmPlatformPkg/ArmVExpressDxe: Load FDT into the EFI Configuration Table

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
This commit is contained in:
Ronald Cron 2015-02-26 10:54:39 +00:00 committed by oliviermartin
parent d550b88184
commit 04f1a7096a
33 changed files with 342 additions and 383 deletions

View File

@ -2,7 +2,7 @@
# ARM processor package. # ARM processor package.
# #
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR> # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR> # Copyright (c) 2011 - 2015, ARM Ltd. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012-2014, ARM Limited. All rights reserved. # Copyright (c) 2012-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -73,6 +73,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-CTA15-A7" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-CTA15-A7"
@ -171,6 +176,11 @@
# Ethernet (SMSC LAN9118) # Ethernet (SMSC LAN9118)
gEmbeddedTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x1A000000 gEmbeddedTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x1A000000
#
# Define the device path to the FDT for the platform
#
gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x0E800000,0x0E803000)"
# #
# ARM OS Loader # ARM OS Loader
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2012-2014, ARM Limited. All rights reserved. # Copyright (c) 2012-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -26,12 +26,12 @@
[FD.ARM_VEXPRESS_CTA15A7_EFI] [FD.ARM_VEXPRESS_CTA15A7_EFI]
BaseAddress = 0xB0000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in remapped DRAM. BaseAddress = 0xB0000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in remapped DRAM.
Size = 0x000B8000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device Size = 0x000C0000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device
ErasePolarity = 1 ErasePolarity = 1
BlockSize = 0x00001000 BlockSize = 0x00001000
NumBlocks = 0xB8 NumBlocks = 0xC0
0x00000000|0x000B8000 0x00000000|0x000C0000
gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
FV = FVMAIN_COMPACT FV = FVMAIN_COMPACT
@ -104,6 +104,11 @@ READ_LOCK_STATUS = TRUE
# #
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmHwDxe.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# Multimedia Card Interface # Multimedia Card Interface
# #
@ -174,6 +179,11 @@ READ_LOCK_STATUS = TRUE
# FV Filesystem # FV Filesystem
INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3) {
# SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/vexpress-v2p-ca15_a7.dtb
#}
[FV.FVMAIN_COMPACT] [FV.FVMAIN_COMPACT]
FvBaseAddress = 0xB0000000 FvBaseAddress = 0xB0000000
FvForceRebase = TRUE FvForceRebase = TRUE

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -98,6 +98,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress"
@ -172,6 +177,11 @@
gArmTokenSpaceGuid.PcdGicDistributorBase|0x1e001000 gArmTokenSpaceGuid.PcdGicDistributorBase|0x1e001000
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1e000100 gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x1e000100
#
# Define the device path to the FDT for the platform
#
gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x46800000,0x46803000)"
# #
# ARM OS Loader # ARM OS Loader
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -194,6 +194,11 @@ READ_LOCK_STATUS = TRUE
# Versatile Express FileSystem # Versatile Express FileSystem
INF ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf INF ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# Multimedia Card Interface # Multimedia Card Interface
# #
@ -243,6 +248,11 @@ READ_LOCK_STATUS = TRUE
# FV Filesystem # FV Filesystem
INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA9x4) {
# SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/vexpress-v2p-ca9.dtb
#}
[FV.FVMAIN_COMPACT] [FV.FVMAIN_COMPACT]
FvAlignment = 8 FvAlignment = 8
ERASE_POLARITY = 1 ERASE_POLARITY = 1

View File

@ -56,6 +56,9 @@
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -77,6 +80,10 @@
# to configure the Non-Secure interrupts in the GIC Redistributors # to configure the Non-Secure interrupts in the GIC Redistributors
# which is not supported at the moment. # which is not supported at the moment.
gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE gArmTokenSpaceGuid.PcdArmGicV3WithV2Legacy|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Fixed Virtual Platform"
@ -188,6 +195,15 @@
# Set tick frequency value to 100Mhz # Set tick frequency value to 100Mhz
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[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 # Components Section - list of all EDK II Modules needed by this Platform

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. # Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -124,7 +124,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -186,6 +191,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -51,6 +51,9 @@
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -74,6 +77,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
@ -170,6 +178,14 @@
# #
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[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" "
################################################################################ ################################################################################
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -110,7 +110,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -187,6 +192,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #
@ -201,6 +211,11 @@ READ_LOCK_STATUS = TRUE
# FV Filesystem # FV Filesystem
INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1) {
# SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca15x1.dtb
#}
[FV.FVMAIN_COMPACT] [FV.FVMAIN_COMPACT]
FvAlignment = 8 FvAlignment = 8
ERASE_POLARITY = 1 ERASE_POLARITY = 1

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -51,6 +51,9 @@
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -74,6 +77,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
@ -172,6 +180,14 @@
# #
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[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" "
################################################################################ ################################################################################
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -110,7 +110,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -187,6 +192,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #
@ -201,6 +211,11 @@ READ_LOCK_STATUS = TRUE
# FV Filesystem # FV Filesystem
INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4) {
# SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca15x4.dtb
#}
[FV.FVMAIN_COMPACT] [FV.FVMAIN_COMPACT]
FvAlignment = 8 FvAlignment = 8
ERASE_POLARITY = 1 ERASE_POLARITY = 1

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -53,6 +53,9 @@
# Uncomment to turn on GDB stub in SEC. # Uncomment to turn on GDB stub in SEC.
#DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -77,6 +80,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
@ -173,6 +181,15 @@
# #
gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x1E00A000 gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x1E00A000
[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 # Components Section - list of all EDK II Modules needed by this Platform

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2014, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -110,7 +110,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -173,6 +178,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #
@ -187,6 +197,11 @@ READ_LOCK_STATUS = TRUE
# FV Filesystem # FV Filesystem
INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
# Example to add a Device Tree to the Firmware Volume
#FILE FREEFORM = PCD(gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4) {
# SECTION RAW = ArmPlatformPkg/ArmVExpressPkg/Fdts/rtsm_ve-ca9x4.dtb
#}
[FV.FVMAIN_COMPACT] [FV.FVMAIN_COMPACT]
FvAlignment = 8 FvAlignment = 8
ERASE_POLARITY = 1 ERASE_POLARITY = 1

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2013, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -50,6 +50,9 @@
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressFoundationSecLib.inf ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressFoundationSecLib.inf
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressFoundationLibSec.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressFoundationLibSec.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -71,6 +74,11 @@
# It could be set FALSE to save size. # It could be set FALSE to save size.
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|FALSE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Foundation Model" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Foundation Model"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmFoundation" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmFoundation"
@ -136,6 +144,15 @@
# Set model tick to 100Mhz. This depends a lot on workstation performance. # Set model tick to 100Mhz. This depends a lot on workstation performance.
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[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 # Components Section - list of all EDK II Modules needed by this Platform

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. # Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -110,7 +110,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -160,6 +165,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2013, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -49,6 +49,9 @@
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf ArmPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/ArmVExpressLibSec.inf
[LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.DXE_DRIVER]
PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
[BuildOptions] [BuildOptions]
GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM GCC:*_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@ -73,6 +76,11 @@
# This PCD ensures the secondary cores are parked into the AArch64 Linux parking protocol. # This PCD ensures the secondary cores are parked into the AArch64 Linux parking protocol.
gArmTokenSpaceGuid.PcdArmLinuxSpinTable|TRUE gArmTokenSpaceGuid.PcdArmLinuxSpinTable|TRUE
#
# FDT installation : enable the development specific features
#
gEmbeddedTokenSpaceGuid.PcdOverridePlatformFdt|TRUE
[PcdsFixedAtBuild.common] [PcdsFixedAtBuild.common]
gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express" gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|"ARM Versatile Express"
gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM" gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmVExpress-RTSM"
@ -165,6 +173,15 @@
# Set model tick to 100Mhz. This depends a lot on workstation performance. # Set model tick to 100Mhz. This depends a lot on workstation performance.
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[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 # Components Section - list of all EDK II Modules needed by this Platform

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. # Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -112,7 +112,12 @@ READ_STATUS = TRUE
READ_LOCK_CAP = TRUE READ_LOCK_CAP = TRUE
READ_LOCK_STATUS = TRUE READ_LOCK_STATUS = TRUE
APRIORI DXE {
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
}
INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Core/Dxe/DxeMain.inf
INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# #
# PI DXE Drivers producing Architectural Protocols (EFI Services) # PI DXE Drivers producing Architectural Protocols (EFI Services)
@ -170,6 +175,11 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FDT installation
#
INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
# #
# UEFI application (Shell Embedded Boot Loader) # UEFI application (Shell Embedded Boot Loader)
# #

View File

@ -378,6 +378,8 @@
gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
[Components.common] [Components.common]
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
# Versatile Express FileSystem # Versatile Express FileSystem
ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf ArmPlatformPkg/FileSystem/BootMonFs/BootMonFs.inf

View File

@ -23,14 +23,14 @@
// model or hardware platforms). // model or hardware platforms).
// //
CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {
{ ARM_FVP_VEXPRESS_AEMv8x4 }, { ARM_FVP_VEXPRESS_AEMv8x4, { 0x240d627e, 0xeb4d, 0x447d, { 0x86, 0x30, 0xf2, 0x12, 0x3b, 0xc3, 0x89, 0x3f } }, L"rtsm_ve-aemv8a.dtb" },
{ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2 }, { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2, { 0xfbed0b94, 0x3c81, 0x49e4, { 0xbd, 0xec, 0xd4, 0xf4, 0xa8, 0x47, 0xeb, 0x51 } }, L"fvp-base-gicv2-psci.dtb" },
{ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY }, { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV2_LEGACY, { 0x6d8dfd91, 0x431a, 0x4e6c, { 0x84, 0x5a, 0x15, 0xf1, 0xfc, 0x8d, 0x9b, 0xe2 } }, L"fvp-base-gicv2legacy-psci.dtb" },
{ ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3 }, { ARM_FVP_BASE_AEMv8x4_AEMv8x4_GICV3, { 0xa8ac2953, 0xc4bb, 0x4914, { 0x87, 0xf5, 0xc5, 0x97, 0x5d, 0x7b, 0x32, 0xd1 } }, L"fvp-base-gicv3-psci.dtb" },
{ ARM_FVP_FOUNDATION_GICV2 }, { ARM_FVP_FOUNDATION_GICV2, { 0x4328cb83, 0x6e50, 0x4cb8, { 0xaa, 0x8c, 0xfb, 0x7a, 0xba, 0xba, 0x37, 0xd8 } }, L"fvp-foundation-gicv2-psci.dtb" },
{ ARM_FVP_FOUNDATION_GICV2_LEGACY }, { ARM_FVP_FOUNDATION_GICV2_LEGACY, { 0x6af00d18, 0x6dfe, 0x45ed, { 0xa6, 0xc4, 0xb4, 0x4d, 0x57, 0xfd, 0xd8, 0xf5 } }, L"fvp-foundation-gicv2legacy-psci.dtb" },
{ ARM_FVP_FOUNDATION_GICV3 }, { ARM_FVP_FOUNDATION_GICV3, { 0x4a17b7fa, 0xf052, 0x4dc1, { 0x92, 0x79, 0x43, 0x80, 0x92, 0x41, 0xf9, 0x98 } }, L"fvp-foundation-gicv3-psci.dtb" },
{ ARM_FVP_VEXPRESS_UNKNOWN } { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }
}; };
/** /**

View File

@ -23,11 +23,11 @@
// model or hardware platforms). // model or hardware platforms).
// //
CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {
{ ARM_FVP_VEXPRESS_A9x4 }, { ARM_FVP_VEXPRESS_A9x4, { 0x943f2ae9, 0x51b2, 0x48b2, { 0x82, 0xc4, 0x9a, 0xeb, 0x2c, 0x21, 0xd8, 0xe1 } }, L"rtsm_ve-cortex_a9x4.dtb" },
{ ARM_FVP_VEXPRESS_A15x1 }, { ARM_FVP_VEXPRESS_A15x1, { 0x581930c3, 0x9f53, 0x4c53, { 0x91, 0x23, 0x43, 0xb8, 0x65, 0xdf, 0x3f, 0x23} }, L"rtsm_ve-cortex_a15x1.dtb" },
{ ARM_FVP_VEXPRESS_A15x2 }, { ARM_FVP_VEXPRESS_A15x2, { 0x3f10b34a, 0xa310, 0x472c, { 0xac, 0xb9, 0x36, 0x0b, 0x1d, 0xb5, 0x7a, 0x8b} }, L"rtsm_ve-cortex_a15x2.dtb" },
{ ARM_FVP_VEXPRESS_A15x4 }, { ARM_FVP_VEXPRESS_A15x4, { 0x9a783838, 0x8a77, 0x4cdb, { 0x82, 0xa4, 0x35, 0x91, 0x2c, 0x08, 0x8a, 0x2e} }, L"rtsm_ve-cortex_a15x4.dtb" },
{ ARM_FVP_VEXPRESS_UNKNOWN } { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }
}; };
/** /**

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR> Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -16,6 +16,7 @@
#include <Library/VirtioMmioDeviceLib.h> #include <Library/VirtioMmioDeviceLib.h>
#include <Library/ArmShellCmdLib.h> #include <Library/ArmShellCmdLib.h>
#include <Library/MemoryAllocationLib.h>
#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000 #define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000
@ -49,6 +50,10 @@ VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =
} }
}; };
/**
* Generic UEFI Entrypoint for 'ArmFvpDxe' driver
* See UEFI specification for the details of the parameters
*/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ArmFvpInitialise ( ArmFvpInitialise (
@ -56,7 +61,11 @@ ArmFvpInitialise (
IN EFI_SYSTEM_TABLE *SystemTable IN EFI_SYSTEM_TABLE *SystemTable
) )
{ {
CONST ARM_VEXPRESS_PLATFORM* Platform;
EFI_STATUS Status; EFI_STATUS Status;
CHAR16 *TextDevicePath;
UINTN TextDevicePathSize;
VOID *Buffer;
Status = gBS->InstallProtocolInterface (&ImageHandle, Status = gBS->InstallProtocolInterface (&ImageHandle,
&gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE, &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
@ -65,6 +74,26 @@ ArmFvpInitialise (
return Status; return Status;
} }
Status = ArmVExpressGetPlatform (&Platform);
if (!EFI_ERROR (Status)) {
TextDevicePathSize = StrSize ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)) - sizeof (CHAR16);
TextDevicePathSize += StrSize (Platform->FdtName);
TextDevicePath = AllocatePool (TextDevicePathSize);
if (TextDevicePath != NULL) {
StrCpy (TextDevicePath, ((CHAR16*)PcdGetPtr (PcdFvpFdtDevicePathsBase)));
StrCat (TextDevicePath, Platform->FdtName);
Buffer = PcdSetPtr (PcdFdtDevicePaths, &TextDevicePathSize, TextDevicePath);
if (Buffer == NULL) {
DEBUG ((
EFI_D_ERROR,
"ArmFvpDxe: Setting of FDT device path in PcdFdtDevicePaths failed - %r\n", EFI_BUFFER_TOO_SMALL
));
}
FreePool (TextDevicePath);
}
}
// Declare the Virtio BlockIo device // Declare the Virtio BlockIo device
Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle); Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {

View File

@ -35,16 +35,25 @@
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
OvmfPkg/OvmfPkg.dec OvmfPkg/OvmfPkg.dec
[LibraryClasses] [LibraryClasses]
PcdLib
ArmShellCmdRunAxfLib ArmShellCmdRunAxfLib
ArmLib ArmLib
ArmPlatformLib ArmPlatformLib
BaseMemoryLib BaseMemoryLib
MemoryAllocationLib
UefiDriverEntryPoint UefiDriverEntryPoint
UefiBootServicesTableLib UefiBootServicesTableLib
VirtioMmioDeviceLib VirtioMmioDeviceLib
[LibraryClasses.AARCH64] [LibraryClasses.AARCH64]
ArmGicLib ArmGicLib
[FixedPcd]
gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase
[Pcd]
gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR> Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -23,11 +23,11 @@
// model or hardware platforms). // model or hardware platforms).
// //
CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = { CONST ARM_VEXPRESS_PLATFORM ArmVExpressPlatforms[] = {
{ ARM_HW_A9x4 }, { ARM_HW_A9x4, { 0x2fd21cf6, 0xe6e8, 0x4ff2, { 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 } }, L"vexpress-v2p-ca9.dtb" },
{ ARM_HW_A15x2_A7x3 }, { ARM_HW_A15x2_A7x3, { 0xd5e606eb, 0x83df, 0x4e90, { 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a } }, L"vexpress-v2p-ca15_a7.dtb" },
{ ARM_HW_A15 }, { ARM_HW_A15, { 0x6b8947c2, 0x4287, 0x4d91, { 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f } }, L"vexpress-v2p-ca15-tc1.dtb" },
{ ARM_HW_A5 }, { ARM_HW_A5, { 0xa2cc7663, 0x4d7c, 0x448a, { 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 } }, L"vexpress-v2p-ca5s.dtb" },
{ ARM_FVP_VEXPRESS_UNKNOWN } { ARM_FVP_VEXPRESS_UNKNOWN, { 0x0, 0x0, 0x0, { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } } }
}; };
/** /**
@ -49,6 +49,10 @@ ArmVExpressGetPlatform (
return EFI_NOT_FOUND; return EFI_NOT_FOUND;
} }
/**
* Generic UEFI Entrypoint for 'ArmHwDxe' driver
* See UEFI specification for the details of the parameters
*/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ArmHwInitialise ( ArmHwInitialise (

View File

@ -1,6 +1,6 @@
#/** @file #/** @file
# #
# Copyright (c) 2013-2014, ARM Ltd. All rights reserved.<BR> # Copyright (c) 2013-2015, ARM Ltd. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -14,7 +14,7 @@
[Defines] [Defines]
INF_VERSION = 0x00010006 INF_VERSION = 0x00010006
BASE_NAME = ArmFvpDxe BASE_NAME = ArmHwDxe
FILE_GUID = fe61bb5f-1b67-4c24-b346-73db42e873e5 FILE_GUID = fe61bb5f-1b67-4c24-b346-73db42e873e5
MODULE_TYPE = UEFI_DRIVER MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0 VERSION_STRING = 1.0
@ -27,8 +27,13 @@
[Packages] [Packages]
ArmPkg/ArmPkg.dec ArmPkg/ArmPkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec ArmPlatformPkg/ArmPlatformPkg.dec
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec MdePkg/MdePkg.dec
[LibraryClasses] [LibraryClasses]
ArmShellCmdRunAxfLib ArmShellCmdRunAxfLib
MemoryAllocationLib
UefiDriverEntryPoint UefiDriverEntryPoint
[Protocols]
gEfiDevicePathProtocolGuid

View File

@ -1,6 +1,6 @@
/** @file /** @file
Copyright (c) 2014, ARM Ltd. All rights reserved. Copyright (c) 2014-2015, ARM Ltd. All rights reserved.
This program and the accompanying materials are licensed and made available This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this under the terms and conditions of the BSD License which accompanies this
@ -50,7 +50,10 @@ typedef enum {
typedef struct { typedef struct {
ARM_VEXPRESS_PLATFORM_ID Id; ARM_VEXPRESS_PLATFORM_ID Id;
// Will be extended with platform specific information
// Flattened Device Tree (FDT) File
EFI_GUID FdtGuid; /// Name of the FDT when present into the FV
CONST CHAR16* FdtName; /// Name of the FDT when present into a File System
} ARM_VEXPRESS_PLATFORM; } ARM_VEXPRESS_PLATFORM;
// Array that contains the list of the VExpress based platform supported by this DXE driver // Array that contains the list of the VExpress based platform supported by this DXE driver

View File

@ -1,11 +1,11 @@
#/** @file #/** @file
# Arm Versatile Express package. # Arm Versatile Express package.
# #
# Copyright (c) 2012, ARM Limited. All rights reserved. # Copyright (c) 2012-2015, ARM Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials are licensed and made available
# are licensed and made available under the terms and conditions of the BSD License # under the terms and conditions of the BSD License which accompanies this
# which accompanies this distribution. The full text of the license may be found at # distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php # http://opensource.org/licenses/bsd-license.php
# #
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
@ -47,11 +47,30 @@
# #
# For a list of mode numbers look in LcdArmVExpress.c # For a list of mode numbers look in LcdArmVExpress.c
# #
gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode|3|UINT32|0x00000003 gArmVExpressTokenSpaceGuid.PcdPL111LcdMaxMode|3|UINT32|0x00000001
gArmVExpressTokenSpaceGuid.PcdPL111LcdVideoModeOscId|1|UINT32|0x00000004 gArmVExpressTokenSpaceGuid.PcdPL111LcdVideoModeOscId|1|UINT32|0x00000002
gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId|0|UINT32|0x00000009 gArmVExpressTokenSpaceGuid.PcdHdLcdVideoModeOscId|0|UINT32|0x00000003
# #
# Device path of block device on which Fastboot will flash partitions # Device path of block device on which Fastboot will flash partitions
# #
gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|""|VOID*|0x00000001 gArmVExpressTokenSpaceGuid.PcdAndroidFastbootNvmDevicePath|""|VOID*|0x00000004
# FVP platforms : install FDT from SemiHosting
gArmVExpressTokenSpaceGuid.PcdFvpFdtDevicePathsBase|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/"|VOID*|0x00000005
# HW platforms : install FDT from NOR Flash
gArmVExpressTokenSpaceGuid.PcdHwFdtDevicePathsBase|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/"|VOID*|0x00000006
#
# ARM Versatile Express FDT Guids
#
# FVP platforms
gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA9x4|{ 0xe9, 0x2a, 0x3f, 0x94, 0xb2, 0x51, 0xb2, 0x48, 0x48, 0xb2, 0x82, 0xc4, 0x9a, 0xeb, 0x2c, 0x21, 0xd8, 0xe1 }|VOID*|0x00000007
gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x1|{ 0xc3, 0x30, 0x19, 0x58 0x53, 0x9f, 0x53, 0x4c, 0x4, 0xc53, 0x91, 0x23, 0x43, 0xb8, 0x65, 0xdf, 0x3f, 0x23 }|VOID*|0x00000008
gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x2|{ 0x4a, 0xb3, 0x10, 0x3f 0x10, 0xa3, 0x2c, 0x47, 0xac, 0xb9, 0x36, 0x0b, 0x1d, 0xb5, 0x7a, 0x8b }|VOID*|0x00000009
gArmVExpressTokenSpaceGuid.PcdFdtVExpressFvpA15x4|{ 0x38, 0x38, 0x78, 0x9a, 0x77, 0x8a, 0xdb, 0x4c, 0x82, 0xa4, 0x35, 0x91, 0x2c, 0x08, 0x8a, 0x2e }|VOID*|0x0000000A
# HW platforms
gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA9x4|{ 0xf6, 0x1c, 0xd2, 0x2f, 0xe8, 0xe6, 0xf2, 0x4f, 0xa9, 0xca, 0x3b, 0x9f, 0x00, 0xe9, 0x28, 0x89 }|VOID*|0x0000000B
gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15x2A7x3|{ 0xeb, 0x06, e6, 0xd5, 0xdf, 0x83, 0x90, 0x4e, 0x81, 0xe8, 0xc3, 0xdb, 0x2f, 0x77, 0x17, 0x9a }|VOID*|0x0000000C
gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA15|{ 0xc2, 0x47, 0x89, 0x6b, 0x87, 0x42, 0x91, 0x4d, 0x8f, 0xe0, 0xa3, 0x81, 0xea, 0x5b, 0x56, 0x8f }|VOID*|0x0000000D
gArmVExpressTokenSpaceGuid.PcdFdtVExpressHwA5|{ 0x63, 0x76, 0xcc, 0xa2, 0x7c, 0x4d, 0x8a, 0x44, 0xaa, 0xb5, 0x4c, 0x03, 0x4b, 0x6f, 0xda, 0xb7 }|VOID*|0x0000000E

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011-2012, ARM Limited. All rights reserved. # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# Copyright (c) 2014, Linaro Limited. All rights reserved. # Copyright (c) 2014, Linaro Limited. All rights reserved.
# #
# This program and the accompanying materials # This program and the accompanying materials

View File

@ -3,7 +3,7 @@
# #
# #
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2012-2014, ARM Ltd. All rights reserved.<BR> # Copyright (c) 2012-2015, ARM Ltd. All rights reserved.<BR>
# #
# This program and the accompanying materials # This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -270,7 +270,6 @@
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
# FDT installation # FDT installation
EmbeddedPkg/Library/FdtLoadLib/FdtLoadLib.inf
EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf EmbeddedPkg/Application/AndroidFastboot/AndroidFastbootApp.inf

View File

@ -1,280 +0,0 @@
/** @file
*
* Copyright (c) 2014, ARM Limited. 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/DebugLib.h>
#include <Library/FdtLoadLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Protocol/DevicePath.h>
#include <Protocol/FirmwareVolume2.h>
#include <Protocol/SimpleFileSystem.h>
#include <Guid/Fdt.h>
#include <Guid/FileInfo.h>
#include <libfdt.h>
//
// Device path for SemiHosting
//
STATIC CONST struct {
VENDOR_DEVICE_PATH Guid;
EFI_DEVICE_PATH_PROTOCOL End;
} mSemihostingDevicePath = {
{
{ HARDWARE_DEVICE_PATH, HW_VENDOR_DP, { sizeof (VENDOR_DEVICE_PATH), 0 } },
{ 0xC5B9C74A, 0x6D72, 0x4719, { 0x99, 0xAB, 0xC5, 0x9F, 0x19, 0x90, 0x91, 0xEB } }
},
{ END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE, { sizeof (EFI_DEVICE_PATH_PROTOCOL), 0 } }
};
/**
This function declares the passed FDT into the UEFI Configuration Table
@param FdtBlob Base address of the Fdt Blob in System Memory
@param FdtSize Size of the Fdt Blob in System Memory
@return EFI_SUCCESS Fdt Blob was successfully installed into the configuration table
@return !EFI_SUCCESS Error returned by BS.InstallConfigurationTable()
**/
STATIC
EFI_STATUS
InstallFdtIntoConfigurationTable (
IN VOID* FdtBlob,
IN UINTN FdtSize
)
{
EFI_STATUS Status;
// Check the FDT header is valid. We only make this check in DEBUG mode in case the FDT header change on
// production device and this ASSERT() becomes not valid.
ASSERT (fdt_check_header (FdtBlob) == 0);
// Ensure the Size of the Device Tree is smaller than the size of the read file
ASSERT ((UINTN)fdt_totalsize (FdtBlob) <= FdtSize);
// Install the FDT into the Configuration Table
Status = gBS->InstallConfigurationTable (&gFdtTableGuid, FdtBlob);
return Status;
}
/**
Load and Install FDT from Semihosting
@param Filename Name of the file to load from semihosting
@return EFI_SUCCESS Fdt Blob was successfully installed into the configuration table
from semihosting
@return EFI_NOT_FOUND Fail to locate the file in semihosting
@return EFI_OUT_OF_RESOURCES Fail to allocate memory to contain the blob
**/
EFI_STATUS
InstallFdtFromSemihosting (
IN CONST CHAR16* FileName
)
{
EFI_STATUS Status;
EFI_DEVICE_PATH* Remaining;
EFI_HANDLE Handle;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SemihostingFs;
EFI_FILE_PROTOCOL *Fs;
EFI_FILE_PROTOCOL *File;
EFI_PHYSICAL_ADDRESS FdtBase;
EFI_FILE_INFO *FileInfo;
UINTN FdtSize;
UINTN FileInfoSize;
// Ensure the Semihosting driver is initialized
Remaining = (EFI_DEVICE_PATH*)&mSemihostingDevicePath;
// The LocateDevicePath() function locates all devices on DevicePath that support Protocol and returns
// the handle to the device that is closest to DevicePath. On output, the device path pointer is modified
// to point to the remaining part of the device path
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &Remaining, &Handle);
if (EFI_ERROR (Status)) {
ASSERT_EFI_ERROR (Status);
return Status;
}
// Recursive = FALSE: We do not want to start the whole device tree
Status = gBS->ConnectController (Handle, NULL, Remaining, FALSE);
if (EFI_ERROR (Status)) {
return Status;
}
// Locate the FileSystem
Status = gBS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID **)&SemihostingFs);
if (EFI_ERROR (Status)) {
ASSERT_EFI_ERROR (Status);
return Status;
}
// Try to Open the volume and get root directory
Status = SemihostingFs->OpenVolume (SemihostingFs, &Fs);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, "Warning: Fail to open semihosting filesystem that should contain FDT file.\n"));
return Status;
}
File = NULL;
Status = Fs->Open (Fs, &File, (CHAR16*)FileName, EFI_FILE_MODE_READ, 0);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_WARN, "Warning: Fail to load FDT file '%s'.\n", FileName));
Fs->Close (Fs);
return Status;
}
FileInfoSize = 0;
File->GetInfo (File, &gEfiFileInfoGuid, &FileInfoSize, NULL);
FileInfo = AllocatePool (FileInfoSize);
if (FileInfo == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto CLOSE_FILES;
}
Status = File->GetInfo (File, &gEfiFileInfoGuid, &FileInfoSize, FileInfo);
if (EFI_ERROR (Status)) {
FreePool (FileInfo);
goto CLOSE_FILES;
}
// Get the file size
FdtSize = FileInfo->FileSize;
FreePool (FileInfo);
// The FDT blob is attached to the Configuration Table. It is recommended to load it as Runtime Service Data
// to prevent the kernel to overwrite its data
Status = gBS->AllocatePages (AllocateAnyPages, EfiRuntimeServicesData, EFI_SIZE_TO_PAGES (FdtSize), &FdtBase);
if (!EFI_ERROR (Status)) {
Status = File->Read (File, &FdtSize, (VOID*)(UINTN)(FdtBase));
if (EFI_ERROR (Status)) {
gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));
} else {
// Install the FDT as part of the UEFI Configuration Table
Status = InstallFdtIntoConfigurationTable ((VOID*)(UINTN)FdtBase, FdtSize);
if (EFI_ERROR (Status)) {
gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));
}
}
}
CLOSE_FILES:
File->Close (File);
Fs->Close (Fs);
return Status;
}
/**
Load and Install FDT from Firmware Volume
@param Filename Guid of the FDT blob to load from firmware volume
@return EFI_SUCCESS Fdt Blob was successfully installed into the configuration table
from firmware volume
@return EFI_NOT_FOUND Fail to locate the file in firmware volume
@return EFI_OUT_OF_RESOURCES Fail to allocate memory to contain the blob
**/
EFI_STATUS
InstallFdtFromFv (
IN CONST EFI_GUID *FileName
)
{
EFI_STATUS Status;
EFI_HANDLE *HandleBuffer;
UINTN NumberOfHandles;
UINT32 FvStatus;
UINTN Index;
EFI_FIRMWARE_VOLUME2_PROTOCOL *FvInstance;
INTN SectionInstance;
UINTN FdtSize;
VOID* FdtBlob;
EFI_PHYSICAL_ADDRESS FdtBase;
FvStatus = 0;
SectionInstance = 0;
// Locate all the Firmware Volume protocols.
Status = gBS->LocateHandleBuffer (
ByProtocol,
&gEfiFirmwareVolume2ProtocolGuid,
NULL,
&NumberOfHandles,
&HandleBuffer
);
if (EFI_ERROR (Status)) {
return Status;
}
// Looking for FV that contains the FDT blob
for (Index = 0; Index < NumberOfHandles; Index++) {
//
// Get the protocol on this handle
// This should not fail because of LocateHandleBuffer
//
Status = gBS->HandleProtocol (
HandleBuffer[Index],
&gEfiFirmwareVolume2ProtocolGuid,
(VOID**) &FvInstance
);
if (EFI_ERROR (Status)) {
goto FREE_HANDLE_BUFFER;
}
while (Status == EFI_SUCCESS) {
// FdtBlob must be allocated by ReadSection
FdtBlob = NULL;
// See if it contains the FDT file
Status = FvInstance->ReadSection (
FvInstance,
FileName,
EFI_SECTION_RAW,
SectionInstance,
&FdtBlob,
&FdtSize,
&FvStatus
);
if (!EFI_ERROR (Status)) {
// When the FDT blob is attached to the Configuration Table it is recommended to load it as Runtime Service Data
// to prevent the kernel to overwrite its data
Status = gBS->AllocatePages (AllocateAnyPages, EfiRuntimeServicesData, EFI_SIZE_TO_PAGES (FdtSize), &FdtBase);
if (EFI_ERROR (Status)) {
goto FREE_HANDLE_BUFFER;
}
// Copy the FDT to the Runtime memory
gBS->CopyMem ((VOID*)(UINTN)FdtBase, FdtBlob, FdtSize);
// Free the buffer allocated by FvInstance->ReadSection()
gBS->FreePool (FdtBlob);
// Install the FDT as part of the UEFI Configuration Table
Status = InstallFdtIntoConfigurationTable ((VOID*)(UINTN)FdtBase, FdtSize);
if (EFI_ERROR (Status)) {
gBS->FreePages (FdtBase, EFI_SIZE_TO_PAGES (FdtSize));
}
break;
}
}
}
FREE_HANDLE_BUFFER:
// Free any allocated buffers
gBS->FreePool (HandleBuffer);
return Status;
}

View File

@ -1,45 +0,0 @@
#/* @file
# Copyright (c) 2014, Linaro Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#*/
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = FdtLoadLib
FILE_GUID = F00298C1-BBC3-445F-8906-AAEAFE7729A4
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = FdtLoadLib
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = ARM AARCH64
#
[Sources]
FdtConfigurationTable.c
[Packages]
MdePkg/MdePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
[LibraryClasses]
FdtLib
[Protocols]
gEfiDevicePathProtocolGuid
gEfiSimpleFileSystemProtocolGuid
gEfiFirmwareVolume2ProtocolGuid
[Guids]
gEfiFileInfoGuid
gFdtTableGuid