summaryrefslogtreecommitdiff
path: root/include/bloblist.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/bloblist.h')
-rw-r--r--include/bloblist.h47
1 files changed, 39 insertions, 8 deletions
diff --git a/include/bloblist.h b/include/bloblist.h
index 84fc9438191..7fbdd622bcf 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,
@@ -341,12 +348,13 @@ int bloblist_new(ulong addr, uint size, uint flags, uint align_log2);
* bloblist_check() - Check if a bloblist exists
*
* @addr: Address of bloblist
- * @size: Expected size of blobsize, or 0 to detect the size
+ * @size: Reserved space size for blobsize, or 0 to use the total size
* Return: 0 if OK, -ENOENT if the magic number doesn't match (indicating that
- * there problem is no bloblist at the given address), -EPROTONOSUPPORT
+ * there problem is no bloblist at the given address) or any fields for header
+ * size, used size and total size do not match, -EPROTONOSUPPORT
* if the version does not match, -EIO if the checksum does not match,
- * -EFBIG if the expected size does not match the detected size, -ENOSPC
- * if the size is not large enough to hold the headers
+ * -EFBIG if the reserved space size is small than the total size or total size
+ * is 0
*/
int bloblist_check(ulong addr, uint size);
@@ -418,11 +426,11 @@ const char *bloblist_tag_name(enum bloblist_tag_t tag);
* bloblist_reloc() - Relocate the bloblist and optionally resize it
*
* @to: Pointer to new bloblist location (must not overlap old location)
- * @to_size: New size for bloblist (must be larger than from_size)
- * @from: Pointer to bloblist to relocate
- * @from_size: Size of bloblist to relocate
+ * @to_size: New size for bloblist
+ * Return: 0 if OK, -ENOSPC if the new size is small than the bloblist total
+ * size.
*/
-void bloblist_reloc(void *to, uint to_size, void *from, uint from_size);
+int bloblist_reloc(void *to, uint to_size);
/**
* bloblist_init() - Init the bloblist system with a single bloblist
@@ -461,4 +469,27 @@ 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);
+
+/**
+ * xferlist_from_boot_arg() - Get bloblist from the boot args and relocate it
+ * to the specified address.
+ *
+ * @addr: Address for the bloblist
+ * @size: Size of space reserved for the bloblist
+ * Return: 0 if OK, else on error
+ */
+int xferlist_from_boot_arg(ulong addr, ulong size);
+
#endif /* __BLOBLIST_H */