From afdfe8f02bdf8d563554bb620c001072862b064e Mon Sep 17 00:00:00 2001 From: andrewfish Date: Fri, 2 Jul 2010 12:00:00 +0000 Subject: [PATCH] Remove ArmEbPkg and replace with ArmRealViewEbPkg. Ported ArmRealViewEbPkg to have a PEI phase, and added place holder CPU PEIM to ArmPkg. This ArmRealViewEbPkg now boots from SEC, PEI, DXE, BDS, to EBL in the ARM RealView system emulator that comes with RealView Pro. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10621 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Drivers/CpuPei/CpuPei.c | 115 +++ ArmPkg/Drivers/CpuPei/CpuPei.inf | 55 ++ .../ArmRealViewEbPkg.dec | 12 +- .../ArmRealViewEbPkg.dsc | 809 +++++++++--------- .../ArmRealViewEbPkg.fdf | 546 ++++++------ {ArmEbPkg => ArmRealViewEbPkg}/Bds/Bds.inf | 0 {ArmEbPkg => ArmRealViewEbPkg}/Bds/BdsEntry.c | 0 {ArmEbPkg => ArmRealViewEbPkg}/Bds/BdsEntry.h | 0 .../Bds/FirmwareVolume.c | 0 .../Debugger_scripts/EBLoadSecSyms.inc | 16 + .../Debugger_scripts/EfiFuncs.inc | 463 ++++++++++ .../Debugger_scripts/rvi_boot_from_ram.inc | 0 .../Debugger_scripts/rvi_convert_symbols.sh | 0 .../Debugger_scripts/rvi_dummy.axf | Bin .../Debugger_scripts/rvi_hw_setup.inc | 0 .../Debugger_scripts/rvi_load_symbols.inc | 0 .../Debugger_scripts/rvi_symbols_macros.inc | 0 .../Debugger_scripts/rvi_unload_symbols.inc | 0 .../Include/ArmEb/ArmEb.h | 0 .../Include/ArmEb/ArmEbTimer.h | 0 .../Include/ArmEb/ArmEbUart.h | 0 .../InterruptDxe/InterruptDxe.c | 0 .../InterruptDxe/InterruptDxe.inf | 2 +- .../DebugAgentTimerLib/DebugAgentTimerLib.c | 0 .../DebugAgentTimerLib/DebugAgentTimerLib.inf | 2 +- .../Library/GdbSerialLib/GdbSerialLib.c | 0 .../Library/GdbSerialLib/GdbSerialLib.inf | 7 +- .../PeiServicesTablePointer.c | 70 ++ .../PeiServicesTablePointerLib.inf | 43 + .../RealTimeClockLib/RealTimeClockLib.c | 0 .../RealTimeClockLib/RealTimeClockLib.inf | 0 .../Library/ResetSystemLib/ResetSystemLib.c | 0 .../Library/ResetSystemLib/ResetSystemLib.inf | 2 +- .../Library/SerialPortLib/SerialPortLib.c | 4 +- .../Library/SerialPortLib/SerialPortLib.inf | 4 +- .../Library/TimerLib/TimerLib.c | 0 .../Library/TimerLib/TimerLib.inf | 2 +- ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c | 104 +++ .../MemoryInitPei/MemoryInitPei.inf | 59 ++ ArmRealViewEbPkg/PlatformPei/PlatformPei.c | 130 +++ ArmRealViewEbPkg/PlatformPei/PlatformPei.inf | 61 ++ .../Sec/Arm}/ModuleEntryPoint.S | 16 +- .../Sec/Arm}/ModuleEntryPoint.asm | 35 +- {ArmEbPkg => ArmRealViewEbPkg}/Sec/Cache.c | 0 .../Sec/LzmaDecompress.h | 0 ArmRealViewEbPkg/Sec/ModuleEntryPoint.S | 68 ++ ArmRealViewEbPkg/Sec/ModuleEntryPoint.asm | 80 ++ {ArmEbPkg => ArmRealViewEbPkg}/Sec/Sec.c | 7 +- {ArmEbPkg => ArmRealViewEbPkg}/Sec/Sec.inf | 5 +- .../SecForPei/Arm/ModuleEntryPoint.S | 79 ++ .../SecForPei/Arm/ModuleEntryPoint.asm | 80 ++ ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.S | 43 + .../SecForPei/Arm/SwitchStack.asm | 38 + ArmRealViewEbPkg/SecForPei/Sec.c | 119 +++ ArmRealViewEbPkg/SecForPei/Sec.inf | 57 ++ .../TimerDxe/Timer.c | 2 + .../TimerDxe/TimerDxe.inf | 2 +- {ArmEbPkg => ArmRealViewEbPkg}/b.bat | 79 +- {ArmEbPkg => ArmRealViewEbPkg}/ba.bat | 27 +- {ArmEbPkg => ArmRealViewEbPkg}/build.sh | 8 +- 60 files changed, 2493 insertions(+), 758 deletions(-) create mode 100755 ArmPkg/Drivers/CpuPei/CpuPei.c create mode 100755 ArmPkg/Drivers/CpuPei/CpuPei.inf rename ArmEbPkg/ArmEbPkg.dec => ArmRealViewEbPkg/ArmRealViewEbPkg.dec (74%) mode change 100644 => 100755 rename ArmEbPkg/ArmEbPkg.dsc => ArmRealViewEbPkg/ArmRealViewEbPkg.dsc (70%) mode change 100644 => 100755 rename ArmEbPkg/ArmEbPkg.fdf => ArmRealViewEbPkg/ArmRealViewEbPkg.fdf (73%) rename {ArmEbPkg => ArmRealViewEbPkg}/Bds/Bds.inf (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Bds/BdsEntry.c (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Bds/BdsEntry.h (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Bds/FirmwareVolume.c (100%) create mode 100755 ArmRealViewEbPkg/Debugger_scripts/EBLoadSecSyms.inc create mode 100755 ArmRealViewEbPkg/Debugger_scripts/EfiFuncs.inc rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_boot_from_ram.inc (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_convert_symbols.sh (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_dummy.axf (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_hw_setup.inc (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_load_symbols.inc (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_symbols_macros.inc (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Debugger_scripts/rvi_unload_symbols.inc (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Include/ArmEb/ArmEb.h (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Include/ArmEb/ArmEbTimer.h (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Include/ArmEb/ArmEbUart.h (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/InterruptDxe/InterruptDxe.c (100%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/InterruptDxe/InterruptDxe.inf (92%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Library/DebugAgentTimerLib/DebugAgentTimerLib.c (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf (93%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/GdbSerialLib/GdbSerialLib.c (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/GdbSerialLib/GdbSerialLib.inf (92%) create mode 100755 ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c create mode 100755 ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf rename {ArmEbPkg => ArmRealViewEbPkg}/Library/RealTimeClockLib/RealTimeClockLib.c (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/RealTimeClockLib/RealTimeClockLib.inf (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/ResetSystemLib/ResetSystemLib.c (100%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Library/ResetSystemLib/ResetSystemLib.inf (93%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Library/SerialPortLib/SerialPortLib.c (92%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Library/SerialPortLib/SerialPortLib.inf (88%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Library/TimerLib/TimerLib.c (100%) rename {ArmEbPkg => ArmRealViewEbPkg}/Library/TimerLib/TimerLib.inf (94%) create mode 100755 ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c create mode 100755 ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf create mode 100755 ArmRealViewEbPkg/PlatformPei/PlatformPei.c create mode 100755 ArmRealViewEbPkg/PlatformPei/PlatformPei.inf rename {ArmEbPkg/Sec => ArmRealViewEbPkg/Sec/Arm}/ModuleEntryPoint.S (84%) rename {ArmEbPkg/Sec => ArmRealViewEbPkg/Sec/Arm}/ModuleEntryPoint.asm (75%) rename {ArmEbPkg => ArmRealViewEbPkg}/Sec/Cache.c (100%) mode change 100644 => 100755 rename {ArmEbPkg => ArmRealViewEbPkg}/Sec/LzmaDecompress.h (100%) mode change 100644 => 100755 create mode 100755 ArmRealViewEbPkg/Sec/ModuleEntryPoint.S create mode 100755 ArmRealViewEbPkg/Sec/ModuleEntryPoint.asm rename {ArmEbPkg => ArmRealViewEbPkg}/Sec/Sec.c (90%) rename {ArmEbPkg => ArmRealViewEbPkg}/Sec/Sec.inf (95%) create mode 100755 ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.S create mode 100755 ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.asm create mode 100755 ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.S create mode 100755 ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.asm create mode 100755 ArmRealViewEbPkg/SecForPei/Sec.c create mode 100755 ArmRealViewEbPkg/SecForPei/Sec.inf rename {ArmEbPkg => ArmRealViewEbPkg}/TimerDxe/Timer.c (99%) rename {ArmEbPkg => ArmRealViewEbPkg}/TimerDxe/TimerDxe.inf (94%) rename {ArmEbPkg => ArmRealViewEbPkg}/b.bat (69%) rename {ArmEbPkg => ArmRealViewEbPkg}/ba.bat (83%) rename {ArmEbPkg => ArmRealViewEbPkg}/build.sh (85%) diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.c b/ArmPkg/Drivers/CpuPei/CpuPei.c new file mode 100755 index 0000000000..5e26244354 --- /dev/null +++ b/ArmPkg/Drivers/CpuPei/CpuPei.c @@ -0,0 +1,115 @@ +/**@file + +Copyright (c) 2006, Intel Corporation. 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. + +Module Name: + + MemoryInit.c + +Abstract: + + PEIM to provide fake memory init + +**/ + + + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// + +// +// The Library classes this module consumes +// +#include +#include +#include +#include +#include + +// +// Module globals +// + +#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK +#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED + +VOID +JamArmMmuConfig ( VOID ) +{ + UINT32 CacheAttributes; + ARM_MEMORY_REGION_DESCRIPTOR MemoryTable[3]; + VOID *TranslationTableBase; + UINTN TranslationTableSize; + + if (FeaturePcdGet(PcdCacheEnable) == TRUE) { + CacheAttributes = DDR_ATTRIBUTES_CACHED; + } else { + CacheAttributes = DDR_ATTRIBUTES_UNCACHED; + } + + // DDR + MemoryTable[0].PhysicalBase = 0; + MemoryTable[0].VirtualBase = 0; + MemoryTable[0].Length = 0x10000000; + MemoryTable[0].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes; + + // SOC Registers. L3 interconnects + MemoryTable[1].PhysicalBase = 0x10000000; + MemoryTable[1].VirtualBase = 0x10000000; + MemoryTable[1].Length = 0xF0000000; + MemoryTable[1].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE; + + // End of Table + MemoryTable[2].PhysicalBase = 0; + MemoryTable[2].VirtualBase = 0; + MemoryTable[2].Length = 0; + MemoryTable[2].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0; + + ArmConfigureMmu (MemoryTable, &TranslationTableBase, &TranslationTableSize); + + BuildMemoryAllocationHob((EFI_PHYSICAL_ADDRESS)(UINTN)TranslationTableBase, TranslationTableSize, EfiBootServicesData); +} + + +EFI_STATUS +EFIAPI +InitializeCpuPeim ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + + +Arguments: + + FileHandle - Handle of the file being invoked. + PeiServices - Describes the list of possible PEI Services. + +Returns: + + Status - EFI_SUCCESS if the boot mode could be set + +--*/ +{ + // Enable program flow prediction, if supported. + ArmEnableBranchPrediction (); + + JamArmMmuConfig(); + + return EFI_SUCCESS; +} diff --git a/ArmPkg/Drivers/CpuPei/CpuPei.inf b/ArmPkg/Drivers/CpuPei/CpuPei.inf new file mode 100755 index 0000000000..3ed8ef9a6c --- /dev/null +++ b/ArmPkg/Drivers/CpuPei/CpuPei.inf @@ -0,0 +1,55 @@ +## @file +# Component description file for BootMode module +# +# This module provides platform specific function to detect boot mode. +# Copyright (c) 2006 - 2010, Intel Corporation. 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 = CpuPei + FILE_GUID = 2FD8B7AD-F8FA-4021-9FC0-0AA572147CDC + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + + ENTRY_POINT = InitializeCpuPeim + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources] + CpuPei.c + +[Packages] + MdePkg/MdePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + ArmPkg/ArmPkg.dec + +[LibraryClasses] + PeimEntryPoint + DebugLib + HobLib + ArmLib + +[Ppis] + +[FixedPcd] + +[FeaturePcd] + gEmbeddedTokenSpaceGuid.PcdCacheEnable + +[depex] + gEfiPeiMemoryDiscoveredPpiGuid + diff --git a/ArmEbPkg/ArmEbPkg.dec b/ArmRealViewEbPkg/ArmRealViewEbPkg.dec old mode 100644 new mode 100755 similarity index 74% rename from ArmEbPkg/ArmEbPkg.dec rename to ArmRealViewEbPkg/ArmRealViewEbPkg.dec index 1c25d96029..654eeeb7e8 --- a/ArmEbPkg/ArmEbPkg.dec +++ b/ArmRealViewEbPkg/ArmRealViewEbPkg.dec @@ -1,5 +1,5 @@ #/** @file -# Omap35xx SoC package. +# Arm RealView EB package. # # Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.
# @@ -15,7 +15,7 @@ [Defines] DEC_SPECIFICATION = 0x00010005 - PACKAGE_NAME = ArmEbPkg + PACKAGE_NAME = ArmRealViewEbPkg PACKAGE_GUID = 44577A0D-361A-45B2-B33D-BB9EE60D5A4F PACKAGE_VERSION = 0.1 @@ -32,11 +32,11 @@ Include # Root include for the package [Guids.common] - gArmEbTokenSpaceGuid = { 0x44577A0D, 0x361A, 0x45B2, { 0xb3, 0x3d, 0xbb, 0x9e, 0xe6, 0x0d, 0x5a, 0x4f} } + gArmRealViewEbPkgTokenSpaceGuid = { 0x44577A0D, 0x361A, 0x45B2, { 0xb3, 0x3d, 0xbb, 0x9e, 0xe6, 0x0d, 0x5a, 0x4f} } [PcdsFeatureFlag.common] [PcdsFixedAtBuild.common] - gArmEbTokenSpaceGuid.PcdConsoleUartBase|0x10009000|UINT32|0x00000001 - gArmEbTokenSpaceGuid.PcdGdbUartBase|0x1000a000|UINT32|0x00000002 - + gArmRealViewEbPkgTokenSpaceGuid.PcdConsoleUartBase|0x10009000|UINT32|0x00000001 + gArmRealViewEbPkgTokenSpaceGuid.PcdGdbUartBase|0x1000a000|UINT32|0x00000002 + gArmRealViewEbPkgTokenSpaceGuid.PcdPeiServicePtrAddr|0|UINT32|0x00000003 diff --git a/ArmEbPkg/ArmEbPkg.dsc b/ArmRealViewEbPkg/ArmRealViewEbPkg.dsc old mode 100644 new mode 100755 similarity index 70% rename from ArmEbPkg/ArmEbPkg.dsc rename to ArmRealViewEbPkg/ArmRealViewEbPkg.dsc index 8a022351a9..0ffb819b3f --- a/ArmEbPkg/ArmEbPkg.dsc +++ b/ArmRealViewEbPkg/ArmRealViewEbPkg.dsc @@ -1,401 +1,410 @@ -#/** @file -# ARM EB package. -# -# Copyright (c) 2009 - 2010, Apple Inc. 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 Section - statements that will be processed to create a Makefile. -# -################################################################################ -[Defines] - PLATFORM_NAME = ArmEbPkg - PLATFORM_GUID = F4C1AD3E-9D3E-4F61-8791-B3BB1C43D04C - PLATFORM_VERSION = 0.1 - DSC_SPECIFICATION = 0x00010005 - OUTPUT_DIRECTORY = Build/ArmEB - SUPPORTED_ARCHITECTURES = ARM - BUILD_TARGETS = DEBUG|RELEASE - SKUID_IDENTIFIER = DEFAULT - FLASH_DEFINITION = ArmEbPkg/ArmEbPkg.fdf - - -[LibraryClasses.common] -!if $(BUILD_TARGETS) == RELEASE - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf -!else - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf - UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf -# UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf -!endif - - ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf - - EfiResetSystemLib|ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.inf - PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - - EblCmdLib|BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf - EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - - # - # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window - # in the debugger will show load and unload commands for symbols. You can cut and paste this - # into the command window to load symbols. We should be able to use a script to do this, but - # the version of RVD I have does not support scipts accessing system memory. - # -# PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf - PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf -# PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf - - - CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf - DefaultExceptioHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf - PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf - - SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf - - RealTimeClockLib|ArmEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf - - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - - DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf - -# -# Assume everything is fixed at build -# - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - - - EblAddExternalCommandLib|EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf - - CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - - - # - # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window - # in the debugger will show load and unload commands for symbols. You can cut and paste this - # into the command window to load symbols. We should be able to use a script to do this, but - # the version of RVD I have does not support scipts accessing system memory. - # -# PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf - PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf - - EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf - - ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf - DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf - DebugAgentTimerLib|ArmEbPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf - - SerialPortLib|ArmEbPkg/Library/SerialPortLib/SerialPortLib.inf - TimerLib|ArmEbPkg/Library/TimerLib/TimerLib.inf - SerialPortLib|ArmEbPkg/Library/SerialPortLib/SerialPortLib.inf - GdbSerialLib|ArmEbPkg/Library/GdbSerialLib/GdbSerialLib.inf - DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf - - -[LibraryClasses.common.SEC] - ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf - ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf - LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf - PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf - - # 1/123 faster than Stm or Vstm version - BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - - # Uncomment to turn on GDB stub in SEC. - #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf - -[LibraryClasses.common.DXE_CORE] - HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf - MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf - DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf -# PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf - - PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf - - -[LibraryClasses.common.DXE_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf - PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf - - -[LibraryClasses.common.UEFI_APPLICATION] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf - PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf - -[LibraryClasses.common.UEFI_DRIVER] - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf - PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf -# PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - PeCoffLib|EmbeddedPkg/Library/DxeHobPeCoffLib/DxeHobPeCoffLib.inf - -[LibraryClasses.ARM] - # - # It is not possible to prevent the ARM compiler for generic intrinsic functions. - # This library provides the instrinsic functions generate by a given compiler. - # [LibraryClasses.ARM] and NULL mean link this library into all ARM images. - # - NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf - - -[BuildOptions] - RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A8 --thumb - RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A8 - RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG - +#/** @file +# ARM RealViewEB package. +# +# Copyright (c) 2009 - 2010, Apple Inc. 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 Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + PLATFORM_NAME = ArmRealViewEbPkg + PLATFORM_GUID = F4C1AD3E-9D3E-4F61-8791-B3BB1C43D04C + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/ArmRealViewEb + SUPPORTED_ARCHITECTURES = ARM + BUILD_TARGETS = DEBUG|RELEASE + SKUID_IDENTIFIER = DEFAULT + FLASH_DEFINITION = ArmRealViewEbPkg/ArmRealViewEbPkg.fdf + + +[LibraryClasses.common] +!if $(BUILD_TARGETS) == RELEASE + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf +!else + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf +# UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf +!endif + + ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf + + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf + + EfiResetSystemLib|ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf + PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + + EblCmdLib|BeagleBoardPkg/Library/EblCmdLib/EblCmdLib.inf + EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + + # + # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window + # in the debugger will show load and unload commands for symbols. You can cut and paste this + # into the command window to load symbols. We should be able to use a script to do this, but + # the version of RVD I have does not support scipts accessing system memory. + # +# PeCoffExtraActionLib|ArmPkg/Library/RvdPeCoffExtraActionLib/RvdPeCoffExtraActionLib.inf + PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf +# PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + + + CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf + DefaultExceptioHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf + + SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf + + RealTimeClockLib|ArmRealViewEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf + + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf + +# +# Assume everything is fixed at build +# + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf + + + EblAddExternalCommandLib|EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf + + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + + EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf + + ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf + DebugAgentTimerLib|ArmRealViewEbPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf + + SerialPortLib|ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.inf + #TimerLib|ArmRealViewEbPkg/Library/TimerLib/TimerLib.inf + TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf + SerialPortLib|ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.inf + GdbSerialLib|ArmRealViewEbPkg/Library/GdbSerialLib/GdbSerialLib.inf + DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf + + +[LibraryClasses.common.SEC] + ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf + + # 1/123 faster than Stm or Vstm version + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + + # Uncomment to turn on GDB stub in SEC. + #DebugAgentLib|EmbeddedPkg/Library/GdbDebugAgent/GdbDebugAgent.inf + +[LibraryClasses.common.PEI_CORE] + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + # note: this won't actually work since globals in PEI are not writeable + # need to generate an ARM PEI services table pointer implementation + PeiServicesTablePointerLib|ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf + +[LibraryClasses.common.PEIM] + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + # note: this won't actually work since globals in PEI are not writeable + # need to generate an ARM PEI services table pointer implementation + PeiServicesTablePointerLib|ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf + +[LibraryClasses.common.DXE_CORE] + HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf + MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf + ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf +# PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + + PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf + + +[LibraryClasses.common.DXE_DRIVER] + ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf + SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf + PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + + +[LibraryClasses.common.UEFI_APPLICATION] + ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf + PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + +[LibraryClasses.common.UEFI_DRIVER] + ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf + ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf + PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + +[LibraryClasses.common.DXE_RUNTIME_DRIVER] + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf +# PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + +[LibraryClasses.ARM] + # + # It is not possible to prevent the ARM compiler for generic intrinsic functions. + # This library provides the instrinsic functions generate by a given compiler. + # [LibraryClasses.ARM] and NULL mean link this library into all ARM images. + # + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf + + +[BuildOptions] + RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A8 --thumb + RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A8 + RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + GCC:*_*_ARM_ARCHCC_FLAGS == -march=armv7-a -mthumb - GCC:*_*_ARM_ARCHASM_FLAGS == -march=armv7-a - GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG - - XCODE:*_*_ARM_ARCHCC_FLAGS == -arch armv7 -march=armv7 - XCODE:*_*_ARM_ARCHASM_FLAGS == -arch armv7 - XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7 - XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG - - -################################################################################ -# -# Pcd Section - list of all EDK II PCD Entries defined by this Platform -# -################################################################################ - -[PcdsFeatureFlag.common] - gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|TRUE - gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE - gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE - gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE - - # - # Control what commands are supported from the UI - # Turn these on and off to add features or save size - # - gEmbeddedTokenSpaceGuid.PcdEmbeddedMacBoot|TRUE - gEmbeddedTokenSpaceGuid.PcdEmbeddedDirCmd|TRUE - gEmbeddedTokenSpaceGuid.PcdEmbeddedHobCmd|TRUE - gEmbeddedTokenSpaceGuid.PcdEmbeddedHwDebugCmd|TRUE - gEmbeddedTokenSpaceGuid.PcdEmbeddedPciDebugCmd|TRUE - gEmbeddedTokenSpaceGuid.PcdEmbeddedIoEnable|FALSE - gEmbeddedTokenSpaceGuid.PcdEmbeddedScriptCmd|FALSE - - gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE - - gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob|TRUE - gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE - - gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE - -[PcdsFixedAtBuild.common] - gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmEb %a" - gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|32 - gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0 - gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 - gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 - gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000 - gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000 - gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0xAF - gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|1 - gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0 - gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320 - -# DEBUG_ASSERT_ENABLED 0x01 -# DEBUG_PRINT_ENABLED 0x02 -# DEBUG_CODE_ENABLED 0x04 -# CLEAR_MEMORY_ENABLED 0x08 -# ASSERT_BREAKPOINT_ENABLED 0x10 -# ASSERT_DEADLOOP_ENABLED 0x20 - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f - -# DEBUG_INIT 0x00000001 // Initialization -# DEBUG_WARN 0x00000002 // Warnings -# DEBUG_LOAD 0x00000004 // Load events -# DEBUG_FS 0x00000008 // EFI File system -# DEBUG_POOL 0x00000010 // Alloc & Free's -# DEBUG_PAGE 0x00000020 // Alloc & Free's -# DEBUG_INFO 0x00000040 // Verbose -# DEBUG_DISPATCH 0x00000080 // PEI/DXE Dispatchers -# DEBUG_VARIABLE 0x00000100 // Variable -# DEBUG_BM 0x00000400 // Boot Manager -# DEBUG_BLKIO 0x00001000 // BlkIo Driver -# DEBUG_NET 0x00004000 // SNI Driver -# DEBUG_UNDI 0x00010000 // UNDI Driver -# DEBUG_LOADFILE 0x00020000 // UNDI Driver -# DEBUG_EVENT 0x00080000 // Event messages -# DEBUG_ERROR 0x80000000 // Error - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000 - - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 - - gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|"" - gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07 - gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000 - - gEmbeddedTokenSpaceGuid.PcdPrePiTempMemorySize|0 - gEmbeddedTokenSpaceGuid.PcdPrePiBfvBaseAddress|0 - gEmbeddedTokenSpaceGuid.PcdPrePiBfvSize|0 - gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|0 - gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize|0 - -# -# Optional feature to help prevent EFI memory map fragments -# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob -# Values are in EFI Pages (4K). DXE Core will make sure that -# at least this much of each type of memory can be allocated -# from a single memory range. This way you only end up with -# maximum of two fragements for each type in the memory map -# (the memory used, and the free memory that was prereserved -# but not used). -# - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|80 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|40 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|400 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|3000 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|10 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0 - - gEmbeddedTokenSpaceGuid.PcdPrePiHobBase|0x00001000 - gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0x07FE0000 # stack at top of memory - gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x20000 # 128K stack - gEmbeddedTokenSpaceGuid.PcdMemoryBase|0x00000000 - gEmbeddedTokenSpaceGuid.PcdMemorySize|0x10000000 # 256 MB - - gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x00000000 - gArmTokenSpaceGuid.PcdCpuResetAddress|0x40000000 # set to start of NOR - - gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 - gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77 - gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000 - - # - # ARM Pcds - # - gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000 - - # - # ARM EB PCDS - # - gArmEbTokenSpaceGuid.PcdConsoleUartBase|0x10009000 - gArmEbTokenSpaceGuid.PcdGdbUartBase|0x1000a000 - - -################################################################################ -# -# Components Section - list of all EDK II Modules needed by this Platform -# -################################################################################ -[Components.common] - -# -# SEC -# - ArmEbPkg/Sec/Sec.inf - -# -# DXE -# - MdeModulePkg/Core/Dxe/DxeMain.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf -# NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf - NULL|EmbeddedPkg/Library/LzmaHobCustomDecompressLib/LzmaHobCustomDecompressLib.inf - } - - ArmPkg/Drivers/CpuDxe/CpuDxe.inf - - MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf - MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf - EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf - EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf - - EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf - EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf - EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf - - ArmEbPkg/InterruptDxe/InterruptDxe.inf - ArmEbPkg/TimerDxe/TimerDxe.inf - - # - # Semi-hosting filesystem - # - ArmPkg/Filesystem/SemihostFs/SemihostFs.inf - - # - # FAT filesystem + GPT/MBR partitioning - # - MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf - MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf - FatPkg/EnhancedFatDxe/Fat.inf - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf - - - # - # Application - # - EmbeddedPkg/Ebl/Ebl.inf - - # - # Bds - # - ArmEbPkg/Bds/Bds.inf - - # - # Example Application - # - MdeModulePkg/Application/HelloWorld/HelloWorld.inf - + GCC:*_*_ARM_ARCHASM_FLAGS == -march=armv7-a + GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + + XCODE:*_*_ARM_ARCHCC_FLAGS == -arch armv7 -march=armv7 + XCODE:*_*_ARM_ARCHASM_FLAGS == -arch armv7 + XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7 + XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG + + +################################################################################ +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +################################################################################ + +[PcdsFeatureFlag.common] + gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|TRUE + gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE + gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE + gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE + + gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE + + gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE + +[PcdsFixedAtBuild.common] + gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ArmEb %a" + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|32 + gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0 + gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 + gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 + gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000 + gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000 + gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0xAF + gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|1 + gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0 + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320 + +# DEBUG_ASSERT_ENABLED 0x01 +# DEBUG_PRINT_ENABLED 0x02 +# DEBUG_CODE_ENABLED 0x04 +# CLEAR_MEMORY_ENABLED 0x08 +# ASSERT_BREAKPOINT_ENABLED 0x10 +# ASSERT_DEADLOOP_ENABLED 0x20 + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f + +# DEBUG_INIT 0x00000001 // Initialization +# DEBUG_WARN 0x00000002 // Warnings +# DEBUG_LOAD 0x00000004 // Load events +# DEBUG_FS 0x00000008 // EFI File system +# DEBUG_POOL 0x00000010 // Alloc & Free's +# DEBUG_PAGE 0x00000020 // Alloc & Free's +# DEBUG_INFO 0x00000040 // Verbose +# DEBUG_DISPATCH 0x00000080 // PEI/DXE Dispatchers +# DEBUG_VARIABLE 0x00000100 // Variable +# DEBUG_BM 0x00000400 // Boot Manager +# DEBUG_BLKIO 0x00001000 // BlkIo Driver +# DEBUG_NET 0x00004000 // SNI Driver +# DEBUG_UNDI 0x00010000 // UNDI Driver +# DEBUG_LOADFILE 0x00020000 // UNDI Driver +# DEBUG_EVENT 0x00080000 // Event messages +# DEBUG_ERROR 0x80000000 // Error + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xffffffcf + + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 + + gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|"" + gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07 + gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000 +# +# Optional feature to help prevent EFI memory map fragments +# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob +# Values are in EFI Pages (4K). DXE Core will make sure that +# at least this much of each type of memory can be allocated +# from a single memory range. This way you only end up with +# maximum of two fragements for each type in the memory map +# (the memory used, and the free memory that was prereserved +# but not used). +# + gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x00000000 + #gArmTokenSpaceGuid.PcdCpuResetAddress|0x40000000 # set to start of NOR + gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 + gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterPeriodInNanoseconds|77 + gEmbeddedTokenSpaceGuid.PcdEmbeddedPerformanceCounterFrequencyInHz|13000000 + + # + # ARM Pcds + # + gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000 + + # + # ARM EB PCDS + # + gArmRealViewEbPkgTokenSpaceGuid.PcdConsoleUartBase|0x10009000 + gArmRealViewEbPkgTokenSpaceGuid.PcdGdbUartBase|0x1000a000 + + # change these together + gArmRealViewEbPkgTokenSpaceGuid.PcdPeiServicePtrAddr|0x48020004 # pei services ptr just above stack + gEmbeddedTokenSpaceGuid.PcdPrePiStackBase|0x48000000 # stack at top of SRAM + gEmbeddedTokenSpaceGuid.PcdPrePiStackSize|0x00020000 # 128K stack + + + + +################################################################################ +# +# Components Section - list of all EDK II Modules needed by this Platform +# +################################################################################ +[Components.common] + +# +# SEC +# + ArmRealViewEbPkg/SecForPei/Sec.inf + +# +# PEI Phase modules +# +MdeModulePkg/Core/Pei/PeiMain.inf +MdeModulePkg/Universal/PCD/Pei/Pcd.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf +} +ArmPkg/Drivers/CpuPei/CpuPei.inf +ArmRealViewEbPkg/PlatformPei/PlatformPei.inf +ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf +IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf +Nt32Pkg/BootModePei/BootModePei.inf +#Nt32Pkg/StallPei/StallPei.inf +#Nt32Pkg/WinNtFlashMapPei/WinNtFlashMapPei.inf +MdeModulePkg/Universal/Variable/Pei/VariablePei.inf +#Nt32Pkg/WinNtFirmwareVolumePei/WinNtFirmwareVolumePei.inf +MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf + +# +# DXE +# + MdeModulePkg/Core/Dxe/DxeMain.inf { + + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf + NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf + } + + ArmPkg/Drivers/CpuDxe/CpuDxe.inf + + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + + EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf + EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf + + EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf + EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf + + ArmRealViewEbPkg/InterruptDxe/InterruptDxe.inf + ArmRealViewEbPkg/TimerDxe/TimerDxe.inf + + # + # Semi-hosting filesystem + # + ArmPkg/Filesystem/SemihostFs/SemihostFs.inf + + # + # FAT filesystem + GPT/MBR partitioning + # + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + FatPkg/EnhancedFatDxe/Fat.inf + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf + + + # + # Application + # + EmbeddedPkg/Ebl/Ebl.inf + + # + # Bds + # + ArmRealViewEbPkg/Bds/Bds.inf + + # + # Example Application + # + MdeModulePkg/Application/HelloWorld/HelloWorld.inf + diff --git a/ArmEbPkg/ArmEbPkg.fdf b/ArmRealViewEbPkg/ArmRealViewEbPkg.fdf similarity index 73% rename from ArmEbPkg/ArmEbPkg.fdf rename to ArmRealViewEbPkg/ArmRealViewEbPkg.fdf index beb103bedc..cd012b8344 100755 --- a/ArmEbPkg/ArmEbPkg.fdf +++ b/ArmRealViewEbPkg/ArmRealViewEbPkg.fdf @@ -1,250 +1,296 @@ -# FLASH layout file for ARM EB. -# -# Copyright (c) 2009 - 2010, Apple Inc. 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. -# - -################################################################################ -# -# FD Section -# The [FD] Section is made up of the definition statements and a -# description of what goes into the Flash Device Image. Each FD section -# defines one flash "device" image. A flash device image may be one of -# the following: Removable media bootable image (like a boot floppy -# image,) an Option ROM image (that would be "flashed" into an add-in -# card,) a System "Flash" image (that would be burned into a system's -# flash) or an Update ("Capsule") image that will be used to update and -# existing system flash. -# -################################################################################ - - -[FD.ArmEb_EFI] -BaseAddress = 0x40000000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device. -Size = 0x00200000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device -ErasePolarity = 1 -BlockSize = 0x00001000 -NumBlocks = 0x200 - -################################################################################ -# -# Following are lists of FD Region layout which correspond to the locations of different -# images within the flash device. -# -# Regions must be defined in ascending order and may not overlap. -# -# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by -# the pipe "|" character, followed by the size of the region, also in hex with the leading -# "0x" characters. Like: -# Offset|Size -# PcdOffsetCName|PcdSizeCName -# RegionType -# -################################################################################ - -0x00000000|0x00200000 -gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize -FV = FVMAIN_COMPACT - -################################################################################ -# -# FV Section -# -# [FV] section is used to define what components or modules are placed within a flash -# device file. This section also defines order the components and modules are positioned -# within the image. The [FV] section consists of define statements, set statements and -# module statements. -# -################################################################################ - -[FV.FvMain] -BlockSize = 0x40 -NumBlocks = 0 # This FV gets compressed so make it just big enough -FvAlignment = 8 # FV alignment and FV attributes setting. -ERASE_POLARITY = 1 -MEMORY_MAPPED = TRUE -STICKY_WRITE = TRUE -LOCK_CAP = TRUE -LOCK_STATUS = TRUE -WRITE_DISABLED_CAP = TRUE -WRITE_ENABLED_CAP = TRUE -WRITE_STATUS = TRUE -WRITE_LOCK_CAP = TRUE -WRITE_LOCK_STATUS = TRUE -READ_DISABLED_CAP = TRUE -READ_ENABLED_CAP = TRUE -READ_STATUS = TRUE -READ_LOCK_CAP = TRUE -READ_LOCK_STATUS = TRUE - - INF MdeModulePkg/Core/Dxe/DxeMain.inf - - # - # PI DXE Drivers producing Architectural Protocols (EFI Services) - # - INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf - - INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf - INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf - INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf - INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf - - INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf - - INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf - INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf - INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf - - INF ArmEbPkg/InterruptDxe/InterruptDxe.inf - INF ArmEbPkg/TimerDxe/TimerDxe.inf - - # - # Semi-hosting filesystem - # - INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf - - # - # FAT filesystem + GPT/MBR partitioning - # - INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf - INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf - INF FatPkg/EnhancedFatDxe/Fat.inf - INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf - - # - # UEFI application (Shell Embedded Boot Loader) - # - INF EmbeddedPkg/Ebl/Ebl.inf - - - # - # Bds - # - INF ArmEbPkg/Bds/Bds.inf - - -[FV.FVMAIN_COMPACT] -FvAlignment = 8 -ERASE_POLARITY = 1 -MEMORY_MAPPED = TRUE -STICKY_WRITE = TRUE -LOCK_CAP = TRUE -LOCK_STATUS = TRUE -WRITE_DISABLED_CAP = TRUE -WRITE_ENABLED_CAP = TRUE -WRITE_STATUS = TRUE -WRITE_LOCK_CAP = TRUE -WRITE_LOCK_STATUS = TRUE -READ_DISABLED_CAP = TRUE -READ_ENABLED_CAP = TRUE -READ_STATUS = TRUE -READ_LOCK_CAP = TRUE -READ_LOCK_STATUS = TRUE - - INF ArmEbPkg/Sec/Sec.inf - - FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { - SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { - SECTION FV_IMAGE = FVMAIN - } - } - - -################################################################################ -# -# Rules are use with the [FV] section's module INF type to define -# how an FFS file is created for a given INF file. The following Rule are the default -# rules for the different module type. User can add the customized rules to define the -# content of the FFS file. -# -################################################################################ - - -############################################################################ -# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # -############################################################################ -# -#[Rule.Common.DXE_DRIVER] -# FILE DRIVER = $(NAMED_GUID) { -# DXE_DEPEX DXE_DEPEX Optional |.depex -# COMPRESS PI_STD { -# GUIDED { -# PE32 PE32 |.efi -# UI STRING="$(MODULE_NAME)" Optional -# VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) -# } -# } -# } -# -############################################################################ - -[Rule.Common.SEC] - FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED { - TE TE Align = 8 |.efi - } - -[Rule.Common.PEI_CORE] - FILE PEI_CORE = $(NAMED_GUID) { - TE TE |.efi - UI STRING ="$(MODULE_NAME)" Optional - } - -[Rule.Common.PEIM] - FILE PEIM = $(NAMED_GUID) { - PEI_DEPEX PEI_DEPEX Optional |.depex - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - -[Rule.Common.PEIM.TIANOCOMPRESSED] - FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { - PEI_DEPEX PEI_DEPEX Optional |.depex - GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE { - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - } - -[Rule.Common.DXE_CORE] - FILE DXE_CORE = $(NAMED_GUID) { - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - - -[Rule.Common.UEFI_DRIVER] - FILE DRIVER = $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional |.depex - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - -[Rule.Common.DXE_DRIVER] - FILE DRIVER = $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional |.depex - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - -[Rule.Common.DXE_RUNTIME_DRIVER] - FILE DRIVER = $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional |.depex - PE32 PE32 |.efi - UI STRING="$(MODULE_NAME)" Optional - } - - -[Rule.Common.UEFI_APPLICATION] - FILE APPLICATION = $(NAMED_GUID) { - UI STRING ="$(MODULE_NAME)" Optional - PE32 PE32 |.efi - } +# FLASH layout file for ARM RealView EB. +# +# Copyright (c) 2009 - 2010, Apple Inc. 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. +# + +################################################################################ +# +# FD Section +# The [FD] Section is made up of the definition statements and a +# description of what goes into the Flash Device Image. Each FD section +# defines one flash "device" image. A flash device image may be one of +# the following: Removable media bootable image (like a boot floppy +# image,) an Option ROM image (that would be "flashed" into an add-in +# card,) a System "Flash" image (that would be burned into a system's +# flash) or an Update ("Capsule") image that will be used to update and +# existing system flash. +# +################################################################################ + + +[FD.ArmRealViewEb_EFI] +BaseAddress = 0x40000000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device. +Size = 0x00200000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device +ErasePolarity = 1 +BlockSize = 0x00010000 +NumBlocks = 0x20 + +################################################################################ +# +# Following are lists of FD Region layout which correspond to the locations of different +# images within the flash device. +# +# Regions must be defined in ascending order and may not overlap. +# +# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by +# the pipe "|" character, followed by the size of the region, also in hex with the leading +# "0x" characters. Like: +# Offset|Size +# PcdOffsetCName|PcdSizeCName +# RegionType +# +################################################################################ + +0x00000000|0x001F0000 +gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize +FV = FVMAIN_COMPACT + +0x001F0000|0x00010000 +gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize +#NV_VARIABLE_STORE +DATA = { + ## This is the EFI_FIRMWARE_VOLUME_HEADER + # ZeroVector [] + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + # FileSystemGuid: gEfiSystemNvDataFvGuid = + # { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, + # FvLength: 0x20000 + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + #Signature "_FVH" #Attributes + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, + #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision + 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02, + #Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, + #Blockmap[1]: End + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + ## This is the VARIABLE_STORE_HEADER + #Signature: gEfiVariableGuid = + # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, + #Size: 0xc000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xBFB8 + # This can speed up the Variable Dispatch a bit. + 0xB8, 0xBF, 0x00, 0x00, + #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +} + +################################################################################ +# +# FV Section +# +# [FV] section is used to define what components or modules are placed within a flash +# device file. This section also defines order the components and modules are positioned +# within the image. The [FV] section consists of define statements, set statements and +# module statements. +# +################################################################################ + +[FV.FvMain] +BlockSize = 0x40 +NumBlocks = 0 # This FV gets compressed so make it just big enough +FvAlignment = 8 # FV alignment and FV attributes setting. +ERASE_POLARITY = 1 +MEMORY_MAPPED = TRUE +STICKY_WRITE = TRUE +LOCK_CAP = TRUE +LOCK_STATUS = TRUE +WRITE_DISABLED_CAP = TRUE +WRITE_ENABLED_CAP = TRUE +WRITE_STATUS = TRUE +WRITE_LOCK_CAP = TRUE +WRITE_LOCK_STATUS = TRUE +READ_DISABLED_CAP = TRUE +READ_ENABLED_CAP = TRUE +READ_STATUS = TRUE +READ_LOCK_CAP = TRUE +READ_LOCK_STATUS = TRUE + + #INF MdeModulePkg/Core/Dxe/DxeMain.inf + + # + # PI DXE Drivers producing Architectural Protocols (EFI Services) + # + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + + INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf + + INF EmbeddedPkg/SimpleTextInOutSerial/SimpleTextInOutSerial.inf + + INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf + INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf + INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf + + INF ArmRealViewEbPkg/InterruptDxe/InterruptDxe.inf + INF ArmRealViewEbPkg/TimerDxe/TimerDxe.inf + + # + # Semi-hosting filesystem + # + INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf + + # + # FAT filesystem + GPT/MBR partitioning + # + INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + INF FatPkg/EnhancedFatDxe/Fat.inf + INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf + + # + # UEFI application (Shell Embedded Boot Loader) + # + INF EmbeddedPkg/Ebl/Ebl.inf + + + # + # Bds + # + INF ArmRealViewEbPkg/Bds/Bds.inf + + +[FV.FVMAIN_COMPACT] +FvAlignment = 8 +ERASE_POLARITY = 1 +MEMORY_MAPPED = TRUE +STICKY_WRITE = TRUE +LOCK_CAP = TRUE +LOCK_STATUS = TRUE +WRITE_DISABLED_CAP = TRUE +WRITE_ENABLED_CAP = TRUE +WRITE_STATUS = TRUE +WRITE_LOCK_CAP = TRUE +WRITE_LOCK_STATUS = TRUE +READ_DISABLED_CAP = TRUE +READ_ENABLED_CAP = TRUE +READ_STATUS = TRUE +READ_LOCK_CAP = TRUE +READ_LOCK_STATUS = TRUE + + INF ArmRealViewEbPkg/SecForPei/Sec.inf + INF MdeModulePkg/Core/Pei/PeiMain.inf + INF ArmPkg/Drivers/CpuPei/CpuPei.inf + INF ArmRealViewEbPkg/PlatformPei/PlatformPei.inf + INF ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf + INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf + INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf + INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf + + # note: this needs to back in fvmaincompressed + # need to add decompression of fvmain + INF MdeModulePkg/Core/Dxe/DxeMain.inf + + FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { + SECTION FV_IMAGE = FVMAIN + } + } + + +################################################################################ +# +# Rules are use with the [FV] section's module INF type to define +# how an FFS file is created for a given INF file. The following Rule are the default +# rules for the different module type. User can add the customized rules to define the +# content of the FFS file. +# +################################################################################ + + +############################################################################ +# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section # +############################################################################ +# +#[Rule.Common.DXE_DRIVER] +# FILE DRIVER = $(NAMED_GUID) { +# DXE_DEPEX DXE_DEPEX Optional |.depex +# COMPRESS PI_STD { +# GUIDED { +# PE32 PE32 |.efi +# UI STRING="$(MODULE_NAME)" Optional +# VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) +# } +# } +# } +# +############################################################################ + +[Rule.Common.SEC] + FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED { + TE TE Align = 8 |.efi + } + +[Rule.Common.PEI_CORE] + FILE PEI_CORE = $(NAMED_GUID) { + TE TE |.efi + UI STRING ="$(MODULE_NAME)" Optional + } + +[Rule.Common.PEIM] + FILE PEIM = $(NAMED_GUID) { + PEI_DEPEX PEI_DEPEX Optional |.depex + TE TE |.efi + UI STRING="$(MODULE_NAME)" Optional + } + +[Rule.Common.PEIM.TIANOCOMPRESSED] + FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 { + PEI_DEPEX PEI_DEPEX Optional |.depex + GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE { + PE32 PE32 |.efi + UI STRING="$(MODULE_NAME)" Optional + } + } + +[Rule.Common.DXE_CORE] + FILE DXE_CORE = $(NAMED_GUID) { + PE32 PE32 |.efi + UI STRING="$(MODULE_NAME)" Optional + } + + +[Rule.Common.UEFI_DRIVER] + FILE DRIVER = $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional |.depex + PE32 PE32 |.efi + UI STRING="$(MODULE_NAME)" Optional + } + +[Rule.Common.DXE_DRIVER] + FILE DRIVER = $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional |.depex + PE32 PE32 |.efi + UI STRING="$(MODULE_NAME)" Optional + } + +[Rule.Common.DXE_RUNTIME_DRIVER] + FILE DRIVER = $(NAMED_GUID) { + DXE_DEPEX DXE_DEPEX Optional |.depex + PE32 PE32 |.efi + UI STRING="$(MODULE_NAME)" Optional + } + + +[Rule.Common.UEFI_APPLICATION] + FILE APPLICATION = $(NAMED_GUID) { + UI STRING ="$(MODULE_NAME)" Optional + PE32 PE32 |.efi + } diff --git a/ArmEbPkg/Bds/Bds.inf b/ArmRealViewEbPkg/Bds/Bds.inf similarity index 100% rename from ArmEbPkg/Bds/Bds.inf rename to ArmRealViewEbPkg/Bds/Bds.inf diff --git a/ArmEbPkg/Bds/BdsEntry.c b/ArmRealViewEbPkg/Bds/BdsEntry.c similarity index 100% rename from ArmEbPkg/Bds/BdsEntry.c rename to ArmRealViewEbPkg/Bds/BdsEntry.c diff --git a/ArmEbPkg/Bds/BdsEntry.h b/ArmRealViewEbPkg/Bds/BdsEntry.h similarity index 100% rename from ArmEbPkg/Bds/BdsEntry.h rename to ArmRealViewEbPkg/Bds/BdsEntry.h diff --git a/ArmEbPkg/Bds/FirmwareVolume.c b/ArmRealViewEbPkg/Bds/FirmwareVolume.c similarity index 100% rename from ArmEbPkg/Bds/FirmwareVolume.c rename to ArmRealViewEbPkg/Bds/FirmwareVolume.c diff --git a/ArmRealViewEbPkg/Debugger_scripts/EBLoadSecSyms.inc b/ArmRealViewEbPkg/Debugger_scripts/EBLoadSecSyms.inc new file mode 100755 index 0000000000..c2df81b23e --- /dev/null +++ b/ArmRealViewEbPkg/Debugger_scripts/EBLoadSecSyms.inc @@ -0,0 +1,16 @@ +// returns the base address of the SEC FV in flash on the EB board +// change this address for where your platform's SEC FV is located +// (or make it more intelligent to search for it) +define /r FindFv() +{ + return 0x40000000; +} +. + +include /s 'ZZZZZZ/ArmRealViewEbPkg/Debugger_scripts/EfiFuncs.inc' +error=continue +unload ,all +error=abort +LoadPeiSec() +include C:\loadfiles.inc + diff --git a/ArmRealViewEbPkg/Debugger_scripts/EfiFuncs.inc b/ArmRealViewEbPkg/Debugger_scripts/EfiFuncs.inc new file mode 100755 index 0000000000..0bbe045a96 --- /dev/null +++ b/ArmRealViewEbPkg/Debugger_scripts/EfiFuncs.inc @@ -0,0 +1,463 @@ +error=abort + +// NOTE: THIS MAY NEED TO BE ADJUSTED +// change to reflect the total amount of ram in your system +define /r GetMaxMem() +{ + return 0x10000000; // 256 MB +} +. + +define /r GetWord(Addr) +{ + unsigned long data; + + if( (Addr & 0x2) == 0 ) + { + data = dword(Addr); + data = data & 0xffff; + //$printf "getword data is %x\n", data$; + return data; + } + else + { + data = dword(Addr & 0xfffffffc); + //data = data >> 16; + data = data / 0x10000; + //$printf "getword data is %x (1)\n", data$; + return data; + } +} +. + +define /r ProcessPE32(imgstart) +unsigned long imgstart; +{ + unsigned long filehdrstart; + unsigned long debugdirentryrva; + unsigned long debugtype; + unsigned long debugrva; + unsigned long dwarfsig; + unsigned long baseofcode; + unsigned long baseofdata; + unsigned long elfbase; + char *elfpath; + + $printf "PE32 image found at %x",imgstart$; + + //$printf "PE file hdr offset %x",dword(imgstart+0x3C)$; + + // offset from dos hdr to PE file hdr + filehdrstart = imgstart + dword(imgstart+0x3C); + + // offset to debug dir in PE hdrs + //$printf "debug dir is at %x",(filehdrstart+0xA8)$; + debugdirentryrva = dword(filehdrstart + 0xA8); + if(debugdirentryrva == 0) + { + $printf "no debug dir for image at %x",imgstart$; + return; + } + + //$printf "debug dir entry rva is %x",debugdirentryrva$; + + debugtype = dword(imgstart + debugdirentryrva + 0xc); + if( (debugtype != 0xdf) && (debugtype != 0x2) ) + { + $printf "debug type is not dwarf for image at %x",imgstart$; + $printf "debug type is %x",debugtype$; + return; + } + + debugrva = dword(imgstart + debugdirentryrva + 0x14); + dwarfsig = dword(imgstart + debugrva); + if(dwarfsig != 0x66727764) + { + $printf "dwarf debug signature not found for image at %x",imgstart$; + return; + } + + elfpath = (char *)(imgstart + debugrva + 0xc); + + baseofcode = imgstart + dword(filehdrstart + 0x28); + baseofdata = imgstart + dword(filehdrstart + 0x2c); + + if( (baseofcode < baseofdata) && (baseofcode != 0) ) + { + elfbase = baseofcode; + } + else + { + elfbase = baseofdata; + } + + $printf "found path %s",elfpath$; + $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$; +} +. + +define /r ProcessTE(imgstart) +unsigned long imgstart; +{ + unsigned long strippedsize; + unsigned long debugdirentryrva; + unsigned long debugtype; + unsigned long debugrva; + unsigned long dwarfsig; + unsigned long elfbase; + char *elfpath; + + $printf "TE image found at %x",imgstart$; + + // determine pe header bytes removed to account for in rva references + //strippedsize = word(imgstart + 0x6); + //strippedsize = (dword(imgstart + 0x4) & 0xffff0000) >> 16; + strippedsize = (dword(imgstart + 0x4) & 0xffff0000) / 0x10000; + strippedsize = strippedsize - 0x28; + + debugdirentryrva = dword(imgstart + 0x20); + if(debugdirentryrva == 0) + { + $printf "no debug dir for image at %x",imgstart$; + return; + } + debugdirentryrva = debugdirentryrva - strippedsize; + + //$printf "debug dir entry rva is %x",debugdirentryrva$; + + debugtype = dword(imgstart + debugdirentryrva + 0xc); + if( (debugtype != 0xdf) && (debugtype != 0x2) ) + { + $printf "debug type is not dwarf for image at %x",imgstart$; + $printf "debug type is %x",debugtype$; + return; + } + + debugrva = dword(imgstart + debugdirentryrva + 0x14); + debugrva = debugrva - strippedsize; + dwarfsig = dword(imgstart + debugrva); + if( (dwarfsig != 0x66727764) && (dwarfsig != 0x3031424e) ) + { + $printf "dwarf debug signature not found for image at %x",imgstart$; + $printf "found %x", dwarfsig$; + return; + } + + if( dwarfsig == 0x66727764 ) + { + elfpath = (char *)(imgstart + debugrva + 0xc); + $printf "looking for elf path at 0x%x", elfpath$; + } + else + { + elfpath = (char *)(imgstart + debugrva + 0x10); + $printf "looking for elf path at 0x%x", elfpath$; + } + + // elf base is baseofcode (we hope that for TE images it's not baseofdata) + elfbase = imgstart + dword(imgstart + 0xc) - strippedsize; + + $printf "found path %s",elfpath$; + $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$; +} +. + +define /r ProcessFvSection(secstart) +unsigned long secstart; +{ + unsigned long sectionsize; + unsigned char sectiontype; + + sectionsize = dword(secstart); + //sectiontype = (sectionsize & 0xff000000) >> 24; + sectiontype = (sectionsize & 0xff000000) / 0x1000000; + sectionsize = sectionsize & 0x00ffffff; + + $printf "fv section at %x size %x type %x",secstart,sectionsize,sectiontype$; + + if(sectiontype == 0x10) // PE32 + { + ProcessPE32(secstart+0x4); + } + else if(sectiontype == 0x12) // TE + { + ProcessTE(secstart+0x4); + } +} +. + +define /r ProcessFfsFile(ffsfilestart) +unsigned long ffsfilestart; +{ + unsigned long ffsfilesize; + unsigned long ffsfiletype; + unsigned long secoffset; + unsigned long secsize; + + //ffsfiletype = byte(ffsfilestart + 0x12); + ffsfilesize = dword(ffsfilestart + 0x14); + //ffsfiletype = (ffsfilesize & 0xff000000) >> 24; + ffsfiletype = (ffsfilesize & 0xff000000) / 0x1000000; + ffsfilesize = ffsfilesize & 0x00ffffff; + + if(ffsfiletype == 0xff) return; + + $printf "ffs file at %x size %x type %x",ffsfilestart,ffsfilesize,ffsfiletype$; + + secoffset = ffsfilestart + 0x18; + + // loop through sections in file + while(secoffset < (ffsfilestart + ffsfilesize)) + { + // process fv section and increment section offset by size + secsize = dword(secoffset) & 0x00ffffff; + ProcessFvSection(secoffset); + secoffset = secoffset + secsize; + + // align to next 4 byte boundary + if( (secoffset & 0x3) != 0 ) + { + secoffset = secoffset + (0x4 - (secoffset & 0x3)); + } + } // end section loop +} +. + +define /r LoadPeiSec() +{ + unsigned long fvbase; + unsigned long fvlen; + unsigned long fvsig; + unsigned long ffsoffset; + unsigned long ffsfilesize; + + fvbase = FindFv(); + $printf "fvbase %x",fvbase$; + + // get fv signature field + fvsig = dword(fvbase + 0x28); + if(fvsig != 0x4856465F) + { + $printf "FV does not have proper signature, exiting"$; + return 0; + } + + $printf "FV signature found"$; + + $fopen 50, 'C:\loadfiles.inc'$; + + fvlen = dword(fvbase + 0x20); + + // first ffs file is after fv header, use headerlength field + //ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) >> 16; + ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) / 0x10000; + ffsoffset = fvbase + GetWord(fvbase + 0x30); + + // loop through ffs files + while(ffsoffset < (fvbase+fvlen)) + { + // process ffs file and increment by ffs file size field + ProcessFfsFile(ffsoffset); + ffsfilesize = (dword(ffsoffset + 0x14) & 0x00ffffff); + if(ffsfilesize == 0) + { + break; + } + ffsoffset = ffsoffset + ffsfilesize; + + + // align to next 8 byte boundary + if( (ffsoffset & 0x7) != 0 ) + { + ffsoffset = ffsoffset + (0x8 - (ffsoffset & 0x7)); + } + + } // end fv ffs loop + + $vclose 50$; + +} +. + +define /r FindSystemTable(TopOfRam) +unsigned long TopOfRam; +{ + unsigned long offset; + + $printf "FindSystemTable"$; + $printf "top of mem is %x",TopOfRam$; + + offset = TopOfRam; + + // align to highest 4MB boundary + offset = offset & 0xFFC00000; + + // start at top and look on 4MB boundaries for system table ptr structure + while(offset > 0) + { + //$printf "checking %x",offset$; + //$printf "value is %x",dword(offset)$; + + // low signature match + if(dword(offset) == 0x20494249) + { + // high signature match + if(dword(offset+4) == 0x54535953) + { + // less than 4GB? + if(dword(offset+0x0c) == 0) + { + // less than top of ram? + if(dword(offset+8) < TopOfRam) + { + return(dword(offset+8)); + } + } + } + + } + + if(offset < 0x400000) break; + offset = offset - 0x400000; + } + + return 0; +} +. + +define /r ProcessImage(ImageBase) +unsigned long ImageBase; +{ + $printf "ProcessImage %x", ImageBase$; +} +. + +define /r FindDebugInfo(SystemTable) +unsigned long SystemTable; +{ + unsigned long CfgTableEntries; + unsigned long ConfigTable; + unsigned long i; + unsigned long offset; + unsigned long dbghdr; + unsigned long dbgentries; + unsigned long dbgptr; + unsigned long dbginfo; + unsigned long loadedimg; + + $printf "FindDebugInfo"$; + + dbgentries = 0; + CfgTableEntries = dword(SystemTable + 0x40); + ConfigTable = dword(SystemTable + 0x44); + + $printf "config table is at %x (%d entries)", ConfigTable, CfgTableEntries$; + + // now search for debug info entry with guid 49152E77-1ADA-4764-B7A2-7AFEFED95E8B + // 0x49152E77 0x47641ADA 0xFE7AA2B7 0x8B5ED9FE + for(i=0; i + 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 +#include +#include +#include + +/** + Caches a pointer PEI Services Table. + + Caches the pointer to the PEI Services Table specified by PeiServicesTablePointer + in a platform specific manner. + + If PeiServicesTablePointer is NULL, then ASSERT(). + + @param PeiServicesTablePointer The address of PeiServices pointer. +**/ +VOID +EFIAPI +SetPeiServicesTablePointer ( + IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer + ) +{ + UINTN *PeiPtrLoc; + ASSERT (PeiServicesTablePointer != NULL); + + PeiPtrLoc = (UINTN *)(UINTN)PcdGet32(PcdPeiServicePtrAddr); + *PeiPtrLoc = (UINTN)PeiServicesTablePointer; +} + +/** + Retrieves the cached value of the PEI Services Table pointer. + + Returns the cached value of the PEI Services Table pointer in a CPU specific manner + as specified in the CPU binding section of the Platform Initialization Pre-EFI + Initialization Core Interface Specification. + + If the cached PEI Services Table pointer is NULL, then ASSERT(). + + @return The pointer to PeiServices. + +**/ +CONST EFI_PEI_SERVICES ** +EFIAPI +GetPeiServicesTablePointer ( + VOID + ) +{ + UINTN *PeiPtrLoc; + + PeiPtrLoc = (UINTN *)(UINTN)PcdGet32(PcdPeiServicePtrAddr); + return (CONST EFI_PEI_SERVICES **)*PeiPtrLoc; +} + + diff --git a/ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf b/ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf new file mode 100755 index 0000000000..db11b936c3 --- /dev/null +++ b/ArmRealViewEbPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf @@ -0,0 +1,43 @@ +## @file +# Instance of PEI Services Table Pointer Library using global variable for the table pointer. +# +# PEI Services Table Pointer Library implementation that retrieves a pointer to the +# PEI Services Table from a global variable. Not available to modules that execute from +# read-only memory. +# +# Copyright (c) 2007 - 2010, Intel Corporation. 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 = PeiServicesTablePointerLib + FILE_GUID = 1c747f6b-0a58-49ae-8ea3-0327a4fa10e3 + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + LIBRARY_CLASS = PeiServicesTablePointerLib|PEIM PEI_CORE SEC + +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only) +# + +[Sources] + PeiServicesTablePointer.c + +[Packages] + MdePkg/MdePkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec + +[LibraryClasses] + DebugLib + +[Pcd] + gArmRealViewEbPkgTokenSpaceGuid.PcdPeiServicePtrAddr diff --git a/ArmEbPkg/Library/RealTimeClockLib/RealTimeClockLib.c b/ArmRealViewEbPkg/Library/RealTimeClockLib/RealTimeClockLib.c similarity index 100% rename from ArmEbPkg/Library/RealTimeClockLib/RealTimeClockLib.c rename to ArmRealViewEbPkg/Library/RealTimeClockLib/RealTimeClockLib.c diff --git a/ArmEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf b/ArmRealViewEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf similarity index 100% rename from ArmEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf rename to ArmRealViewEbPkg/Library/RealTimeClockLib/RealTimeClockLib.inf diff --git a/ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.c b/ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.c old mode 100644 new mode 100755 similarity index 100% rename from ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.c rename to ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.c diff --git a/ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.inf b/ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf old mode 100644 new mode 100755 similarity index 93% rename from ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.inf rename to ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf index bd11a5e9c3..f74587743c --- a/ArmEbPkg/Library/ResetSystemLib/ResetSystemLib.inf +++ b/ArmRealViewEbPkg/Library/ResetSystemLib/ResetSystemLib.inf @@ -28,7 +28,7 @@ [Packages] MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec - ArmEbPkg/ArmEbPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec [LibraryClasses] DebugLib diff --git a/ArmEbPkg/Library/SerialPortLib/SerialPortLib.c b/ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.c old mode 100644 new mode 100755 similarity index 92% rename from ArmEbPkg/Library/SerialPortLib/SerialPortLib.c rename to ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.c index 09a9333785..90e559a245 --- a/ArmEbPkg/Library/SerialPortLib/SerialPortLib.c +++ b/ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.c @@ -74,7 +74,7 @@ SerialPortWrite ( UINTN Count; for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) { - while ((MmioRead32 (FR) & UART_TX_EMPTY_FLAG_MASK) != 0); + while ((MmioRead32 (FR) & UART_TX_EMPTY_FLAG_MASK) == 0); MmioWrite8 (DR, *Buffer); } @@ -104,7 +104,7 @@ SerialPortRead ( UINTN Count; for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) { - while ((MmioRead32 (FR) & UART_RX_EMPTY_FLAG_MASK) == 0); + while ((MmioRead32 (FR) & UART_RX_EMPTY_FLAG_MASK) != 0); *Buffer = MmioRead8 (DR); } diff --git a/ArmEbPkg/Library/SerialPortLib/SerialPortLib.inf b/ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.inf old mode 100644 new mode 100755 similarity index 88% rename from ArmEbPkg/Library/SerialPortLib/SerialPortLib.inf rename to ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.inf index ee4eed90be..a53c0fef5b --- a/ArmEbPkg/Library/SerialPortLib/SerialPortLib.inf +++ b/ArmRealViewEbPkg/Library/SerialPortLib/SerialPortLib.inf @@ -34,8 +34,8 @@ [Packages] MdePkg/MdePkg.dec - ArmEbPkg/ArmEbPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec [FixedPcd] - gArmEbTokenSpaceGuid.PcdConsoleUartBase + gArmRealViewEbPkgTokenSpaceGuid.PcdConsoleUartBase diff --git a/ArmEbPkg/Library/TimerLib/TimerLib.c b/ArmRealViewEbPkg/Library/TimerLib/TimerLib.c similarity index 100% rename from ArmEbPkg/Library/TimerLib/TimerLib.c rename to ArmRealViewEbPkg/Library/TimerLib/TimerLib.c diff --git a/ArmEbPkg/Library/TimerLib/TimerLib.inf b/ArmRealViewEbPkg/Library/TimerLib/TimerLib.inf similarity index 94% rename from ArmEbPkg/Library/TimerLib/TimerLib.inf rename to ArmRealViewEbPkg/Library/TimerLib/TimerLib.inf index 8f1697cd05..a194ef1e9a 100755 --- a/ArmEbPkg/Library/TimerLib/TimerLib.inf +++ b/ArmRealViewEbPkg/Library/TimerLib/TimerLib.inf @@ -31,7 +31,7 @@ [Packages] MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec - ArmEbPkg/ArmEbPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec [LibraryClasses] DebugLib diff --git a/ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c b/ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c new file mode 100755 index 0000000000..972bb37d2e --- /dev/null +++ b/ArmRealViewEbPkg/MemoryInitPei/MemoryInit.c @@ -0,0 +1,104 @@ +/**@file + +Copyright (c) 2006, Intel Corporation. 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. + +Module Name: + + MemoryInit.c + +Abstract: + + PEIM to provide fake memory init + +**/ + + + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +#include +#include +// +// The Library classes this module consumes +// +#include +#include +#include +#include +#include + + +// +// Module globals +// + +EFI_STATUS +EFIAPI +InitializeMemory ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + + +Arguments: + + FileHandle - Handle of the file being invoked. + PeiServices - Describes the list of possible PEI Services. + +Returns: + + Status - EFI_SUCCESS if the boot mode could be set + +--*/ +{ + EFI_STATUS Status; + EFI_RESOURCE_ATTRIBUTE_TYPE Attributes; + UINT64 MemoryBase; + UINT64 MemorySize; + + DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n")); + + // NOTE: this needs to come from your memory controller initization process + MemoryBase = 0; + MemorySize = 0x10000000; + + DEBUG ((EFI_D_ERROR, "Installing hardcoded 256MB\n")); + Status = PeiServicesInstallPeiMemory (MemoryBase, MemorySize); + ASSERT_EFI_ERROR (Status); + + Attributes = + ( + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_TESTED + ); + + BuildResourceDescriptorHob ( + EFI_RESOURCE_SYSTEM_MEMORY, + Attributes, + MemoryBase, + MemorySize + ); + + return Status; +} diff --git a/ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf b/ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf new file mode 100755 index 0000000000..e50e2ecbcf --- /dev/null +++ b/ArmRealViewEbPkg/MemoryInitPei/MemoryInitPei.inf @@ -0,0 +1,59 @@ +## @file +# Component description file for BootMode module +# +# This module provides platform specific function to detect boot mode. +# Copyright (c) 2006 - 2010, Intel Corporation. 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 = MemoryInit + FILE_GUID = D6F4724D-4504-418c-92BF-5E4D98FDBE85 + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + + ENTRY_POINT = InitializeMemory + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources] + MemoryInit.c + + +[Packages] + MdePkg/MdePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + + +[LibraryClasses] + PeimEntryPoint + DebugLib + HobLib + + +[Ppis] + +[FixedPcd] + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device. + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device + gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase + gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize + +[depex] + TRUE + diff --git a/ArmRealViewEbPkg/PlatformPei/PlatformPei.c b/ArmRealViewEbPkg/PlatformPei/PlatformPei.c new file mode 100755 index 0000000000..8ef0cb9cc0 --- /dev/null +++ b/ArmRealViewEbPkg/PlatformPei/PlatformPei.c @@ -0,0 +1,130 @@ +/**@file + +Copyright (c) 2006, Intel Corporation. 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. + +Module Name: + + BootMode.c + +Abstract: + + Tiano PEIM to provide the platform support functionality within Windows + +**/ + + + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +#include +#include +// +// The Library classes this module consumes +// +#include +#include +#include +#include + + +// +// Module globals +// +EFI_PEI_PPI_DESCRIPTOR mPpiListBootMode = { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiMasterBootModePpiGuid, + NULL +}; + +EFI_PEI_PPI_DESCRIPTOR mPpiListRecoveryBootMode = { + (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), + &gEfiPeiBootInRecoveryModePpiGuid, + NULL +}; + +EFI_STATUS +EFIAPI +InitializePlatformPeim ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + + +Arguments: + + FileHandle - Handle of the file being invoked. + PeiServices - Describes the list of possible PEI Services. + +Returns: + + Status - EFI_SUCCESS if the boot mode could be set + +--*/ +{ + EFI_STATUS Status; + EFI_RESOURCE_ATTRIBUTE_TYPE Attributes; + UINTN BootMode; + + DEBUG ((EFI_D_ERROR, "ARM EB Platform PEIM Loaded\n")); + + BuildCpuHob (PcdGet8 (PcdPrePiCpuMemorySize), PcdGet8 (PcdPrePiCpuIoSize)); + + Attributes =( + EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_TESTED | + EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE + ); + + //BuildResourceDescriptorHob (EFI_RESOURCE_SYSTEM_MEMORY, Attributes, (UINTN)MemoryBegin, MemoryLength); + + BuildFvHob (FixedPcdGet32(PcdFlashFvMainBase), FixedPcdGet32(PcdFlashFvMainSize)); + + BuildResourceDescriptorHob (EFI_RESOURCE_FIRMWARE_DEVICE, + (EFI_RESOURCE_ATTRIBUTE_PRESENT | + EFI_RESOURCE_ATTRIBUTE_INITIALIZED | + EFI_RESOURCE_ATTRIBUTE_TESTED | + EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE), + FixedPcdGet32(PcdFlashFvMainBase), FixedPcdGet32(PcdFlashFvMainSize)); + + //BuildStackHob ((UINTN)StackBase, Hob->EfiMemoryTop - (UINTN)StackBase); + + + // + // Let's assume things are OK if not told otherwise + // Should we read an environment variable in order to easily change this? + // + BootMode = BOOT_WITH_FULL_CONFIGURATION; + + Status = (**PeiServices).SetBootMode (PeiServices, (UINT8) BootMode); + ASSERT_EFI_ERROR (Status); + + Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListBootMode); + ASSERT_EFI_ERROR (Status); + + if (BootMode == BOOT_IN_RECOVERY_MODE) { + Status = (**PeiServices).InstallPpi (PeiServices, &mPpiListRecoveryBootMode); + ASSERT_EFI_ERROR (Status); + } + + return Status; +} diff --git a/ArmRealViewEbPkg/PlatformPei/PlatformPei.inf b/ArmRealViewEbPkg/PlatformPei/PlatformPei.inf new file mode 100755 index 0000000000..0d9b64bce0 --- /dev/null +++ b/ArmRealViewEbPkg/PlatformPei/PlatformPei.inf @@ -0,0 +1,61 @@ +## @file +# Component description file for BootMode module +# +# This module provides platform specific function to detect boot mode. +# Copyright (c) 2006 - 2010, Intel Corporation. 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 = PlatformPei + FILE_GUID = 8E7E1414-2290-4a80-A325-F55CFF10907A + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + + ENTRY_POINT = InitializePlatformPeim + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources] + PlatformPei.c + + +[Packages] + MdePkg/MdePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + + +[LibraryClasses] + PeimEntryPoint + DebugLib + HobLib + + +[Ppis] + gEfiPeiMasterBootModePpiGuid # PPI ALWAYS_PRODUCED + gEfiPeiBootInRecoveryModePpiGuid # PPI SOMETIMES_PRODUCED + +[FixedPcd] + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device. + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device + gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase + gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize + gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize + +[depex] + TRUE + diff --git a/ArmEbPkg/Sec/ModuleEntryPoint.S b/ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.S similarity index 84% rename from ArmEbPkg/Sec/ModuleEntryPoint.S rename to ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.S index e8338e9544..2b5ee8f31a 100755 --- a/ArmEbPkg/Sec/ModuleEntryPoint.S +++ b/ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.S @@ -32,7 +32,8 @@ ASM_PFX(_ModuleEntryPoint): // Turn off remapping NOR to 0. We can now use DRAM in low memory - MmioOr32 (EB_SP810_CTRL_BASE ,BIT8) + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (EB_SP810_CTRL_BASE ,BIT8) // Enable NEON register in case folks want to use them for optimizations (CopyMem) mrc p15, 0, r0, c1, c0, 2 @@ -40,23 +41,12 @@ ASM_PFX(_ModuleEntryPoint): mcr p15, 0, r0, c1, c0, 2 mov r0, #0x40000000 // Set EN bit in FPEXC mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly - - // Set CPU vectors to start of DRAM + // Set CPU vectors to 0 (which is currently flash) LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base mcr p15, 0, r0, c12, c0, 0 isb // Sync changes to control registers - // Fill vector table with branchs to current pc (jmp $) - // CPU DXE driver likes known values so it can let GDB stub hook vectors - ldr r1, ShouldNeverGetHere - movs r2, #0 -FillVectors: - str r1, [r0, r2] - adds r2, r2, #4 - cmp r2, #32 - bne FillVectors - // // Set stack based on PCD values. Need to do it this way to make C code work // when it runs from FLASH. diff --git a/ArmEbPkg/Sec/ModuleEntryPoint.asm b/ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.asm similarity index 75% rename from ArmEbPkg/Sec/ModuleEntryPoint.asm rename to ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.asm index e77b5057a8..aa0b98f3e6 100755 --- a/ArmEbPkg/Sec/ModuleEntryPoint.asm +++ b/ArmRealViewEbPkg/Sec/Arm/ModuleEntryPoint.asm @@ -27,33 +27,26 @@ AREA ModuleEntryPoint, CODE, READONLY +StartupAddr DCD CEntryPoint + _ModuleEntryPoint // Turn off remapping NOR to 0. We can now use DRAM in low memory - MmioOr32 (0x10001000 ,BIT8) //EB_SP810_CTRL_BASE + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (0x10001000 ,BIT8) //EB_SP810_CTRL_BASE // Enable NEON register in case folks want to use them for optimizations (CopyMem) mrc p15, 0, r0, c1, c0, 2 - orr r0, r0, #0x00f00000 // Enable VPF access (V* instructions) + orr r0, r0, #0x00f00000 // Enable VFP access (V* instructions) mcr p15, 0, r0, c1, c0, 2 mov r0, #0x40000000 // Set EN bit in FPEXC mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly - // Set CPU vectors to start of DRAM + // Set CPU vectors to 0 (which is currently flash) LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base mcr p15, 0, r0, c12, c0, 0 isb // Sync changes to control registers - // Fill vector table with branchs to current pc (jmp $) - // CPU DXE driver likes known values so it can let GDB stub hook vectors - ldr r1, ShouldNeverGetHere - movs r2, #0 -FillVectors - str r1, [r0, r2] - adds r2, r2, #4 - cmp r2, #32 - bne FillVectors - // // Set stack based on PCD values. Need to do it this way to make C code work // when it runs from FLASH. @@ -62,11 +55,21 @@ FillVectors LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) // stack size arg3 add r4, r2, r3 mov r13, r4 + + LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1 + LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) // memory size arg0 + // move sec startup address into a data register + // ensure we're jumping to FV version of the code (not boot remapped alias) + ldr r4, StartupAddr + + // jump to SEC C code + blx r4 + // Call C entry point - LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1 - LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) // memory size arg0 - blx CEntryPoint + // THIS DOESN'T WORK, WE NEED A LONG JUMP + + // blx CEntryPoint ShouldNeverGetHere // _CEntryPoint should never return diff --git a/ArmEbPkg/Sec/Cache.c b/ArmRealViewEbPkg/Sec/Cache.c old mode 100644 new mode 100755 similarity index 100% rename from ArmEbPkg/Sec/Cache.c rename to ArmRealViewEbPkg/Sec/Cache.c diff --git a/ArmEbPkg/Sec/LzmaDecompress.h b/ArmRealViewEbPkg/Sec/LzmaDecompress.h old mode 100644 new mode 100755 similarity index 100% rename from ArmEbPkg/Sec/LzmaDecompress.h rename to ArmRealViewEbPkg/Sec/LzmaDecompress.h diff --git a/ArmRealViewEbPkg/Sec/ModuleEntryPoint.S b/ArmRealViewEbPkg/Sec/ModuleEntryPoint.S new file mode 100755 index 0000000000..2b5ee8f31a --- /dev/null +++ b/ArmRealViewEbPkg/Sec/ModuleEntryPoint.S @@ -0,0 +1,68 @@ +#------------------------------------------------------------------------------ +# +# ARM EB Entry point. Reset vector in FV header will brach to +# _ModuleEntryPoint. +# +# We use crazy macros, like LoadConstantToReg, since Xcode assembler +# does not support = assembly syntax for ldr. +# +# Copyright (c) 2008 - 2009, Apple Inc. 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 +#include +#include +#include + +.text +.align 3 + +.globl ASM_PFX(CEntryPoint) +.globl ASM_PFX(_ModuleEntryPoint) + +ASM_PFX(_ModuleEntryPoint): + + // Turn off remapping NOR to 0. We can now use DRAM in low memory + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (EB_SP810_CTRL_BASE ,BIT8) + + // Enable NEON register in case folks want to use them for optimizations (CopyMem) + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #0x00f00000 // Enable VPF access (V* instructions) + mcr p15, 0, r0, c1, c0, 2 + mov r0, #0x40000000 // Set EN bit in FPEXC + mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly + + // Set CPU vectors to 0 (which is currently flash) + LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base + mcr p15, 0, r0, c12, c0, 0 + isb // Sync changes to control registers + + // + // Set stack based on PCD values. Need to do it this way to make C code work + // when it runs from FLASH. + // + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) // stack base arg2 + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) // stack size arg3 + add r4, r2, r3 + mov r13, r4 + + // Call C entry point + LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1 + LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) // memory size arg0 + blx ASM_PFX(CEntryPoint) + +ShouldNeverGetHere: + // _CEntryPoint should never return + b ShouldNeverGetHere + + diff --git a/ArmRealViewEbPkg/Sec/ModuleEntryPoint.asm b/ArmRealViewEbPkg/Sec/ModuleEntryPoint.asm new file mode 100755 index 0000000000..aa0b98f3e6 --- /dev/null +++ b/ArmRealViewEbPkg/Sec/ModuleEntryPoint.asm @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2008 - 2009, Apple Inc. 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 +#include +#include +#include +#include + + INCLUDE AsmMacroIoLib.inc + + IMPORT CEntryPoint + EXPORT _ModuleEntryPoint + + PRESERVE8 + AREA ModuleEntryPoint, CODE, READONLY + + +StartupAddr DCD CEntryPoint + +_ModuleEntryPoint + + // Turn off remapping NOR to 0. We can now use DRAM in low memory + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (0x10001000 ,BIT8) //EB_SP810_CTRL_BASE + + // Enable NEON register in case folks want to use them for optimizations (CopyMem) + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #0x00f00000 // Enable VFP access (V* instructions) + mcr p15, 0, r0, c1, c0, 2 + mov r0, #0x40000000 // Set EN bit in FPEXC + mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly + + // Set CPU vectors to 0 (which is currently flash) + LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base + mcr p15, 0, r0, c12, c0, 0 + isb // Sync changes to control registers + + // + // Set stack based on PCD values. Need to do it this way to make C code work + // when it runs from FLASH. + // + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r2) // stack base arg2 + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r3) // stack size arg3 + add r4, r2, r3 + mov r13, r4 + + LoadConstantToReg (FixedPcdGet32(PcdMemorySize) ,r1) // memory size arg1 + LoadConstantToReg (FixedPcdGet32(PcdMemoryBase) ,r0) // memory size arg0 + + // move sec startup address into a data register + // ensure we're jumping to FV version of the code (not boot remapped alias) + ldr r4, StartupAddr + + // jump to SEC C code + blx r4 + + // Call C entry point + // THIS DOESN'T WORK, WE NEED A LONG JUMP + + // blx CEntryPoint + +ShouldNeverGetHere + // _CEntryPoint should never return + b ShouldNeverGetHere + + END + + diff --git a/ArmEbPkg/Sec/Sec.c b/ArmRealViewEbPkg/Sec/Sec.c similarity index 90% rename from ArmEbPkg/Sec/Sec.c rename to ArmRealViewEbPkg/Sec/Sec.c index 8b161ef4c7..360a7b017b 100755 --- a/ArmEbPkg/Sec/Sec.c +++ b/ArmRealViewEbPkg/Sec/Sec.c @@ -109,10 +109,13 @@ CEntryPoint ( { VOID *HobBase; - // Build a basic HOB list - HobBase = (VOID *)(UINTN)(FixedPcdGet32(PcdEmbeddedFdBaseAddress) + FixedPcdGet32(PcdEmbeddedFdSize)); + // HOB list is at bottom of stack area + // Stack grows from top-to-bottom towards HOB list + HobBase = (VOID *)StackBase; CreateHobList (MemoryBase, MemorySize, HobBase, StackBase); + // Turn off remapping NOR to 0. We can will now see DRAM in low memory + MmioOr32 (0x10001000 ,BIT8); //EB_SP810_CTRL_BASE // Enable program flow prediction, if supported. ArmEnableBranchPrediction (); diff --git a/ArmEbPkg/Sec/Sec.inf b/ArmRealViewEbPkg/Sec/Sec.inf similarity index 95% rename from ArmEbPkg/Sec/Sec.inf rename to ArmRealViewEbPkg/Sec/Sec.inf index 6c416729fb..f2ba434427 100755 --- a/ArmEbPkg/Sec/Sec.inf +++ b/ArmRealViewEbPkg/Sec/Sec.inf @@ -15,7 +15,7 @@ [Defines] INF_VERSION = 0x00010005 - BASE_NAME = BeagleBoardSec + BASE_NAME = ArmEBSec FILE_GUID = d959e387-7b91-452c-90e0-a1dbac90ddb8 MODULE_TYPE = SEC VERSION_STRING = 1.0 @@ -35,7 +35,7 @@ EmbeddedPkg/EmbeddedPkg.dec ArmPkg/ArmPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - ArmEbPkg/ArmEbPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec [LibraryClasses] @@ -62,6 +62,7 @@ gEmbeddedTokenSpaceGuid.PcdPrePiStackBase gEmbeddedTokenSpaceGuid.PcdMemoryBase gEmbeddedTokenSpaceGuid.PcdMemorySize + gArmTokenSpaceGuid.PcdCpuVectorBaseAddress diff --git a/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.S b/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.S new file mode 100755 index 0000000000..f87aa58037 --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.S @@ -0,0 +1,79 @@ +#------------------------------------------------------------------------------ +# +# ARM EB Entry point. Reset vector in FV header will brach to +# _ModuleEntryPoint. +# +# We use crazy macros, like LoadConstantToReg, since Xcode assembler +# does not support = assembly syntax for ldr. +# +# Copyright (c) 2008 - 2009, Apple Inc. 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 +#include +#include +#include + +.text +.align 3 + +.globl ASM_PFX(CEntryPoint) +.globl ASM_PFX(_ModuleEntryPoint) +.globl ASM_PFX(StartupAddr) + +ASM_PFX(_ModuleEntryPoint): + + // Turn off remapping NOR to 0. We can now use DRAM in low memory + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (0x10001000 ,BIT8) //EB_SP810_CTRL_BASE + + // Enable NEON register in case folks want to use them for optimizations (CopyMem) + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #0x00f00000 // Enable VFP access (V* instructions) + mcr p15, 0, r0, c1, c0, 2 + mov r0, #0x40000000 // Set EN bit in FPEXC + mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly + + // Set CPU vectors to 0 (which is currently flash) + LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base + mcr p15, 0, r0, c12, c0, 0 + isb // Sync changes to control registers + + // + // Set stack based on PCD values. Need to do it this way to make C code work + // when it runs from FLASH. + // + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r0) // temp ram base arg 0 TODO: change "stackbase" to "temprambase" + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r1) // temp ram size arg 1 + lsr r3, r1, #1 // r4 = size of temp mem / 2 + add r3, r3, r0 // r2 = temp ram base + r4 + mov r13, r3 // result: stack pointer = temp ram base + (size of temp mem / 2) + + // lr points to area in reset vector block containing PEI core address + ldr r2, [lr] // pei core arg 3 + + // move sec startup address into a data register + // ensure we're jumping to FV version of the code (not boot remapped alias) +#ifndef __APPLE__ +// This does not generate a valid relocation for Xcode. Fix me... + ldr r4, ASM_PFX(StartupAddr) + + // jump to SEC C code + blx r4 +#endif + + +ASM_PFX(ShouldNeverGetHere): + // _CEntryPoint should never return + b ASM_PFX(ShouldNeverGetHere) + + diff --git a/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.asm b/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.asm new file mode 100755 index 0000000000..135cb8d207 --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Arm/ModuleEntryPoint.asm @@ -0,0 +1,80 @@ +//------------------------------------------------------------------------------ +// +// Copyright (c) 2008 - 2009, Apple Inc. 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 +#include +#include +#include +#include + + INCLUDE AsmMacroIoLib.inc + + IMPORT CEntryPoint + EXPORT _ModuleEntryPoint + + PRESERVE8 + AREA ModuleEntryPoint, CODE, READONLY + + +StartupAddr DCD CEntryPoint + +_ModuleEntryPoint + + // Turn off remapping NOR to 0. We can now use DRAM in low memory + // CAN'T DO THIS HERE -- BRANCH FROM RESET VECTOR IS RELATIVE AND REMAINS IN REMAPPED NOR + //MmioOr32 (0x10001000 ,BIT8) //EB_SP810_CTRL_BASE + + // Enable NEON register in case folks want to use them for optimizations (CopyMem) + mrc p15, 0, r0, c1, c0, 2 + orr r0, r0, #0x00f00000 // Enable VFP access (V* instructions) + mcr p15, 0, r0, c1, c0, 2 + mov r0, #0x40000000 // Set EN bit in FPEXC + mcr p10,#0x7,r0,c8,c0,#0 // msr FPEXC,r0 in ARM assembly + + // Set CPU vectors to 0 (which is currently flash) + LoadConstantToReg (FixedPcdGet32(PcdCpuVectorBaseAddress) ,r0) // Get vector base + mcr p15, 0, r0, c12, c0, 0 + isb // Sync changes to control registers + + // + // Set stack based on PCD values. Need to do it this way to make C code work + // when it runs from FLASH. + // + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackBase) ,r0) // temp ram base arg 0 TODO: change "stackbase" to "temprambase" + LoadConstantToReg (FixedPcdGet32(PcdPrePiStackSize) ,r1) // temp ram size arg 1 + lsr r3, r1, #1 // r4 = size of temp mem / 2 + add r3, r3, r0 // r2 = temp ram base + r4 + mov r13, r3 // result: stack pointer = temp ram base + (size of temp mem / 2) + + // lr points to area in reset vector block containing PEI core address + ldr r2, [lr] // pei core arg 3 + + // move sec startup address into a data register + // ensure we're jumping to FV version of the code (not boot remapped alias) + ldr r4, StartupAddr + + // jump to SEC C code + blx r4 + + // Call C entry point + // THIS DOESN'T WORK, WE NEED A LONG JUMP + // blx CEntryPoint + +ShouldNeverGetHere + // _CEntryPoint should never return + b ShouldNeverGetHere + + END + + diff --git a/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.S b/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.S new file mode 100755 index 0000000000..b4b62d935a --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.S @@ -0,0 +1,43 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+# Portions copyright (c) 2008 - 2009, Apple Inc. 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. +# +#------------------------------------------------------------------------------ + +.text +.align 3 + +.globl ASM_PFX(SecSwitchStack) + + + +#/** +# This allows the caller to switch the stack and return +# +# @param StackDelta Signed amount by which to modify the stack pointer +# +# @return Nothing. Goes to the Entry Point passing in the new parameters +# +#**/ +#VOID +#EFIAPI +#SecSwitchStack ( +# VOID *StackDelta +# )# +# +ASM_PFX(SecSwitchStack): + mov R1, R13 + add R1, R0, R1 + mov R13, R1 + bx LR + + + diff --git a/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.asm b/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.asm new file mode 100755 index 0000000000..10da81d6ac --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Arm/SwitchStack.asm @@ -0,0 +1,38 @@ +;------------------------------------------------------------------------------ +; +; Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+; Portions copyright (c) 2008 - 2009, Apple Inc. 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. +; +;------------------------------------------------------------------------------ + + EXPORT SecSwitchStack + + AREA Switch_Stack, CODE, READONLY + +;/** +; This allows the caller to switch the stack and return +; +; @param StackDelta Signed amount by which to modify the stack pointer +; +; @return Nothing. Goes to the Entry Point passing in the new parameters +; +;**/ +;VOID +;EFIAPI +;SecSwitchStack ( +; VOID *StackDelta +; ); +; +SecSwitchStack + MOV R1, SP + ADD R1, R0, R1 + MOV SP, R1 + BX LR + END diff --git a/ArmRealViewEbPkg/SecForPei/Sec.c b/ArmRealViewEbPkg/SecForPei/Sec.c new file mode 100755 index 0000000000..fbe5b9a2d0 --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Sec.c @@ -0,0 +1,119 @@ +/** @file + C Entry point for the SEC. First C code after the reset vector. + + Copyright (c) 2008 - 2009, Apple Inc. 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 +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +SecTemporaryRamSupport ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase, + IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, + IN UINTN CopySize + ); + +VOID +SecSwitchStack ( + INTN StackDelta + ); + +TEMPORARY_RAM_SUPPORT_PPI mSecTemporaryRamSupportPpi = {SecTemporaryRamSupport}; + +EFI_PEI_PPI_DESCRIPTOR gSecPpiTable[] = { + { + EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, + &gEfiTemporaryRamSupportPpiGuid, + &mSecTemporaryRamSupportPpi + } +}; + + +VOID +EFIAPI +_ModuleEntryPoint( + VOID + ); + +VOID +CEntryPoint ( + IN UINTN TempRamBase, + IN UINTN TempRamSize, + IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint + ) +{ + EFI_SEC_PEI_HAND_OFF SecCoreData; + + // Turn off remapping NOR to 0. We can will now see DRAM in low memory (although it is not yet initialized) + // note: this makes SEC platform-specific for the EB platform + MmioOr32 (0x10001000 ,BIT8); //EB_SP810_CTRL_BASE + + // + // Bind this information into the SEC hand-off state + // Note: this must be in sync with the stuff in the asm file + // Note also: HOBs (pei temp ram) MUST be above stack + // + SecCoreData.DataSize = sizeof(EFI_SEC_PEI_HAND_OFF); + SecCoreData.BootFirmwareVolumeBase = (VOID *)(UINTN)PcdGet32 (PcdEmbeddedFdBaseAddress); + SecCoreData.BootFirmwareVolumeSize = PcdGet32 (PcdEmbeddedFdSize); + SecCoreData.TemporaryRamBase = (VOID*)(UINTN)TempRamBase; + SecCoreData.TemporaryRamSize = TempRamSize; + SecCoreData.PeiTemporaryRamBase = (VOID *)(UINTN)(SecCoreData.TemporaryRamBase + (SecCoreData.TemporaryRamSize / 2)); + SecCoreData.PeiTemporaryRamSize = SecCoreData.TemporaryRamSize / 2; + SecCoreData.StackBase = (VOID *)(UINTN)(SecCoreData.TemporaryRamBase); + SecCoreData.StackSize = SecCoreData.TemporaryRamSize - SecCoreData.PeiTemporaryRamSize; + + // jump to pei core entry point + (PeiCoreEntryPoint)(&SecCoreData, (VOID *)&gSecPpiTable); +} + +EFI_STATUS +EFIAPI +SecTemporaryRamSupport ( + IN CONST EFI_PEI_SERVICES **PeiServices, + IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase, + IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, + IN UINTN CopySize + ) +{ + // + // Migrate the whole temporary memory to permenent memory. + // + CopyMem ( + (VOID*)(UINTN)PermanentMemoryBase, + (VOID*)(UINTN)TemporaryMemoryBase, + CopySize + ); + + SecSwitchStack((UINTN)(PermanentMemoryBase - TemporaryMemoryBase)); + + // + // We need *not* fix the return address because currently, + // The PeiCore is excuted in flash. + // + + // + // Simulate to invalid temporary memory, terminate temporary memory + // + //ZeroMem ((VOID*)(UINTN)TemporaryMemoryBase, CopySize); + + return EFI_SUCCESS; +} + diff --git a/ArmRealViewEbPkg/SecForPei/Sec.inf b/ArmRealViewEbPkg/SecForPei/Sec.inf new file mode 100755 index 0000000000..e1673f0189 --- /dev/null +++ b/ArmRealViewEbPkg/SecForPei/Sec.inf @@ -0,0 +1,57 @@ + +#/** @file +# SEC - Reset vector code that jumps to C and loads DXE core +# +# Copyright (c) 2008, Apple Inc. 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 = ArmRealViewEbSec + FILE_GUID = d959e387-7b91-452c-90e0-a1dbac90ddb8 + MODULE_TYPE = SEC + VERSION_STRING = 1.0 + + + +[Sources.ARM] + Sec.c + Arm/SwitchStack.asm + Arm/SwitchStack.S + Arm/ModuleEntryPoint.S + Arm/ModuleEntryPoint.asm + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + EmbeddedPkg/EmbeddedPkg.dec + ArmPkg/ArmPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + IoLib + +[Ppis] + gEfiTemporaryRamSupportPpiGuid + +[FeaturePcd] + +[FixedPcd] + gArmTokenSpaceGuid.PcdCpuVectorBaseAddress + gEmbeddedTokenSpaceGuid.PcdPrePiStackSize + gEmbeddedTokenSpaceGuid.PcdPrePiStackBase + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize + gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress + + diff --git a/ArmEbPkg/TimerDxe/Timer.c b/ArmRealViewEbPkg/TimerDxe/Timer.c similarity index 99% rename from ArmEbPkg/TimerDxe/Timer.c rename to ArmRealViewEbPkg/TimerDxe/Timer.c index 12102a3c0b..0a7e054610 100755 --- a/ArmEbPkg/TimerDxe/Timer.c +++ b/ArmRealViewEbPkg/TimerDxe/Timer.c @@ -350,6 +350,8 @@ TimerInitialize ( EFI_HANDLE Handle = NULL; EFI_STATUS Status; + Status = gBS->LocateProtocol(&gHardwareInterruptProtocolGuid, NULL, (VOID **)&gInterrupt); + ASSERT_EFI_ERROR(Status); // configure free running timer (TIMER1) for 1MHz operation diff --git a/ArmEbPkg/TimerDxe/TimerDxe.inf b/ArmRealViewEbPkg/TimerDxe/TimerDxe.inf similarity index 94% rename from ArmEbPkg/TimerDxe/TimerDxe.inf rename to ArmRealViewEbPkg/TimerDxe/TimerDxe.inf index 49ee0377be..3929861ae3 100755 --- a/ArmEbPkg/TimerDxe/TimerDxe.inf +++ b/ArmRealViewEbPkg/TimerDxe/TimerDxe.inf @@ -28,7 +28,7 @@ [Packages] MdePkg/MdePkg.dec EmbeddedPkg/EmbeddedPkg.dec - ArmEbPkg/ArmEbPkg.dec + ArmRealViewEbPkg/ArmRealViewEbPkg.dec [LibraryClasses] BaseLib diff --git a/ArmEbPkg/b.bat b/ArmRealViewEbPkg/b.bat similarity index 69% rename from ArmEbPkg/b.bat rename to ArmRealViewEbPkg/b.bat index adb2505ee2..28aab38d62 100755 --- a/ArmEbPkg/b.bat +++ b/ArmRealViewEbPkg/b.bat @@ -1,50 +1,43 @@ -@REM Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
-@REM This program and the accompanying materials -@REM are licensed and made available under the terms and conditions of the BSD License -@REM which accompanies this distribution. The full text of the license may be found at -@REM http://opensource.org/licenses/bsd-license.php -@REM -@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -@REM - -@REM Example usage of this script. default is a DEBUG build -@REM b -@REM b clean -@REM b release -@REM b release clean -@REM b -v -y build.log - -ECHO OFF -@REM Setup Build environment. Sets WORKSPACE and puts build in path -CALL ..\edksetup.bat - -@REM Set for tools chain. Currently RVCT31 -SET TARGET_TOOLS=RVCT31 -SET TARGET=DEBUG +@REM Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
+@REM This program and the accompanying materials +@REM are licensed and made available under the terms and conditions of the BSD License +@REM which accompanies this distribution. The full text of the license may be found at +@REM http://opensource.org/licenses/bsd-license.php +@REM +@REM THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +@REM + +@REM Example usage of this script. default is a DEBUG build +@REM b +@REM b clean +@REM b release +@REM b release clean +@REM b -v -y build.log + +ECHO OFF +@REM Setup Build environment. Sets WORKSPACE and puts build in path +CALL ..\edksetup.bat + +@REM Set for tools chain. Currently RVCT31 +SET TARGET_TOOLS=RVCT31 +SET TARGET=DEBUG @if /I "%1"=="RELEASE" ( @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it SET TARGET=RELEASE shift /1 ) - -SET BUILD_ROOT=%WORKSPACE%\Build\ArmEb\%TARGET%_%TARGET_TOOLS% - -@REM Build the ARM EB firmware and creat an FD (FLASH Device) Image. -CALL build -p ArmEbPkg\ArmEbPkg.dsc -a ARM -t RVCT31 -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8 -@if ERRORLEVEL 1 goto Exit - + +SET BUILD_ROOT=%WORKSPACE%\Build\ArmRealViewEb\%TARGET%_%TARGET_TOOLS% + +@REM Build the ARM RealView EB firmware and creat an FD (FLASH Device) Image. +CALL build -p ArmRealViewEbPkg\ArmRealViewEbPkg.dsc -a ARM -t RVCT31 -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8 +@if ERRORLEVEL 1 goto Exit + @if /I "%1"=="CLEAN" goto Clean - - -ECHO Patching ..\Debugger_scripts ... -SET DEBUGGER_SCRIPT=Debugger_scripts -@for /f %%a IN ('dir /b %DEBUGGER_SCRIPT%\*.inc %DEBUGGER_SCRIPT%\*.cmm') do ( - @CALL replace %DEBUGGER_SCRIPT%\%%a %BUILD_ROOT%\%%a ZZZZZZ %BUILD_ROOT% WWWWWW %WORKSPACE% -) - -:Exit -EXIT /B - -:Clean + +:Exit +EXIT /B + +:Clean diff --git a/ArmEbPkg/ba.bat b/ArmRealViewEbPkg/ba.bat similarity index 83% rename from ArmEbPkg/ba.bat rename to ArmRealViewEbPkg/ba.bat index cd5eb5076e..545da382bf 100755 --- a/ArmEbPkg/ba.bat +++ b/ArmRealViewEbPkg/ba.bat @@ -22,20 +22,27 @@ CALL ..\edksetup.bat @REM Set for tools chain. Currently ARMGCC SET TARGET_TOOLS=ARMGCC SET TARGET=DEBUG - -@if /I "%1"=="RELEASE" ( - @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it - SET TARGET=RELEASE - shift /1 -) -SET BUILD_ROOT=%WORKSPACE%\Build\ArmEb\%TARGET%_%TARGET_TOOLS% -@REM Build the Beagle Board firmware and creat an FD (FLASH Device) Image. -CALL build -p ArmEbPkg\ArmEbPkg.dsc -a ARM -t %TARGET_TOOLS% -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8 +@if /I "%1"=="RELEASE" ( + + @REM If 1st argument is release set TARGET to RELEASE and shift arguments to remove it + + SET TARGET=RELEASE + + shift /1 + +) + + +SET BUILD_ROOT=%WORKSPACE%\Build\ArmRealViewEb\%TARGET%_%TARGET_TOOLS% + +@REM Build the ARM RealView EB firmware and creat an FD (FLASH Device) Image. +CALL build -p ArmRealViewEbPkg\ArmRealViewEbPkg.dsc -a ARM -t %TARGET_TOOLS% -b %TARGET% %1 %2 %3 %4 %5 %6 %7 %8 @if ERRORLEVEL 1 goto Exit -@if /I "%1"=="CLEAN" goto Clean +@if /I "%1"=="CLEAN" goto Clean + ECHO Patching ..\Debugger_scripts ... SET DEBUGGER_SCRIPT=Debugger_scripts diff --git a/ArmEbPkg/build.sh b/ArmRealViewEbPkg/build.sh similarity index 85% rename from ArmEbPkg/build.sh rename to ArmRealViewEbPkg/build.sh index 485936b396..449ed22fd8 100755 --- a/ArmEbPkg/build.sh +++ b/ArmRealViewEbPkg/build.sh @@ -79,7 +79,7 @@ do fi done -BUILD_ROOT=$WORKSPACE/Build/ArmEb/"$TARGET"_"$TARGET_TOOLS" +BUILD_ROOT=$WORKSPACE/Build/ArmRealViewEb/"$TARGET"_"$TARGET_TOOLS" if [[ ! -e $EDK_TOOLS_PATH/Source/C/bin ]]; then @@ -94,9 +94,9 @@ fi # Build the edk2 ArmEb code # if [[ $TARGET == RELEASE ]]; then - build -p $WORKSPACE/ArmEbPkg/ArmEbPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET -D DEBUG_TARGET=RELEASE $2 $3 $4 $5 $6 $7 $8 + build -p $WORKSPACE/ArmRealViewEbPkg/ArmRealViewEbPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET -D DEBUG_TARGET=RELEASE $2 $3 $4 $5 $6 $7 $8 else - build -p $WORKSPACE/ArmEbPkg/ArmEbPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8 + build -p $WORKSPACE/ArmRealViewEbPkg/ArmRealViewEbPkg.dsc -a ARM -t $TARGET_TOOLS -b $TARGET $1 $2 $3 $4 $5 $6 $7 $8 fi @@ -114,5 +114,5 @@ done echo Creating debugger scripts -process_debug_scripts $WORKSPACE/ArmEbPkg/Debugger_scripts +process_debug_scripts $WORKSPACE/ArmRealViewEbPkg/Debugger_scripts -- 2.39.2