blob: bcabe6fa164e6f753c0be6d1f0d4eeae535b7b08 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Paul Walmsley2f334a32012-10-29 20:56:07 -06002/*
3 * omap3-restart.c - Code common to all OMAP3xxx machines.
4 *
5 * Copyright (C) 2009, 2012 Texas Instruments
6 * Copyright (C) 2010 Nokia Corporation
7 * Tony Lindgren <tony@atomide.com>
8 * Santosh Shilimkar <santosh.shilimkar@ti.com>
Paul Walmsley2f334a32012-10-29 20:56:07 -06009 */
10#include <linux/kernel.h>
11#include <linux/init.h>
Robin Holt7b6d8642013-07-08 16:01:40 -070012#include <linux/reboot.h>
Paul Walmsley2f334a32012-10-29 20:56:07 -060013
Sekhar Nori9e5d46b2015-07-11 20:29:16 +053014#include "common.h"
Paul Walmsley2f334a32012-10-29 20:56:07 -060015#include "control.h"
Tero Kristo61c86212014-10-27 08:39:26 -070016#include "prm.h"
Paul Walmsley2f334a32012-10-29 20:56:07 -060017
18/* Global address base setup code */
19
20/**
21 * omap3xxx_restart - trigger a software restart of the SoC
22 * @mode: the "reboot mode", see arch/arm/kernel/{setup,process}.c
23 * @cmd: passed from the userspace program rebooting the system (if provided)
24 *
25 * Resets the SoC. For @cmd, see the 'reboot' syscall in
26 * kernel/sys.c. No return value.
27 */
Robin Holt7b6d8642013-07-08 16:01:40 -070028void omap3xxx_restart(enum reboot_mode mode, const char *cmd)
Paul Walmsley2f334a32012-10-29 20:56:07 -060029{
30 omap3_ctrl_write_boot_mode((cmd ? (u8)*cmd : 0));
Tero Kristo61c86212014-10-27 08:39:26 -070031 omap_prm_reset_system();
Paul Walmsley2f334a32012-10-29 20:56:07 -060032}