summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch')
-rw-r--r--meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch53
1 files changed, 40 insertions, 13 deletions
diff --git a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch
index d5ccddf27..d1cb523e5 100644
--- a/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch
+++ b/meta-openbmc-mods/meta-ast2600/recipes-bsp/u-boot/files/0022-Reboot-into-UBOOT-on-Watchdog-Failures.patch
@@ -1,4 +1,4 @@
-From b81b62f2ca4d4e434f2fec090725e99f198f64ef Mon Sep 17 00:00:00 2001
+From 56a1cafcf68c624ca9ea9de6c38080603e80ea0d Mon Sep 17 00:00:00 2001
From: James Feist <james.feist@linux.intel.com>
Date: Wed, 31 Jul 2019 16:01:49 -0700
Subject: [PATCH] Reboot into UBOOT on Watchdog Failures
@@ -13,17 +13,17 @@ uboot after 3 times
Signed-off-by: James Feist <james.feist@linux.intel.com>
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com>
---
- board/aspeed/ast2600_intel/intel.c | 34 ++++++++++++++++++++++++++++++
- 1 file changed, 34 insertions(+)
+ board/aspeed/ast2600_intel/intel.c | 61 ++++++++++++++++++++++++++++++
+ 1 file changed, 61 insertions(+)
diff --git a/board/aspeed/ast2600_intel/intel.c b/board/aspeed/ast2600_intel/intel.c
-index 565893777ffc..2fb84e880e5c 100644
+index a644010dd339..2db162bc9d4c 100644
--- a/board/aspeed/ast2600_intel/intel.c
+++ b/board/aspeed/ast2600_intel/intel.c
-@@ -7,6 +7,28 @@
- #include <asm/io.h>
+@@ -9,6 +9,55 @@
#include <malloc.h>
+ #define SYS_PWR_RESET_FLAG BIT(0) /* from scu_info.c */
+#define WATCHDOG_RESET_BIT BIT(20)
+#define BOOT_FAILURE_LIMIT 3
+
@@ -43,13 +43,40 @@ index 565893777ffc..2fb84e880e5c 100644
+
+int intel_failed_boot(void)
+{
-+ return get_boot_failures() >= BOOT_FAILURE_LIMIT;
-+}
++ struct udevice *dev;
++ int ret;
++
++ ret = get_boot_failures() >= BOOT_FAILURE_LIMIT;
++ if (ret) {
++ /*
++ * Failure Recovery state:
++ * ChassisID - Solid Blue, StatusLED - Blinking Amber at 3Hz
++ */
++ ret = led_get_by_label("green", &dev);
++ if (!ret)
++ led_set_state(dev, LEDST_OFF);
++
++#ifdef CONFIG_LED_BLINK
++ ret = led_get_by_label("amber", &dev);
++ if (!ret) {
++ led_set_period(dev, 160);
++ led_set_state(dev, LEDST_BLINK);
++ }
++#endif
+
++ ret = led_get_by_label("id", &dev);
++ if (!ret)
++ led_set_state(dev, LEDST_ON);
++
++ return 1;
++ }
++
++ return 0;
++}
+
/* use GPIOC0 on intel boards */
#define FFUJ_GPIO "gpio@1e78000016"
-
-@@ -33,6 +55,10 @@ int read_ffuj(void)
+@@ -56,6 +105,10 @@ int read_ffuj(void)
int gpio_abort(void)
{
int value;
@@ -60,7 +87,7 @@ index 565893777ffc..2fb84e880e5c 100644
/* check ffuj to abort the autoboot */
value = read_ffuj();
printf("FFUJ: %d\n", value);
-@@ -407,6 +433,7 @@ int board_late_init(void)
+@@ -460,6 +513,7 @@ int board_late_init(void)
#define REV_ID_AST2600A0 0x05000303 /* AST2600 A0 */
#define ONE_MSEC_IN_USEC 1000
char value[11];
@@ -68,7 +95,7 @@ index 565893777ffc..2fb84e880e5c 100644
if (readl(SCU_BASE | SCU_014) == REV_ID_AST2600A0)
timer_enable(0, ONE_MSEC_IN_USEC, timer_callback, (void *)0);
-@@ -417,6 +444,13 @@ int board_late_init(void)
+@@ -475,6 +529,13 @@ int board_late_init(void)
snprintf(value, sizeof(value), "0x%x", gd->reset_reason);
update_bootargs_cmd("resetreason", value);
@@ -80,7 +107,7 @@ index 565893777ffc..2fb84e880e5c 100644
+ set_boot_failures(0);
+
/* Update the special mode in bootargs */
- if (is_mfg_mode_phy_req())
+ if (gd->reset_reason & SYS_PWR_RESET_FLAG && is_mfg_mode_phy_req())
update_bootargs_cmd("special", "mfg");
--
2.17.1