aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/pm-sh7372.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2011-10-19 17:52:41 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-10-21 18:19:58 -0400
commitd93f5cdea968284f05aa9905ee9752874885a6fa (patch)
tree11d4eebb5a887aaab37f592f23ac8ca60fbc7e6a /arch/arm/mach-shmobile/pm-sh7372.c
parent4ca46ff3e0d8c234cb40ebb6457653b59584426c (diff)
ARM: mach-shmobile: sh7372 A3SP support (v4)
This change adds support for the sh7372 A3SP power domain. The sh7372 A3SP hardware power domain contains a wide range of I/O devices. The list of I/O devices include SCIF serial ports, DMA Engine hardware, SD and MMC controller hardware, USB controllers and I2C master controllers. This patch adds the A3SP low level code which powers the hardware power domain on and off. It also ties in platform devices to the pm domain support code. It is worth noting that the serial console is hooked up to SCIFA0 on most sh7372 boards, and the SCIFA0 port is included in the A3SP hardware power domain. For this reason we cannot output debug messages from the low level power control code in the case of A3SP. QoS support is needed in drivers before we can enable the A3SP power control on the fly. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch/arm/mach-shmobile/pm-sh7372.c')
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c
index 8e0944f96ba1..fde619dd4c05 100644
--- a/arch/arm/mach-shmobile/pm-sh7372.c
+++ b/arch/arm/mach-shmobile/pm-sh7372.c
@@ -92,8 +92,9 @@ static int pd_power_down(struct generic_pm_domain *genpd)
92 } 92 }
93 } 93 }
94 94
95 pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n", 95 if (!sh7372_pd->no_debug)
96 mask, __raw_readl(PSTR)); 96 pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n",
97 mask, __raw_readl(PSTR));
97 98
98 return 0; 99 return 0;
99} 100}
@@ -122,8 +123,9 @@ static int pd_power_up(struct generic_pm_domain *genpd)
122 ret = -EIO; 123 ret = -EIO;
123 124
124 out: 125 out:
125 pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n", 126 if (!sh7372_pd->no_debug)
126 mask, __raw_readl(PSTR)); 127 pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n",
128 mask, __raw_readl(PSTR));
127 129
128 return ret; 130 return ret;
129} 131}
@@ -133,11 +135,20 @@ static bool pd_active_wakeup(struct device *dev)
133 return true; 135 return true;
134} 136}
135 137
138static bool sh7372_power_down_forbidden(struct dev_pm_domain *domain)
139{
140 return false;
141}
142
143struct dev_power_governor sh7372_always_on_gov = {
144 .power_down_ok = sh7372_power_down_forbidden,
145};
146
136void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd) 147void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
137{ 148{
138 struct generic_pm_domain *genpd = &sh7372_pd->genpd; 149 struct generic_pm_domain *genpd = &sh7372_pd->genpd;
139 150
140 pm_genpd_init(genpd, NULL, false); 151 pm_genpd_init(genpd, sh7372_pd->gov, false);
141 genpd->stop_device = pm_clk_suspend; 152 genpd->stop_device = pm_clk_suspend;
142 genpd->start_device = pm_clk_resume; 153 genpd->start_device = pm_clk_resume;
143 genpd->dev_irq_safe = true; 154 genpd->dev_irq_safe = true;
@@ -183,6 +194,12 @@ struct sh7372_pm_domain sh7372_a3ri = {
183 .bit_shift = 8, 194 .bit_shift = 8,
184}; 195};
185 196
197struct sh7372_pm_domain sh7372_a3sp = {
198 .bit_shift = 11,
199 .gov = &sh7372_always_on_gov,
200 .no_debug = true,
201};
202
186struct sh7372_pm_domain sh7372_a3sg = { 203struct sh7372_pm_domain sh7372_a3sg = {
187 .bit_shift = 13, 204 .bit_shift = 13,
188}; 205};
@@ -422,6 +439,9 @@ void __init sh7372_pm_init(void)
422 __raw_writel(0x0000a501, DBGREG9); 439 __raw_writel(0x0000a501, DBGREG9);
423 __raw_writel(0x00000000, DBGREG1); 440 __raw_writel(0x00000000, DBGREG1);
424 441
442 /* do not convert A3SM, A3SP, A3SG, A4R power down into A4S */
443 __raw_writel(0, PDNSEL);
444
425 sh7372_suspend_init(); 445 sh7372_suspend_init();
426 sh7372_cpuidle_init(); 446 sh7372_cpuidle_init();
427} 447}