xref: /openbmc/u-boot/arch/arm/cpu/arm926ejs/spear/reset.c (revision 78a88f79)
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2009
4  * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
5  */
6 
7 #include <common.h>
8 #include <asm/io.h>
9 #include <asm/arch/hardware.h>
10 #include <asm/arch/spr_syscntl.h>
11 
12 void 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 }
38