diff options
Diffstat (limited to 'board')
-rw-r--r-- | board/sunxi/board.c | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 55a880e..6ac398c 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -13,15 +13,7 @@ #include <common.h> #include <mmc.h> -#ifdef CONFIG_AXP152_POWER -#include <axp152.h> -#endif -#ifdef CONFIG_AXP209_POWER -#include <axp209.h> -#endif -#ifdef CONFIG_AXP221_POWER -#include <axp221.h> -#endif +#include <axp_pmic.h> #include <asm/arch/clock.h> #include <asm/arch/cpu.h> #include <asm/arch/display.h> @@ -438,40 +430,42 @@ void sunxi_board_init(void) int power_failed = 0; unsigned long ramsize; -#ifdef CONFIG_AXP152_POWER - power_failed = axp152_init(); - power_failed |= axp152_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); - power_failed |= axp152_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); - power_failed |= axp152_set_dcdc4(CONFIG_AXP_DCDC4_VOLT); - power_failed |= axp152_set_ldo2(CONFIG_AXP_ALDO2_VOLT); +#if defined CONFIG_AXP152_POWER || defined CONFIG_AXP209_POWER || defined CONFIG_AXP221_POWER + power_failed = axp_init(); + +#ifdef CONFIG_AXP221_POWER + power_failed |= axp_set_dcdc1(CONFIG_AXP_DCDC1_VOLT); #endif -#ifdef CONFIG_AXP209_POWER - power_failed |= axp209_init(); - power_failed |= axp209_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); - power_failed |= axp209_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); - power_failed |= axp209_set_ldo2(CONFIG_AXP_ALDO2_VOLT); - power_failed |= axp209_set_ldo3(CONFIG_AXP_ALDO3_VOLT); - power_failed |= axp209_set_ldo4(CONFIG_AXP_ALDO4_VOLT); + power_failed |= axp_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); + power_failed |= axp_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); +#ifndef CONFIG_AXP209_POWER + power_failed |= axp_set_dcdc4(CONFIG_AXP_DCDC4_VOLT); #endif #ifdef CONFIG_AXP221_POWER - power_failed = axp221_init(); - power_failed |= axp221_set_dcdc1(CONFIG_AXP_DCDC1_VOLT); - power_failed |= axp221_set_dcdc2(CONFIG_AXP_DCDC2_VOLT); - power_failed |= axp221_set_dcdc3(CONFIG_AXP_DCDC3_VOLT); - power_failed |= axp221_set_dcdc4(CONFIG_AXP_DCDC4_VOLT); - power_failed |= axp221_set_dcdc5(CONFIG_AXP_DCDC5_VOLT); - power_failed |= axp221_set_aldo1(CONFIG_AXP_ALDO1_VOLT); - power_failed |= axp221_set_aldo2(CONFIG_AXP_ALDO2_VOLT); - power_failed |= axp221_set_aldo3(CONFIG_AXP_ALDO3_VOLT); - power_failed |= axp221_set_dldo1(CONFIG_AXP_DLDO1_VOLT); - power_failed |= axp221_set_dldo2(CONFIG_AXP_DLDO2_VOLT); - power_failed |= axp221_set_dldo3(CONFIG_AXP_DLDO3_VOLT); - power_failed |= axp221_set_dldo4(CONFIG_AXP_DLDO4_VOLT); - power_failed |= axp221_set_eldo(1, CONFIG_AXP_ELDO1_VOLT); - power_failed |= axp221_set_eldo(2, CONFIG_AXP_ELDO2_VOLT); - power_failed |= axp221_set_eldo(3, CONFIG_AXP_ELDO3_VOLT); + power_failed |= axp_set_dcdc5(CONFIG_AXP_DCDC5_VOLT); #endif +#ifdef CONFIG_AXP221_POWER + power_failed |= axp_set_aldo1(CONFIG_AXP_ALDO1_VOLT); +#endif + power_failed |= axp_set_aldo2(CONFIG_AXP_ALDO2_VOLT); +#ifndef CONFIG_AXP152_POWER + power_failed |= axp_set_aldo3(CONFIG_AXP_ALDO3_VOLT); +#endif +#ifdef CONFIG_AXP209_POWER + power_failed |= axp_set_aldo4(CONFIG_AXP_ALDO4_VOLT); +#endif + +#ifdef CONFIG_AXP221_POWER + power_failed |= axp_set_dldo1(CONFIG_AXP_DLDO1_VOLT); + power_failed |= axp_set_dldo2(CONFIG_AXP_DLDO2_VOLT); + power_failed |= axp_set_dldo3(CONFIG_AXP_DLDO3_VOLT); + power_failed |= axp_set_dldo4(CONFIG_AXP_DLDO4_VOLT); + power_failed |= axp_set_eldo(1, CONFIG_AXP_ELDO1_VOLT); + power_failed |= axp_set_eldo(2, CONFIG_AXP_ELDO2_VOLT); + power_failed |= axp_set_eldo(3, CONFIG_AXP_ELDO3_VOLT); +#endif +#endif printf("DRAM:"); ramsize = sunxi_dram_init(); printf(" %lu MiB\n", ramsize >> 20); |