Attention is currently required from: Andrey Petrov, Patrick Rudolph. Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58984 )
Change subject: drivers/intel/fsp2_0: Allow FSP-M to be relocated ......................................................................
drivers/intel/fsp2_0: Allow FSP-M to be relocated
AMD platforms pass in the base address to cbfs tool: fspm.bin-options: -b $(CONFIG_FSP_M_ADDR)
There is no technical reason not to allow FSP-M to be relocated when !XIP. By allowing this, we no longer need to pass in the base address into cbfstool when adding fspm.bin. This enables passing in the `--alignment` argument to cbfs tool instead. cbfstool currently has a check that prevents both `-b` and `-a` from being passed in.
BUG=b:179699789 TEST=Boot guybrush to OS
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: I797fb319333c53ad0bbf7340924f7d07dfc7de30 --- M src/commonlib/Makefile.inc M src/drivers/intel/fsp2_0/util.c 2 files changed, 3 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/58984/1
diff --git a/src/commonlib/Makefile.inc b/src/commonlib/Makefile.inc index 53975bc..e8845d2 100644 --- a/src/commonlib/Makefile.inc +++ b/src/commonlib/Makefile.inc @@ -22,6 +22,7 @@ postcar-y += region.c
ramstage-$(CONFIG_PLATFORM_USES_FSP1_1) += fsp_relocate.c +romstage-$(CONFIG_PLATFORM_USES_FSP2_0) += fsp_relocate.c ramstage-$(CONFIG_PLATFORM_USES_FSP2_0) += fsp_relocate.c
bootblock-y += cbfs.c diff --git a/src/drivers/intel/fsp2_0/util.c b/src/drivers/intel/fsp2_0/util.c index 1128013..49934fe 100644 --- a/src/drivers/intel/fsp2_0/util.c +++ b/src/drivers/intel/fsp2_0/util.c @@ -163,8 +163,8 @@ if (!dest) return CB_ERR;
- /* Don't allow FSP-M relocation. */ - if (!fspm_env() && fsp_component_relocate((uintptr_t)dest, dest, output_size) < 0) { + /* Don't allow FSP-M relocation when XIP. */ + if (!fspm_xip() && fsp_component_relocate((uintptr_t)dest, dest, output_size) < 0) { printk(BIOS_ERR, "Unable to relocate FSP component!\n"); return CB_ERR; }