]> git.ipfire.org Git - thirdparty/u-boot.git/blame - arch/mips/cpu/mips32/incaip/incaip_wdt.S
Add GPL-2.0+ SPDX-License-Identifier to source files
[thirdparty/u-boot.git] / arch / mips / cpu / mips32 / incaip / incaip_wdt.S
CommitLineData
c021880a
WD
1/*
2 * INCA-IP Watchdog timer management code.
3 *
4 * Copyright (c) 2003 Wolfgang Denk <wd@denx.de>
5 *
1a459660 6 * SPDX-License-Identifier: GPL-2.0+
c021880a
WD
7 */
8
9
10#include <config.h>
c021880a
WD
11#include <asm/regdef.h>
12
13
14#define WD_BASE 0xb8000000
15#define WD_CON0(value) 0x0020(value)
16#define WD_CON1(value) 0x0024(value)
17#define WD_DISABLE 0x00000008
18#define WD_ENABLE 0x00000000
19#define WD_WRITE_PW 0xFFFC00F8
20#define WD_WRITE_ENDINIT 0xFFFC00F3
21#define WD_WRITE_INIT 0xFFFC00F2
22
23
24 .globl disable_incaip_wdt
25disable_incaip_wdt:
26 li t0, WD_BASE
27
28 /* Calculate password.
29 */
30 lw t2, WD_CON1(t0)
31 and t2, 0xC
32
33 lw t3, WD_CON0(t0)
34 and t3, 0xFFFFFF01
35
36 or t3, t2
53677ef1 37 or t3, 0xF0
c021880a
WD
38
39 sw t3, WD_CON0(t0) /* write password */
40
41 /* Clear ENDINIT.
42 */
43 li t1, WD_WRITE_INIT
44 sw t1, WD_CON0(t0)
45
46
47 li t1, WD_DISABLE
48 sw t1, WD_CON1(t0) /* disable watchdog */
49 li t1, WD_WRITE_PW
50 sw t1, WD_CON0(t0) /* write password */
51 li t1, WD_WRITE_ENDINIT
52 sw t1, WD_CON0(t0) /* end command */
53
43c50925 54 jr ra
c021880a 55 nop