xref: /openbmc/linux/arch/arm/mach-omap2/omap3-restart.c (revision 9e5d46b0510e686550c486c410491291c67e8f0e)
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>
157b6d864bSRobin Holt #include <linux/reboot.h>
162f334a38SPaul Walmsley 
17*9e5d46b0SSekhar Nori #include "common.h"
182f334a38SPaul Walmsley #include "control.h"
1961c8621eSTero Kristo #include "prm.h"
202f334a38SPaul Walmsley 
212f334a38SPaul Walmsley /* Global address base setup code */
222f334a38SPaul Walmsley 
232f334a38SPaul Walmsley /**
242f334a38SPaul Walmsley  * omap3xxx_restart - trigger a software restart of the SoC
252f334a38SPaul Walmsley  * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
262f334a38SPaul Walmsley  * @cmd: passed from the userspace program rebooting the system (if provided)
272f334a38SPaul Walmsley  *
282f334a38SPaul Walmsley  * Resets the SoC.  For @cmd, see the 'reboot' syscall in
292f334a38SPaul Walmsley  * kernel/sys.c.  No return value.
302f334a38SPaul Walmsley  */
317b6d864bSRobin Holt void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
322f334a38SPaul Walmsley {
332f334a38SPaul Walmsley 	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
3461c8621eSTero Kristo 	omap_prm_reset_system();
352f334a38SPaul Walmsley }
36