aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-tegra/irq.c')
-rw-r--r--arch/arm/mach-tegra/irq.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/irq.c b/arch/arm/mach-tegra/irq.c
index 0de4eed1493d..1a74d562dca1 100644
--- a/arch/arm/mach-tegra/irq.c
+++ b/arch/arm/mach-tegra/irq.c
@@ -18,10 +18,12 @@
18 */ 18 */
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/cpu_pm.h>
21#include <linux/interrupt.h> 22#include <linux/interrupt.h>
22#include <linux/irq.h> 23#include <linux/irq.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/of.h> 25#include <linux/of.h>
26#include <linux/of_address.h>
25#include <linux/irqchip/arm-gic.h> 27#include <linux/irqchip/arm-gic.h>
26#include <linux/syscore_ops.h> 28#include <linux/syscore_ops.h>
27 29
@@ -65,6 +67,7 @@ static u32 cpu_ier[TEGRA_MAX_NUM_ICTLRS];
65static u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS]; 67static u32 cpu_iep[TEGRA_MAX_NUM_ICTLRS];
66 68
67static u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS]; 69static u32 ictlr_wake_mask[TEGRA_MAX_NUM_ICTLRS];
70static void __iomem *tegra_gic_cpu_base;
68#endif 71#endif
69 72
70bool tegra_pending_sgi(void) 73bool tegra_pending_sgi(void)
@@ -213,8 +216,43 @@ int tegra_legacy_irq_syscore_init(void)
213 216
214 return 0; 217 return 0;
215} 218}
219
220static int tegra_gic_notifier(struct notifier_block *self,
221 unsigned long cmd, void *v)
222{
223 switch (cmd) {
224 case CPU_PM_ENTER:
225 writel_relaxed(0x1E0, tegra_gic_cpu_base + GIC_CPU_CTRL);
226 break;
227 }
228
229 return NOTIFY_OK;
230}
231
232static struct notifier_block tegra_gic_notifier_block = {
233 .notifier_call = tegra_gic_notifier,
234};
235
236static const struct of_device_id tegra114_dt_gic_match[] __initconst = {
237 { .compatible = "arm,cortex-a15-gic" },
238 { }
239};
240
241static void tegra114_gic_cpu_pm_registration(void)
242{
243 struct device_node *dn;
244
245 dn = of_find_matching_node(NULL, tegra114_dt_gic_match);
246 if (!dn)
247 return;
248
249 tegra_gic_cpu_base = of_iomap(dn, 1);
250
251 cpu_pm_register_notifier(&tegra_gic_notifier_block);
252}
216#else 253#else
217#define tegra_set_wake NULL 254#define tegra_set_wake NULL
255static void tegra114_gic_cpu_pm_registration(void) { }
218#endif 256#endif
219 257
220void __init tegra_init_irq(void) 258void __init tegra_init_irq(void)
@@ -252,4 +290,6 @@ void __init tegra_init_irq(void)
252 if (!of_have_populated_dt()) 290 if (!of_have_populated_dt())
253 gic_init(0, 29, distbase, 291 gic_init(0, 29, distbase,
254 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 292 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
293
294 tegra114_gic_cpu_pm_registration();
255} 295}