提交 8f9a0981 编写于 作者: M Murali Karicheri 提交者: Sekhar Nori

ARM: davinci: psc: fix incorrect mask

There are 5 LSB bits defined in PDSTAT and the code
currently uses a mask of 1 bit to check the status.

Use a proper mask per the hardware specification.
While at it, use a #define for the mask to improve
readability.
Reviewed-by: NSergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: NMurali Karicheri <m-karicheri2@ti.com>
Signed-off-by: NSekhar Nori <nsekhar@ti.com>
上级 5611cc45
...@@ -244,6 +244,7 @@ ...@@ -244,6 +244,7 @@
#define PSC_STATE_ENABLE 3 #define PSC_STATE_ENABLE 3
#define MDSTAT_STATE_MASK 0x3f #define MDSTAT_STATE_MASK 0x3f
#define PDSTAT_STATE_MASK 0x1f
#define MDCTL_FORCE BIT(31) #define MDCTL_FORCE BIT(31)
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
......
...@@ -80,7 +80,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, ...@@ -80,7 +80,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
__raw_writel(mdctl, psc_base + MDCTL + 4 * id); __raw_writel(mdctl, psc_base + MDCTL + 4 * id);
pdstat = __raw_readl(psc_base + PDSTAT); pdstat = __raw_readl(psc_base + PDSTAT);
if ((pdstat & 0x00000001) == 0) { if ((pdstat & PDSTAT_STATE_MASK) == 0) {
pdctl1 = __raw_readl(psc_base + PDCTL1); pdctl1 = __raw_readl(psc_base + PDCTL1);
pdctl1 |= 0x1; pdctl1 |= 0x1;
__raw_writel(pdctl1, psc_base + PDCTL1); __raw_writel(pdctl1, psc_base + PDCTL1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册