summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2015-07-14 17:15:24 +0100
committerPatrick Georgi <pgeorgi@google.com>2015-07-14 22:37:10 +0200
commitf61b35d5b0b25ca766f6d207c4b354407862b973 (patch)
tree6649b9dc23400677e7aca24fce755c0593b92bb1 /payloads/libpayload/libc
parentfb5d5b16eef66d37dc20cdf0769c9049bf47d6be (diff)
downloadcoreboot-f61b35d5b0b25ca766f6d207c4b354407862b973.tar.xz
libpayload: store boot media information in sysinfo
Write boot media information in sysinfo, if it exists. This allows picking the right CBFS for further files in case there are several. Change-Id: I75a8ee6b93f349b9f2fab1e82826aba675949c0a Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10869 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/coreboot.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index 8a5d3ae7f4..3e248e19c3 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -220,6 +220,17 @@ static void cb_parse_spi_flash(void *ptr, struct sysinfo_t *info)
info->spi_flash.erase_cmd = flash->erase_cmd;
}
+static void cb_parse_boot_media_params(unsigned char *ptr,
+ struct sysinfo_t *info)
+{
+ struct cb_boot_media_params *const bmp =
+ (struct cb_boot_media_params *)ptr;
+ info->fmap_offset = bmp->fmap_offset;
+ info->cbfs_offset = bmp->cbfs_offset;
+ info->cbfs_size = bmp->cbfs_size;
+ info->boot_media_size = bmp->boot_media_size;
+}
+
int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
{
struct cb_header *header;
@@ -372,6 +383,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_MTC:
cb_parse_mtc(ptr, info);
break;
+ case CB_TAG_BOOT_MEDIA_PARAMS:
+ cb_parse_boot_media_params(ptr, info);
+ break;
default:
cb_parse_arch_specific(rec, info);
break;