blob: 034135bff46905ef97c532d0a03be554d12681ce [file] [log] [blame]
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00001/*
2 * Copyright (C) 2012 Altera Corporation <www.altera.com>
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Dinh Nguyenad51f7c2012-10-04 06:46:02 +00005 */
6
7#ifndef _RESET_MANAGER_H_
8#define _RESET_MANAGER_H_
9
10void reset_cpu(ulong addr);
11void reset_deassert_peripherals_handoff(void);
12
Marek Vasut8d8c6482014-09-08 14:08:45 +020013void socfpga_bridges_reset(int enable);
14
Marek Vasutc38c8692014-09-08 14:08:45 +020015void socfpga_emac_reset(int enable);
Pavel Machek56a00ab2014-09-09 14:03:28 +020016void socfpga_watchdog_reset(void);
Stefan Roeseca6b8fb2014-11-07 13:50:30 +010017void socfpga_spim_enable(void);
Pavel Machek56a00ab2014-09-09 14:03:28 +020018
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000019struct socfpga_reset_manager {
Chin Liang See1922dad2013-08-07 10:08:03 -050020 u32 status;
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000021 u32 ctrl;
Chin Liang See1922dad2013-08-07 10:08:03 -050022 u32 counts;
23 u32 padding1;
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000024 u32 mpu_mod_reset;
25 u32 per_mod_reset;
26 u32 per2_mod_reset;
27 u32 brg_mod_reset;
28};
29
Chin Liang See1922dad2013-08-07 10:08:03 -050030#if defined(CONFIG_SOCFPGA_VIRTUAL_TARGET)
31#define RSTMGR_CTRL_SWWARMRSTREQ_LSB 2
32#else
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000033#define RSTMGR_CTRL_SWWARMRSTREQ_LSB 1
Chin Liang See1922dad2013-08-07 10:08:03 -050034#endif
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000035
Marek Vasutc38c8692014-09-08 14:08:45 +020036#define RSTMGR_PERMODRST_EMAC0_LSB 0
37#define RSTMGR_PERMODRST_EMAC1_LSB 1
Pavel Machek56a00ab2014-09-09 14:03:28 +020038#define RSTMGR_PERMODRST_L4WD0_LSB 6
Stefan Roeseca6b8fb2014-11-07 13:50:30 +010039#define RSTMGR_PERMODRST_SPIM0_LSB 18
40#define RSTMGR_PERMODRST_SPIM1_LSB 19
Pavel Machek56a00ab2014-09-09 14:03:28 +020041
Dinh Nguyenad51f7c2012-10-04 06:46:02 +000042#endif /* _RESET_MANAGER_H_ */