diff options
-rw-r--r-- | arch/arm/cpu/armv7/mx6/soc.c | 22 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-mx6/sys_proto.h | 2 | ||||
-rw-r--r-- | board/freescale/mx6sabresd/mx6sabresd.c | 3 | ||||
-rw-r--r-- | board/freescale/mx6slevk/mx6slevk.c | 2 | ||||
-rw-r--r-- | board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c | 2 | ||||
-rw-r--r-- | board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c | 2 | ||||
-rw-r--r-- | board/freescale/mx6sxsabresd/mx6sxsabresd.c | 2 |
7 files changed, 28 insertions, 7 deletions
diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c index a3f2a2a..93be090 100644 --- a/arch/arm/cpu/armv7/mx6/soc.c +++ b/arch/arm/cpu/armv7/mx6/soc.c @@ -869,15 +869,35 @@ void prep_anatop_bypass(void) #endif } -int set_anatop_bypass(void) +int set_anatop_bypass(int wdog_reset_pin) { struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; + struct wdog_regs *wdog; u32 reg = readl(&anatop->reg_core); /* bypass VDDARM/VDDSOC */ reg = reg | (0x1F << 18) | 0x1F; writel(reg, &anatop->reg_core); + if (wdog_reset_pin == 2) + wdog = (struct wdog_regs *) WDOG2_BASE_ADDR; + else if (wdog_reset_pin == 1) + wdog = (struct wdog_regs *) WDOG1_BASE_ADDR; + else + return arm_orig_podf; + /* + * 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; + writew(reg, &wdog->wcr); + return arm_orig_podf; } diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h b/arch/arm/include/asm/arch-mx6/sys_proto.h index c8e5136..5b42ce9 100644 --- a/arch/arm/include/asm/arch-mx6/sys_proto.h +++ b/arch/arm/include/asm/arch-mx6/sys_proto.h @@ -26,7 +26,7 @@ unsigned imx_ddr_size(void); #ifdef CONFIG_LDO_BYPASS_CHECK int check_ldo_bypass(void); int check_1_2G(void); -int set_anatop_bypass(void); +int set_anatop_bypass(int wdog_reset_pin); void ldo_mode_set(int ldo_bypass); void prep_anatop_bypass(void); void finish_anatop_bypass(void); diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c index 994a9dd..c65b983 100644 --- a/board/freescale/mx6sabresd/mx6sabresd.c +++ b/board/freescale/mx6sabresd/mx6sabresd.c @@ -253,6 +253,7 @@ static void setup_iomux_uart(void) } #ifdef CONFIG_SYS_I2C_MXC + /* set all switches APS in normal and PFM mode in standby */ static int setup_pmic_mode(int chip) { @@ -456,7 +457,7 @@ void ldo_mode_set(int ldo_bypass) * VDDARM:1.175V@800M; VDDSOC:1.175V@800M * VDDARM:1.075V@400M; VDDSOC:1.175V@400M */ - is_400M = set_anatop_bypass(); + is_400M = set_anatop_bypass(2); if (is_400M) #if defined(CONFIG_MX6DL) vddarm = 0x1f; diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c index 21dc196..9ff49b4 100644 --- a/board/freescale/mx6slevk/mx6slevk.c +++ b/board/freescale/mx6slevk/mx6slevk.c @@ -787,7 +787,7 @@ void ldo_mode_set(int ldo_bypass) return; } - is_400M = set_anatop_bypass(); + is_400M = set_anatop_bypass(0); /* * MX6SL: VDDARM:1.175V@800M; VDDSOC:1.175V@800M diff --git a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c index 8ddaded..c253a6d 100644 --- a/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c +++ b/board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c @@ -737,7 +737,7 @@ void ldo_mode_set(int ldo_bypass) return; } - set_anatop_bypass(); + set_anatop_bypass(1); printf("switch to ldo_bypass mode!\n"); } diff --git a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c index 70fe481..2d5c8fc 100644 --- a/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c +++ b/board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c @@ -784,7 +784,7 @@ void ldo_mode_set(int ldo_bypass) return; } - set_anatop_bypass(); + set_anatop_bypass(1); printf("switch to ldo_bypass mode!\n"); } diff --git a/board/freescale/mx6sxsabresd/mx6sxsabresd.c b/board/freescale/mx6sxsabresd/mx6sxsabresd.c index 8fa4329..a6552de 100644 --- a/board/freescale/mx6sxsabresd/mx6sxsabresd.c +++ b/board/freescale/mx6sxsabresd/mx6sxsabresd.c @@ -801,7 +801,7 @@ void ldo_mode_set(int ldo_bypass) return; } - set_anatop_bypass(); + set_anatop_bypass(1); printf("switch to ldo_bypass mode!\n"); } |