Skip to contentSkip to conversation

mxs: Do not disable bo detection when DC-DC is already enabled

PATCH New Stefan Wahren 3 participants 3 messages May 21, 2015 – Jun 1, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mxs: Do not disable bo detection when DC-DC is already enabled

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.

---
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +5 -5
index c342217..42f3df2 100644
@@ -332,6 +332,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) &
@@ -343,11 +348,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
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 mxs: Do not disable bo detection when DC-DC is already enabled

Quoted 5 lines · Stefan Wahren

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.

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 mxs: Do not disable bo detection when DC-DC is already enabled

In reply to Stefan Wahren
Quoted 28 lines · Stefan Wahren

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.

---
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +5 -0
index c342217..42f3df2 100644
@@ -332,6 +332,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) &
@@ -343,11 +348,6 @@ static void mxs_enable_4p2_dcdc_input(int xfer)
 

arch/arm/cpu/arm926ejs/mxs/spl_power_init.c static void mxs_enable_4p2_dcdc_input(int xfer) · line 353

Quoted 10 lines
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +0 -5
 	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

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================