xref: /openbmc/linux/arch/arm/mach-omap2/omap3-restart.c (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*d2912cb1SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only
22f334a38SPaul Walmsley /*
32f334a38SPaul Walmsley  * omap3-restart.c - Code common to all OMAP3xxx machines.
42f334a38SPaul Walmsley  *
52f334a38SPaul Walmsley  * Copyright (C) 2009, 2012 Texas Instruments
62f334a38SPaul Walmsley  * Copyright (C) 2010 Nokia Corporation
72f334a38SPaul Walmsley  * Tony Lindgren <tony@atomide.com>
82f334a38SPaul Walmsley  * Santosh Shilimkar <santosh.shilimkar@ti.com>
92f334a38SPaul Walmsley  */
102f334a38SPaul Walmsley #include <linux/kernel.h>
112f334a38SPaul Walmsley #include <linux/init.h>
127b6d864bSRobin Holt #include <linux/reboot.h>
132f334a38SPaul Walmsley 
149e5d46b0SSekhar Nori #include "common.h"
152f334a38SPaul Walmsley #include "control.h"
1661c8621eSTero Kristo #include "prm.h"
172f334a38SPaul Walmsley 
182f334a38SPaul Walmsley /* Global address base setup code */
192f334a38SPaul Walmsley 
202f334a38SPaul Walmsley /**
212f334a38SPaul Walmsley  * omap3xxx_restart - trigger a software restart of the SoC
222f334a38SPaul Walmsley  * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
232f334a38SPaul Walmsley  * @cmd: passed from the userspace program rebooting the system (if provided)
242f334a38SPaul Walmsley  *
252f334a38SPaul Walmsley  * Resets the SoC.  For @cmd, see the 'reboot' syscall in
262f334a38SPaul Walmsley  * kernel/sys.c.  No return value.
272f334a38SPaul Walmsley  */
omap3xxx_restart(enum reboot_mode mode,const char * cmd)287b6d864bSRobin Holt void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
292f334a38SPaul Walmsley {
302f334a38SPaul Walmsley 	omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
3161c8621eSTero Kristo 	omap_prm_reset_system();
322f334a38SPaul Walmsley }
33