xref: /openbmc/linux/arch/arm/mach-omap2/omap3-restart.c (revision 2f334a3896714b47e24cc4cd08eed11d1a7f0d8e)
1*2f334a38SPaul Walmsley /*
2*2f334a38SPaul Walmsley  * omap3-restart.c - Code common to all OMAP3xxx machines.
3*2f334a38SPaul Walmsley  *
4*2f334a38SPaul Walmsley  * Copyright (C) 2009, 2012 Texas Instruments
5*2f334a38SPaul Walmsley  * Copyright (C) 2010 Nokia Corporation
6*2f334a38SPaul Walmsley  * Tony Lindgren <tony@atomide.com>
7*2f334a38SPaul Walmsley  * Santosh Shilimkar <santosh.shilimkar@ti.com>
8*2f334a38SPaul Walmsley  *
9*2f334a38SPaul Walmsley  * This program is free software; you can redistribute it and/or modify
10*2f334a38SPaul Walmsley  * it under the terms of the GNU General Public License version 2 as
11*2f334a38SPaul Walmsley  * published by the Free Software Foundation.
12*2f334a38SPaul Walmsley  */
13*2f334a38SPaul Walmsley #include <linux/kernel.h>
14*2f334a38SPaul Walmsley #include <linux/init.h>
15*2f334a38SPaul Walmsley 
16*2f334a38SPaul Walmsley #include "iomap.h"
17*2f334a38SPaul Walmsley #include "common.h"
18*2f334a38SPaul Walmsley #include "control.h"
19*2f334a38SPaul Walmsley #include "prm3xxx.h"
20*2f334a38SPaul Walmsley 
21*2f334a38SPaul Walmsley /* Global address base setup code */
22*2f334a38SPaul Walmsley 
23*2f334a38SPaul Walmsley /**
24*2f334a38SPaul Walmsley  * omap3xxx_restart - trigger a software restart of the SoC
25*2f334a38SPaul Walmsley  * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
26*2f334a38SPaul Walmsley  * @cmd: passed from the userspace program rebooting the system (if provided)
27*2f334a38SPaul Walmsley  *
28*2f334a38SPaul Walmsley  * Resets the SoC.  For @cmd, see the 'reboot' syscall in
29*2f334a38SPaul Walmsley  * kernel/sys.c.  No return value.
30*2f334a38SPaul Walmsley  */
31*2f334a38SPaul Walmsley void omap3xxx_restart(char mode, const char *cmd)
32*2f334a38SPaul Walmsley {
33*2f334a38SPaul Walmsley 	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
34*2f334a38SPaul Walmsley 	omap3xxx_prm_dpll3_reset(); /* never returns */
35*2f334a38SPaul Walmsley 	while (1);
36*2f334a38SPaul Walmsley }
37