xref: /openbmc/u-boot/arch/arm/cpu/arm920t/ep93xx/cpu.c (revision cbd2fba1)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
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>
9  */
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. */
16 extern 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 }
37