blob: 1389c82169bc286b63462c03b2e5c853be74ddd1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Chin Liang See1922dad2013-08-07 10:08:03 -05002/*
3 * Copyright (C) 2013 Altera Corporation <www.altera.com>
Chin Liang See1922dad2013-08-07 10:08:03 -05004 */
5
6
7#include <common.h>
8#include <asm/io.h>
Marek Vasutb10a6072015-08-24 11:51:46 +02009#include <asm/arch/reset_manager.h>
Chin Liang See1922dad2013-08-07 10:08:03 -050010
Chin Liang See1922dad2013-08-07 10:08:03 -050011static const struct socfpga_reset_manager *reset_manager_base =
12 (void *)SOCFPGA_RSTMGR_ADDRESS;
Marek Vasut49edbd42015-07-09 04:27:28 +020013
14/*
Chin Liang See1922dad2013-08-07 10:08:03 -050015 * Write the reset manager register to cause reset
16 */
17void reset_cpu(ulong addr)
18{
19 /* request a warm reset */
Ley Foon Tandd5d12d2017-04-26 02:44:34 +080020 writel(1 << RSTMGR_CTRL_SWWARMRSTREQ_LSB,
21 &reset_manager_base->ctrl);
Chin Liang See1922dad2013-08-07 10:08:03 -050022 /*
23 * infinite loop here as watchdog will trigger and reset
24 * the processor
25 */
26 while (1)
27 ;
28}