[U-Boot] [PATCH] imx: Remove boolean parameter from wdog powerdown function
Fabio Estevam
fabio.estevam at nxp.com
Thu Nov 23 12:55:33 UTC 2017
imx_set_wdog_powerdown() is always used to disable the power down
enable bit, so remove the boolean parameter of the function.
It is also a bit strange to write a boolean value into registers,
so this new version makes explicit that we are writing 0.
While at it, rename it to imx_wdog_disable_powerdown().
Signed-off-by: Fabio Estevam <fabio.estevam at nxp.com>
---
arch/arm/include/asm/mach-imx/sys_proto.h | 2 +-
arch/arm/mach-imx/init.c | 10 +++++-----
arch/arm/mach-imx/mx6/soc.c | 2 +-
arch/arm/mach-imx/mx7/soc.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h
index d5e3eec..d789de1 100644
--- a/arch/arm/include/asm/mach-imx/sys_proto.h
+++ b/arch/arm/include/asm/mach-imx/sys_proto.h
@@ -105,7 +105,7 @@ void set_chipselect_size(int const);
void init_aips(void);
void init_src(void);
-void imx_set_wdog_powerdown(bool enable);
+void imx_wdog_disable_powerdown(void);
int board_mmc_get_env_dev(int devno);
diff --git a/arch/arm/mach-imx/init.c b/arch/arm/mach-imx/init.c
index 2a05c59..0aa8295 100644
--- a/arch/arm/mach-imx/init.c
+++ b/arch/arm/mach-imx/init.c
@@ -65,7 +65,7 @@ void init_aips(void)
}
}
-void imx_set_wdog_powerdown(bool enable)
+void imx_wdog_disable_powerdown(void)
{
struct wdog_regs *wdog1 = (struct wdog_regs *)WDOG1_BASE_ADDR;
struct wdog_regs *wdog2 = (struct wdog_regs *)WDOG2_BASE_ADDR;
@@ -75,13 +75,13 @@ void imx_set_wdog_powerdown(bool enable)
#endif
/* Write to the PDE (Power Down Enable) bit */
- writew(enable, &wdog1->wmcr);
- writew(enable, &wdog2->wmcr);
+ writew(0, &wdog1->wmcr);
+ writew(0, &wdog2->wmcr);
if (is_mx6sx() || is_mx6ul() || is_mx6ull() || is_mx7())
- writew(enable, &wdog3->wmcr);
+ writew(0, &wdog3->wmcr);
#ifdef CONFIG_MX7D
- writew(enable, &wdog4->wmcr);
+ writew(0, &wdog4->wmcr);
#endif
}
diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index ad72c12..43cb581 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -436,7 +436,7 @@ int arch_cpu_init(void)
if (is_mx6sl())
setbits_le32(&ccm->cscmr1, MXC_CCM_CSCMR1_PER_CLK_SEL_MASK);
- imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
+ imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register */
if (is_mx6sx())
setbits_le32(&ccm->cscdr1, MXC_CCM_CSCDR1_UART_CLK_SEL);
diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c
index 87bf105..d160e80 100644
--- a/arch/arm/mach-imx/mx7/soc.c
+++ b/arch/arm/mach-imx/mx7/soc.c
@@ -236,7 +236,7 @@ int arch_cpu_init(void)
init_csu();
/* Disable PDE bit of WMCR register */
- imx_set_wdog_powerdown(false);
+ imx_wdog_disable_powerdown();
imx_enet_mdio_fixup();
--
2.7.4
More information about the U-Boot
mailing list