The value written to the register was not shifted by the offset leading
to sram being claimed incorrectly.

Signed-off-by: Michal Suchanek <[email protected]>
---
 drivers/soc/sunxi/sunxi_sram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index f2bce8e..66631bd 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -144,7 +144,7 @@ int sunxi_sram_claim(enum sunxi_sram_type type, const char 
*function)
                        val = readl(base + sram->reg);
                        val &= ~GENMASK(sram->offset + sram->width,
                                        sram->offset);
-                       writel(val | func->val, base + sram->reg);
+                       writel(val | (func->val << sram->offset), base + 
sram->reg);
 
                        return 0;
                }
-- 
2.1.4

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to