Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Vipin KUMAR | 7cb1635 | 2010-01-15 19:15:43 +0530 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2009 |
| 4 | * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com. |
Vipin KUMAR | 7cb1635 | 2010-01-15 19:15:43 +0530 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Simon Glass | afb0215 | 2019-12-28 10:45:01 -0700 | [diff] [blame] | 8 | #include <cpu_func.h> |
Vipin KUMAR | 7cb1635 | 2010-01-15 19:15:43 +0530 | [diff] [blame] | 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/hardware.h> |
| 11 | #include <asm/arch/spr_syscntl.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 12 | #include <linux/delay.h> |
Vipin KUMAR | 7cb1635 | 2010-01-15 19:15:43 +0530 | [diff] [blame] | 13 | |
| 14 | void reset_cpu(ulong ignored) |
| 15 | { |
| 16 | struct syscntl_regs *syscntl_regs_p = |
| 17 | (struct syscntl_regs *)CONFIG_SPEAR_SYSCNTLBASE; |
| 18 | |
| 19 | printf("System is going to reboot ...\n"); |
| 20 | |
| 21 | /* |
| 22 | * This 1 second delay will allow the above message |
| 23 | * to be printed before reset |
| 24 | */ |
| 25 | udelay((1000 * 1000)); |
| 26 | |
| 27 | /* Going into slow mode before resetting SOC */ |
| 28 | writel(0x02, &syscntl_regs_p->scctrl); |
| 29 | |
| 30 | /* |
| 31 | * Writing any value to the system status register will |
| 32 | * reset the SoC |
| 33 | */ |
| 34 | writel(0x00, &syscntl_regs_p->scsysstat); |
| 35 | |
| 36 | /* system will restart */ |
| 37 | while (1) |
| 38 | ; |
| 39 | } |