Lines Matching +full:non +full:- +full:secure +full:- +full:domain

1 // SPDX-License-Identifier: GPL-2.0
3 // Copyright (c) 2011-2014 Samsung Electronics Co., Ltd.
6 // Exynos - Suspend support
8 // Based on arch/arm/mach-s3c2410/pm.c
23 #include <linux/soc/samsung/exynos-pmu.h>
24 #include <linux/soc/samsung/exynos-regs-pmu.h>
27 #include <asm/hardware/cache-l2x0.h>
36 #define REG_TABLE_END (-1U)
41 * struct exynos_wkup_irq - PMU IRQ to mask mapping
43 * @mask: Mask in PMU wake-up mask register
74 * GIC wake-up support
106 if (!pm_data->wkup_irq) in exynos_irq_set_wake()
107 return -ENOENT; in exynos_irq_set_wake()
108 wkup_irq = pm_data->wkup_irq; in exynos_irq_set_wake()
110 while (wkup_irq->mask) { in exynos_irq_set_wake()
111 if (wkup_irq->hwirq == data->hwirq) { in exynos_irq_set_wake()
113 exynos_irqwake_intmask |= wkup_irq->mask; in exynos_irq_set_wake()
115 exynos_irqwake_intmask &= ~wkup_irq->mask; in exynos_irq_set_wake()
121 return -ENOENT; in exynos_irq_set_wake()
141 if (is_of_node(fwspec->fwnode)) { in exynos_pmu_domain_translate()
142 if (fwspec->param_count != 3) in exynos_pmu_domain_translate()
143 return -EINVAL; in exynos_pmu_domain_translate()
145 /* No PPI should point to this domain */ in exynos_pmu_domain_translate()
146 if (fwspec->param[0] != 0) in exynos_pmu_domain_translate()
147 return -EINVAL; in exynos_pmu_domain_translate()
149 *hwirq = fwspec->param[1]; in exynos_pmu_domain_translate()
150 *type = fwspec->param[2]; in exynos_pmu_domain_translate()
154 return -EINVAL; in exynos_pmu_domain_translate()
157 static int exynos_pmu_domain_alloc(struct irq_domain *domain, in exynos_pmu_domain_alloc() argument
166 if (fwspec->param_count != 3) in exynos_pmu_domain_alloc()
167 return -EINVAL; /* Not GIC compliant */ in exynos_pmu_domain_alloc()
168 if (fwspec->param[0] != 0) in exynos_pmu_domain_alloc()
169 return -EINVAL; /* No PPI should point to this domain */ in exynos_pmu_domain_alloc()
171 hwirq = fwspec->param[1]; in exynos_pmu_domain_alloc()
174 irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i, in exynos_pmu_domain_alloc()
178 parent_fwspec.fwnode = domain->parent->fwnode; in exynos_pmu_domain_alloc()
179 return irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, in exynos_pmu_domain_alloc()
192 struct irq_domain *parent_domain, *domain; in exynos_pmu_irq_init() local
196 return -ENODEV; in exynos_pmu_irq_init()
201 pr_err("%pOF: unable to obtain parent domain\n", node); in exynos_pmu_irq_init()
202 return -ENXIO; in exynos_pmu_irq_init()
209 return -ENOMEM; in exynos_pmu_irq_init()
212 domain = irq_domain_add_hierarchy(parent_domain, 0, 0, in exynos_pmu_irq_init()
215 if (!domain) { in exynos_pmu_irq_init()
218 return -ENOMEM; in exynos_pmu_irq_init()
232 EXYNOS_PMU_IRQ(exynos3250_pmu_irq, "samsung,exynos3250-pmu");
233 EXYNOS_PMU_IRQ(exynos4210_pmu_irq, "samsung,exynos4210-pmu");
234 EXYNOS_PMU_IRQ(exynos4212_pmu_irq, "samsung,exynos4212-pmu");
235 EXYNOS_PMU_IRQ(exynos4412_pmu_irq, "samsung,exynos4412-pmu");
236 EXYNOS_PMU_IRQ(exynos5250_pmu_irq, "samsung,exynos5250-pmu");
237 EXYNOS_PMU_IRQ(exynos5420_pmu_irq, "samsung,exynos5420-pmu");
286 * Set wake-up mask registers in exynos_pm_set_wakeup_mask()
303 /* Set wake-up mask registers */ in exynos_pm_prepare()
316 /* Set wake-up mask registers */ in exynos3250_pm_prepare()
333 /* Set wake-up mask registers */ in exynos5420_pm_prepare()
339 * secondary CPUs will enter low power start. Though the U-Boot in exynos5420_pm_prepare()
422 if (call_firmware_op(resume) == -ENOSYS in exynos_pm_resume()
442 if (call_firmware_op(resume) == -ENOSYS in exynos3250_pm_resume()
467 * propagate the SPNIDEN and SPIDEN signals from Secure JTAG in exynos5420_prepare_pm_resume()
535 if (exynos_irqwake_intmask == -1U in exynos_suspend_enter()
537 pr_err("%s: No wake-up sources!\n", __func__); in exynos_suspend_enter()
539 return -EINVAL; in exynos_suspend_enter()
542 if (pm_data->pm_prepare) in exynos_suspend_enter()
543 pm_data->pm_prepare(); in exynos_suspend_enter()
547 if (ret == -ENOSYS) in exynos_suspend_enter()
548 ret = cpu_suspend(0, pm_data->cpu_suspend); in exynos_suspend_enter()
552 if (pm_data->pm_resume_prepare) in exynos_suspend_enter()
553 pm_data->pm_resume_prepare(); in exynos_suspend_enter()
570 * avoid hard-coding the suspend to mem state. It's safe to do in exynos_suspend_prepare()
639 .compatible = "samsung,exynos3250-pmu",
642 .compatible = "samsung,exynos4210-pmu",
645 .compatible = "samsung,exynos4212-pmu",
648 .compatible = "samsung,exynos4412-pmu",
651 .compatible = "samsung,exynos5250-pmu",
654 .compatible = "samsung,exynos5420-pmu",
674 if (WARN_ON(!of_property_read_bool(np, "interrupt-controller"))) { in exynos_pm_init()
681 pm_data = (const struct exynos_pm_data *) match->data; in exynos_pm_init()
685 tmp |= pm_data->wake_disable_mask; in exynos_pm_init()
688 exynos_pm_syscore_ops.suspend = pm_data->pm_suspend; in exynos_pm_init()
689 exynos_pm_syscore_ops.resume = pm_data->pm_resume; in exynos_pm_init()
695 * Applicable as of now only to Exynos542x. If booted under secure in exynos_pm_init()
696 * firmware, the non-secure region of sysram should be used. in exynos_pm_init()