Lines Matching +full:sbsc +full:- +full:sh73a0
8 * based on pm-sh7372.c
28 #include "pm-rmobile.h"
49 if (rmobile_pd->bit_shift == ~0) in rmobile_pd_power_down()
50 return -EBUSY; in rmobile_pd_power_down()
52 mask = BIT(rmobile_pd->bit_shift); in rmobile_pd_power_down()
53 if (rmobile_pd->suspend) { in rmobile_pd_power_down()
54 int ret = rmobile_pd->suspend(); in rmobile_pd_power_down()
60 if (__raw_readl(rmobile_pd->base + PSTR) & mask) { in rmobile_pd_power_down()
62 __raw_writel(mask, rmobile_pd->base + SPDCR); in rmobile_pd_power_down()
64 for (retry_count = PSTR_RETRIES; retry_count; retry_count--) { in rmobile_pd_power_down()
65 if (!(__raw_readl(rmobile_pd->base + SPDCR) & mask)) in rmobile_pd_power_down()
71 if (!rmobile_pd->no_debug) in rmobile_pd_power_down()
72 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", in rmobile_pd_power_down()
73 genpd->name, mask, in rmobile_pd_power_down()
74 __raw_readl(rmobile_pd->base + PSTR)); in rmobile_pd_power_down()
86 if (rmobile_pd->bit_shift == ~0) in __rmobile_pd_power_up()
89 mask = BIT(rmobile_pd->bit_shift); in __rmobile_pd_power_up()
90 if (__raw_readl(rmobile_pd->base + PSTR) & mask) in __rmobile_pd_power_up()
93 __raw_writel(mask, rmobile_pd->base + SWUCR); in __rmobile_pd_power_up()
95 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) { in __rmobile_pd_power_up()
96 if (!(__raw_readl(rmobile_pd->base + SWUCR) & mask)) in __rmobile_pd_power_up()
104 ret = -EIO; in __rmobile_pd_power_up()
106 if (!rmobile_pd->no_debug) in __rmobile_pd_power_up()
107 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", in __rmobile_pd_power_up()
108 rmobile_pd->genpd.name, mask, in __rmobile_pd_power_up()
109 __raw_readl(rmobile_pd->base + PSTR)); in __rmobile_pd_power_up()
112 if (ret == 0 && rmobile_pd->resume && do_resume) in __rmobile_pd_power_up()
113 rmobile_pd->resume(); in __rmobile_pd_power_up()
125 struct generic_pm_domain *genpd = &rmobile_pd->genpd; in rmobile_init_pm_domain()
126 struct dev_power_governor *gov = rmobile_pd->gov; in rmobile_init_pm_domain()
128 genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; in rmobile_init_pm_domain()
129 genpd->power_off = rmobile_pd_power_down; in rmobile_init_pm_domain()
130 genpd->power_on = rmobile_pd_power_up; in rmobile_init_pm_domain()
131 genpd->attach_dev = cpg_mstp_attach_dev; in rmobile_init_pm_domain()
132 genpd->detach_dev = cpg_mstp_detach_dev; in rmobile_init_pm_domain()
143 return console_suspend_enabled ? 0 : -EBUSY; in rmobile_pd_suspend_console()
164 { .compatible = "arm,coresight-etm3x", .data = (void *)PD_DEBUG },
165 { .compatible = "renesas,dbsc-r8a73a4", .data = (void *)PD_MEMCTL, },
166 { .compatible = "renesas,dbsc3-r8a7740", .data = (void *)PD_MEMCTL, },
167 { .compatible = "renesas,sbsc-sh73a0", .data = (void *)PD_MEMCTL, },
176 pd = of_parse_phandle(np, "power-domains", 0); in add_special_pd()
192 pr_debug("Special PM domain %s type %d for %pOF\n", pd->name, type, np); in add_special_pd()
214 add_special_pd(np, (enum pd_types)id->data); in get_special_pds()
239 const char *name = pd->genpd.name; in rmobile_setup_pm_domain()
248 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
253 pd->gov = &pm_domain_always_on_gov; in rmobile_setup_pm_domain()
254 pd->suspend = rmobile_pd_suspend_console; in rmobile_setup_pm_domain()
259 * This domain contains the Coresight-ETM hardware block and in rmobile_setup_pm_domain()
263 pr_debug("PM domain %s contains Coresight-ETM\n", name); in rmobile_setup_pm_domain()
264 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
269 * This domain contains a memory-controller and therefore it in rmobile_setup_pm_domain()
273 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
294 /* always-on domain */ in rmobile_add_pm_domains()
300 return -ENOMEM; in rmobile_add_pm_domains()
303 pd->genpd.name = np->name; in rmobile_add_pm_domains()
304 pd->base = base; in rmobile_add_pm_domains()
305 pd->bit_shift = idx; in rmobile_add_pm_domains()
309 pm_genpd_add_subdomain(genpd_parent, &pd->genpd); in rmobile_add_pm_domains()
310 of_genpd_add_provider_simple(np, &pd->genpd); in rmobile_add_pm_domains()
312 rmobile_add_pm_domains(base, np, &pd->genpd); in rmobile_add_pm_domains()
324 for_each_compatible_node(np, NULL, "renesas,sysc-rmobile") { in rmobile_init_pm_domains()
331 pmd = of_get_child_by_name(np, "pm-domains"); in rmobile_init_pm_domains()
333 pr_warn("%pOF lacks pm-domains node\n", np); in rmobile_init_pm_domains()