blob: 4f990115b1bd7070c3092f3b768a7cce7e6f94a0 [file] [log] [blame]
Russell Kingdd1661e2011-11-05 21:10:37 +00001/*
2 * arch/arm/plat-spear/restart.c
3 *
4 * SPEAr platform specific restart functions
5 *
6 * Copyright (C) 2009 ST Microelectronics
Viresh Kumar10d89352012-06-20 12:53:02 -07007 * Viresh Kumar <viresh.linux@gmail.com>
Russell Kingdd1661e2011-11-05 21:10:37 +00008 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13#include <linux/io.h>
David Howells9f97da72012-03-28 18:30:01 +010014#include <asm/system_misc.h>
Russell Kingdd1661e2011-11-05 21:10:37 +000015#include <asm/hardware/sp810.h>
Arnd Bergmann5019f0b2012-04-11 17:30:11 +000016#include <mach/spear.h>
Russell Kingdd1661e2011-11-05 21:10:37 +000017#include <mach/generic.h>
18
Viresh Kumare3978dc2012-04-19 22:23:13 +053019#define SPEAR13XX_SYS_SW_RES (VA_MISC_BASE + 0x204)
Russell Kingdd1661e2011-11-05 21:10:37 +000020void spear_restart(char mode, const char *cmd)
21{
22 if (mode == 's') {
23 /* software reset, Jump into ROM at address 0 */
24 soft_restart(0);
25 } else {
26 /* hardware reset, Use on-chip reset capability */
Viresh Kumare3978dc2012-04-19 22:23:13 +053027#ifdef CONFIG_ARCH_SPEAR13XX
28 writel_relaxed(0x01, SPEAR13XX_SYS_SW_RES);
29#else
Russell Kingdd1661e2011-11-05 21:10:37 +000030 sysctl_soft_reset((void __iomem *)VA_SPEAR_SYS_CTRL_BASE);
Viresh Kumare3978dc2012-04-19 22:23:13 +053031#endif
Russell Kingdd1661e2011-11-05 21:10:37 +000032 }
33}