]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mxs: Do not disable bo detection when DC-DC is already enabled
authorStefan Wahren <stefan.wahren@i2se.com>
Thu, 21 May 2015 11:20:17 +0000 (11:20 +0000)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:47:21 +0000 (22:47 +0200)
In case the DC-DC is already enabled mxs_enable_4p2_dcdc_input() returns
without reenabling brown out detection. So fix this issue by
moving the return before brown out deactivation.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Marek Vasut <marex@denx.de>
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c

index aa0be982c82e79b2164b7eed08d42a84cc116f29..daae30c451058cb21854106cb336d1d9d2e72cb3 100644 (file)
@@ -403,6 +403,11 @@ static void mxs_enable_4p2_dcdc_input(int xfer)
 
        debug("SPL: %s 4P2 DC-DC Input\n", xfer ? "Enabling" : "Disabling");
 
+       if (xfer && (readl(&power_regs->hw_power_5vctrl) &
+                       POWER_5VCTRL_ENABLE_DCDC)) {
+               return;
+       }
+
        prev_5v_brnout = readl(&power_regs->hw_power_5vctrl) &
                                POWER_5VCTRL_PWDN_5VBRNOUT;
        prev_5v_droop = readl(&power_regs->hw_power_ctrl) &
@@ -414,11 +419,6 @@ static void mxs_enable_4p2_dcdc_input(int xfer)
 
        clrbits_le32(&power_regs->hw_power_ctrl, POWER_CTRL_ENIRQ_VDD5V_DROOP);
 
-       if (xfer && (readl(&power_regs->hw_power_5vctrl) &
-                       POWER_5VCTRL_ENABLE_DCDC)) {
-               return;
-       }
-
        /*
         * Recording orignal values that will be modified temporarlily
         * to handle a chip bug. See chip errata for CQ ENGR00115837