summaryrefslogtreecommitdiff
path: root/Platform/ARM/Library
AgeCommit message (Collapse)AuthorFilesLines
2026-07-27Platform/ARM: FwsMetadata: fix wrong loop for checking metadataYeoreum Yun1-1/+1
When the number of bank is lesser than the maximum bank number (4), bank state in the metadata for absent banks should be "INVALID" state. However, current loop condition for checking above doing with the nubmer real bank. So the validation loop itself becomes dead code. To check properly, fix this problem. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-07-27Platform/ARM: FwsMetadata: fix missing check for metadata validationYeoreum Yun1-1/+2
For a bank state, FWU_BANK_STATE_INVALID is valid state for partial update and it's one of validate value. Therefore, include FWU_BANK_STATE_INVALID as valid state bank can have. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-02-23Platform/ARM/Library: Introduce FwsGptSystemFipLiblevi.yun2-0/+1625
FwsPlatformLib is platform specific library class used to access the firmware storage. In case of Base FVP, this is implemented with FwsGptSystemFipLib which uses GPT partitions and system fip image. Following is the PSA-FWU GPT-partition layout for the flash as defined by TF-A: +----------------------+ | GPT-HEADER | +----------------------+ | FIP_A (bank0) | +----------------------+ | FIP_B (bank1) | +----------------------+ | FWU-Metadata | +----------------------+ | Bkup-FWU-Metadata | +----------------------+ FwsGptSystemFipLib defines API to access the GPT partitions for updating the images in the banks and to read/update the Metadata. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-02-23Platform/ARM/Library: Introduce FwsMetadata API used in FwsGptSystemFipLiblevi.yun3-0/+2302
Platform Firwmare security firmware Update for the A-profile Arm Architecture defines two versions of firwmare update storage metadata. In real world, Arm only uses firmware update storagae metadata version 2. In light of the above, and to support future versions, introduce a firmware update storage metadata API by defining an operation interface that can be used to select version specific handling. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-02-23Platform/ARM/Library: Introduce Gpt partition access API used in ↵levi.yun2-0/+626
FwsArmVExpressLib This is preparation patch for FwsGptSystemFipLib which uses firmware storage with GPT partitions with system fip image.. Here is brief view how it works: UEFI (Normal world) | StandaloneMm (Secure world) ---------------------------------|-------------------------------------- | +-------+ | ---------| Fws | | | +-------+ +------------------+ | | (Gpt parted) | FmpDevicePkg | | Read /Write Image | +------------------+ | | | | +-------------------+ | SetTheImage and etc | | FwsPlatformLib | | progress via FmpDeviceLib | +-------------------+ | | | | | Parsing Request | Access Fws via | | | FwsPlatformLib | | | | | | -> +---------------------+ PSA ABI (FF-A) +-------------------+ | FmpDevicePsaFwuLib |<------------------> | FwuSmm.c | | (FmpDeviceLib) | PSA Error code +-------------------+ +---------------------+ | The following diagram depicts the GPT partition layout of the FLASH area defined by TF-A. +----------------------+ | GPT-HEADER | +----------------------+ | FIP_A (bank0) | +----------------------+ | FIP_B (bank1) | +----------------------+ | FWU-Metadata | +----------------------+ | Bkup-FWU-Metadata | +----------------------+ each image bank contains 1 image (only fip image). Therefore, define a standard mechanism for accessing these partitions used in FwsGptSystemFipLib which is instance of FwsPlatformLib. Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2026-02-23Platform/ARM/Library: Introduce CapsuleUpdateRuntimePolicyLiblevi.yun3-0/+176
CapsuleUpdatePolicyLib is used to control the CapsuleUpdate process. Normaly, it's enough to use CapsuleUpdatePolicyLibNull if platform updates firmware via the CapsuleUpdate with Coalescing. However, if the platform updates the firmware without coalescing, it would follow one of the approach listed below: 1. fwupdate (using capsule on disk) - ReadyToBoot phase. 2. CapsuleApp (in UEFI Shell) - ReadyToBoot phase. 3. Runtime Capsule Update - Runtime phase. The implementation of IsLockFmpDeviceAtLockEventGuidRequired() in CapsuleUpdatePolicyLibNull, returns TRUE. Which means the FmpDevicePkg Variables (i.e FmpVersionX, FmpLsvX, LastAttemptStatusX, LastAttemptVersionX and etc) are locked to prevent any updates. Therefore, FmpDevicePkg cannot access the Variable after the EndofDxe phase. Arm does not update the firmware using capsule coalescing. It updates the firmware by streaming the update data to StandaloneMm which has an update client that manages the firmware storage device. This means device locking is not required. Therefore, add platform specific library that returns FALSE for IsLockFmpDeviceAtLockEventGuidRequired() so that FmpDevicePkg can access the variable data. This also means FmpDeviceLib does not need to implement the FmpDeviceLock(). Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-13Global: Remove ARM32 SupportOliver Smith-Denny3-45/+1
edk2 is removing support for ARM32, so drop all ARM32 code from edk2-platforms. This does not change code copied from edk2 as-is. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2024-10-24Platform/ARM/ArmShellCmdRunAxf: Fix build with clangSudeep Holla1-0/+1
Clang build fails with the below warning: | Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:216:11: error: variable | 'FileSize' is used uninitialized whenever 'if' condition is false | [-Werror,-Wsometimes-uninitialized]. | if (FileHandle != NULL) { | ^~~~~~~~~~~~~~~~~~ | Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:281:38: note: | uninitialized use occurs here. | WriteBackDataCacheRange (FileData, FileSize); | ^~~~~~~~ | Platform/ARM/Library/ArmShellCmdRunAxf/RunAxf.c:136:39: note: initialize | the variable 'FileSize' to silence this warning | UINTN FileSize; | ^ | = 0 | 4 errors generated. Fix it by initializing the variable. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2024-09-16Replace deprecated EFI_D_* with DEBUG_*Rebecca Cran2-15/+15
Replaced the deprecated EFI_D_{INFO,WARN,ERROR,VERBOSE} usage with DEBUG_{INFO,WARN,ERROR,VERBOSE}. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-09-16Arm/AARCH64 Platforms: Update AsmMacroLib.h IncludesOliver Smith-Denny2-2/+2
edk2 PR https://github.com/tianocore/edk2/pull/6048 moves AsmMacroIoLib.h and AsmMacroIoLibV8.h to MdePkg and renames them to Arm/AsmMacroLib.h and AArch64/AsmMacroLib.h, respectively. This updates all edk2-platforms in one go, as this is a breaking change and no functional change. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-05-29Platform/ARM: Add CadenceQspiNorFlashDeviceLib for NorFlashDxesahil3-0/+1092
In N1Sdp platform, the SoC is connected to IOFPGA which has a Cadence Quad SPI (QSPI) controller. This QSPI controller manages the flash chip device via QSPI bus. This patch adds CadenceQspiNorFlashDeviceLib which is used to manage and access the above configuration. Signed-off-by: sahil <sahil@arm.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-05-29Platform/ARM: Add optional provision to fetch and print NOR Flash infosahil1-0/+18
This patch adds an optional functionality in NorFlashDxe to fetch and print NOR Flash information from NorFlashInfoLib using its JEDEC ID. NOR Flash libraries will implement a function "NorFlashReadID" which will fetch and return JEDEC ID. This JEDEC ID can be then printed along with the NOR Flash info by NorFlashInfoLib. If this functionality is not needed then the function can just return EFI_UNSUPPORTED. Signed-off-by: sahil <sahil@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2024-05-29Platform/ARM: Add P30NorFlashDeviceLib Librarysahil3-0/+1086
This patch implements functions to interact with P30 NOR Flash. The code is taken from Platform/ARM/Drivers/NorFlashDxe/NorFlash.c file. Signed-off-by: sahil <sahil@arm.com> Reviewed-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: levi.yun <yeoreum.yun@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2020-04-06Platform/ARM: Fix uninitialized variable in RunAxfSami Mujawar1-1/+2
RunAxf is a shell command used for running an Axf file. The ShellDynCmdRunAxfHandler() loads an ELF file or one processed by the Flashloader. It calls the appropriate loaders to load the file in memory and to obtain the entry point address. The first argument to RunAxfPivot() is the entry point address for the image to execute. The patch https://github.com/tianocore/edk2-platforms/commit/996047695a06167a918b07b22fcd0fbd0def5da6 changes set/way cache maintenance operations to by-VA operation. This patch however introduced an error: 'variable StartElf is not initialized'. Since, StartElf is the first argument to RunAxfPivot(), which is expected to be the entry point address; RunAxfPivot() would end up branching to an invalid address resulting in a crash. Therefore, initialize StartElf to the entry point address before calling RunAxfPivot(). Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-03-06Platform/ARM/ArmShellCmdRunAxf: switch to by-VA cache maintenanceArd Biesheuvel4-47/+130
Currently, the 'runaxf' shell command that exists only on ARM's own development platforms deals with the caches in an unsafe manner, as it relies on set/way maintenance to ensure that the ELF image it has put into memory, as well as the running image itself is visible in memory after the MMU and caches are disabled. So let's switch to by-VA maintenance for the currently running image, as well as the ELF image, and use a helper in assembly to ensure that we are not relying on the stack between the disabling of the MMU and the invocation of the ELF image. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2019-05-21Platform/ARM: Add NetworkPkg/NetworkPkg.dec as the package dependencyLiming Gao1-0/+1
NetLib will be moved from MdeModulePkg and NetworkPkg. So, the module that consumes NetLib need to depend on NetworkPkg.dec. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-05-18Platform/ARM: Replace BSD License with BSD+Patent LicenseMichael D Kinney16-112/+16
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html NOTE: Files with a BSD 3-Clause license are not modified by this patch series. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-11-26Platform/ARM/BdsLib: maintain alignment for DevicePathsArd Biesheuvel1-4/+8
DevicePath node types may have any size, and so it is up to the code that manipulates them to ensure that dereferencing them only occurs when the pointer is aligned explicitly. Since BdsConnectAndUpdateDevicePath() has only two callers, one of which itself, we can simply duplicate the device path (similar to how DxeCore's CoreConnectController () does it), and free the pool allocation again on the way out. (Note that the allocation only occurs when the non-recursive path is taken and the function returns EFI_SUCCESS) Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Thomas Abraham <thomas.abraham@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-11-26Platform/ARM/BdsLib: drop unused functionsArd Biesheuvel6-734/+13
Clean up BdsLib (which is deprecated and should not be used for future development) by removing all the pieces that are not being used at the moment. After this patch, only BdsLoadImage() remains, and the pieces it relies upon. This function is used by FdtPlatformDxe to load device tree binaries from device paths. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Thomas Abraham <thomas.abraham@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-11-26Platform/ARM: import ARM platform specific BdsLib headerArd Biesheuvel2-2/+1
The BdsLib library has been moved into Platform/ARM a while ago, but the BdsLib.h header was left behind, and so all users in Platform/ARM are still relying on it to be available in ArmPkg. So let's add a copy to Platform/ARM and wire it up, so we can drop it from ArmPkg going forward. Note that the BdsLib implementation included ArmLib.h from ArmPkg without using anything it provides, so drop that false dependency as well. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Thomas Abraham <thomas.abraham@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-12-08Platform/ARM: import BootMonFs and ArmShellCmdRunAxf from EDK2Ard Biesheuvel12-0/+2896
BootMonFs and ArmShellCmdRunAxf are only used on development boards manufactured by ARM itself, so let's keep it under Platform/ARM where it belongs. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2017-11-26Platform/ARM: import BdsLib from ArmPkgArd Biesheuvel6-0/+2294
We are about to migrate the only remaining user of the deprecated ARM BdsLib, i.e., FdtPlatformDxe, into Platform/ARM. So create our own copy of BdsLib, allowing us to finally remove it from upstream EDK2. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>