summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2020-06-09 21:20:27 -0700
committerFurquan Shaikh <furquan@google.com>2020-06-13 06:49:50 +0000
commitc3bb6923bdcd20f4b343ba373a7d211655d6468a (patch)
tree4211b364e730090ba3d638eef5912886cd3b3787
parent00a8ed8fcd9f3ebab1b06b9e05f9d52d5a938738 (diff)
downloadcoreboot-c3bb6923bdcd20f4b343ba373a7d211655d6468a.tar.xz
util/cbfstool: Drop IS_TOP_ALIGNED_ADDRESS() check in cbfstool_convert_fsp
This change drops the check for IS_TOP_ALIGNED_ADDRESS() before setting offset to 0 in cbfstool_convert_fsp(). If the user provides a baseaddress to relocate the FSP to, then the offset should be set to 0 since there is no requirement on where the file ends up in cbfs. This allows the user to relocate the FSP to an address in lower DRAM. BUG=b:155322763 Signed-off-by: Furquan Shaikh <furquan@google.com> Change-Id: Ibeadbf06881f7659b2ac7d62d2152636c853fb9f Reviewed-on: https://review.coreboot.org/c/coreboot/+/42263 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--util/cbfstool/cbfstool.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 4ec8c904e5..decbd051f6 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -642,20 +642,17 @@ static int cbfstool_convert_fsp(struct buffer *buffer,
do_relocation = 0;
} else {
address = param.baseaddress;
- }
-
- /*
- * *offset should either be 0 or the value returned by
- * do_cbfs_locate. do_cbfs_locate should not ever return a value
- * that is TOP_ALIGNED_ADDRESS. Thus, if *offset contains a top
- * aligned address, set it to 0.
- *
- * The only requirement in this case is that the binary should
- * be relocated to the base address that is requested. There is
- * no requirement on where the file ends up in the cbfs.
- */
- if (IS_TOP_ALIGNED_ADDRESS(*offset))
+ /*
+ * *offset should either be 0 or the value returned by
+ * do_cbfs_locate. do_cbfs_locate is called only when param.baseaddress
+ * is not provided by user. Thus, set *offset to 0 if user provides
+ * a baseaddress i.e. params.baseaddress_assigned is set. The only
+ * requirement in this case is that the binary should be relocated to
+ * the base address that is requested. There is no requirement on where
+ * the file ends up in the cbfs.
+ */
*offset = 0;
+ }
}
/*