diff options
author | Adrian Alonso <aalonso@freescale.com> | 2015-09-02 13:54:21 -0500 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-09-13 10:11:54 +0200 |
commit | 648539c906bb3b039b503b9b6325076eff4d9e5d (patch) | |
tree | e4fd83b111b6f88e6329946ea6e4ee21c4f99353 /arch/arm/imx-common | |
parent | 75a565f2977b423c43a9ebbc6858d708b36b1194 (diff) |
arm: imx-common: init: rework wdog settings for imx6/imx7
Rework imx_set_wdog_powerdown to be reused by imx6 and imx7
Signed-off-by: Adrian Alonso <aalonso@freescale.com>
Diffstat (limited to 'arch/arm/imx-common')
-rw-r--r-- | arch/arm/imx-common/init.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/imx-common/init.c b/arch/arm/imx-common/init.c index f1d43142a2..56d5010449 100644 --- a/arch/arm/imx-common/init.c +++ b/arch/arm/imx-common/init.c @@ -66,6 +66,27 @@ void init_aips(void) } } +void imx_set_wdog_powerdown(bool enable) +{ + struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR; + struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR; + struct wdog_regs *wdog3 = (struct wdog_regs *)WDOG3_BASE_ADDR; +#ifdef CONFIG_MX7D + struct wdog_regs *wdog4 = (struct wdog_regs *)WDOG4_BASE_ADDR; +#endif + + /* Write to the PDE (Power Down Enable) bit */ + writew(enable, &wdog1->wmcr); + writew(enable, &wdog2->wmcr); + + if (is_cpu_type(MXC_CPU_MX6SX) || is_cpu_type(MXC_CPU_MX6UL) || + is_soc_type(MXC_SOC_MX7)) + writew(enable, &wdog3->wmcr); +#ifdef CONFIG_MX7D + writew(enable, &wdog4->wmcr); +#endif +} + #define SRC_SCR_WARM_RESET_ENABLE 0 void init_src(void) |