xref: /openbmc/u-boot/arch/arm/mach-uniphier/reset.c (revision dffceb4b)
1 /*
2  * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <linux/io.h>
9 
10 #include "sc-regs.h"
11 
12 void reset_cpu(unsigned long ignored)
13 {
14 	u32 tmp;
15 
16 	writel(5, SC_IRQTIMSET); /* default value */
17 
18 	tmp  = readl(SC_SLFRSTSEL);
19 	tmp &= ~0x3; /* mask [1:0] */
20 	tmp |= 0x0;  /* XRST reboot */
21 	writel(tmp, SC_SLFRSTSEL);
22 
23 	tmp = readl(SC_SLFRSTCTL);
24 	tmp |= 0x1;
25 	writel(tmp, SC_SLFRSTCTL);
26 }
27