]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
davinci: enable forced transitions on PSC
authorSekhar Nori <nsekhar@ti.com>
Wed, 6 Jul 2011 06:01:22 +0000 (06:01 +0000)
committerSekhar Nori <nsekhar@ti.com>
Fri, 8 Jul 2011 05:40:09 +0000 (11:10 +0530)
Some DaVinci modules like the SATA on DA850
need forced module state transitions.

Define a "force" flag which can be passed to
the PSC config function to enable it to make
forced transitions.

Forced transitions shouldn't normally be attempted,
unless the TRM explicitly specifies its usage.

ChangeLog:
v2:
Modified to take care of the fact that
davinci_psc_config() now takes the flags
directly.

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/clock.h
arch/arm/mach-davinci/include/mach/psc.h
arch/arm/mach-davinci/psc.c

index 0dd22031ec6222467a4a3a5ccb0eb27405e1d510..48ee4627e18814a44aa93d4ee7764cecd9632b55 100644 (file)
@@ -111,6 +111,7 @@ struct clk {
 #define CLK_PLL                        BIT(4) /* PLL-derived clock */
 #define PRE_PLL                        BIT(5) /* source is before PLL mult/div */
 #define PSC_SWRSTDISABLE       BIT(6) /* Disable state is SwRstDisable */
+#define PSC_FORCE              BIT(7) /* Force module state transtition */
 
 #define CLK(dev, con, ck)      \
        {                       \
index 215fcca6bbdc24fa7e9f45aaebff3973101a106b..6213f0d4211d91055516882d66e6e237dfa1d7da 100644 (file)
 #define PSC_STATE_ENABLE       3
 
 #define MDSTAT_STATE_MASK 0x1f
+#define MDCTL_FORCE            BIT(31)
 
 #ifndef __ASSEMBLER__
 
index 823cb1b9e484991d583320659e36a1569216fe29..1fb6bdff38c1f5e9ff796e72c4c57be824919209 100644 (file)
@@ -75,6 +75,8 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr,
        mdctl = __raw_readl(psc_base + MDCTL + 4 * id);
        mdctl &= ~MDSTAT_STATE_MASK;
        mdctl |= next_state;
+       if (flags & PSC_FORCE)
+               mdctl |= MDCTL_FORCE;
        __raw_writel(mdctl, psc_base + MDCTL + 4 * id);
 
        pdstat = __raw_readl(psc_base + PDSTAT);