xref: /openbmc/linux/arch/arm/mach-omap2/omap3-restart.c (revision 7b6d864b48d95e6ea1df7df64475b9cb9616dcf9)
12f334a38SPaul Walmsley /*
22f334a38SPaul Walmsley  * omap3-restart.c - Code common to all OMAP3xxx machines.
32f334a38SPaul Walmsley  *
42f334a38SPaul Walmsley  * Copyright (C) 2009, 2012 Texas Instruments
52f334a38SPaul Walmsley  * Copyright (C) 2010 Nokia Corporation
62f334a38SPaul Walmsley  * Tony Lindgren <tony@atomide.com>
72f334a38SPaul Walmsley  * Santosh Shilimkar <santosh.shilimkar@ti.com>
82f334a38SPaul Walmsley  *
92f334a38SPaul Walmsley  * This program is free software; you can redistribute it and/or modify
102f334a38SPaul Walmsley  * it under the terms of the GNU General Public License version 2 as
112f334a38SPaul Walmsley  * published by the Free Software Foundation.
122f334a38SPaul Walmsley  */
132f334a38SPaul Walmsley #include <linux/kernel.h>
142f334a38SPaul Walmsley #include <linux/init.h>
15*7b6d864bSRobin Holt #include <linux/reboot.h>
162f334a38SPaul Walmsley 
172f334a38SPaul Walmsley #include "iomap.h"
182f334a38SPaul Walmsley #include "common.h"
192f334a38SPaul Walmsley #include "control.h"
202f334a38SPaul Walmsley #include "prm3xxx.h"
212f334a38SPaul Walmsley 
222f334a38SPaul Walmsley /* Global address base setup code */
232f334a38SPaul Walmsley 
242f334a38SPaul Walmsley /**
252f334a38SPaul Walmsley  * omap3xxx_restart - trigger a software restart of the SoC
262f334a38SPaul Walmsley  * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
272f334a38SPaul Walmsley  * @cmd: passed from the userspace program rebooting the system (if provided)
282f334a38SPaul Walmsley  *
292f334a38SPaul Walmsley  * Resets the SoC.  For @cmd, see the 'reboot' syscall in
302f334a38SPaul Walmsley  * kernel/sys.c.  No return value.
312f334a38SPaul Walmsley  */
32*7b6d864bSRobin Holt void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
332f334a38SPaul Walmsley {
342f334a38SPaul Walmsley 	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
352f334a38SPaul Walmsley 	omap3xxx_prm_dpll3_reset(); /* never returns */
362f334a38SPaul Walmsley 	while (1);
372f334a38SPaul Walmsley }
38