Lines Matching +full:sbsc +full:- +full:sh73a0
1 // SPDX-License-Identifier: GPL-2.0
9 * based on pm-sh7372.c
51 unsigned int 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 pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n", genpd->name, mask, in rmobile_pd_power_down()
72 __raw_readl(rmobile_pd->base + PSTR)); in rmobile_pd_power_down()
79 unsigned int mask = BIT(rmobile_pd->bit_shift); in __rmobile_pd_power_up()
83 if (__raw_readl(rmobile_pd->base + PSTR) & mask) in __rmobile_pd_power_up()
86 __raw_writel(mask, rmobile_pd->base + SWUCR); in __rmobile_pd_power_up()
88 for (retry_count = 2 * PSTR_RETRIES; retry_count; retry_count--) { in __rmobile_pd_power_up()
89 if (!(__raw_readl(rmobile_pd->base + SWUCR) & mask)) in __rmobile_pd_power_up()
97 ret = -EIO; in __rmobile_pd_power_up()
99 pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n", in __rmobile_pd_power_up()
100 rmobile_pd->genpd.name, mask, in __rmobile_pd_power_up()
101 __raw_readl(rmobile_pd->base + PSTR)); in __rmobile_pd_power_up()
113 struct generic_pm_domain *genpd = &rmobile_pd->genpd; in rmobile_init_pm_domain()
114 struct dev_power_governor *gov = rmobile_pd->gov; in rmobile_init_pm_domain()
116 genpd->flags |= GENPD_FLAG_PM_CLK | GENPD_FLAG_ACTIVE_WAKEUP; in rmobile_init_pm_domain()
117 genpd->attach_dev = cpg_mstp_attach_dev; in rmobile_init_pm_domain()
118 genpd->detach_dev = cpg_mstp_detach_dev; in rmobile_init_pm_domain()
120 if (!(genpd->flags & GENPD_FLAG_ALWAYS_ON)) { in rmobile_init_pm_domain()
121 genpd->power_off = rmobile_pd_power_down; in rmobile_init_pm_domain()
122 genpd->power_on = rmobile_pd_power_up; in rmobile_init_pm_domain()
135 return console_suspend_enabled ? 0 : -EBUSY; in rmobile_pd_suspend_console()
156 { .compatible = "arm,coresight-etm3x", .data = (void *)PD_DEBUG },
157 { .compatible = "renesas,dbsc-r8a73a4", .data = (void *)PD_MEMCTL, },
158 { .compatible = "renesas,dbsc3-r8a7740", .data = (void *)PD_MEMCTL, },
159 { .compatible = "renesas,sbsc-sh73a0", .data = (void *)PD_MEMCTL, },
168 pd = of_parse_phandle(np, "power-domains", 0); in add_special_pd()
206 add_special_pd(np, (enum pd_types)id->data); in get_special_pds()
231 const char *name = pd->genpd.name; in rmobile_setup_pm_domain()
240 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
245 pd->gov = &pm_domain_always_on_gov; in rmobile_setup_pm_domain()
246 pd->suspend = rmobile_pd_suspend_console; in rmobile_setup_pm_domain()
251 * This domain contains the Coresight-ETM hardware block and in rmobile_setup_pm_domain()
255 pr_debug("PM domain %s contains Coresight-ETM\n", name); in rmobile_setup_pm_domain()
256 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
261 * This domain contains a memory-controller and therefore it in rmobile_setup_pm_domain()
265 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
269 if (pd->bit_shift == ~0) { in rmobile_setup_pm_domain()
270 /* Top-level always-on domain */ in rmobile_setup_pm_domain()
271 pr_debug("PM domain %s is always-on domain\n", name); in rmobile_setup_pm_domain()
272 pd->genpd.flags |= GENPD_FLAG_ALWAYS_ON; in rmobile_setup_pm_domain()
291 /* always-on domain */ in rmobile_add_pm_domains()
297 return -ENOMEM; in rmobile_add_pm_domains()
300 pd->genpd.name = np->name; in rmobile_add_pm_domains()
301 pd->base = base; in rmobile_add_pm_domains()
302 pd->bit_shift = idx; in rmobile_add_pm_domains()
306 pm_genpd_add_subdomain(genpd_parent, &pd->genpd); in rmobile_add_pm_domains()
307 of_genpd_add_provider_simple(np, &pd->genpd); in rmobile_add_pm_domains()
309 rmobile_add_pm_domains(base, np, &pd->genpd); in rmobile_add_pm_domains()
321 for_each_compatible_node(np, NULL, "renesas,sysc-rmobile") { in rmobile_init_pm_domains()
328 pmd = of_get_child_by_name(np, "pm-domains"); in rmobile_init_pm_domains()
330 pr_warn("%pOF lacks pm-domains node\n", np); in rmobile_init_pm_domains()