blob: ba0a7c3b4baaee13115ed2d49c724df84e07fa1f [file] [log] [blame]
Sergey Kubushyne8f39122007-08-10 20:26:18 +02001/*
2 * Processor reset using WDT for TI TMS320DM644x SoC.
3 *
4 * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
5 *
6 * -----------------------------------------------------
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24.globl reset_cpu
25reset_cpu:
26 ldr r0, WDT_TGCR
27 mov r1, $0x08
28 str r1, [r0]
29 ldr r1, [r0]
30 orr r1, r1, $0x03
31 str r1, [r0]
32 mov r1, $0
33 ldr r0, WDT_TIM12
34 str r1, [r0]
35 ldr r0, WDT_TIM34
36 str r1, [r0]
37 ldr r0, WDT_PRD12
38 str r1, [r0]
39 ldr r0, WDT_PRD34
40 str r1, [r0]
41 ldr r0, WDT_TCR
42 ldr r1, [r0]
43 orr r1, r1, $0x40
44 str r1, [r0]
45 ldr r0, WDT_WDTCR
46 ldr r1, [r0]
47 orr r1, r1, $0x4000
48 str r1, [r0]
49 ldr r1, WDTCR_VAL1
50 str r1, [r0]
51 ldr r1, WDTCR_VAL2
52 str r1, [r0]
Thomas Lange26650af2009-05-03 20:07:33 +020053 /* Write an invalid value to the WDKEY field to trigger
54 * an immediate watchdog reset */
55 mov r1, $0x4000
56 str r1, [r0]
Sergey Kubushyne8f39122007-08-10 20:26:18 +020057 nop
58 nop
59 nop
60 nop
61reset_cpu_loop:
62 b reset_cpu_loop
63
64WDT_TGCR:
65 .word 0x01c21c24
66WDT_TIM12:
67 .word 0x01c21c10
68WDT_TIM34:
69 .word 0x01c21c14
70WDT_PRD12:
71 .word 0x01c21c18
72WDT_PRD34:
73 .word 0x01c21c1c
74WDT_TCR:
75 .word 0x01c21c20
76WDT_WDTCR:
77 .word 0x01c21c28
78WDTCR_VAL1:
79 .word 0xa5c64000
80WDTCR_VAL2:
81 .word 0xda7e4000