diff options
author | Raymond Mao | 2024-02-03 08:36:20 -0800 |
---|---|---|
committer | Tom Rini | 2024-02-29 09:24:21 -0500 |
commit | 1c4751fd1ac7bda72ab72ce352dc9b2131df2807 (patch) | |
tree | 0a5ca1167fe606aace81f1407395e8dbf92698aa /common | |
parent | 819abd0a1eaff9a921f5b917e152b85dab302e33 (diff) |
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>
Diffstat (limited to 'common')
-rw-r--r-- | common/bloblist.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/bloblist.c b/common/bloblist.c index 2d373910b6d..980b1ddbcb4 100644 --- a/common/bloblist.c +++ b/common/bloblist.c @@ -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; +} |