Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTR
[pandora-u-boot.git] / arch / arm / mach-socfpga / reset_manager.c
1 /*
2  *  Copyright (C) 2013 Altera Corporation <www.altera.com>
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6
7
8 #include <common.h>
9 #include <asm/io.h>
10 #include <asm/arch/reset_manager.h>
11
12 static const struct socfpga_reset_manager *reset_manager_base =
13                 (void *)SOCFPGA_RSTMGR_ADDRESS;
14
15 /*
16  * Write the reset manager register to cause reset
17  */
18 void reset_cpu(ulong addr)
19 {
20         /* request a warm reset */
21         writel(1 << RSTMGR_CTRL_SWWARMRSTREQ_LSB,
22                &reset_manager_base->ctrl);
23         /*
24          * infinite loop here as watchdog will trigger and reset
25          * the processor
26          */
27         while (1)
28                 ;
29 }