blob: 3435bdc748a2e450e75e021eb88f7abb6b9a0a3a [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +01002/*
3 * Cirrus Logic EP93xx CPU-specific support.
4 *
5 * Copyright (C) 2009 Matthias Kaehlcke <matthias@kaehlcke.net>
6 *
7 * Copyright (C) 2004, 2005
8 * Cory T. Tusar, Videon Central, Inc., <ctusar@videon-central.com>
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +01009 */
10
11#include <common.h>
Simon Glassafb02152019-12-28 10:45:01 -070012#include <cpu_func.h>
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +010013#include <asm/arch/ep93xx.h>
14#include <asm/io.h>
15
16/* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
Harald Seiler6f14d5f2020-12-15 16:47:52 +010017extern void reset_cpu(void)
Matthias Kaehlcke195dbd12010-02-01 21:29:39 +010018{
19 struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
20 uint32_t value;
21
22 /* Unlock DeviceCfg and set SWRST */
23 writel(0xAA, &syscon->sysswlock);
24 value = readl(&syscon->devicecfg);
25 value |= SYSCON_DEVICECFG_SWRST;
26 writel(value, &syscon->devicecfg);
27
28 /* Unlock DeviceCfg and clear SWRST */
29 writel(0xAA, &syscon->sysswlock);
30 value = readl(&syscon->devicecfg);
31 value &= ~SYSCON_DEVICECFG_SWRST;
32 writel(value, &syscon->devicecfg);
33
34 /* Dying... */
35 while (1)
36 ; /* noop */
37}