cbfstool/fsp: Rename fsp1_1_relocate
FSP 2.0 uses the same relocate logic as FSP 1.1. Thus, rename fsp1_1_relocate to more generic fsp_component_relocate that can be used by cbfstool to relocate either FSP 1.1 or FSP 2.0 components. Allow FSP1.1 driver to still call fsp1_1_relocate which acts as a wrapper for fsp_component_relocate. Change-Id: I14a6efde4d86a340663422aff5ee82175362d1b0 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/14749 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
This commit is contained in:
@@ -12,7 +12,7 @@ cbfsobj += fit.o
|
||||
cbfsobj += partitioned_file.o
|
||||
# COMMONLIB
|
||||
cbfsobj += cbfs.o
|
||||
cbfsobj += fsp1_1_relocate.o
|
||||
cbfsobj += fsp_relocate.o
|
||||
cbfsobj += lz4_wrapper.o
|
||||
cbfsobj += mem_pool.o
|
||||
cbfsobj += region.o
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "cbfs_sections.h"
|
||||
#include "fit.h"
|
||||
#include "partitioned_file.h"
|
||||
#include <commonlib/fsp1_1.h>
|
||||
#include <commonlib/fsp.h>
|
||||
|
||||
#define SECTION_WITH_FIT_TABLE "BOOTBLOCK"
|
||||
|
||||
@@ -515,12 +515,13 @@ static int cbfstool_convert_fsp(struct buffer *buffer,
|
||||
memcpy(buffer_get(&fsp), buffer_get(buffer), buffer_size(buffer));
|
||||
|
||||
/* Replace the buffer contents w/ the relocated ones on success. */
|
||||
if (fsp1_1_relocate(address, buffer_get(&fsp), buffer_size(&fsp)) > 0) {
|
||||
if (fsp_component_relocate(address, buffer_get(&fsp), buffer_size(&fsp))
|
||||
> 0) {
|
||||
buffer_delete(buffer);
|
||||
buffer_clone(buffer, &fsp);
|
||||
} else {
|
||||
buffer_delete(&fsp);
|
||||
WARN("FSP was not a 1.1 variant.\n");
|
||||
WARN("Invalid FSP variant.\n");
|
||||
}
|
||||
|
||||
/* Let the raw path handle all the cbfs metadata logic. */
|
||||
|
Reference in New Issue
Block a user