1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

cbfs: Add functions to support multiple CBFSs

Sometimes an image has multiple CBFS. The current CBFS API is limited to
handling only one at time. Also it keeps track of the CBFS internally in
BSS, which does not work before relocation, for example.

Add a few new functions to overcome these limitations.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
Simon Glass
2019-08-14 19:56:14 -06:00
committed by Bin Meng
parent c7f1693474
commit 630b2f39dd
2 changed files with 68 additions and 0 deletions

View File

@@ -135,6 +135,28 @@ void file_cbfs_get_next(const struct cbfs_cachenode **file);
*/
const struct cbfs_cachenode *file_cbfs_find(const char *name);
struct cbfs_priv *priv;
/**
* cbfs_find_file() - Find a file in a given CBFS
*
* @cbfs: CBFS to look in (use cbfs_init_mem() to set it up)
* @name: Filename to look for
* @return pointer to CBFS node if found, else NULL
*/
const struct cbfs_cachenode *cbfs_find_file(struct cbfs_priv *cbfs,
const char *name);
/**
* cbfs_init_mem() - Set up a new CBFS
*
* @base: Base address of CBFS
* @size: Size of CBFS in bytes
* @cbfsp: Returns a pointer to CBFS on success
* @return 0 if OK, -ve on error
*/
int cbfs_init_mem(ulong base, ulong size, struct cbfs_priv **privp);
/***************************************************************************/
/* All of the functions below can be used without first initializing CBFS. */