blob: 05c7ecdb4917eac9c1205c17dcb712b4dbe4672c [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Vipin KUMAR7cb16352010-01-15 19:15:43 +05302/*
3 * (C) Copyright 2009
4 * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
Vipin KUMAR7cb16352010-01-15 19:15:43 +05305 */
6
7#include <common.h>
8#include <asm/io.h>
9#include <asm/arch/hardware.h>
10#include <asm/arch/spr_syscntl.h>
11
12void reset_cpu(ulong ignored)
13{
14 struct syscntl_regs *syscntl_regs_p =
15 (struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE;
16
17 printf("System is going to reboot ...\n");
18
19 /*
20 * This 1 second delay will allow the above message
21 * to be printed before reset
22 */
23 udelay((1000 * 1000));
24
25 /* Going into slow mode before resetting SOC */
26 writel(0x02, &syscntl_regs_p->scctrl);
27
28 /*
29 * Writing any value to the system status register will
30 * reset the SoC
31 */
32 writel(0x00, &syscntl_regs_p->scsysstat);
33
34 /* system will restart */
35 while (1)
36 ;
37}