提交 ade6ec05 编写于 作者: N Nishanth Menon 提交者: Kevin Hilman

ARM: OMAP3+: SmartReflex: Fix status masking in ERRCONFIG register

ERRCONFIG register has status bits that were intended not to
be destroyed by bad modification. We cleanup and simplify the
handling the status in the modify path.
Reported-by: NVincent Bour <v-bour@ti.com>
Signed-off-by: NNishanth Menon <nm@ti.com>
Signed-off-by: NJean Pihet <j-pihet@ti.com>
Reviewed-by: NKevin Hilman <khilman@ti.com>
Signed-off-by: NKevin Hilman <khilman@ti.com>
上级 1f55bc18
...@@ -74,10 +74,6 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask, ...@@ -74,10 +74,6 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask,
u32 value) u32 value)
{ {
u32 reg_val; u32 reg_val;
u32 errconfig_offs = 0, errconfig_mask = 0;
reg_val = __raw_readl(sr->base + offset);
reg_val &= ~mask;
/* /*
* Smartreflex error config register is special as it contains * Smartreflex error config register is special as it contains
...@@ -88,16 +84,15 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask, ...@@ -88,16 +84,15 @@ static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask,
* if they are currently set, but does allow the caller to write * if they are currently set, but does allow the caller to write
* those bits. * those bits.
*/ */
if (sr->ip_type == SR_TYPE_V1) { if (sr->ip_type == SR_TYPE_V1 && offset == ERRCONFIG_V1)
errconfig_offs = ERRCONFIG_V1; mask |= ERRCONFIG_STATUS_V1_MASK;
errconfig_mask = ERRCONFIG_STATUS_V1_MASK; else if (sr->ip_type == SR_TYPE_V2 && offset == ERRCONFIG_V2)
} else if (sr->ip_type == SR_TYPE_V2) { mask |= ERRCONFIG_VPBOUNDINTST_V2;
errconfig_offs = ERRCONFIG_V2;
errconfig_mask = ERRCONFIG_VPBOUNDINTST_V2; reg_val = __raw_readl(sr->base + offset);
} reg_val &= ~mask;
if (offset == errconfig_offs) value &= mask;
reg_val &= ~errconfig_mask;
reg_val |= value; reg_val |= value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册