2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2011-10-11 22:33:18 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2011 Andes Technology Corporation
|
|
|
|
* Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <asm/arch-ag101/ag101.h>
|
2011-11-30 08:01:28 +00:00
|
|
|
#include <linux/linkage.h>
|
2011-10-11 22:33:18 +00:00
|
|
|
|
|
|
|
.text
|
|
|
|
|
|
|
|
#ifndef CONFIG_SKIP_TRUNOFF_WATCHDOG
|
2011-11-30 08:01:28 +00:00
|
|
|
ENTRY(turnoff_watchdog)
|
2011-10-11 22:33:18 +00:00
|
|
|
|
|
|
|
#define WD_CR 0xC
|
|
|
|
#define WD_ENABLE 0x1
|
|
|
|
|
|
|
|
! Turn off the watchdog, according to Faraday FTWDT010 spec
|
2021-09-27 15:42:39 +00:00
|
|
|
li $p0, (CONFIG_FTWDT010_BASE+WD_CR) ! Get the addr of WD CR
|
2011-10-11 22:33:18 +00:00
|
|
|
lwi $p1, [$p0] ! Get the config of WD
|
|
|
|
andi $p1, $p1, 0x1f ! Wipe out useless bits
|
|
|
|
li $r0, ~WD_ENABLE
|
|
|
|
and $p1, $p1, $r0 ! Set WD disable
|
|
|
|
sw $p1, [$p0] ! Write back to WD CR
|
|
|
|
|
|
|
|
! Disable Interrupts by clear GIE in $PSW reg
|
|
|
|
setgie.d
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
2011-11-30 08:01:28 +00:00
|
|
|
ENDPROC(turnoff_watchdog)
|
2011-10-11 22:33:18 +00:00
|
|
|
#endif
|