Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * arch/arm/plat-spear/restart.c
0004  *
0005  * SPEAr platform specific restart functions
0006  *
0007  * Copyright (C) 2009 ST Microelectronics
0008  * Viresh Kumar <vireshk@kernel.org>
0009  */
0010 #include <linux/io.h>
0011 #include <linux/amba/sp810.h>
0012 #include <linux/reboot.h>
0013 #include <asm/system_misc.h>
0014 #include "spear.h"
0015 #include "generic.h"
0016 
0017 #define SPEAR13XX_SYS_SW_RES            (VA_MISC_BASE + 0x204)
0018 void spear_restart(enum reboot_mode mode, const char *cmd)
0019 {
0020     if (mode == REBOOT_SOFT) {
0021         /* software reset, Jump into ROM at address 0 */
0022         soft_restart(0);
0023     } else {
0024         /* hardware reset, Use on-chip reset capability */
0025 #ifdef CONFIG_ARCH_SPEAR13XX
0026         writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES);
0027 #endif
0028 #if defined(CONFIG_ARCH_SPEAR3XX) || defined(CONFIG_ARCH_SPEAR6XX)
0029         sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
0030 #endif
0031     }
0032 }