drivers/intel/fsp2_0: Handle FspNotify calls

Other SOC platforms need to handle the FspNotify calls in the same way
as Apollo Lake.  Migrate the FspNotify calls into the FSP 2.0 driver.
Provide a platform callback to handle anything else that needs to be
done after the FspNotify call.

Display the MTRRs before the first call to fsp_notify.

TEST=Build and run on Galileo Gen2

Change-Id: I1ff327d77516d4ea212740c16c2514c2908758a2
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-on: https://review.coreboot.org/15855
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Lee Leahy
2016-08-01 13:55:02 -07:00
parent 9671faa497
commit 806fa2463f
3 changed files with 37 additions and 20 deletions

View File

@@ -62,12 +62,14 @@ enum fsp_notify_phase {
/* Main FSP stages */ /* Main FSP stages */
void fsp_memory_init(bool s3wake); void fsp_memory_init(bool s3wake);
void fsp_silicon_init(void); void fsp_silicon_init(void);
void fsp_notify(enum fsp_notify_phase phase);
/* Callbacks for updating stage-specific parameters */ /* Callbacks for updating stage-specific parameters */
void platform_fsp_memory_init_params_cb(struct FSPM_UPD *mupd); void platform_fsp_memory_init_params_cb(struct FSPM_UPD *mupd);
void platform_fsp_silicon_init_params_cb(struct FSPS_UPD *supd); void platform_fsp_silicon_init_params_cb(struct FSPS_UPD *supd);
/* Callback after processing FSP notify */
void platform_fsp_notify_status(enum fsp_notify_phase phase);
/* /*
* # DOCUMENTATION: * # DOCUMENTATION:
* *

View File

@@ -11,13 +11,15 @@
*/ */
#include <arch/cpu.h> #include <arch/cpu.h>
#include <bootstate.h>
#include <console/console.h> #include <console/console.h>
#include <fsp/api.h> #include <fsp/api.h>
#include <fsp/util.h> #include <fsp/util.h>
#include <soc/intel/common/util.h>
#include <string.h> #include <string.h>
#include <timestamp.h> #include <timestamp.h>
void fsp_notify(enum fsp_notify_phase phase) static void fsp_notify(enum fsp_notify_phase phase)
{ {
enum fsp_status ret; enum fsp_status ret;
fsp_notify_fn fspnotify; fsp_notify_fn fspnotify;
@@ -55,4 +57,32 @@ void fsp_notify(enum fsp_notify_phase phase)
printk(BIOS_SPEW, "FspNotify returned 0x%08x\n", ret); printk(BIOS_SPEW, "FspNotify returned 0x%08x\n", ret);
die("FspNotify returned an error!\n"); die("FspNotify returned an error!\n");
} }
/* Allow the platform to run something after FspNotify */
platform_fsp_notify_status(phase);
}
static void fsp_notify_dummy(void *arg)
{
enum fsp_notify_phase phase = (uint32_t)arg;
/* Display the MTRRs */
if (IS_ENABLED(CONFIG_DISPLAY_MTRRS))
soc_display_mtrrs();
fsp_notify(phase);
if (phase == READY_TO_BOOT)
fsp_notify(END_OF_FIRMWARE);
}
BOOT_STATE_INIT_ENTRY(BS_DEV_RESOURCES, BS_ON_EXIT, fsp_notify_dummy,
(void *) AFTER_PCI_ENUM);
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, fsp_notify_dummy,
(void *) READY_TO_BOOT);
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, fsp_notify_dummy,
(void *) READY_TO_BOOT);
__attribute__((weak)) void platform_fsp_notify_status(
enum fsp_notify_phase phase)
{
} }

View File

@@ -406,28 +406,13 @@ struct chip_operations soc_intel_apollolake_ops = {
.final = &soc_final .final = &soc_final
}; };
static void fsp_notify_dummy(void *arg) void platform_fsp_notify_status(enum fsp_notify_phase phase)
{ {
/* Hide the P2SB device to align with previous behavior. */
enum fsp_notify_phase ph = (enum fsp_notify_phase) arg; if (phase == END_OF_FIRMWARE)
fsp_notify(ph);
/* Call END_OF_FIRMWARE Notify after READY_TO_BOOT Notify */
if (ph == READY_TO_BOOT) {
fsp_notify_dummy((void *)END_OF_FIRMWARE);
/* Hide the P2SB device to align with previous behavior. */
p2sb_hide(); p2sb_hide();
}
} }
BOOT_STATE_INIT_ENTRY(BS_DEV_RESOURCES, BS_ON_EXIT, fsp_notify_dummy,
(void *) AFTER_PCI_ENUM);
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, fsp_notify_dummy,
(void *) READY_TO_BOOT);
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, fsp_notify_dummy,
(void *) READY_TO_BOOT);
/* /*
* spi_init() needs to run unconditionally on every boot (including resume) to * spi_init() needs to run unconditionally on every boot (including resume) to
* allow write protect to be disabled for eventlog and nvram updates. This needs * allow write protect to be disabled for eventlog and nvram updates. This needs