Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Vikas Manocha | 33913c5 | 2014-11-18 10:42:22 -0800 | [diff] [blame] | 2 | /* |
Patrice Chotard | cc55116 | 2017-10-23 09:53:59 +0200 | [diff] [blame] | 3 | * Copyright (C) 2014, STMicroelectronics - All Rights Reserved |
| 4 | * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics. |
Vikas Manocha | 33913c5 | 2014-11-18 10:42:22 -0800 | [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> |
Vikas Manocha | 33913c5 | 2014-11-18 10:42:22 -0800 | [diff] [blame] | 9 | #include <asm/io.h> |
| 10 | #include <asm/arch/stv0991_wdru.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 11 | #include <linux/delay.h> |
Harald Seiler | 6f14d5f | 2020-12-15 16:47:52 +0100 | [diff] [blame] | 12 | void reset_cpu(void) |
Vikas Manocha | 33913c5 | 2014-11-18 10:42:22 -0800 | [diff] [blame] | 13 | { |
| 14 | puts("System is going to reboot ...\n"); |
| 15 | /* |
| 16 | * This 1 second delay will allow the above message |
| 17 | * to be printed before reset |
| 18 | */ |
| 19 | udelay((1000 * 1000)); |
| 20 | |
| 21 | /* Setting bit 1 of the WDRU unit will reset the SoC */ |
| 22 | writel(WDRU_RST_SYS, &stv0991_wd_ru_ptr->wdru_ctrl1); |
| 23 | |
| 24 | /* system will restart */ |
| 25 | while (1) |
| 26 | ; |
| 27 | } |