Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | f6e7f07 | 2015-05-29 17:30:00 +0900 | [diff] [blame] | 2 | * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
Masahiro Yamada | f6e7f07 | 2015-05-29 17:30:00 +0900 | [diff] [blame] | 8 | #include <linux/io.h> |
Masahiro Yamada | a86ac95 | 2015-02-27 02:26:44 +0900 | [diff] [blame] | 9 | #include <mach/sc-regs.h> |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 10 | |
| 11 | void reset_cpu(unsigned long ignored) |
| 12 | { |
| 13 | u32 tmp; |
| 14 | |
Masahiro Yamada | 5894ca0 | 2014-10-03 19:21:06 +0900 | [diff] [blame] | 15 | writel(5, SC_IRQTIMSET); /* default value */ |
| 16 | |
| 17 | tmp = readl(SC_SLFRSTSEL); |
| 18 | tmp &= ~0x3; /* mask [1:0] */ |
| 19 | tmp |= 0x0; /* XRST reboot */ |
| 20 | writel(tmp, SC_SLFRSTSEL); |
| 21 | |
| 22 | tmp = readl(SC_SLFRSTCTL); |
| 23 | tmp |= 0x1; |
| 24 | writel(tmp, SC_SLFRSTCTL); |
| 25 | } |