summaryrefslogtreecommitdiff
path: root/board/sunxi
diff options
context:
space:
mode:
authorOliver Schinagl <oliver@schinagl.nl>2013-07-26 12:56:58 +0200
committerHans de Goede <hdegoede@redhat.com>2014-11-13 14:49:01 +0100
commit5c7f10fda362db16a7bf3e571b4ae1e88fac2466 (patch)
treee1f036b2b6a5eadc0101430183dd0a01f4a830ba /board/sunxi
parent3b10e6eb68d1bb774d93e1f3d153e68875fda5ad (diff)
downloadu-boot-imx-5c7f10fda362db16a7bf3e571b4ae1e88fac2466.zip
u-boot-imx-5c7f10fda362db16a7bf3e571b4ae1e88fac2466.tar.gz
u-boot-imx-5c7f10fda362db16a7bf3e571b4ae1e88fac2466.tar.bz2
sun6i: Add basic axp221 driver
The A31 uses the AXP221 pmic for various voltages. Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> -- Changes in v2: -Rebase Changes in v3: -Add support for all dldo and aldo-s -Add Kconfig option to select building AXP221 and to select voltage of dldo and aldo-s Changes in v4: -Add axp221_setbits helper function -Use symbolic names for enabled bits in CTRL1 - CTRL3 registers
Diffstat (limited to 'board/sunxi')
-rw-r--r--board/sunxi/board.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index 03890c8..e6ec5b8 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -19,6 +19,9 @@
#ifdef CONFIG_AXP209_POWER
#include <axp209.h>
#endif
+#ifdef CONFIG_AXP221_POWER
+#include <axp221.h>
+#endif
#include <asm/arch/clock.h>
#include <asm/arch/cpu.h>
#include <asm/arch/dram.h>
@@ -169,6 +172,29 @@ void sunxi_board_init(void)
power_failed |= axp209_set_ldo3(2800);
power_failed |= axp209_set_ldo4(2800);
#endif
+#ifdef CONFIG_AXP221_POWER
+ power_failed = axp221_init();
+ power_failed |= axp221_set_dcdc1(3000);
+ power_failed |= axp221_set_dcdc2(1200);
+ power_failed |= axp221_set_dcdc3(1200);
+ power_failed |= axp221_set_dcdc4(1200);
+ power_failed |= axp221_set_dcdc5(1500);
+#if CONFIG_AXP221_DLDO1_VOLT != -1
+ power_failed |= axp221_set_dldo1(CONFIG_AXP221_DLDO1_VOLT);
+#endif
+#if CONFIG_AXP221_DLDO4_VOLT != -1
+ power_failed |= axp221_set_dldo4(CONFIG_AXP221_DLDO4_VOLT);
+#endif
+#if CONFIG_AXP221_ALDO1_VOLT != -1
+ power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT);
+#endif
+#if CONFIG_AXP221_ALDO2_VOLT != -1
+ power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT);
+#endif
+#if CONFIG_AXP221_ALDO3_VOLT != -1
+ power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT);
+#endif
+#endif
printf("DRAM:");
ramsize = sunxi_dram_init();