MdeModulePkg: Add helper to check if FF-A is supported

Added ArmFfaLibIsFfaSupported to ArmFfaCommon to allow for
queries of FF-A support outside of ArmFfaCommonInit.

Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
This commit is contained in:
rdiaz
2026-02-13 11:55:46 +00:00
committed by mergify[bot]
parent 7baa358e2c
commit 16d9ba7275
2 changed files with 57 additions and 0 deletions
@@ -1172,3 +1172,48 @@ GetRxTxBufferMinSizeAndAlign (
return EFI_SUCCESS;
}
/**
Determine if FF-A is supported
@retval TRUE if FF-A is supported, FALSE otherwise.
**/
BOOLEAN
EFIAPI
ArmFfaLibIsFfaSupported (
IN VOID
)
{
EFI_STATUS Status;
UINT16 CurrentMajorVersion;
UINT16 CurrentMinorVersion;
Status = ArmFfaLibGetVersion (
ARM_FFA_MAJOR_VERSION,
ARM_FFA_MINOR_VERSION,
&CurrentMajorVersion,
&CurrentMinorVersion
);
if (EFI_ERROR (Status)) {
return FALSE;
}
if ((ARM_FFA_MAJOR_VERSION != CurrentMajorVersion) ||
(ARM_FFA_MINOR_VERSION > CurrentMinorVersion))
{
DEBUG ((
DEBUG_INFO,
"Incompatible FF-A Versions.\n" \
"Request Version: Major=0x%x, Minor=0x%x.\n" \
"Current Version: Major=0x%x, Minor>=0x%x.\n",
ARM_FFA_MAJOR_VERSION,
ARM_FFA_MINOR_VERSION,
CurrentMajorVersion,
CurrentMinorVersion
));
return FALSE;
}
return TRUE;
}
@@ -86,4 +86,16 @@ GetRxTxBufferMinSizeAndAlign (
OUT UINTN *MinSizeAndAlign
);
/**
Determine if FF-A is supported
@retval TRUE if FF-A is supported, FALSE otherwise.
**/
BOOLEAN
EFIAPI
ArmFfaLibIsFfaSupported (
IN VOID
);
#endif