summaryrefslogtreecommitdiff
path: root/src/mainboard/ocp
diff options
context:
space:
mode:
authorJohnny Lin <johnny_lin@wiwynn.com>2020-07-29 15:58:17 +0800
committerAngel Pons <th3fanbus@gmail.com>2020-07-30 09:11:50 +0000
commit5ea5336b6e7eb305dffb36d243746f5202738e69 (patch)
tree17caddabe2045ec2922be53ee6ef67165f35e829 /src/mainboard/ocp
parentb96d9b6e2fce4594baa045de82e2f7708e35b9ee (diff)
downloadcoreboot-5ea5336b6e7eb305dffb36d243746f5202738e69.tar.xz
mb/ocp/deltalake: Add VPD variable for FRB2 timer action
Tested on OCP Delta Lake, the timer action can be set correctly. Change-Id: I1013169e12455e01214d089c9398c78143af4df8 Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44019 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/ocp')
-rw-r--r--src/mainboard/ocp/deltalake/ipmi.c14
-rw-r--r--src/mainboard/ocp/deltalake/vpd.h5
2 files changed, 16 insertions, 3 deletions
diff --git a/src/mainboard/ocp/deltalake/ipmi.c b/src/mainboard/ocp/deltalake/ipmi.c
index 790038f380..415b26d5d8 100644
--- a/src/mainboard/ocp/deltalake/ipmi.c
+++ b/src/mainboard/ocp/deltalake/ipmi.c
@@ -101,7 +101,7 @@ enum cb_err ipmi_set_post_start(const int port)
void init_frb2_wdt(void)
{
char val[VPD_LEN];
- u8 enable;
+ uint8_t enable, action;
uint16_t countdown;
if (vpd_get_bool(FRB2_TIMER, VPD_RW_THEN_RO, &enable)) {
@@ -122,8 +122,16 @@ void init_frb2_wdt(void)
FRB2_COUNTDOWN_DEFAULT * 100);
countdown = FRB2_COUNTDOWN_DEFAULT;
}
- ipmi_init_and_start_bmc_wdt(CONFIG_BMC_KCS_BASE, countdown,
- TIMEOUT_HARD_RESET);
+
+ if (vpd_gets(FRB2_ACTION, val, VPD_LEN, VPD_RW_THEN_RO)) {
+ action = (uint8_t)atol(val);
+ printk(BIOS_DEBUG, "FRB2 timer action set to: %d\n", action);
+ } else {
+ printk(BIOS_DEBUG, "FRB2 timer action use default value: %d\n",
+ FRB2_ACTION_DEFAULT);
+ action = FRB2_ACTION_DEFAULT;
+ }
+ ipmi_init_and_start_bmc_wdt(CONFIG_BMC_KCS_BASE, countdown, action);
} else {
printk(BIOS_DEBUG, "Disable FRB2 timer\n");
ipmi_stop_bmc_wdt(CONFIG_BMC_KCS_BASE);
diff --git a/src/mainboard/ocp/deltalake/vpd.h b/src/mainboard/ocp/deltalake/vpd.h
index 5466ef7fee..39efd73ea9 100644
--- a/src/mainboard/ocp/deltalake/vpd.h
+++ b/src/mainboard/ocp/deltalake/vpd.h
@@ -15,6 +15,11 @@
/* Default countdown is 15 minutes when the VPD variable is not found */
#define FRB2_COUNTDOWN_DEFAULT 9000
+/* VPD variable for setting FRB2 timer action.
+ 0: No action, 1: hard reset, 2: power down, 3: power cycle */
+#define FRB2_ACTION "frb2_action"
+#define FRB2_ACTION_DEFAULT 0 /* Default no action when the VPD variable is not found */
+
/* 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 */
#define FSP_LOG_DEFAULT 1 /* Default value when the VPD variable is not found */