From 1c4751fd1ac7bda72ab72ce352dc9b2131df2807 Mon Sep 17 00:00:00 2001 From: Raymond Mao Date: Sat, 3 Feb 2024 08:36:20 -0800 Subject: 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 --- include/bloblist.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/bloblist.h') diff --git a/include/bloblist.h b/include/bloblist.h index 84fc9438191..f7e800f6812 100644 --- a/include/bloblist.h +++ b/include/bloblist.h @@ -78,6 +78,13 @@ enum { BLOBLIST_VERSION = 1, BLOBLIST_MAGIC = 0x4a0fb10b, + /* + * FIXME: + * Register convention version should be placed into a higher byte + * https://github.com/FirmwareHandoff/firmware_handoff/issues/32 + */ + BLOBLIST_REGCONV_VER = 1 << 24, + BLOBLIST_BLOB_ALIGN_LOG2 = 3, BLOBLIST_BLOB_ALIGN = 1 << BLOBLIST_BLOB_ALIGN_LOG2, @@ -461,4 +468,17 @@ static inline int bloblist_maybe_init(void) } #endif /* BLOBLIST */ +/** + * bloblist_check_reg_conv() - Check whether the bloblist is compliant to + * the register conventions according to the + * Firmware Handoff spec. + * + * @rfdt: Register that holds the FDT base address. + * @rzero: Register that must be zero. + * @rsig: Register that holds signature and register conventions version. + * Return: 0 if OK, -EIO if the bloblist is not compliant to the register + * conventions. + */ +int bloblist_check_reg_conv(ulong rfdt, ulong rzero, ulong rsig); + #endif /* __BLOBLIST_H */ -- cgit v1.2.3