summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-02-03 10:13:57 -0800
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-02-03 22:17:07 +0100
commita9ffa9e7f28a77579860a2f46dd0594172853c48 (patch)
tree98f2571d0a2f3d8d08175752d296358a6cc178d6 /src/lib
parent71ea717f726526c2f2b13eb6fc4ab5a85a36d587 (diff)
downloadcoreboot-a9ffa9e7f28a77579860a2f46dd0594172853c48.tar.xz
lib: Support UNCOMPRESSED_RAMSTAGE
Selecting UNCOMPRESSED_RAMSTAGE prevents lzma.c from being compiled for romstage. Adjust the logic in rmodule.c to prevent calls to the ulzma routine when UNCOMPRESSED_RAMSTAGE is selected. TEST=Build and run on Galileo Change-Id: I7409e082baab3c2a086c57ad5aa9844ba788c7cd Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/13591 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/rmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/rmodule.c b/src/lib/rmodule.c
index 84b8734f53..13eb324aa8 100644
--- a/src/lib/rmodule.c
+++ b/src/lib/rmodule.c
@@ -259,6 +259,8 @@ int rmodule_stage_load(struct rmod_stage_load *rsl)
struct cbfs_stage stage;
void *rmod_loc;
struct region_device *fh;
+ const int use_lzma = ENV_RAMSTAGE
+ || (ENV_ROMSTAGE && IS_ENABLED(CONFIG_COMPRESS_RAMSTAGE));
if (rsl->prog == NULL || prog_name(rsl->prog) == NULL)
return -1;
@@ -286,7 +288,7 @@ int rmodule_stage_load(struct rmod_stage_load *rsl)
if (rdev_readat(fh, rmod_loc, sizeof(stage), stage.len) !=
stage.len)
return -1;
- } else if (stage.compression == CBFS_COMPRESS_LZMA) {
+ } else if (use_lzma && (stage.compression == CBFS_COMPRESS_LZMA)) {
size_t fsize;
void *map = rdev_mmap(fh, sizeof(stage), stage.len);