summaryrefslogtreecommitdiff
path: root/src/lib/cbfs.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-05-20 12:08:55 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-06-02 14:10:08 +0200
commitac12c66cf91343153ea90a6f33977a13e10b21d0 (patch)
tree2864de25bb12ed2d5c7ec8d691ec753f146c5e57 /src/lib/cbfs.c
parent6a452eff90411176f9f2cad0ca0c665a31c032ee (diff)
assets: abstract away the firmware assets used for booting
As there can be more than one source of firmware assets this patch generalizes the notion of locating a particular asset. struct asset is added along with some helper functions for working on assets as a first class citizen. Change-Id: I2ce575d1e5259aed4c34c3dcfd438abe9db1d7b9 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/10264 Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/lib/cbfs.c')
-rw-r--r--src/lib/cbfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 23dfee70c9..3e83765bf3 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -188,12 +188,10 @@ void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device)
void *cbfs_boot_load_stage_by_name(const char *name)
{
- struct prog stage = {
- .name = name,
- };
+ struct prog stage = PROG_INIT(ASSET_UNKNOWN, name);
uint32_t type = CBFS_TYPE_STAGE;
- if (cbfs_boot_locate(&stage.rdev, name, &type))
+ if (cbfs_boot_locate(&stage.asset.rdev, name, &type))
return NULL;
if (cbfs_prog_stage_load(&stage))
@@ -209,7 +207,7 @@ int cbfs_prog_stage_load(struct prog *pstage)
void *entry;
size_t fsize;
size_t foffset;
- const struct region_device *fh = &pstage->rdev;
+ const struct region_device *fh = &pstage->asset.rdev;
if (rdev_readat(fh, &stage, 0, sizeof(stage)) != sizeof(stage))
return 0;