summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/cbfs.h11
-rw-r--r--src/lib/cbfs.c4
-rw-r--r--src/mainboard/google/gru/sdram_configs.c4
3 files changed, 10 insertions, 9 deletions
diff --git a/src/include/cbfs.h b/src/include/cbfs.h
index 1dac504242..85e25b3d9b 100644
--- a/src/include/cbfs.h
+++ b/src/include/cbfs.h
@@ -37,11 +37,12 @@ void *cbfs_boot_map_with_leak(const char *name, uint32_t type, size_t *size);
/* Locate file in a specific region of fmap. Return 0 on success. < 0 on error*/
int cbfs_locate_file_in_region(struct cbfsf *fh, const char *region_name,
const char *name, uint32_t *type);
-/* Load a struct file from CBFS into a buffer. Returns amount of loaded
- * bytes on success or 0 on error. File will get decompressed as necessary.
- * Same decompression requirements as cbfs_load_and_decompress(). */
-size_t cbfs_boot_load_struct(const char *name, void *buf, size_t buf_size);
-
+/* Load an arbitrary type file from CBFS into a buffer. Returns amount of
+ * loaded bytes on success or 0 on error. File will get decompressed as
+ * necessary. Same decompression requirements as
+ * cbfs_load_and_decompress(). */
+size_t cbfs_boot_load_file(const char *name, void *buf, size_t buf_size,
+ uint32_t type);
/* Load |in_size| bytes from |rdev| at |offset| to the |buffer_size| bytes
* large |buffer|, decompressing it according to |compression| in the process.
* Returns the decompressed file size, or 0 on error.
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 596abc5ad2..9e81bd3a3a 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -182,12 +182,12 @@ void *cbfs_boot_load_stage_by_name(const char *name)
return prog_entry(&stage);
}
-size_t cbfs_boot_load_struct(const char *name, void *buf, size_t buf_size)
+size_t cbfs_boot_load_file(const char *name, void *buf, size_t buf_size,
+ uint32_t type)
{
struct cbfsf fh;
uint32_t compression_algo;
size_t decompressed_size;
- uint32_t type = CBFS_TYPE_STRUCT;
if (cbfs_boot_locate(&fh, name, &type) < 0)
return 0;
diff --git a/src/mainboard/google/gru/sdram_configs.c b/src/mainboard/google/gru/sdram_configs.c
index ac5c427027..2091c36b7a 100644
--- a/src/mainboard/google/gru/sdram_configs.c
+++ b/src/mainboard/google/gru/sdram_configs.c
@@ -67,8 +67,8 @@ const struct rk3399_sdram_params *get_sdram_config()
if (ramcode >= ARRAY_SIZE(sdram_configs) ||
!snprintf(config_file, sizeof(config_file), "%s-%d",
sdram_configs[ramcode], get_sdram_target_mhz()) ||
- (cbfs_boot_load_struct(config_file, &params,
- sizeof(params)) != sizeof(params)))
+ (cbfs_boot_load_file(config_file, &params, sizeof(params),
+ CBFS_TYPE_STRUCT) != sizeof(params)))
die("Cannot load SDRAM parameter file!");
return &params;