Commit 12631a3faba80f58f24086d6d9b561ab9b808025
1 parent
404fd02e96
Exists in
smarc-imx-l5.0.0_1.0.0-ga
ENGR00326277-2 imx6: watchdog: use WDOG_B mode for wdog reset in ldo-bypass mode
In ldo-bypass mode, we need trigger WDOG_B pin to reset pmic in ldo-bypass mode. Signed-off-by: Robin Gong <b38343@freescale.com>
Showing 7 changed files with 28 additions and 7 deletions Side-by-side Diff
arch/arm/cpu/armv7/mx6/soc.c
... | ... | @@ -869,14 +869,34 @@ |
869 | 869 | #endif |
870 | 870 | } |
871 | 871 | |
872 | -int set_anatop_bypass(void) | |
872 | +int set_anatop_bypass(int wdog_reset_pin) | |
873 | 873 | { |
874 | 874 | struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR; |
875 | + struct wdog_regs *wdog; | |
875 | 876 | u32 reg = readl(&anatop->reg_core); |
876 | 877 | |
877 | 878 | /* bypass VDDARM/VDDSOC */ |
878 | 879 | reg = reg | (0x1F << 18) | 0x1F; |
879 | 880 | writel(reg, &anatop->reg_core); |
881 | + | |
882 | + if (wdog_reset_pin == 2) | |
883 | + wdog = (struct wdog_regs *) WDOG2_BASE_ADDR; | |
884 | + else if (wdog_reset_pin == 1) | |
885 | + wdog = (struct wdog_regs *) WDOG1_BASE_ADDR; | |
886 | + else | |
887 | + return arm_orig_podf; | |
888 | + /* | |
889 | + * use WDOG_B mode to reset external pmic because it's risky for the | |
890 | + * following watchdog reboot in case of cpu freq at lowest 400Mhz with | |
891 | + * ldo-bypass mode. Because boot frequency maybe higher 800Mhz i.e. So | |
892 | + * in ldo-bypass mode watchdog reset will only triger POR reset, not | |
893 | + * WDOG reset. But below code depends on hardware design, if HW didn't | |
894 | + * connect WDOG_B pin to external pmic such as i.mx6slevk, we can skip | |
895 | + * these code since it assumed boot from 400Mhz always. | |
896 | + */ | |
897 | + reg = readw(&wdog->wcr); | |
898 | + reg |= 1 << 3; | |
899 | + writew(reg, &wdog->wcr); | |
880 | 900 | |
881 | 901 | return arm_orig_podf; |
882 | 902 | } |
arch/arm/include/asm/arch-mx6/sys_proto.h
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | #ifdef CONFIG_LDO_BYPASS_CHECK |
27 | 27 | int check_ldo_bypass(void); |
28 | 28 | int check_1_2G(void); |
29 | -int set_anatop_bypass(void); | |
29 | +int set_anatop_bypass(int wdog_reset_pin); | |
30 | 30 | void ldo_mode_set(int ldo_bypass); |
31 | 31 | void prep_anatop_bypass(void); |
32 | 32 | void finish_anatop_bypass(void); |
board/freescale/mx6sabresd/mx6sabresd.c
... | ... | @@ -253,6 +253,7 @@ |
253 | 253 | } |
254 | 254 | |
255 | 255 | #ifdef CONFIG_SYS_I2C_MXC |
256 | + | |
256 | 257 | /* set all switches APS in normal and PFM mode in standby */ |
257 | 258 | static int setup_pmic_mode(int chip) |
258 | 259 | { |
... | ... | @@ -456,7 +457,7 @@ |
456 | 457 | * VDDARM:1.175V@800M; VDDSOC:1.175V@800M |
457 | 458 | * VDDARM:1.075V@400M; VDDSOC:1.175V@400M |
458 | 459 | */ |
459 | - is_400M = set_anatop_bypass(); | |
460 | + is_400M = set_anatop_bypass(2); | |
460 | 461 | if (is_400M) |
461 | 462 | #if defined(CONFIG_MX6DL) |
462 | 463 | vddarm = 0x1f; |
board/freescale/mx6slevk/mx6slevk.c
board/freescale/mx6sx_17x17_arm2/mx6sx_17x17_arm2.c
board/freescale/mx6sx_19x19_arm2/mx6sx_19x19_arm2.c