summaryrefslogtreecommitdiff
path: root/src/mainboard/ocp/deltalake/ipmi.c
diff options
context:
space:
mode:
authorJohnny Lin <johnny_lin@wiwynn.com>2020-07-20 17:35:31 +0800
committerAngel Pons <th3fanbus@gmail.com>2020-07-22 12:19:53 +0000
commit2b3a500fed1cbe5b04421ac881c2f806e14f5964 (patch)
tree62fbcc565f9442a35b94227b87a41e557f8b878e /src/mainboard/ocp/deltalake/ipmi.c
parent973b2aaa2424757649c32df7084c9eb9d070e539 (diff)
downloadcoreboot-2b3a500fed1cbe5b04421ac881c2f806e14f5964.tar.xz
mb/ocp/deltalake: Set FSP log level and add default values if VPD variables are not found
1. Read VPD variable 'fsp_log_level' to decide FSP log level. 2. Define the default values when the VPD variables cannot be found, put all the values to vpd.h for better documentation and maintenance. Tested=On OCP DeltaLake, the fsp_log_level can be changed from the VPD variable. Change-Id: I44cd59ed0c942c31aaf95ed0c8ac78eb7d661123 Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/43606 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/ocp/deltalake/ipmi.c')
-rw-r--r--src/mainboard/ocp/deltalake/ipmi.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mainboard/ocp/deltalake/ipmi.c b/src/mainboard/ocp/deltalake/ipmi.c
index 19a85d567c..acff3dba4a 100644
--- a/src/mainboard/ocp/deltalake/ipmi.c
+++ b/src/mainboard/ocp/deltalake/ipmi.c
@@ -77,19 +77,18 @@ enum cb_err ipmi_get_slot_id(uint8_t *slot_id)
void init_frb2_wdt(void)
{
-
char val[VPD_LEN];
- /* Enable FRB2 timer by default. */
- u8 enable = 1;
+ u8 enable;
uint16_t countdown;
if (vpd_get_bool(FRB2_TIMER, VPD_RW_THEN_RO, &enable)) {
- if (!enable) {
- printk(BIOS_DEBUG, "Disable FRB2 timer\n");
- ipmi_stop_bmc_wdt(CONFIG_BMC_KCS_BASE);
- return;
- }
+ printk(BIOS_DEBUG, "Got VPD %s value: %d\n", FRB2_TIMER, enable);
+ } else {
+ printk(BIOS_INFO, "Not able to get VPD %s, default set to %d\n", FRB2_TIMER,
+ FRB2_TIMER_DEFAULT);
+ enable = FRB2_TIMER_DEFAULT;
}
+
if (enable) {
if (vpd_gets(FRB2_COUNTDOWN, val, VPD_LEN, VPD_RW_THEN_RO)) {
countdown = (uint16_t)atol(val);
@@ -97,10 +96,13 @@ void init_frb2_wdt(void)
countdown * 100);
} else {
printk(BIOS_DEBUG, "FRB2 timer use default value: %d ms\n",
- DEFAULT_COUNTDOWN * 100);
- countdown = DEFAULT_COUNTDOWN;
+ FRB2_COUNTDOWN_DEFAULT * 100);
+ countdown = FRB2_COUNTDOWN_DEFAULT;
}
ipmi_init_and_start_bmc_wdt(CONFIG_BMC_KCS_BASE, countdown,
TIMEOUT_HARD_RESET);
+ } else {
+ printk(BIOS_DEBUG, "Disable FRB2 timer\n");
+ ipmi_stop_bmc_wdt(CONFIG_BMC_KCS_BASE);
}
}