Skip to content

Commit

Permalink
ARM: davinci: psc: fix incorrect mask
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Murali Karicheri authored and Sekhar Nori committed Dec 5, 2011
1 parent 5611cc4 commit 8f9a098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/mach-davinci/include/mach/psc.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
#define PSC_STATE_ENABLE 3

#define MDSTAT_STATE_MASK 0x3f
#define PDSTAT_STATE_MASK 0x1f
#define MDCTL_FORCE BIT(31)

#ifndef __ASSEMBLER__
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-davinci/psc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
__raw_writel(mdctl, psc_base + MDCTL + 4 * id);

pdstat = __raw_readl(psc_base + PDSTAT);
if ((pdstat & 0x00000001) == 0) {
if ((pdstat & PDSTAT_STATE_MASK) == 0) {
pdctl1 = __raw_readl(psc_base + PDCTL1);
pdctl1 |= 0x1;
__raw_writel(pdctl1, psc_base + PDCTL1);
Expand Down

0 comments on commit 8f9a098

Please sign in to comment.