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>
This commit is contained in:
Furquan Shaikh 2020-06-09 21:20:27 -07:00
parent 00a8ed8fcd
commit c3bb6923bd
1 changed files with 10 additions and 13 deletions

View File

@ -642,20 +642,17 @@ static int cbfstool_convert_fsp(struct buffer *buffer,
do_relocation = 0; do_relocation = 0;
} else { } else {
address = param.baseaddress; address = param.baseaddress;
} /*
* *offset should either be 0 or the value returned by
/* * do_cbfs_locate. do_cbfs_locate is called only when param.baseaddress
* *offset should either be 0 or the value returned by * is not provided by user. Thus, set *offset to 0 if user provides
* do_cbfs_locate. do_cbfs_locate should not ever return a value * a baseaddress i.e. params.baseaddress_assigned is set. The only
* that is TOP_ALIGNED_ADDRESS. Thus, if *offset contains a top * requirement in this case is that the binary should be relocated to
* aligned address, set it to 0. * the base address that is requested. There is no requirement on where
* * the file ends up in the cbfs.
* 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 = 0; *offset = 0;
}
} }
/* /*