mb/ocp/deltalake: Use VPD data to configure FSP UPD at romstage

Read VPD variable 'fsp_log_enable' to decide enabling FSP log or not.
With VPD_RW_THEN_RO, VPD_RW takes precedence over VPD_RO, and
would be set to enabled if both places cannot find it.

Tested=On OCP Delta Lake, use vpd to create and set fsp_log_enable
and verified the results are expected.

Change-Id: I0b3463acedd90e8e17f7e4eedc2fab63644f87e1
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42903
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: insomniac <insomniac@slackware.it>
This commit is contained in:
Johnny Lin 2020-06-30 17:36:36 +08:00 committed by Patrick Georgi
parent 0ccb3828bc
commit 145a76182c
2 changed files with 25 additions and 3 deletions

View File

@ -2,11 +2,32 @@
#include <console/console.h> #include <console/console.h>
#include <drivers/ipmi/ipmi_kcs.h> #include <drivers/ipmi/ipmi_kcs.h>
#include <drivers/vpd/vpd.h>
#include <fsp/api.h> #include <fsp/api.h>
#include <FspmUpd.h> #include <FspmUpd.h>
#include <soc/romstage.h> #include <soc/romstage.h>
#include "ipmi.h" #include "ipmi.h"
#include "vpd.h"
/*
* Search from VPD_RW first then VPD_RO for UPD config variables,
* overwrites them from VPD if it's found.
*/
static void mainboard_config_upd(FSPM_UPD *mupd)
{
uint8_t val;
/* Send FSP log message to SOL */
if (vpd_get_bool(FSP_LOG, VPD_RW_THEN_RO, &val))
mupd->FspmConfig.SerialIoUartDebugEnable = val;
else {
printk(BIOS_INFO, "Not able to get VPD %s, default set "
"SerialIoUartDebugEnable to 1\n", FSP_LOG);
mupd->FspmConfig.SerialIoUartDebugEnable = 1;
}
mupd->FspmConfig.SerialIoUartDebugIoBase = 0x2f8;
}
/* Update bifurcation settings according to different Configs */ /* Update bifurcation settings according to different Configs */
static void oem_update_iio(FSPM_UPD *mupd) static void oem_update_iio(FSPM_UPD *mupd)
@ -53,9 +74,6 @@ static void mainboard_config_gpios(FSPM_UPD *mupd)
static void mainboard_config_iio(FSPM_UPD *mupd) static void mainboard_config_iio(FSPM_UPD *mupd)
{ {
/* Send FSP log message to SOL */
mupd->FspmConfig.SerialIoUartDebugEnable = 1;
mupd->FspmConfig.SerialIoUartDebugIoBase = 0x2f8;
oem_update_iio(mupd); oem_update_iio(mupd);
} }
@ -68,4 +86,5 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
mainboard_config_gpios(mupd); mainboard_config_gpios(mupd);
mainboard_config_iio(mupd); mainboard_config_iio(mupd);
mainboard_config_upd(mupd);
} }

View File

@ -11,4 +11,7 @@
/* Default countdown is 15 minutes. */ /* Default countdown is 15 minutes. */
#define DEFAULT_COUNTDOWN 9000 #define DEFAULT_COUNTDOWN 9000
/* Define the VPD keys for UPD variables that can be overwritten */
#define FSP_LOG "fsp_log_enable" /* 1 or 0: enable or disable FSP SOL log */
#endif #endif