summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2015-06-12 18:10:24 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:39 +0100
commitab54d9d962d86de4b2ce72e9317896d0162c16dc (patch)
treeb7ed6dd5da889d1970a1a2499264686f19e0cf36 /arch
parent369391082a08fa846980f3447fae662bb12082c4 (diff)
MLK-11101 imx: mx6: Move the set_wdog_reset out of CONFIG_LDO_BYPASS_CHECK
Since the 6ul does not enable the CONFIG_LDO_BYPASS_CHECK, but have to use the set_wdog_reset function. Need to move the funciton out of CONFIG_LDO_BYPASS_CHECK to resolve build issue. Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/mx6/soc.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 0375996af5..291be76803 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -765,6 +765,28 @@ void s_init(void)
writel(mask528, &anatop->pfd_528_clr);
}
+void set_wdog_reset(struct wdog_regs *wdog)
+{
+ u32 reg = readw(&wdog->wcr);
+ /*
+ * use WDOG_B mode to reset external pmic because it's risky for the
+ * following watchdog reboot in case of cpu freq at lowest 400Mhz with
+ * ldo-bypass mode. Because boot frequency maybe higher 800Mhz i.e. So
+ * in ldo-bypass mode watchdog reset will only triger POR reset, not
+ * WDOG reset. But below code depends on hardware design, if HW didn't
+ * connect WDOG_B pin to external pmic such as i.mx6slevk, we can skip
+ * these code since it assumed boot from 400Mhz always.
+ */
+ reg = readw(&wdog->wcr);
+ reg |= 1 << 3;
+ /*
+ * WDZST bit is write-once only bit. Align this bit in kernel,
+ * otherwise kernel code will have no chance to set this bit.
+ */
+ reg |= 1 << 0;
+ writew(reg, &wdog->wcr);
+}
+
#ifdef CONFIG_LDO_BYPASS_CHECK
DECLARE_GLOBAL_DATA_PTR;
static int ldo_bypass;
@@ -857,28 +879,6 @@ void prep_anatop_bypass(void)
#endif
}
-void set_wdog_reset(struct wdog_regs *wdog)
-{
- u32 reg = readw(&wdog->wcr);
- /*
- * use WDOG_B mode to reset external pmic because it's risky for the
- * following watchdog reboot in case of cpu freq at lowest 400Mhz with
- * ldo-bypass mode. Because boot frequency maybe higher 800Mhz i.e. So
- * in ldo-bypass mode watchdog reset will only triger POR reset, not
- * WDOG reset. But below code depends on hardware design, if HW didn't
- * connect WDOG_B pin to external pmic such as i.mx6slevk, we can skip
- * these code since it assumed boot from 400Mhz always.
- */
- reg = readw(&wdog->wcr);
- reg |= 1 << 3;
- /*
- * WDZST bit is write-once only bit. Align this bit in kernel,
- * otherwise kernel code will have no chance to set this bit.
- */
- reg |= 1 << 0;
- writew(reg, &wdog->wcr);
-}
-
int set_anatop_bypass(int wdog_reset_pin)
{
struct anatop_regs *anatop= (struct anatop_regs*)ANATOP_BASE_ADDR;