sunxi: power: Make all voltages configurable through Kconfig

On boards with axp221/223 pmic-s we already allow configuring most
voltages. Make the Kconfig options for these also apply to boards with
axp152 / axp209 pmic-s and extend them to configure all voltages.

The Kconfig defaults are chosen so that this commit does not introduce any
functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
This commit is contained in:
Hans de Goede 2015-09-30 15:22:42 +02:00
parent 1df44814f5
commit 401175220d
16 changed files with 195 additions and 109 deletions

View File

@ -440,36 +440,36 @@ void sunxi_board_init(void)
#ifdef CONFIG_AXP152_POWER
power_failed = axp152_init();
power_failed |= axp152_set_dcdc2(1400);
power_failed |= axp152_set_dcdc3(1500);
power_failed |= axp152_set_dcdc4(1250);
power_failed |= axp152_set_ldo2(3000);
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);
#endif
#ifdef CONFIG_AXP209_POWER
power_failed |= axp209_init();
power_failed |= axp209_set_dcdc2(1400);
power_failed |= axp209_set_dcdc3(1250);
power_failed |= axp209_set_ldo2(3000);
power_failed |= axp209_set_ldo3(2800);
power_failed |= axp209_set_ldo4(2800);
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);
#endif
#ifdef CONFIG_AXP221_POWER
power_failed = axp221_init();
power_failed |= axp221_set_dcdc1(CONFIG_AXP221_DCDC1_VOLT);
power_failed |= axp221_set_dcdc2(CONFIG_AXP221_DCDC2_VOLT);
power_failed |= axp221_set_dcdc3(1200); /* VDD-CPU */
#ifdef CONFIG_MACH_SUN6I
power_failed |= axp221_set_dcdc4(1200); /* A31:VDD-SYS */
#else
power_failed |= axp221_set_dcdc4(0); /* A23:unused */
#endif
power_failed |= axp221_set_dcdc5(1500); /* VCC-DRAM */
power_failed |= axp221_set_dldo1(CONFIG_AXP221_DLDO1_VOLT);
power_failed |= axp221_set_dldo4(CONFIG_AXP221_DLDO4_VOLT);
power_failed |= axp221_set_aldo1(CONFIG_AXP221_ALDO1_VOLT);
power_failed |= axp221_set_aldo2(CONFIG_AXP221_ALDO2_VOLT);
power_failed |= axp221_set_aldo3(CONFIG_AXP221_ALDO3_VOLT);
power_failed |= axp221_set_eldo(3, CONFIG_AXP221_ELDO3_VOLT);
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);
#endif
printf("DRAM:");

View File

@ -12,7 +12,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_MUSB_HOST=y

View File

@ -22,6 +22,6 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP221_ELDO3_VOLT=1800
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_AXP_ELDO3_VOLT=1800
CONFIG_USB_EHCI_HCD=y

View File

@ -14,5 +14,5 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPA(21)"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y

View File

@ -16,7 +16,7 @@ CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_USB_MUSB_HOST=y
CONFIG_VIDEO_LCD_SSD2828_TX_CLK=27
CONFIG_VIDEO_LCD_SSD2828_RESET="PA26"

View File

@ -12,9 +12,9 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_DCDC1_VOLT=3300
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_DLDO4_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_MUSB_HOST=y

View File

@ -12,8 +12,8 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_DCDC1_VOLT=3300
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_DLDO4_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y

View File

@ -12,8 +12,8 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_DCDC1_VOLT=3300
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_DLDO4_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_DCDC1_VOLT=3300
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_DLDO4_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y

View File

@ -9,4 +9,4 @@ CONFIG_SPL=y
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_ALDO1_VOLT=3000

View File

@ -21,7 +21,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3000
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_MUSB_HOST=y

View File

@ -20,7 +20,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DCDC2_VOLT=1100
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_DCDC2_VOLT=1100
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3000
CONFIG_USB_MUSB_HOST=y

View File

@ -13,5 +13,5 @@ CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII,MACPWR=SUNXI_GPA(21)"
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_ETH_DESIGNWARE=y
CONFIG_AXP221_ALDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3300
CONFIG_USB_EHCI_HCD=y

View File

@ -20,6 +20,6 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3000
CONFIG_USB_MUSB_HOST=y

View File

@ -20,6 +20,6 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3000
CONFIG_USB_MUSB_HOST=y

View File

@ -20,6 +20,6 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=5"
# CONFIG_CMD_IMLS is not set
# CONFIG_CMD_FLASH is not set
# CONFIG_CMD_FPGA is not set
CONFIG_AXP221_DLDO1_VOLT=3300
CONFIG_AXP221_ALDO1_VOLT=3000
CONFIG_AXP_DLDO1_VOLT=3300
CONFIG_AXP_ALDO1_VOLT=3000
CONFIG_USB_MUSB_HOST=y

View File

@ -38,79 +38,165 @@ config AXP221_POWER
endchoice
config AXP221_DCDC1_VOLT
int "axp221 dcdc1 voltage"
config AXP_DCDC1_VOLT
int "axp pmic dcdc1 voltage"
depends on AXP221_POWER
default 3000
default 3000 if MACH_SUN6I || MACH_SUN8I
---help---
Set the voltage (mV) to program the axp221 dcdc1 at, set to 0 to
disable dcdc1. This is typically used as generic 3.3V IO voltage for
things like GPIO-s, sdcard interfaces, etc. On most boards this is
undervolted to 3.0V to safe battery.
Set the voltage (mV) to program the axp pmic dcdc1 at, set to 0 to
disable dcdc1. On A23 / A31 / A33 (axp221) boards dcdc1 is used for
generic 3.3V IO voltage for external devices like the lcd-panal and
sdcard interfaces, etc. On most boards dcdc1 is undervolted to 3.0V to
safe battery. On A31 devices dcdc1 is also used for VCC-IO.
config AXP221_DCDC2_VOLT
int "axp221 dcdc2 voltage"
config AXP_DCDC2_VOLT
int "axp pmic dcdc2 voltage"
depends on AXP152_POWER || AXP209_POWER || AXP221_POWER
default 1400 if AXP152_POWER || AXP209_POWER
default 1200 if MACH_SUN6I || MACH_SUN8I
---help---
Set the voltage (mV) to program the axp pmic dcdc2 at, set to 0 to
disable dcdc2.
On A10(s) / A13 / A20 boards dcdc2 is VDD-CPU and should be 1.4V.
On A31 boards dcdc2 is used for VDD-GPU and should be 1.2V.
On A23/A33 boards dcdc2 is used for VDD-SYS and should be 1.2V.
config AXP_DCDC3_VOLT
int "axp pmic dcdc3 voltage"
depends on AXP152_POWER || AXP209_POWER || AXP221_POWER
default 1500 if AXP152_POWER
default 1250 if AXP209_POWER
default 1200 if MACH_SUN6I || MACH_SUN8I
---help---
Set the voltage (mV) to program the axp pmic dcdc3 at, set to 0 to
disable dcdc3.
On A10(s) / A13 / A20 boards with an axp209 dcdc3 is VDD-INT-DLL and
should be 1.25V.
On A10s boards with an axp152 dcdc3 is VCC-DRAM and should be 1.5V.
On A23 / A31 / A33 boards dcdc3 is VDD-CPU and should be 1.2V.
config AXP_DCDC4_VOLT
int "axp pmic dcdc4 voltage"
depends on AXP152_POWER || AXP221_POWER
default 1250 if AXP152_POWER
default 1200 if MACH_SUN6I
default 0 if MACH_SUN8I
---help---
Set the voltage (mV) to program the axp pmic dcdc4 at, set to 0 to
disable dcdc4.
On A10s boards with an axp152 dcdc4 is VDD-INT-DLL and should be 1.25V.
On A31 boards dcdc4 is used for VDD-SYS and should be 1.2V.
On A23 / A33 boards dcdc4 is unused and should be disabled.
config AXP_DCDC5_VOLT
int "axp pmic dcdc5 voltage"
depends on AXP221_POWER
default 1200
default 1500 if MACH_SUN6I || MACH_SUN8I
---help---
Set the voltage (mV) to program the axp221 dcdc2 at, set to 0 to
disable dcdc2. On A31 boards this is typically used for VDD-GPU,
on A23/A33 for VDD-SYS, this should normally be set to 1.2V.
Set the voltage (mV) to program the axp pmic dcdc5 at, set to 0 to
disable dcdc5.
On A23 / A31 / A33 boards dcdc5 is VCC-DRAM and should be 1.5V.
config AXP221_DLDO1_VOLT
int "axp221 dldo1 voltage"
config AXP_ALDO1_VOLT
int "axp pmic (a)ldo1 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp221 dldo1 at, set to 0 to
disable dldo1. On sun6i (A31) boards with ethernet this is often used
to power the ethernet phy. On sun8i (A23) boards this is often used to
power the wifi.
Set the voltage (mV) to program the axp pmic aldo1 at, set to 0 to
disable aldo1.
On A31 boards aldo1 is often used to power the wifi module.
On A23 / A33 boards aldo1 is used for VCC-IO and should be 3.0V.
config AXP221_DLDO4_VOLT
int "axp221 dldo4 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp221 dldo4 at, set to 0 to
disable dldo4.
config AXP221_ALDO1_VOLT
int "axp221 aldo1 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp221 aldo1 at, set to 0 to
disable aldo1. On sun6i (A31) boards which have a wifi module this is
often used to power the wifi module.
config AXP221_ALDO2_VOLT
int "axp221 aldo2 voltage"
depends on AXP221_POWER
config AXP_ALDO2_VOLT
int "axp pmic (a)ldo2 voltage"
depends on AXP152_POWER || AXP209_POWER || AXP221_POWER
default 3000 if AXP152_POWER || AXP209_POWER
default 0 if MACH_SUN6I
default 2500 if MACH_SUN8I
---help---
Set the voltage (mV) to program the axp221 aldo2 at, set to 0 to
disable aldo2. On sun6i (A31) boards this is typically unused and
should be disabled, if it is used for LPDDR2 it should be set to 1.8V.
On sun8i (A23) this is typically connected to VDD-DLL and must be set
to 2.5V.
Set the voltage (mV) to program the axp pmic aldo2 at, set to 0 to
disable aldo2.
On A10(s) / A13 / A20 boards aldo2 is AVCC and should be 3.0V.
On A31 boards aldo2 is typically unused and should be disabled.
On A31 boards aldo2 may be used for LPDDR2 then it should be 1.8V.
On A23 / A33 boards aldo2 is used for VDD-DLL and should be 2.5V.
config AXP221_ALDO3_VOLT
int "axp221 aldo3 voltage"
depends on AXP221_POWER
default 3000
config AXP_ALDO3_VOLT
int "axp pmic (a)ldo3 voltage"
depends on AXP209_POWER || AXP221_POWER
default 2800 if AXP209_POWER
default 3000 if MACH_SUN6I || MACH_SUN8I
---help---
Set the voltage (mV) to program the axp221 aldo3 at, set to 0 to
disable aldo3. This is typically connected to VCC-PLL and AVCC and
must be set to 3V.
Set the voltage (mV) to program the axp pmic aldo3 at, set to 0 to
disable aldo3.
On A10(s) / A13 / A20 boards aldo3 should be 2.8V.
On A23 / A31 / A33 boards aldo3 is VCC-PLL and AVCC and should be 3.0V.
config AXP221_ELDO3_VOLT
int "axp221 eldo3 voltage"
config AXP_ALDO4_VOLT
int "axp pmic (a)ldo4 voltage"
depends on AXP209_POWER
default 2800 if AXP209_POWER
---help---
Set the voltage (mV) to program the axp pmic aldo4 at, set to 0 to
disable aldo4.
On A10(s) / A13 / A20 boards aldo4 should be 2.8V.
config AXP_DLDO1_VOLT
int "axp pmic dldo1 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp221 eldo3 at, set to 0 to
Set the voltage (mV) to program the axp pmic dldo1 at, set to 0 to
disable dldo1. On sun6i (A31) boards with ethernet dldo1 is often used
to power the ethernet phy. On sun8i (A23) boards this is often used to
power the wifi.
config AXP_DLDO2_VOLT
int "axp pmic dldo2 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic dldo2 at, set to 0 to
disable dldo2.
config AXP_DLDO3_VOLT
int "axp pmic dldo3 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic dldo3 at, set to 0 to
disable dldo3.
config AXP_DLDO4_VOLT
int "axp pmic dldo4 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic dldo4 at, set to 0 to
disable dldo4.
config AXP_ELDO1_VOLT
int "axp pmic eldo1 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic eldo1 at, set to 0 to
disable eldo1.
config AXP_ELDO2_VOLT
int "axp pmic eldo2 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic eldo2 at, set to 0 to
disable eldo2.
config AXP_ELDO3_VOLT
int "axp pmic eldo3 voltage"
depends on AXP221_POWER
default 0
---help---
Set the voltage (mV) to program the axp pmic eldo3 at, set to 0 to
disable eldo3. On some A31(s) tablets it might be used to supply
1.2V for the SSD2828 chip (converter of parallel LCD interface
into MIPI DSI).