aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c4
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c8
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh7372.h3
-rw-r--r--arch/arm/mach-shmobile/pm-sh7372.c30
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c14
5 files changed, 54 insertions, 5 deletions
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index d6c8ae813175..bf4f6372dcf4 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1409,6 +1409,10 @@ static void __init ap4evb_init(void)
1409 sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device); 1409 sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
1410 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device); 1410 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
1411 1411
1412 sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
1413 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
1414 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi1_device);
1415
1412 hdmi_init_pm_clock(); 1416 hdmi_init_pm_clock();
1413 fsi_init_pm_clock(); 1417 fsi_init_pm_clock();
1414 sh7372_pm_init(); 1418 sh7372_pm_init();
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 19f5d4922e2c..fdb1ca31dfe1 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1588,6 +1588,14 @@ static void __init mackerel_init(void)
1588 sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device); 1588 sh7372_add_device_to_domain(&sh7372_a4lc, &lcdc_device);
1589 sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device); 1589 sh7372_add_device_to_domain(&sh7372_a4lc, &hdmi_lcdc_device);
1590 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device); 1590 sh7372_add_device_to_domain(&sh7372_a4mp, &fsi_device);
1591 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs0_device);
1592 sh7372_add_device_to_domain(&sh7372_a3sp, &usbhs1_device);
1593 sh7372_add_device_to_domain(&sh7372_a3sp, &sh_mmcif_device);
1594 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi0_device);
1595#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1596 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi1_device);
1597#endif
1598 sh7372_add_device_to_domain(&sh7372_a3sp, &sdhi2_device);
1591 1599
1592 hdmi_init_pm_clock(); 1600 hdmi_init_pm_clock();
1593 sh7372_pm_init(); 1601 sh7372_pm_init();
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h
index efc984c4cef3..8542f2d31a56 100644
--- a/arch/arm/mach-shmobile/include/mach/sh7372.h
+++ b/arch/arm/mach-shmobile/include/mach/sh7372.h
@@ -479,7 +479,9 @@ struct platform_device;
479 479
480struct sh7372_pm_domain { 480struct sh7372_pm_domain {
481 struct generic_pm_domain genpd; 481 struct generic_pm_domain genpd;
482 struct dev_power_governor *gov;
482 unsigned int bit_shift; 483 unsigned int bit_shift;
484 bool no_debug;
483}; 485};
484 486
485static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d) 487static inline struct sh7372_pm_domain *to_sh7372_pd(struct generic_pm_domain *d)
@@ -493,6 +495,7 @@ extern struct sh7372_pm_domain sh7372_a4mp;
493extern struct sh7372_pm_domain sh7372_d4; 495extern struct sh7372_pm_domain sh7372_d4;
494extern struct sh7372_pm_domain sh7372_a3rv; 496extern struct sh7372_pm_domain sh7372_a3rv;
495extern struct sh7372_pm_domain sh7372_a3ri; 497extern struct sh7372_pm_domain sh7372_a3ri;
498extern struct sh7372_pm_domain sh7372_a3sp;
496extern struct sh7372_pm_domain sh7372_a3sg; 499extern struct sh7372_pm_domain sh7372_a3sg;
497 500
498extern void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd); 501extern void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd);
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}
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index d317c224ed63..5f1afcc4de6e 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -994,6 +994,7 @@ void __init sh7372_add_standard_devices(void)
994 sh7372_init_pm_domain(&sh7372_a3rv); 994 sh7372_init_pm_domain(&sh7372_a3rv);
995 sh7372_init_pm_domain(&sh7372_a3ri); 995 sh7372_init_pm_domain(&sh7372_a3ri);
996 sh7372_init_pm_domain(&sh7372_a3sg); 996 sh7372_init_pm_domain(&sh7372_a3sg);
997 sh7372_init_pm_domain(&sh7372_a3sp);
997 998
998 sh7372_pm_add_subdomain(&sh7372_a4lc, &sh7372_a3rv); 999 sh7372_pm_add_subdomain(&sh7372_a4lc, &sh7372_a3rv);
999 1000
@@ -1006,6 +1007,19 @@ void __init sh7372_add_standard_devices(void)
1006 sh7372_add_device_to_domain(&sh7372_a3rv, &vpu_device); 1007 sh7372_add_device_to_domain(&sh7372_a3rv, &vpu_device);
1007 sh7372_add_device_to_domain(&sh7372_a4mp, &spu0_device); 1008 sh7372_add_device_to_domain(&sh7372_a4mp, &spu0_device);
1008 sh7372_add_device_to_domain(&sh7372_a4mp, &spu1_device); 1009 sh7372_add_device_to_domain(&sh7372_a4mp, &spu1_device);
1010 sh7372_add_device_to_domain(&sh7372_a3sp, &scif0_device);
1011 sh7372_add_device_to_domain(&sh7372_a3sp, &scif1_device);
1012 sh7372_add_device_to_domain(&sh7372_a3sp, &scif2_device);
1013 sh7372_add_device_to_domain(&sh7372_a3sp, &scif3_device);
1014 sh7372_add_device_to_domain(&sh7372_a3sp, &scif4_device);
1015 sh7372_add_device_to_domain(&sh7372_a3sp, &scif5_device);
1016 sh7372_add_device_to_domain(&sh7372_a3sp, &scif6_device);
1017 sh7372_add_device_to_domain(&sh7372_a3sp, &iic1_device);
1018 sh7372_add_device_to_domain(&sh7372_a3sp, &dma0_device);
1019 sh7372_add_device_to_domain(&sh7372_a3sp, &dma1_device);
1020 sh7372_add_device_to_domain(&sh7372_a3sp, &dma2_device);
1021 sh7372_add_device_to_domain(&sh7372_a3sp, &usb_dma0_device);
1022 sh7372_add_device_to_domain(&sh7372_a3sp, &usb_dma1_device);
1009} 1023}
1010 1024
1011void __init sh7372_add_early_devices(void) 1025void __init sh7372_add_early_devices(void)