Tom Rini | 77bfa6b | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Processor reset using WDT. |
| 3 | * |
| 4 | * Copyright (C) 2012 Dmitry Bondar <bond@inmys.ru> |
| 5 | * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> |
| 6 | * |
| 7 | * This file is released under the terms of GPL v2 and any later version. |
| 8 | * See the file COPYING in the root directory of the source tree for details. |
| 9 | */ |
| 10 | |
| 11 | #include <common.h> |
| 12 | #include <asm/io.h> |
| 13 | #include <asm/arch/timer_defs.h> |
| 14 | #include <asm/arch/hardware.h> |
| 15 | |
| 16 | void reset_cpu(unsigned long a) |
| 17 | { |
| 18 | struct davinci_timer *const wdttimer = |
| 19 | (struct davinci_timer *)DAVINCI_TIMER1_BASE; |
| 20 | writel(0x08, &wdttimer->tgcr); |
| 21 | writel(readl(&wdttimer->tgcr) | 0x03, &wdttimer->tgcr); |
| 22 | writel(0, &wdttimer->tim12); |
| 23 | writel(0, &wdttimer->tim34); |
| 24 | writel(0, &wdttimer->prd12); |
| 25 | writel(0, &wdttimer->prd34); |
| 26 | writel(readl(&wdttimer->tcr) | 0x40, &wdttimer->tcr); |
| 27 | writel(readl(&wdttimer->wdtcr) | 0x4000, &wdttimer->wdtcr); |
| 28 | writel(0xa5c64000, &wdttimer->wdtcr); |
| 29 | writel(0xda7e4000, &wdttimer->wdtcr); |
| 30 | writel(0x4000, &wdttimer->wdtcr); |
| 31 | while (1) |
| 32 | /*nothing*/; |
| 33 | } |