Skip to contentSkip to conversation

mxs: Fix VDDx brownout interrupt disable/enable

PATCH Superseded Cody Green 2 participants 5 messages Jul 3, 2023 – Jul 4, 2023

Subsystems (2)
lore
Share & tools
lore

Cody Green

author
#0 lore raw

PATCH 1/2 mxs: Fix VDDx brownout interrupt disable/enable

HW_POWER_CTRL register contains brownout interrupt enable bits ENIRQ_VDDIO_BO, ENIRQ_VDDA_BO and ENIRQ_VDDD_BO.

Cc Stefano Babic <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Fabio Estevam <[email protected]>
---
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +5 -3
index c33170f06d..33b76533e4 100644
@@ -1142,8 +1142,9 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
 
 	if (adjust_up && cfg->bo_irq) {
 		if (powered_by_linreg) {
-			bo_int = readl(cfg->reg);
-			clrbits_le32(cfg->reg, cfg->bo_enirq);
+			bo_int = readl(&power_regs->hw_power_ctrl);
+			clrbits_le32(&power_regs->hw_power_ctrl,
+				cfg->bo_enirq);
 		}
 		setbits_le32(cfg->reg, cfg->bo_offset_mask);
 	}
@@ -1185,7 +1186,8 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
 		if (adjust_up && powered_by_linreg) {
 			writel(cfg->bo_irq, &power_regs->hw_power_ctrl_clr);
 			if (bo_int & cfg->bo_enirq)
-				setbits_le32(cfg->reg, cfg->bo_enirq);
+				setbits_le32(&power_regs->hw_power_ctrl,
+					cfg->bo_enirq);
 		}
 
 		clrsetbits_le32(cfg->reg, cfg->bo_offset_mask,
Signature · 1 line
2.25.1
#1 lore raw
Quoted 3 lines · Cody Green

HW_POWER_CTRL register contains brownout interrupt enable bits ENIRQ_VDDIO_BO, ENIRQ_VDDA_BO and ENIRQ_VDDD_BO.

So what does this patch do (that is missing in the commit message) ?

author
#2 lore raw
Quoted 7 lines · Marek Vasut
Quoted 3 lines · Cody Green

HW_POWER_CTRL register contains brownout interrupt enable bits ENIRQ_VDDIO_BO, ENIRQ_VDDA_BO and ENIRQ_VDDD_BO.

So what does this patch do (that is missing in the commit message) ?

There are incorrect registers HW_POWER_VDDIOCTRL, HW_POWER_VDDACTRL and HW_POWER_VDDDCTRL used in the current code to disable/enable brownout interrupts in 'mxs_power_set_vddx()'. This patch ensures the correct register HW_POWER_CTRL is used.
Sorry for the unspecific commit message, I will amend the patch.

#3 lore raw
Quoted 7 lines · Cody Green
Quoted 6 lines · Marek Vasut
Quoted 3 lines · Cody Green

HW_POWER_CTRL register contains brownout interrupt enable bits ENIRQ_VDDIO_BO, ENIRQ_VDDA_BO and ENIRQ_VDDD_BO.

Quoted 7 lines
Quoted 1 line

So what does this patch do (that is missing in the commit message) ?

There are incorrect registers HW_POWER_VDDIOCTRL, HW_POWER_VDDACTRL and HW_POWER_VDDDCTRL used in the current code to disable/enable brownout interrupts in 'mxs_power_set_vddx()'. This patch ensures the correct register HW_POWER_CTRL is used.
Sorry for the unspecific commit message, I will amend the patch.

Much better, thank you.

Also CC Lukasz (on CC here) on V2.

author
#4 lore raw

PATCH v2 1/2 mxs: Fix VDDx brownout interrupt disable/enable

In reply to Cody Green

Incorrect registers HW_POWER_VDDIOCTRL, HW_POWER_VDDACTRL and HW_POWER_VDDDCTRL are used in the current code to disable/enable brownout interrupts in 'mxs_power_set_vddx()'.
Change register to HW_POWER_CTRL which contains brownout interrupt enable bits ENIRQ_VDDIO_BO, ENIRQ_VDDA_BO and ENIRQ_VDDD_BO.

Cc Stefano Babic <[email protected]>
Cc Marek Vasut <[email protected]>
Cc Fabio Estevam <[email protected]>
Cc Lukasz Majewski <[email protected]>

---
Changes for v2:
- Commit message reworded to be more specific.

 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/mxs/spl_power_init.c +5 -3
index c33170f06d..33b76533e4 100644
@@ -1142,8 +1142,9 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
 
 	if (adjust_up && cfg->bo_irq) {
 		if (powered_by_linreg) {
-			bo_int = readl(cfg->reg);
-			clrbits_le32(cfg->reg, cfg->bo_enirq);
+			bo_int = readl(&power_regs->hw_power_ctrl);
+			clrbits_le32(&power_regs->hw_power_ctrl,
+				cfg->bo_enirq);
 		}
 		setbits_le32(cfg->reg, cfg->bo_offset_mask);
 	}
@@ -1185,7 +1186,8 @@ static void mxs_power_set_vddx(const struct mxs_vddx_cfg *cfg,
 		if (adjust_up && powered_by_linreg) {
 			writel(cfg->bo_irq, &power_regs->hw_power_ctrl_clr);
 			if (bo_int & cfg->bo_enirq)
-				setbits_le32(cfg->reg, cfg->bo_enirq);
+				setbits_le32(&power_regs->hw_power_ctrl,
+					cfg->bo_enirq);
 		}
 
 		clrsetbits_le32(cfg->reg, cfg->bo_offset_mask,
Signature · 1 line
2.25.1