2018-05-06 21:58:06 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ */
|
2012-10-04 06:46:02 +00:00
|
|
|
/*
|
2017-04-25 18:44:34 +00:00
|
|
|
* Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
|
2012-10-04 06:46:02 +00:00
|
|
|
*/
|
|
|
|
|
2017-04-25 18:44:34 +00:00
|
|
|
#ifndef _RESET_MANAGER_H_
|
|
|
|
#define _RESET_MANAGER_H_
|
2012-10-04 06:46:02 +00:00
|
|
|
|
2019-11-08 02:38:19 +00:00
|
|
|
phys_addr_t socfpga_get_rstmgr_addr(void);
|
|
|
|
|
2012-10-04 06:46:02 +00:00
|
|
|
void reset_cpu(ulong addr);
|
2014-09-08 12:08:45 +00:00
|
|
|
|
2015-07-09 00:45:15 +00:00
|
|
|
void socfpga_per_reset(u32 reset, int set);
|
2015-07-09 02:27:28 +00:00
|
|
|
void socfpga_per_reset_all(void);
|
2015-07-09 00:45:15 +00:00
|
|
|
|
2019-07-15 19:47:52 +00:00
|
|
|
#define RSTMGR_CTRL_SWCOLDRSTREQ_LSB 0
|
2012-10-04 06:46:02 +00:00
|
|
|
#define RSTMGR_CTRL_SWWARMRSTREQ_LSB 1
|
|
|
|
|
2015-07-09 00:30:35 +00:00
|
|
|
/*
|
|
|
|
* Define a reset identifier, from which a permodrst bank ID
|
|
|
|
* and reset ID can be extracted using the subsequent macros
|
|
|
|
* RSTMGR_RESET() and RSTMGR_BANK().
|
|
|
|
*/
|
|
|
|
#define RSTMGR_BANK_OFFSET 8
|
|
|
|
#define RSTMGR_BANK_MASK 0x7
|
|
|
|
#define RSTMGR_RESET_OFFSET 0
|
|
|
|
#define RSTMGR_RESET_MASK 0x1f
|
|
|
|
#define RSTMGR_DEFINE(_bank, _offset) \
|
|
|
|
((_bank) << RSTMGR_BANK_OFFSET) | ((_offset) << RSTMGR_RESET_OFFSET)
|
|
|
|
|
|
|
|
/* Extract reset ID from the reset identifier. */
|
|
|
|
#define RSTMGR_RESET(_reset) \
|
|
|
|
(((_reset) >> RSTMGR_RESET_OFFSET) & RSTMGR_RESET_MASK)
|
|
|
|
|
|
|
|
/* Extract bank ID from the reset identifier. */
|
|
|
|
#define RSTMGR_BANK(_reset) \
|
|
|
|
(((_reset) >> RSTMGR_BANK_OFFSET) & RSTMGR_BANK_MASK)
|
|
|
|
|
|
|
|
/* Create a human-readable reference to SoCFPGA reset. */
|
|
|
|
#define SOCFPGA_RESET(_name) RSTMGR_##_name
|
2014-09-09 12:03:28 +00:00
|
|
|
|
2017-04-25 18:44:34 +00:00
|
|
|
#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
|
|
|
|
#include <asm/arch/reset_manager_gen5.h>
|
2017-04-25 18:44:38 +00:00
|
|
|
#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
|
|
|
|
#include <asm/arch/reset_manager_arria10.h>
|
2018-05-18 14:05:23 +00:00
|
|
|
#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
|
2019-11-27 07:55:16 +00:00
|
|
|
#include <asm/arch/reset_manager_soc64.h>
|
2017-04-25 18:44:34 +00:00
|
|
|
#endif
|
|
|
|
|
2012-10-04 06:46:02 +00:00
|
|
|
#endif /* _RESET_MANAGER_H_ */
|