2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include <asm/arch/reset_manager.h>
22 DECLARE_GLOBAL_DATA_PTR;
24 static const struct socfpga_reset_manager *reset_manager_base =
25 (void *)SOCFPGA_RSTMGR_ADDRESS;
28 * Write the reset manager register to cause reset
30 void reset_cpu(ulong addr)
32 /* request a warm reset */
33 writel(RSTMGR_CTRL_SWWARMRSTREQ_LSB, &reset_manager_base->ctrl);
35 * infinite loop here as watchdog will trigger and reset
43 * Release peripherals from reset based on handoff
45 void reset_deassert_peripherals_handoff(void)
47 writel(0, &reset_manager_base->per_mod_reset);
52 gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);