diff options
author | Johnny Lin <johnny_lin@wiwynn.com> | 2020-01-14 09:17:18 +0800 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2020-07-29 08:39:29 +0000 |
commit | dcc2eb9a935e6db83472f503815460d0fd159b52 (patch) | |
tree | e20152ee536ac0ce83fcd11b90cf888cbf7e7a28 /src/mainboard/ocp/tiogapass/ipmi.c | |
parent | a9d3e652f79ba0b2036ebf8f09187adccaf5e4b3 (diff) | |
download | coreboot-dcc2eb9a935e6db83472f503815460d0fd159b52.tar.xz |
mb/ocp/tiogapass: Configure IPMI FRB2 watchdog timer via VPD variables
Add VPD variables for enabling/disabling FRB2 watchdog timer and setting
the timer countdown value in romstage. By default it would start the timer
and trigger hard reset when it's expired. The timer is expected to be
stopped later by payload or OS.
Add RO_VPD and RW_VPD sections.
Tested on OCP Tioga Pass.
Change-Id: I53b69c3c5d22c022130fd812ef26097898d913d0
Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39690
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/ocp/tiogapass/ipmi.c')
-rw-r--r-- | src/mainboard/ocp/tiogapass/ipmi.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mainboard/ocp/tiogapass/ipmi.c b/src/mainboard/ocp/tiogapass/ipmi.c index aa50688db5..0cdf110bd8 100644 --- a/src/mainboard/ocp/tiogapass/ipmi.c +++ b/src/mainboard/ocp/tiogapass/ipmi.c @@ -2,8 +2,12 @@ #include <console/console.h> #include <drivers/ipmi/ipmi_kcs.h> +#include <drivers/ipmi/ipmi_ops.h> +#include <drivers/vpd/vpd.h> +#include <string.h> #include "ipmi.h" +#include "vpd.h" void ipmi_set_ppin(struct ppin_req *req) { @@ -21,3 +25,32 @@ void ipmi_set_ppin(struct ppin_req *req) } printk(BIOS_DEBUG, "IPMI Set PPIN to BMC done.\n"); } + +void init_frb2_wdt(void) +{ + char val[VPD_LEN]; + /* Enable FRB2 timer by default. */ + u8 enable = 1; + 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; + } + } + if (enable) { + if (vpd_gets(FRB2_COUNTDOWN, val, VPD_LEN, VPD_RW_THEN_RO)) { + countdown = (uint16_t)atol(val); + printk(BIOS_DEBUG, "FRB2 timer countdown set to: %d ms\n", + countdown * 100); + } else { + printk(BIOS_DEBUG, "FRB2 timer use default value: %d ms\n", + DEFAULT_COUNTDOWN * 100); + countdown = DEFAULT_COUNTDOWN; + } + ipmi_init_and_start_bmc_wdt(CONFIG_BMC_KCS_BASE, countdown, + TIMEOUT_HARD_RESET); + } +} |