2 * Copyright (C) 2011 Andes Technology Corporation
3 * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #include <asm/arch-ag101/ag101.h>
9 #include <linux/linkage.h>
13 #ifndef CONFIG_SKIP_TRUNOFF_WATCHDOG
14 ENTRY(turnoff_watchdog)
19 ! Turn off the watchdog, according to Faraday FTWDT010 spec
20 li $p0, (CONFIG_FTWDT010_BASE+WD_CR) ! Get the addr of WD CR
21 lwi $p1, [$p0] ! Get the config of WD
22 andi $p1, $p1, 0x1f ! Wipe out useless bits
24 and $p1, $p1, $r0 ! Set WD disable
25 sw $p1, [$p0] ! Write back to WD CR
27 ! Disable Interrupts by clear GIE in $PSW reg
32 ENDPROC(turnoff_watchdog)