Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 #include <linux/kernel.h>
0003 #include <linux/init.h>
0004 #include <linux/reboot.h>
0005 
0006 #include "iomap.h"
0007 #include "common.h"
0008 #include "control.h"
0009 #include "prm3xxx.h"
0010 
0011 #define TI81XX_PRM_DEVICE_RSTCTRL   0x00a0
0012 #define TI81XX_GLOBAL_RST_COLD      BIT(1)
0013 
0014 /**
0015  * ti81xx_restart - trigger a software restart of the SoC
0016  * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
0017  * @cmd: passed from the userspace program rebooting the system (if provided)
0018  *
0019  * Resets the SoC.  For @cmd, see the 'reboot' syscall in
0020  * kernel/sys.c.  No return value.
0021  *
0022  * NOTE: Warm reset does not seem to work, may require resetting
0023  * clocks to bypass mode.
0024  */
0025 void ti81xx_restart(enum reboot_mode mode, const char *cmd)
0026 {
0027     omap2_prm_set_mod_reg_bits(TI81XX_GLOBAL_RST_COLD, 0,
0028                    TI81XX_PRM_DEVICE_RSTCTRL);
0029     while (1);
0030 }