diff options
author | Aaron Durbin <adurbin@chromium.org> | 2015-08-05 10:17:33 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2015-08-14 15:18:13 +0200 |
commit | 22ea0078917415aa179f868b94b7f91fd533b369 (patch) | |
tree | 1b127e98bf685351c62e1a21d5d4fe81aaba43e9 /src/drivers/intel/fsp1_1/fsp_util.h | |
parent | 54546c97c780f86a050021d38109aa6c681bfd15 (diff) |
fsp1_1: fsp_relocate: use struct region_device and struct prog
Using struct prog and struct region_device allows for the
caller to be none-the-wiser about where FSP gets placed. It
also allows for the source location to be abstracted away
such that it doesn't require a large mapping up front to
do the relocation. Lastly, it allows for simplifying the
intel/commmon FSP support in that it can pass around a
struct prog.
BUG=chrome-os-partner:43636
BRANCH=None
TEST=Built, booted, suspended, and resumed on glados.
Original-Change-Id: I034b04ab2b7e9e01f5ee14fcc190f04b90517d30
Original-Signed-off-by: Aaron Durbin <adurbin@chroumium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/290830
Original-Tested-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Leroy P Leahy <leroy.p.leahy@intel.com>
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Original-Commit-Queue: Aaron Durbin <adurbin@chromium.org>
Change-Id: Ibe1f206a9541902103551afaf212418fcc90e73c
Signed-off-by: Aaron Durbin <adurbin@chroumium.org>
Reviewed-on: http://review.coreboot.org/11193
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/drivers/intel/fsp1_1/fsp_util.h')
-rw-r--r-- | src/drivers/intel/fsp1_1/fsp_util.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/drivers/intel/fsp1_1/fsp_util.h b/src/drivers/intel/fsp1_1/fsp_util.h index 618317ba69..fba91165a1 100644 --- a/src/drivers/intel/fsp1_1/fsp_util.h +++ b/src/drivers/intel/fsp1_1/fsp_util.h @@ -24,6 +24,8 @@ #include <types.h> #include <arch/cpu.h> #include <fsp_gop.h> +#include <program_loading.h> +#include <region.h> /* * The following are functions with prototypes defined in the EDK2 headers. The @@ -63,10 +65,11 @@ void *get_next_type_guid_hob(UINT16 type, const EFI_GUID *guid, void *get_next_resource_hob(const EFI_GUID *guid, const void *hob_start); void *get_first_resource_hob(const EFI_GUID *guid); /* - * Relocate FSP entire binary into ram. Returns NULL on error. Otherwise the - * FSP_INFO_HEADER pointer to the relocated FSP. + * Relocate FSP entire binary into ram. Returns < 0 on error, 0 on success. + * The FSP source is pointed to by region_device and the relocation information + * is encoded in a struct prog with its entry point set to the FSP info header. */ -FSP_INFO_HEADER *fsp_relocate(void *fsp_src, size_t size); +int fsp_relocate(struct prog *fsp_relocd, const struct region_device *fsp_src); /* Additional HOB types not included in the FSP: * #define EFI_HOB_TYPE_HANDOFF 0x0001 |