]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: mxs: Provide Kconfig option to disable battery charging at IMX28 PMU
authorLukasz Majewski <lukma@denx.de>
Tue, 9 May 2023 14:32:40 +0000 (16:32 +0200)
committerStefano Babic <sbabic@denx.de>
Tue, 11 Jul 2023 12:40:03 +0000 (14:40 +0200)
This new Kconfig option allows disabling the in-PMU battery charging
block. This may be required when DCDC_BAT source is powered not from
battery, but from already regulated, good quality source.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
arch/arm/mach-imx/mxs/Kconfig

index 9965810ac271eabf1d6db1bf9527c628049e470d..7c584db27c9de36bb9025c0e1ad7db9b88291d9e 100644 (file)
@@ -756,6 +756,13 @@ static void mxs_batt_boot(void)
                setbits_le32(&power_regs->hw_power_5vctrl,
                             POWER_5VCTRL_ILIMIT_EQ_ZERO);
 
+       if (CONFIG_IS_ENABLED(MXS_PMU_DISABLE_BATT_CHARGE)) {
+               writel(POWER_CHARGE_PWD_BATTCHRG,
+                      &power_regs->hw_power_charge_set);
+               writel(POWER_5VCTRL_PWD_CHARGE_4P2_MASK,
+                      &power_regs->hw_power_5vctrl_set);
+       }
+
        mxs_power_enable_4p2();
 }
 
index 3232b0fb677ccda4760f85abaa89e3546f492f4d..f5e45ae84679a304157ec12892cbaf11dcfff82b 100644 (file)
@@ -59,6 +59,10 @@ config SPL_MXS_PMU_MINIMAL_VDD5V_CURRENT
          by the PMU is reduced to zero - the DCDC_BATT is used as
          the main power source for PMU.
 
+config SPL_MXS_PMU_DISABLE_BATT_CHARGE
+       bool "Disable Battery Charging in MX28 PMU"
+       default n
+
 source "board/freescale/mx28evk/Kconfig"
 source "board/liebherr/xea/Kconfig"