diff options
-rw-r--r-- | util/cbfstool/cbfstool.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 0f24af99c9..7b30ce94f7 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -471,6 +471,7 @@ static int cbfstool_convert_fsp(struct buffer *buffer, { uint32_t address; struct buffer fsp; + int do_relocation = 1; address = *offset; @@ -486,14 +487,13 @@ static int cbfstool_convert_fsp(struct buffer *buffer, address = -convert_to_from_absolute_top_aligned( param.image_region, address); } else { - if ((param.baseaddress_assigned == 0) || - (param.baseaddress == 0)) { - ERROR("Invalid baseaddress for non-XIP FSP.\n"); - return 1; + if (param.baseaddress_assigned == 0) { + INFO("Honoring pre-linked FSP module.\n"); + do_relocation = 0; + } else { + address = param.baseaddress; } - 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 @@ -508,6 +508,13 @@ static int cbfstool_convert_fsp(struct buffer *buffer, *offset = 0; } + /* + * Nothing left to do if relocation is not being attempted. Just add + * the file. + */ + if (!do_relocation) + return cbfstool_convert_raw(buffer, offset, header); + /* Create a copy of the buffer to attempt relocation. */ if (buffer_create(&fsp, buffer_size(buffer), "fsp")) return -1; |