From d98f436149fbf3dc4c0d30ba7549f53f8d8f8259 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Tue, 23 Aug 2016 00:46:19 +0200 Subject: sunxi: Add support for the AXP806 on sun9i On A80 boards, both a AXP809 (primary) and AXP806 (secondary) PMIC are found. The AXP806 supplies the Cortex-A15 cores with a poly-phase supply to deliver up to 10A of total power. When used in the slave configuration, the AXP806 needs a write to the REGADDR_EXT register to configure it to work on the same RSB bus as the primary PMIC. --- arch/arm/cpu/armv7/sunxi/pmic_bus.c | 8 ++++++++ drivers/power/Kconfig | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/arch/arm/cpu/armv7/sunxi/pmic_bus.c b/arch/arm/cpu/armv7/sunxi/pmic_bus.c index d96130b6ed..8d39046e7b 100644 --- a/arch/arm/cpu/armv7/sunxi/pmic_bus.c +++ b/arch/arm/cpu/armv7/sunxi/pmic_bus.c @@ -14,6 +14,7 @@ #include #include #include +#include #define AXP152_I2C_ADDR 0x30 @@ -27,6 +28,9 @@ #define AXP223_DEVICE_ADDR 0x3a3 #define AXP223_RUNTIME_ADDR 0x2d +#define AXP806_DEVICE_ADDR 0x745 +#define AXP806_RUNTIME_ADDR 0x3a + int pmic_bus_init(void) { /* This cannot be 0 because it is used in SPL before BSS is ready */ @@ -47,6 +51,10 @@ int pmic_bus_init(void) return ret; ret = rsb_set_device_address(AXP223_DEVICE_ADDR, AXP223_RUNTIME_ADDR); +# if defined(CONFIG_AXP806_POWER) + ret |= rsb_set_device_address(AXP806_DEVICE_ADDR, AXP806_RUNTIME_ADDR); + rsb_write(AXP806_RUNTIME_ADDR, AXP806_REGADDR_EXT, 0x10); +# endif # endif if (ret) return ret; diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index d17e2bd698..b3979138f4 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -66,6 +66,13 @@ config SY8106A_POWER endchoice +config AXP806_POWER + boolean "axp806 (slave) pmic support" + depends on MACH_SUN9I && AXP809_POWER + ---help--- + Select this to enable support for the axp806 (slave) pmic found + on most A80 boards. + config AXP_DCDC1_VOLT int "axp pmic dcdc1 voltage" depends on AXP221_POWER || AXP818_POWER || AXP809_POWER -- cgit v1.2.3