summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2012-05-01 11:09:49 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-05-15 08:31:36 +0200
commit3f3255c3d731143da87ac1fd26629b57f6f1e2cf (patch)
treefc848fb05dc8d7f96bc22b4e2e00915a06963680 /arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
parentec4836be6e741b55e45efcb42ee29c8994a55c28 (diff)
i.MX28: Add LRADC init to i.MX28 SPL
This code is part of battery boot support for i.MX28. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Detlev Zundel <dzu@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'arch/arm/cpu/arm926ejs/mx28/spl_power_init.c')
-rw-r--r--arch/arm/cpu/arm926ejs/mx28/spl_power_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
index aa4117d3a2..dfb62eb9aa 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_power_init.c
@@ -883,6 +883,13 @@ void mx28_power_set_vddd(uint32_t new_target, uint32_t new_brownout)
new_brownout << POWER_VDDDCTRL_BO_OFFSET_OFFSET);
}
+void mx28_setup_batt_detect(void)
+{
+ mx28_lradc_init();
+ mx28_lradc_enable_batt_measurement();
+ early_delay(10);
+}
+
void mx28_power_init(void)
{
struct mx28_power_regs *power_regs =
@@ -892,6 +899,9 @@ void mx28_power_init(void)
mx28_power_clear_auto_restart();
mx28_power_set_linreg();
mx28_power_setup_5v_detect();
+
+ mx28_setup_batt_detect();
+
mx28_power_configure_power_source();
mx28_enable_output_rail_protection();