Lines Matching +full:sbsc +full:- +full:sh73a0

1 // SPDX-License-Identifier: GPL-2.0
9 * based on pm-sh7372.c
49 unsigned int mask = BIT(rmobile_pd->bit_shift); in rmobile_pd_power_down()
51 if (rmobile_pd->suspend) { in rmobile_pd_power_down()
52 int ret = rmobile_pd->suspend(); in rmobile_pd_power_down()
58 if (readl(rmobile_pd->base + PSTR) & mask) { in rmobile_pd_power_down()
60 writel(mask, rmobile_pd->base + SPDCR); in rmobile_pd_power_down()
62 for (retry_count = PSTR_RETRIES; retry_count; retry_count--) { in rmobile_pd_power_down()
63 if (!(readl(rmobile_pd->base + SPDCR) & mask)) in rmobile_pd_power_down()
69 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask, in rmobile_pd_power_down()
70 readl(rmobile_pd->base + PSTR)); in rmobile_pd_power_down()
77 unsigned int mask = BIT(rmobile_pd->bit_shift); in __rmobile_pd_power_up()
81 if (readl(rmobile_pd->base + PSTR) & mask) in __rmobile_pd_power_up()
84 writel(mask, rmobile_pd->base + SWUCR); in __rmobile_pd_power_up()
86 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) { in __rmobile_pd_power_up()
87 if (!(readl(rmobile_pd->base + SWUCR) & mask)) in __rmobile_pd_power_up()
95 ret = -EIO; in __rmobile_pd_power_up()
97 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", in __rmobile_pd_power_up()
98 rmobile_pd->genpd.name, mask, in __rmobile_pd_power_up()
99 readl(rmobile_pd->base + PSTR)); in __rmobile_pd_power_up()
111 struct generic_pm_domain *genpd = &rmobile_pd->genpd; in rmobile_init_pm_domain()
112 struct dev_power_governor *gov = rmobile_pd->gov; in rmobile_init_pm_domain()
114 genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; in rmobile_init_pm_domain()
115 genpd->attach_dev = cpg_mstp_attach_dev; in rmobile_init_pm_domain()
116 genpd->detach_dev = cpg_mstp_detach_dev; in rmobile_init_pm_domain()
118 if (!(genpd->flags & GENPD_FLAG_ALWAYS_ON)) { in rmobile_init_pm_domain()
119 genpd->power_off = rmobile_pd_power_down; in rmobile_init_pm_domain()
120 genpd->power_on = rmobile_pd_power_up; in rmobile_init_pm_domain()
133 return console_suspend_enabled ? 0 : -EBUSY; in rmobile_pd_suspend_console()
154 { .compatible = "arm,coresight-etm3x", .data = (void *)PD_DEBUG },
155 { .compatible = "renesas,dbsc-r8a73a4", .data = (void *)PD_MEMCTL, },
156 { .compatible = "renesas,dbsc3-r8a7740", .data = (void *)PD_MEMCTL, },
157 { .compatible = "renesas,sbsc-sh73a0", .data = (void *)PD_MEMCTL, },
166 pd = of_parse_phandle(np, "power-domains", 0); in add_special_pd()
204 add_special_pd(np, (enum pd_types)id->data); in get_special_pds()
229 const char *name = pd->genpd.name; in rmobile_setup_pm_domain()
238 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
243 pd->gov = &pm_domain_always_on_gov; in rmobile_setup_pm_domain()
244 pd->suspend = rmobile_pd_suspend_console; in rmobile_setup_pm_domain()
249 * This domain contains the Coresight-ETM hardware block and in rmobile_setup_pm_domain()
253 pr_debug("PM domain %s contains Coresight-ETM\n", name); in rmobile_setup_pm_domain()
254 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
259 * This domain contains a memory-controller and therefore it in rmobile_setup_pm_domain()
263 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
267 if (pd->bit_shift == ~0) { in rmobile_setup_pm_domain()
268 /* Top-level always-on domain */ in rmobile_setup_pm_domain()
269 pr_debug("PM domain %s is always-on domain\n", name); in rmobile_setup_pm_domain()
270 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
289 /* always-on domain */ in rmobile_add_pm_domains()
295 return -ENOMEM; in rmobile_add_pm_domains()
298 pd->genpd.name = np->name; in rmobile_add_pm_domains()
299 pd->base = base; in rmobile_add_pm_domains()
300 pd->bit_shift = idx; in rmobile_add_pm_domains()
304 pm_genpd_add_subdomain(genpd_parent, &pd->genpd); in rmobile_add_pm_domains()
305 of_genpd_add_provider_simple(np, &pd->genpd); in rmobile_add_pm_domains()
307 rmobile_add_pm_domains(base, np, &pd->genpd); in rmobile_add_pm_domains()
319 for_each_compatible_node(np, NULL, "renesas,sysc-rmobile") { in rmobile_init_pm_domains()
326 pmd = of_get_child_by_name(np, "pm-domains"); in rmobile_init_pm_domains()
329 pr_warn("%pOF lacks pm-domains node\n", np); in rmobile_init_pm_domains()
346 fwnode_dev_initialized(&np->fwnode, true); in rmobile_init_pm_domains()