diff options
author | Anson Huang <b20788@freescale.com> | 2014-09-16 23:11:46 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2014-11-23 01:56:17 -0500 |
commit | bc4abc3e5f40edc43e54da41b7acf8222e9cb888 (patch) | |
tree | f28fe8c8748ece34518b7c0c2127ee11b0f764bb /arch/arm/mach-imx | |
parent | ec336b284136610a43c9daac56d66b20d43ddf7b (diff) |
ARM: imx: add anatop settings for LPDDR2 when enter DSM mode
For LPDDR2 platform, no need to enable weak2P5 in DSM mode,
it can be pulled down to save power(~0.65mW).
And per design team's recommendation, we should disconnect
VDDHIGH and SNVS in DSM mode on i.MX6SL.
Signed-off-by: Anson Huang <b20788@freescale.com>
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/anatop.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/anatop.c b/arch/arm/mach-imx/anatop.c index 8259a625a920..7f262fe4ba77 100644 --- a/arch/arm/mach-imx/anatop.c +++ b/arch/arm/mach-imx/anatop.c | |||
@@ -30,8 +30,11 @@ | |||
30 | #define ANADIG_DIGPROG_IMX6SL 0x280 | 30 | #define ANADIG_DIGPROG_IMX6SL 0x280 |
31 | 31 | ||
32 | #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG 0x40000 | 32 | #define BM_ANADIG_REG_2P5_ENABLE_WEAK_LINREG 0x40000 |
33 | #define BM_ANADIG_REG_2P5_ENABLE_PULLDOWN 0x8 | ||
33 | #define BM_ANADIG_REG_CORE_FET_ODRIVE 0x20000000 | 34 | #define BM_ANADIG_REG_CORE_FET_ODRIVE 0x20000000 |
34 | #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000 | 35 | #define BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG 0x1000 |
36 | /* Below MISC0_DISCON_HIGH_SNVS is only for i.MX6SL */ | ||
37 | #define BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS 0x2000 | ||
35 | #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000 | 38 | #define BM_ANADIG_USB_CHRG_DETECT_CHK_CHRG_B 0x80000 |
36 | #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000 | 39 | #define BM_ANADIG_USB_CHRG_DETECT_EN_B 0x100000 |
37 | 40 | ||
@@ -56,16 +59,43 @@ static void imx_anatop_enable_fet_odrive(bool enable) | |||
56 | BM_ANADIG_REG_CORE_FET_ODRIVE); | 59 | BM_ANADIG_REG_CORE_FET_ODRIVE); |
57 | } | 60 | } |
58 | 61 | ||
62 | static inline void imx_anatop_enable_2p5_pulldown(bool enable) | ||
63 | { | ||
64 | regmap_write(anatop, ANADIG_REG_2P5 + (enable ? REG_SET : REG_CLR), | ||
65 | BM_ANADIG_REG_2P5_ENABLE_PULLDOWN); | ||
66 | } | ||
67 | |||
68 | static inline void imx_anatop_disconnect_high_snvs(bool enable) | ||
69 | { | ||
70 | regmap_write(anatop, ANADIG_ANA_MISC0 + (enable ? REG_SET : REG_CLR), | ||
71 | BM_ANADIG_ANA_MISC0_DISCON_HIGH_SNVS); | ||
72 | } | ||
73 | |||
59 | void imx_anatop_pre_suspend(void) | 74 | void imx_anatop_pre_suspend(void) |
60 | { | 75 | { |
61 | imx_anatop_enable_weak2p5(true); | 76 | if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) |
77 | imx_anatop_enable_2p5_pulldown(true); | ||
78 | else | ||
79 | imx_anatop_enable_weak2p5(true); | ||
80 | |||
62 | imx_anatop_enable_fet_odrive(true); | 81 | imx_anatop_enable_fet_odrive(true); |
82 | |||
83 | if (cpu_is_imx6sl()) | ||
84 | imx_anatop_disconnect_high_snvs(true); | ||
63 | } | 85 | } |
64 | 86 | ||
65 | void imx_anatop_post_resume(void) | 87 | void imx_anatop_post_resume(void) |
66 | { | 88 | { |
89 | if (imx_mmdc_get_ddr_type() == IMX_DDR_TYPE_LPDDR2) | ||
90 | imx_anatop_enable_2p5_pulldown(false); | ||
91 | else | ||
92 | imx_anatop_enable_weak2p5(false); | ||
93 | |||
67 | imx_anatop_enable_fet_odrive(false); | 94 | imx_anatop_enable_fet_odrive(false); |
68 | imx_anatop_enable_weak2p5(false); | 95 | |
96 | if (cpu_is_imx6sl()) | ||
97 | imx_anatop_disconnect_high_snvs(false); | ||
98 | |||
69 | } | 99 | } |
70 | 100 | ||
71 | static void imx_anatop_usb_chrg_detect_disable(void) | 101 | static void imx_anatop_usb_chrg_detect_disable(void) |