diff options
Diffstat (limited to 'arch/arm/mach-davinci/psc.c')
-rw-r--r-- | arch/arm/mach-davinci/psc.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/arch/arm/mach-davinci/psc.c b/arch/arm/mach-davinci/psc.c index d7e210f4b55c..82fdc69d5728 100644 --- a/arch/arm/mach-davinci/psc.c +++ b/arch/arm/mach-davinci/psc.c | |||
@@ -35,7 +35,7 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | |||
35 | struct davinci_soc_info *soc_info = &davinci_soc_info; | 35 | struct davinci_soc_info *soc_info = &davinci_soc_info; |
36 | 36 | ||
37 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { | 37 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { |
38 | pr_warning("PSC: Bad psc data: 0x%x[%d]\n", | 38 | pr_warn("PSC: Bad psc data: 0x%x[%d]\n", |
39 | (int)soc_info->psc_bases, ctlr); | 39 | (int)soc_info->psc_bases, ctlr); |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
@@ -48,6 +48,31 @@ int __init davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id) | |||
48 | return mdstat & BIT(12); | 48 | return mdstat & BIT(12); |
49 | } | 49 | } |
50 | 50 | ||
51 | /* Control "reset" line associated with PSC domain */ | ||
52 | void davinci_psc_reset(unsigned int ctlr, unsigned int id, bool reset) | ||
53 | { | ||
54 | u32 mdctl; | ||
55 | void __iomem *psc_base; | ||
56 | struct davinci_soc_info *soc_info = &davinci_soc_info; | ||
57 | |||
58 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { | ||
59 | pr_warn("PSC: Bad psc data: 0x%x[%d]\n", | ||
60 | (int)soc_info->psc_bases, ctlr); | ||
61 | return; | ||
62 | } | ||
63 | |||
64 | psc_base = ioremap(soc_info->psc_bases[ctlr], SZ_4K); | ||
65 | |||
66 | mdctl = readl(psc_base + MDCTL + 4 * id); | ||
67 | if (reset) | ||
68 | mdctl &= ~MDCTL_LRST; | ||
69 | else | ||
70 | mdctl |= MDCTL_LRST; | ||
71 | writel(mdctl, psc_base + MDCTL + 4 * id); | ||
72 | |||
73 | iounmap(psc_base); | ||
74 | } | ||
75 | |||
51 | /* Enable or disable a PSC domain */ | 76 | /* Enable or disable a PSC domain */ |
52 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, | 77 | void davinci_psc_config(unsigned int domain, unsigned int ctlr, |
53 | unsigned int id, bool enable, u32 flags) | 78 | unsigned int id, bool enable, u32 flags) |
@@ -58,7 +83,7 @@ void davinci_psc_config(unsigned int domain, unsigned int ctlr, | |||
58 | u32 next_state = PSC_STATE_ENABLE; | 83 | u32 next_state = PSC_STATE_ENABLE; |
59 | 84 | ||
60 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { | 85 | if (!soc_info->psc_bases || (ctlr >= soc_info->psc_bases_num)) { |
61 | pr_warning("PSC: Bad psc data: 0x%x[%d]\n", | 86 | pr_warn("PSC: Bad psc data: 0x%x[%d]\n", |
62 | (int)soc_info->psc_bases, ctlr); | 87 | (int)soc_info->psc_bases, ctlr); |
63 | return; | 88 | return; |
64 | } | 89 | } |