Merge branch linux-tegra-2.6.36 into android-tegra-2.6.36
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / fiq.c
1 /*
2  * Copyright (C) 2010 Google, Inc.
3  *
4  * Author:
5  *      Brian Swetland <swetland@google.com>
6  *      Iliyan Malchev <malchev@google.com>
7  *
8  * This software is licensed under the terms of the GNU General Public
9  * License version 2, as published by the Free Software Foundation, and
10  * may be copied, distributed, and modified under those terms.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  */
18
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/interrupt.h>
22 #include <linux/irq.h>
23 #include <linux/io.h>
24 #include <linux/slab.h>
25
26 #include <asm/hardware/gic.h>
27
28 #include <mach/iomap.h>
29 #include <mach/fiq.h>
30 #include <mach/legacy_irq.h>
31
32 #include "board.h"
33
34 void tegra_fiq_enable(int irq)
35 {
36         void __iomem *base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100);
37         /* enable FIQ */
38         u32 val = readl(base + GIC_CPU_CTRL);
39         val &= ~8; /* pass FIQs through */
40         val |= 2; /* enableNS */
41         writel(val, base + GIC_CPU_CTRL);
42         tegra_legacy_select_fiq(irq, true);
43         tegra_legacy_unmask_irq(irq);
44 }
45
46 void tegra_fiq_disable(int irq)
47 {
48         tegra_legacy_mask_irq(irq);
49         tegra_legacy_select_fiq(irq, false);
50 }