blob: 3aae12f8ad3f62684218ecb4670e8ed6f9ac4809 [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>
12#include <asm/arch/ep93xx.h>
13#include <asm/io.h>
14
15/* We reset the CPU by generating a 1-->0 transition on DeviceCfg bit 31. */
16extern void reset_cpu(ulong addr)
17{
18 struct syscon_regs *syscon = (struct syscon_regs *)SYSCON_BASE;
19 uint32_t value;
20
21 /* Unlock DeviceCfg and set SWRST */
22 writel(0xAA, &syscon->sysswlock);
23 value = readl(&syscon->devicecfg);
24 value |= SYSCON_DEVICECFG_SWRST;
25 writel(value, &syscon->devicecfg);
26
27 /* Unlock DeviceCfg and clear SWRST */
28 writel(0xAA, &syscon->sysswlock);
29 value = readl(&syscon->devicecfg);
30 value &= ~SYSCON_DEVICECFG_SWRST;
31 writel(value, &syscon->devicecfg);
32
33 /* Dying... */
34 while (1)
35 ; /* noop */
36}