diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2011-11-14 15:12:06 -0500 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2011-12-05 06:17:14 -0500 |
commit | 8f9a0981aca6bd454ef2a4bdac510af0f6e55bd4 (patch) | |
tree | ac6fe47392799e2d7476c5dfd79801d2f89b96b5 /arch/arm/mach-davinci | |
parent | 5611cc4572e889b62a7b4c72a413536bf6a9c416 (diff) |
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: Sergei Shtylyov <sshtylyov@mvista.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/include/mach/psc.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-davinci/psc.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/include/mach/psc.h b/arch/arm/mach-davinci/include/mach/psc.h index fa59c097223d..8bf279a88b4b 100644 --- a/arch/arm/mach-davinci/include/mach/psc.h +++ b/arch/arm/mach-davinci/include/mach/psc.h | |||
@@ -244,6 +244,7 @@ | |||
244 | #define PSC_STATE_ENABLE 3 | 244 | #define PSC_STATE_ENABLE 3 |
245 | 245 | ||
246 | #define MDSTAT_STATE_MASK 0x3f | 246 | #define MDSTAT_STATE_MASK 0x3f |
247 | #define PDSTAT_STATE_MASK 0x1f | ||
247 | #define MDCTL_FORCE BIT(31) | 248 | #define MDCTL_FORCE BIT(31) |
248 | 249 | ||
249 | #ifndef __ASSEMBLER__ | 250 | #ifndef __ASSEMBLER__ |
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index 1fb6bdff38c1..a0e17707c981 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -80,7 +80,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); | 80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); |
81 | 81 | ||
82 | pdstat = __raw_readl(psc_base + PDSTAT); | 82 | pdstat = __raw_readl(psc_base + PDSTAT); |
83 | if ((pdstat & 0x00000001) == 0) { | 83 | if ((pdstat & PDSTAT_STATE_MASK) == 0) { |
84 | pdctl1 = __raw_readl(psc_base + PDCTL1); | 84 | pdctl1 = __raw_readl(psc_base + PDCTL1); |
85 | pdctl1 |= 0x1; | 85 | pdctl1 |= 0x1; |
86 | __raw_writel(pdctl1, psc_base + PDCTL1); | 86 | __raw_writel(pdctl1, psc_base + PDCTL1); |