summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTien Fong Chee <tien.fong.chee@intel.com>2019-08-07 13:40:32 +0800
committerTien Fong Chee <tien.fong.chee@intel.com>2019-08-19 16:20:27 +0800
commita8a2b629db18c98409c46655e07656deba762e26 (patch)
treed1f6e1889ad06560d5042cc0e4d37f2672d993ab
parent2e82a8b3a8edde91fbdc0c76442e38eeac4f3035 (diff)
downloadu-boot-socfpga-a8a2b629db18c98409c46655e07656deba762e26.tar.gz
arm: socfpga: Add watchdog 1 support to A10
Add watchdog 1 support to A10, ensure the same enable/disable process as watchdog 0. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>
-rw-r--r--arch/arm/mach-socfpga/include/mach/base_addr_a10.h1
-rw-r--r--arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h1
-rw-r--r--arch/arm/mach-socfpga/reset_manager_arria10.c21
-rw-r--r--arch/arm/mach-socfpga/spl_a10.c2
4 files changed, 19 insertions, 6 deletions
diff --git a/arch/arm/mach-socfpga/include/mach/base_addr_a10.h b/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
index 929c413e03..e6eccf1f94 100644
--- a/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
+++ b/arch/arm/mach-socfpga/include/mach/base_addr_a10.h
@@ -17,6 +17,7 @@
#define SOCFPGA_FPGAMGRDATA_ADDRESS 0xffcfe400
#define SOCFPGA_FPGAMGRREGS_ADDRESS 0xffd03000
#define SOCFPGA_L4WD0_ADDRESS 0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS 0xffd00300
#define SOCFPGA_SYSMGR_ADDRESS 0xffd06000
#define SOCFPGA_PINMUX_SHARED_3V_IO_ADDRESS 0xffd07000
#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS 0xffd07200
diff --git a/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h b/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
index 4a1768c71d..561683b5ed 100644
--- a/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
+++ b/arch/arm/mach-socfpga/include/mach/reset_manager_arria10.h
@@ -12,6 +12,7 @@ void socfpga_watchdog_disable(void);
void socfpga_reset_deassert_noc_ddr_scheduler(void);
int socfpga_reset_deassert_bridges_handoff(void);
void socfpga_reset_deassert_wd0(void);
+void socfpga_reset_deassert_wd1(void);
int socfpga_bridges_reset(void);
struct socfpga_reset_manager {
diff --git a/arch/arm/mach-socfpga/reset_manager_arria10.c b/arch/arm/mach-socfpga/reset_manager_arria10.c
index 0112cbbfb5..24cf9e625f 100644
--- a/arch/arm/mach-socfpga/reset_manager_arria10.c
+++ b/arch/arm/mach-socfpga/reset_manager_arria10.c
@@ -65,6 +65,9 @@ void socfpga_watchdog_disable(void)
/* assert reset for watchdog */
setbits_le32(&reset_manager_base->per1modrst,
ALT_RSTMGR_PER1MODRST_WD0_SET_MSK);
+
+ setbits_le32(&reset_manager_base->per1modrst,
+ ALT_RSTMGR_PER1MODRST_WD1_SET_MSK);
}
/* Release NOC ddr scheduler from reset */
@@ -117,6 +120,13 @@ void socfpga_reset_deassert_wd0(void)
ALT_RSTMGR_PER1MODRST_WD0_SET_MSK);
}
+/* Release Watchdog 1 from reset through reset manager */
+void socfpga_reset_deassert_wd1(void)
+{
+ clrbits_le32(&reset_manager_base->per1modrst,
+ ALT_RSTMGR_PER1MODRST_WD1_SET_MSK);
+}
+
/*
* Assert or de-assert SoCFPGA reset manager reset.
*/
@@ -153,15 +163,16 @@ void socfpga_per_reset(u32 reset, int set)
}
/*
- * Assert reset on every peripheral but L4WD0.
+ * Assert reset on every peripheral but L4WD0 & l4WD1.
* Watchdog must be kept intact to prevent glitches
* and/or hangs.
* For the Arria10, we disable all the peripherals except L4 watchdog0,
- * L4 Timer 0, and ECC.
+ * L4 watchdog1, L4 Timer 0, and ECC.
*/
void socfpga_per_reset_all(void)
{
- const u32 l4wd0 = (1 << RSTMGR_RESET(SOCFPGA_RESET(L4WD0)) |
+ const u32 l4wd = (1 << RSTMGR_RESET(SOCFPGA_RESET(L4WD0)) |
+ 1 << RSTMGR_RESET(SOCFPGA_RESET(L4WD1)) |
(1 << RSTMGR_RESET(SOCFPGA_RESET(L4SYSTIMER0))));
unsigned mask_ecc_ocp =
ALT_RSTMGR_PER0MODRST_EMACECC0_SET_MSK |
@@ -173,8 +184,8 @@ void socfpga_per_reset_all(void)
ALT_RSTMGR_PER0MODRST_QSPIECC_SET_MSK |
ALT_RSTMGR_PER0MODRST_SDMMCECC_SET_MSK;
- /* disable all components except ECC_OCP, L4 Timer0 and L4 WD0 */
- writel(~l4wd0, &reset_manager_base->per1modrst);
+ /* disable all components except ECC_OCP, L4 Timer0, L4 WD0 & l4 WD1 */
+ writel(~l4wd, &reset_manager_base->per1modrst);
setbits_le32(&reset_manager_base->per0modrst, ~mask_ecc_ocp);
/* Finally disable the ECC_OCP */
diff --git a/arch/arm/mach-socfpga/spl_a10.c b/arch/arm/mach-socfpga/spl_a10.c
index ff1ba36f81..8c55e9d7bc 100644
--- a/arch/arm/mach-socfpga/spl_a10.c
+++ b/arch/arm/mach-socfpga/spl_a10.c
@@ -112,7 +112,7 @@ void board_init_f(ulong dummy)
socfpga_sdram_remap_zero();
socfpga_pl310_clear();
- /* Assert reset to all except L4WD0 and L4TIMER0 */
+ /* Assert reset to all except L4WD0, l4WD1 and L4TIMER0 */
socfpga_per_reset_all();
socfpga_watchdog_disable();