Lines Matching +full:deep +full:- +full:sleep

1 // SPDX-License-Identifier: GPL-2.0-only
7 * Copyright (c) 2006-2007 Freescale Semiconductor, Inc.
49 /* All but PMCI are deep-sleep only */
61 /* deep-sleep only */
68 /* deep-sleep only */
123 u32 reg_cfg1 = in_be32(&pmc_regs->config1); in mpc83xx_change_state()
133 out_be32(&pmc_regs->config1, reg_cfg1); in mpc83xx_change_state()
145 u32 event = in_be32(&pmc_regs->event); in pmc_irq_handler()
152 out_be32(&pmc_regs->event, event); in pmc_irq_handler()
161 out_be32(&syscr_regs->sicrl, saved_regs.sicrl); in mpc83xx_suspend_restore_regs()
162 out_be32(&syscr_regs->sicrh, saved_regs.sicrh); in mpc83xx_suspend_restore_regs()
163 out_be32(&clock_regs->sccr, saved_regs.sccr); in mpc83xx_suspend_restore_regs()
168 saved_regs.sicrl = in_be32(&syscr_regs->sicrl); in mpc83xx_suspend_save_regs()
169 saved_regs.sicrh = in_be32(&syscr_regs->sicrh); in mpc83xx_suspend_save_regs()
170 saved_regs.sccr = in_be32(&clock_regs->sccr); in mpc83xx_suspend_save_regs()
175 int ret = -EAGAIN; in mpc83xx_suspend_enter()
177 /* Don't go to sleep if there's a race where pci_pm_state changes in mpc83xx_suspend_enter()
185 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
186 in_be32(&pmc_regs->config1) | PMCCR1_PME_EN); in mpc83xx_suspend_enter()
189 /* Put the system into low-power mode and the RAM in mpc83xx_suspend_enter()
190 * into self-refresh mode once the core goes to in mpc83xx_suspend_enter()
191 * sleep. in mpc83xx_suspend_enter()
194 out_be32(&pmc_regs->config, PMCCR_SLPEN | PMCCR_DLPEN); in mpc83xx_suspend_enter()
196 /* If it has deep sleep (i.e. it's an 831x or compatible), in mpc83xx_suspend_enter()
197 * disable power to the core upon entering sleep mode. This will in mpc83xx_suspend_enter()
204 out_be32(&pmc_regs->mask, PMCER_ALL); in mpc83xx_suspend_enter()
206 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
207 in_be32(&pmc_regs->config1) | PMCCR1_POWER_OFF); in mpc83xx_suspend_enter()
214 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
215 in_be32(&pmc_regs->config1) & ~PMCCR1_POWER_OFF); in mpc83xx_suspend_enter()
217 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_suspend_enter()
221 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_suspend_enter()
229 out_be32(&pmc_regs->config1, in mpc83xx_suspend_enter()
230 in_be32(&pmc_regs->config1) & ~PMCCR1_PME_EN); in mpc83xx_suspend_enter()
259 return -EINVAL; in mpc83xx_suspend_begin()
274 * a userspace-driven suspend request. It's probably best in agent_thread_fn()
293 out_be32(&pmc_regs->config1, PMCCR1_USE_STATE); in mpc83xx_set_agent()
294 out_be32(&pmc_regs->mask, PMCER_PMCI); in mpc83xx_set_agent()
308 return -ENOMEM; in mpc83xx_is_pci_agent()
310 ret = !(in_be32(&rcw_regs->rcwhr) & RCW_PCI_HOST); in mpc83xx_is_pci_agent()
334 .compatible = "fsl,mpc8313-pmc",
338 .compatible = "fsl,mpc8349-pmc",
346 struct device_node *np = ofdev->dev.of_node; in pmc_probe()
351 type = of_device_get_match_data(&ofdev->dev); in pmc_probe()
353 return -EINVAL; in pmc_probe()
356 return -ENODEV; in pmc_probe()
358 has_deep_sleep = type->has_deep_sleep; in pmc_probe()
367 return -ENODEV; in pmc_probe()
375 return -EBUSY; in pmc_probe()
381 ret = -ENOMEM; in pmc_probe()
387 ret = -ENODEV; in pmc_probe()
394 ret = -ENOMEM; in pmc_probe()
402 ret = -ENOMEM; in pmc_probe()
426 .name = "mpc83xx-pmc",