bloblist: add API to check the register conventions

Add bloblist_check_reg_conv() to check whether the bloblist is compliant
to the register conventions defined in Firmware Handoff specification.
This API can be used for all Arm platforms.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
This commit is contained in:
Raymond Mao
2024-02-03 08:36:20 -08:00
committed by Tom Rini
parent 819abd0a1e
commit 1c4751fd1a
2 changed files with 31 additions and 0 deletions

View File

@@ -542,3 +542,14 @@ int bloblist_maybe_init(void)
return 0;
}
int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig)
{
if (rzero || rsig != (BLOBLIST_MAGIC | BLOBLIST_REGCONV_VER) ||
rfdt != (ulong)bloblist_find(BLOBLISTT_CONTROL_FDT, 0)) {
gd->bloblist = NULL; /* Reset the gd bloblist pointer */
return -EIO;
}
return 0;
}