diff options
author | Simon Glass <sjg@chromium.org> | 2021-03-15 18:00:12 +1300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-03-27 13:59:37 +1300 |
commit | 5536f1285fd2f9ec3e177d6e74b7eb73c6821c8b (patch) | |
tree | ce5ac8f37aa0a0809b36db86604ac4d4d30f06ba /include/cbfs.h | |
parent | 272e62cb83f01acf7ae89449eaa9f020e76bff23 (diff) | |
download | u-boot-5536f1285fd2f9ec3e177d6e74b7eb73c6821c8b.tar.gz |
cbfs: Allow access to CBFS without a header
In some cases CBFS does not start with a header but is just a collection
of files. It is possible to support this so long as the size of the CBFS
is provided.
Update the cbfs_init_mem() function to support this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/cbfs.h')
-rw-r--r-- | include/cbfs.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/cbfs.h b/include/cbfs.h index d98afea6480..05770e2c7ec 100644 --- a/include/cbfs.h +++ b/include/cbfs.h @@ -42,6 +42,8 @@ enum cbfs_filetype { enum { CBFS_HEADER_MAGIC = 0x4f524243, + CBFS_SIZE_UNKNOWN = 0xffffffff, + CBFS_ALIGN_SIZE = 0x40, }; /** @@ -186,11 +188,13 @@ const struct cbfs_cachenode *cbfs_find_file(struct cbfs_priv *cbfs, * cbfs_init_mem() - Set up a new CBFS * * @base: Base address of CBFS + * @size: Size of CBFS if known, else CBFS_SIZE_UNKNOWN + * @require_header: true to read a header at the start, false to not require one * @cbfsp: Returns a pointer to CBFS on success * @return 0 if OK, -ve on error */ -int cbfs_init_mem(ulong base, struct cbfs_priv **privp); - +int cbfs_init_mem(ulong base, ulong size, bool require_hdr, + struct cbfs_priv **privp); /***************************************************************************/ /* All of the functions below can be used without first initializing CBFS. */ |