2 * Copyright (C) 2010 Google, Inc.
5 * Brian Swetland <swetland@google.com>
6 * Iliyan Malchev <malchev@google.com>
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.
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.
19 #include <linux/kernel.h>
20 #include <linux/init.h>
21 #include <linux/interrupt.h>
22 #include <linux/irq.h>
24 #include <linux/slab.h>
26 #include <asm/hardware/gic.h>
28 #include <mach/iomap.h>
30 #include <mach/legacy_irq.h>
34 void tegra_fiq_enable(int irq)
36 void __iomem *base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100);
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);
46 void tegra_fiq_disable(int irq)
48 tegra_legacy_mask_irq(irq);
49 tegra_legacy_select_fiq(irq, false);