diff options
Diffstat (limited to 'arch/arm/mach-davinci/psc.c')
-rw-r--r-- | arch/arm/mach-davinci/psc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index a41580400701..1fb6bdff38c1 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -25,6 +25,8 @@ | |||
25 | #include <mach/cputype.h> | 25 | #include <mach/cputype.h> |
26 | #include <mach/psc.h> | 26 | #include <mach/psc.h> |
27 | 27 | ||
28 | #include "clock.h" | ||
29 | |||
28 | /* Return nonzero iff the domain's clock is active */ | 30 | /* Return nonzero iff the domain's clock is active */ |
29 | int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | 31 | int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) |
30 | { | 32 | { |
@@ -48,11 +50,12 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | |||
48 | 50 | ||
49 | /* Enable or disable a PSC domain */ | 51 | /* Enable or disable a PSC domain */ |
50 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, | 52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, |
51 | unsigned int id, u32 next_state) | 53 | unsigned int id, bool enable, u32 flags) |
52 | { | 54 | { |
53 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; | 55 | u32 epcpr, ptcmd, ptstat, pdstat, pdctl1, mdstat, mdctl; |
54 | void __iomem *psc_base; | 56 | void __iomem *psc_base; |
55 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 57 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
58 | u32 next_state = PSC_STATE_ENABLE; | ||
56 | 59 | ||
57 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { | 60 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { |
58 | pr_warning("PSC: Bad psc data: 0x%x[%d]\n", | 61 | pr_warning("PSC: Bad psc data: 0x%x[%d]\n", |
@@ -62,9 +65,18 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
62 | 65 | ||
63 | psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K); | 66 | psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K); |
64 | 67 | ||
68 | if (!enable) { | ||
69 | if (flags & PSC_SWRSTDISABLE) | ||
70 | next_state = PSC_STATE_SWRSTDISABLE; | ||
71 | else | ||
72 | next_state = PSC_STATE_DISABLE; | ||
73 | } | ||
74 | |||
65 | mdctl = __raw_readl(psc_base + MDCTL + 4 * id); | 75 | mdctl = __raw_readl(psc_base + MDCTL + 4 * id); |
66 | mdctl &= ~MDSTAT_STATE_MASK; | 76 | mdctl &= ~MDSTAT_STATE_MASK; |
67 | mdctl |= next_state; | 77 | mdctl |= next_state; |
78 | if (flags & PSC_FORCE) | ||
79 | mdctl |= MDCTL_FORCE; | ||
68 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); | 80 | __raw_writel(mdctl, psc_base + MDCTL + 4 * id); |
69 | 81 | ||
70 | pdstat = __raw_readl(psc_base + PDSTAT); | 82 | pdstat = __raw_readl(psc_base + PDSTAT); |