blob: e3e2c56a6760ad3962f34e277bac7e17ab6ac919 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Tom Rini7de0d822012-06-27 05:27:05 +00002/*
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 Denkd79de1d2013-07-08 09:37:19 +02007 */
Tom Rini7de0d822012-06-27 05:27:05 +00008
Simon Glassafb02152019-12-28 10:45:01 -07009#include <cpu_func.h>
Tom Rini7de0d822012-06-27 05:27:05 +000010#include <asm/io.h>
11#include <asm/arch/timer_defs.h>
12#include <asm/arch/hardware.h>
13
Harald Seiler6f14d5f2020-12-15 16:47:52 +010014void reset_cpu(void)
Tom Rini7de0d822012-06-27 05:27:05 +000015{
16 struct davinci_timer *const wdttimer =
Davide Bonfanti2baa0972012-11-21 00:45:12 +000017 (struct davinci_timer *)DAVINCI_WDOG_BASE;
Tom Rini7de0d822012-06-27 05:27:05 +000018 writel(0x08, &wdttimer->tgcr);
19 writel(readl(&wdttimer->tgcr) | 0x03, &wdttimer->tgcr);
20 writel(0, &wdttimer->tim12);
21 writel(0, &wdttimer->tim34);
22 writel(0, &wdttimer->prd12);
23 writel(0, &wdttimer->prd34);
24 writel(readl(&wdttimer->tcr) | 0x40, &wdttimer->tcr);
25 writel(readl(&wdttimer->wdtcr) | 0x4000, &wdttimer->wdtcr);
26 writel(0xa5c64000, &wdttimer->wdtcr);
27 writel(0xda7e4000, &wdttimer->wdtcr);
28 writel(0x4000, &wdttimer->wdtcr);
29 while (1)
30 /*nothing*/;
31}