Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144509
b: refs/heads/master
c: fe277d9
h: refs/heads/master
i:
  144507: b8e7f72
v: v3
  • Loading branch information
Mark A. Greer authored and Kevin Hilman committed Apr 27, 2009
1 parent 1f1cfdf commit b244c35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 474dad54baee8f8abe63ac334357a37021147701
refs/heads/master: fe277d9bbba9c2851ec11edcd5701f82e034ddd4
17 changes: 6 additions & 11 deletions trunk/arch/arm/mach-davinci/psc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define MDSTAT 0x800
#define MDCTL 0xA00

#define MDSTAT_STATE_MASK 0x1f

/* Return nonzero iff the domain's clock is active */
int __init davinci_psc_is_clk_active(unsigned int id)
Expand All @@ -53,14 +54,13 @@ int __init davinci_psc_is_clk_active(unsigned int id)
/* Enable or disable a PSC domain */
void davinci_psc_config(unsigned int domain, unsigned int id, char enable)
{
u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl, mdstat_mask;
u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl;
void __iomem *psc_base = IO_ADDRESS(DAVINCI_PWR_SLEEP_CNTRL_BASE);
u32 next_state = enable ? 0x3 : 0x2; /* 0x3 enables, 0x2 disables */

mdctl = __raw_readl(psc_base + MDCTL + 4 * id);
if (enable)
mdctl |= 0x00000003; /* Enable Module */
else
mdctl &= 0xFFFFFFE2; /* Disable Module */
mdctl &= ~MDSTAT_STATE_MASK;
mdctl |= next_state;
__raw_writel(mdctl, psc_base + MDCTL + 4 * id);

pdstat = __raw_readl(psc_base + PDSTAT);
Expand Down Expand Up @@ -93,12 +93,7 @@ void davinci_psc_config(unsigned int domain, unsigned int id, char enable)
} while (!(((ptstat >> domain) & 1) == 0));
}

if (enable)
mdstat_mask = 0x3;
else
mdstat_mask = 0x2;

do {
mdstat = __raw_readl(psc_base + MDSTAT + 4 * id);
} while (!((mdstat & 0x0000001F) == mdstat_mask));
} while (!((mdstat & MDSTAT_STATE_MASK) == next_state));
}

0 comments on commit b244c35

Please sign in to comment.