From f86d0351051bddf98ed96a5da044b9779e35e9a1 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 23 Oct 2015 20:25:03 +0200 Subject: libpayload: Allow non-default CBFS media CBFS requests were always fulfilled using the CBFS specified in cbtables. That's a great policy when default requests are sought, but not so great when the user deliberately asked for something else. So check if they want default CBFS media information, otherwise ignore cbtables data. BUG=chromium:445938 BRANCH=none TEST=none Change-Id: I01b63049eebfba6f467808ac84ef77385840c204 Signed-off-by: Patrick Georgi Original-Commit-Id: 621c916ab14c0de4bae3dde09c05060c4f3c63c5 Original-Change-Id: Ia4a8848fd7db9d9a2bf9f5c226566fe3936ff543 Original-Signed-off-by: Patrick Georgi Original-Reviewed-on: https://chromium-review.googlesource.com/308520 Original-Commit-Ready: Patrick Georgi Original-Tested-by: Patrick Georgi Original-Reviewed-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/12232 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/libcbfs/cbfs_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/libcbfs/cbfs_core.c b/payloads/libpayload/libcbfs/cbfs_core.c index ff3c527f46..14a2001855 100644 --- a/payloads/libpayload/libcbfs/cbfs_core.c +++ b/payloads/libpayload/libcbfs/cbfs_core.c @@ -100,7 +100,8 @@ static int get_cbfs_range(uint32_t *offset, uint32_t *cbfs_end, { const struct cbfs_header *header; - if (lib_sysinfo.cbfs_offset && lib_sysinfo.cbfs_size) { + if (media == CBFS_DEFAULT_MEDIA && + lib_sysinfo.cbfs_offset && lib_sysinfo.cbfs_size) { *offset = lib_sysinfo.cbfs_offset; *cbfs_end = *offset + lib_sysinfo.cbfs_size; return 0; -- cgit v1.2.3