Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tom Rini | 7de0d82 | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Processor reset using WDT. |
| 4 | * |
| 5 | * Copyright (C) 2012 Dmitry Bondar <bond@inmys.ru> |
| 6 | * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net> |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 7 | */ |
Tom Rini | 7de0d82 | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 8 | |
| 9 | #include <common.h> |
Simon Glass | afb0215 | 2019-12-28 10:45:01 -0700 | [diff] [blame] | 10 | #include <cpu_func.h> |
Tom Rini | 7de0d82 | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 11 | #include <asm/io.h> |
| 12 | #include <asm/arch/timer_defs.h> |
| 13 | #include <asm/arch/hardware.h> |
| 14 | |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 15 | void reset_cpu(void) |
Tom Rini | 7de0d82 | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 16 | { |
| 17 | struct davinci_timer *const wdttimer = |
Davide Bonfanti | 2baa097 | 2012-11-21 00:45:12 +0000 | [diff] [blame] | 18 | (struct davinci_timer *)DAVINCI_WDOG_BASE; |
Tom Rini | 7de0d82 | 2012-06-27 05:27:05 +0000 | [diff] [blame] | 19 | writel(0x08, &wdttimer->tgcr); |
| 20 | writel(readl(&wdttimer->tgcr) | 0x03, &wdttimer->tgcr); |
| 21 | writel(0, &wdttimer->tim12); |
| 22 | writel(0, &wdttimer->tim34); |
| 23 | writel(0, &wdttimer->prd12); |
| 24 | writel(0, &wdttimer->prd34); |
| 25 | writel(readl(&wdttimer->tcr) | 0x40, &wdttimer->tcr); |
| 26 | writel(readl(&wdttimer->wdtcr) | 0x4000, &wdttimer->wdtcr); |
| 27 | writel(0xa5c64000, &wdttimer->wdtcr); |
| 28 | writel(0xda7e4000, &wdttimer->wdtcr); |
| 29 | writel(0x4000, &wdttimer->wdtcr); |
| 30 | while (1) |
| 31 | /*nothing*/; |
| 32 | } |