blob: b5825bc0c7f134a241db24d0724f6ce46a5cd0b3 [file] [log] [blame]
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09001/*
Masahiro Yamada663a23f2015-05-29 17:30:00 +09002 * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +09003 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
Masahiro Yamada663a23f2015-05-29 17:30:00 +09008#include <linux/io.h>
Masahiro Yamadaefdf3402016-01-09 01:51:13 +09009
10#include "sc-regs.h"
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090011
12void reset_cpu(unsigned long ignored)
13{
14 u32 tmp;
15
Masahiro Yamadabb2ff9d2014-10-03 19:21:06 +090016 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}