From 5926ae24a6fa4ebf83f24281c3df88b61076b838 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Mon, 4 Mar 2019 15:14:29 +0100 Subject: drivers/intel/fsp1_0: Deduplicate code Move ChipsetFspReturnPoint() to drivers/intel/fsp1_0. Allows to have a common entry after FSP-M. Change-Id: I064ae67041c521ee92877cff30c814fce7b08e1f Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/31713 Tested-by: build bot (Jenkins) Reviewed-by: Werner Zeh Reviewed-by: David Guckian Reviewed-by: Paul Menzel Reviewed-by: Jay Talbott --- src/drivers/intel/fsp1_0/fsp_util.c | 12 ++++++++++++ src/drivers/intel/fsp1_0/fsp_util.h | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/drivers') diff --git a/src/drivers/intel/fsp1_0/fsp_util.c b/src/drivers/intel/fsp1_0/fsp_util.c index 2da07d519b..4e50abae4e 100644 --- a/src/drivers/intel/fsp1_0/fsp_util.c +++ b/src/drivers/intel/fsp1_0/fsp_util.c @@ -23,6 +23,7 @@ #include #include #include +#include #ifndef __PRE_RAM__ /* Globals pointers for FSP structures */ @@ -63,6 +64,17 @@ void FspNotify (u32 Phase) #ifdef __PRE_RAM__ +/* The FSP returns here after the fsp_early_init call */ +static void ChipsetFspReturnPoint(EFI_STATUS Status, VOID *HobListPtr) +{ + *(void **)CBMEM_FSP_HOB_PTR = HobListPtr; + + if (Status == 0xFFFFFFFF) + system_reset(); + + romstage_main_continue(Status, HobListPtr); +} + /* * Call the FSP to do memory init. The FSP doesn't return to this function. * The FSP returns to the romstage_main_continue(). diff --git a/src/drivers/intel/fsp1_0/fsp_util.h b/src/drivers/intel/fsp1_0/fsp_util.h index f781329d21..e0da19e8ac 100644 --- a/src/drivers/intel/fsp1_0/fsp_util.h +++ b/src/drivers/intel/fsp1_0/fsp_util.h @@ -32,10 +32,12 @@ void romstage_fsp_rt_buffer_callback(FSP_INIT_RT_BUFFER *FspRtBuffer); void print_fsp_info(void); void chipset_fsp_early_init(FSP_INIT_PARAMS *FspInitParams, FSP_INFO_HEADER *fsp_ptr); -void ChipsetFspReturnPoint(EFI_STATUS Status, VOID *HobListPtr); void *find_saved_temp_mem(void *hob_list_ptr); void *find_fsp_reserved_mem(void *hob_list_ptr); +/* function in romstage.c */ +void romstage_main_continue(EFI_STATUS status, void *hob_list_ptr); + /* functions in hob.c */ void print_hob_mem_attributes(void *Hobptr); void print_hob_type_structure(u16 Hobtype, void *Hoblistptr); -- cgit v1.2.3