Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / arch / arm / mach-spear / restart.c
blob76fb16cc81320aba4759f637830766a8ad3f4a4e
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * arch/arm/plat-spear/restart.c
5 * SPEAr platform specific restart functions
7 * Copyright (C) 2009 ST Microelectronics
8 * Viresh Kumar <vireshk@kernel.org>
9 */
10 #include <linux/io.h>
11 #include <linux/amba/sp810.h>
12 #include <linux/reboot.h>
13 #include <asm/system_misc.h>
14 #include "spear.h"
15 #include "generic.h"
17 #define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204)
18 void spear_restart(enum reboot_mode mode, const char *cmd)
20 if (mode == REBOOT_SOFT) {
21 /* software reset, Jump into ROM at address 0 */
22 soft_restart(0);
23 } else {
24 /* hardware reset, Use on-chip reset capability */
25 #ifdef CONFIG_ARCH_SPEAR13XX
26 writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES);
27 #endif
28 #if defined(CONFIG_ARCH_SPEAR3XX) || defined(CONFIG_ARCH_SPEAR6XX)
29 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
30 #endif