[PATCH u-boot v2016.07-aspeed-openbmc] Add WD2 reset support for ast-g5

Mykola Kostenok c_mykolak at mellanox.com
Thu May 25 01:28:20 AEST 2017


Add support for WATCHDOG_RESET macro for aspeed g5 boards

Signed-off-by: Mykola Kostenok <c_mykolak at mellanox.com>
---
 board/aspeed/ast-g5/ast-g5.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/board/aspeed/ast-g5/ast-g5.c b/board/aspeed/ast-g5/ast-g5.c
index da79d7b79a..412b632a41 100644
--- a/board/aspeed/ast-g5/ast-g5.c
+++ b/board/aspeed/ast-g5/ast-g5.c
@@ -46,3 +46,17 @@ int board_eth_init(bd_t *bd)
         return aspeednic_initialize(bd);
 }
 #endif
+
+/*Called by macro WATCHDOG_RESET*/
+#if defined(CONFIG_HW_WATCHDOG)
+
+#define AST_WDT2_RESTART_REG 0x28 /*WDT2 Counter Restart Register*/
+#define AST_WDT2_RESTART_SET 0x4755 /*WDT2 Restart Counter programming value*/
+
+void hw_watchdog_reset(void)
+{
+	/*restart WD2 timer*/
+	writel(AST_WDT2_RESTART_SET, AST_BASE_WD | AST_WDT2_RESTART_REG);
+}
+
+#endif /* CONFIG_WATCHDOG */
-- 
2.11.0



More information about the openbmc mailing list