summaryrefslogtreecommitdiff
path: root/board/pandora/pandora.c
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2010-06-08 17:19:22 -0400
committerSandeep Paulraj <s-paulraj@ti.com>2010-06-08 17:19:22 -0400
commit5246d01edd8935e04cdf79a5b9a03874509a31b1 (patch)
tree98312de0662f38bc64275dff8f24ae9fd44bef28 /board/pandora/pandora.c
parent23911740486c59851df57521c49bfd81ce1865ec (diff)
downloadu-boot-imx-5246d01edd8935e04cdf79a5b9a03874509a31b1.zip
u-boot-imx-5246d01edd8935e04cdf79a5b9a03874509a31b1.tar.gz
u-boot-imx-5246d01edd8935e04cdf79a5b9a03874509a31b1.tar.bz2
OMAP3: pandora: enable battery backup capacitor
Pandora has a capacitor connected as backup battery, which allows retaining RTC for some time while main battery is removed. Enable backup battery charge function to charge that capacitor. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Diffstat (limited to 'board/pandora/pandora.c')
-rw-r--r--board/pandora/pandora.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c
index 75e4330..355e9ea 100644
--- a/board/pandora/pandora.c
+++ b/board/pandora/pandora.c
@@ -37,6 +37,10 @@
#include <asm/mach-types.h>
#include "pandora.h"
+#define TWL4030_BB_CFG_BBCHEN (1 << 4)
+#define TWL4030_BB_CFG_BBSEL_3200MV (3 << 2)
+#define TWL4030_BB_CFG_BBISEL_500UA 2
+
/*
* Routine: board_init
* Description: Early hardware init.
@@ -78,6 +82,11 @@ int misc_init_r(void)
writel(GPIO28, &gpio5_base->setdataout);
writel(GPIO4, &gpio6_base->setdataout);
+ /* Enable battery backup capacitor (3.2V, 0.5mA charge current) */
+ twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER,
+ TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
+ TWL4030_BB_CFG_BBISEL_500UA, TWL4030_PM_RECEIVER_BB_CFG);
+
dieid_num_r();
return 0;