summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2010-05-26 14:21:21 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:34:38 -0800
commit51a2c9c8467da398d85bf5abbc47409cccbd6349 (patch)
tree2426e93da809b05151914ffb8656771ef4489076
parente5042f45b5bbe43afa99cc68569a8e3ea2baa125 (diff)
[ARM] tegra: add FIQ support
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/mach-tegra/Makefile2
-rw-r--r--arch/arm/mach-tegra/fiq.c53
-rw-r--r--arch/arm/mach-tegra/include/mach/fiq.h32
-rw-r--r--arch/arm/mach-tegra/include/mach/irqs.h2
5 files changed, 90 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9c4d71ba4595..231112d20132 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -608,6 +608,7 @@ config ARCH_TEGRA
select HAVE_SCHED_CLOCK
select ARCH_HAS_CPUFREQ
select ARCH_PROVIDES_UDELAY
+ select FIQ
help
This enables support for NVIDIA Tegra based systems (Tegra APX,
Tegra 6xx and Tegra 2 series).
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 52ec87c5fc48..ddcc00454d80 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -12,6 +12,8 @@ obj-$(CONFIG_PM_SLEEP) += pm.o
obj-$(CONFIG_PM_SLEEP) += pm-irq.o
obj-$(CONFIG_PM_SLEEP) += sleep.o
obj-y += fuse.o
+obj-$(CONFIG_FIQ) += fiq.o
+
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clock.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_clocks.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
diff --git a/arch/arm/mach-tegra/fiq.c b/arch/arm/mach-tegra/fiq.c
new file mode 100644
index 000000000000..81f573b1a1dc
--- /dev/null
+++ b/arch/arm/mach-tegra/fiq.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Author:
+ * Brian Swetland <swetland@google.com>
+ * Iliyan Malchev <malchev@google.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <linux/slab.h>
+
+#include <asm/hardware/gic.h>
+
+#include <mach/iomap.h>
+#include <mach/fiq.h>
+#include <mach/legacy_irq.h>
+
+#include "board.h"
+
+void tegra_fiq_enable(int irq)
+{
+ void __iomem *base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100);
+ /* enable FIQ */
+ u32 val = readl(base + GIC_CPU_CTRL);
+ val &= ~8; /* pass FIQs through */
+ val |= 2; /* enableNS */
+ writel(val, base + GIC_CPU_CTRL);
+ tegra_legacy_unmask_irq(irq);
+}
+
+void tegra_fiq_disable(int irq)
+{
+ tegra_legacy_mask_irq(irq);
+}
+
+void tegra_fiq_select(int irq, int on)
+{
+ tegra_legacy_select_fiq(irq, !!on);
+}
diff --git a/arch/arm/mach-tegra/include/mach/fiq.h b/arch/arm/mach-tegra/include/mach/fiq.h
new file mode 100644
index 000000000000..b538629c74a9
--- /dev/null
+++ b/arch/arm/mach-tegra/include/mach/fiq.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Author:
+ * Iliyan Malchev <malchev@google.com>
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#ifndef __ASM_ARCH_TEGRA_FIQ_H
+#define __ASM_ARCH_TEGRA_FIQ_H
+
+/* change an interrupt to be an FIQ instead of an IRQ */
+void tegra_fiq_select(int n, int on);
+
+/* enable/disable an interrupt that is an FIQ (safe from FIQ context?) */
+void tegra_fiq_enable(int n);
+void tegra_fiq_disable(int n);
+
+/* install an FIQ handler */
+int tegra_fiq_set_handler(void (*func)(void *data, void *regs, void *svc_sp),
+ void *data);
+
+#endif
diff --git a/arch/arm/mach-tegra/include/mach/irqs.h b/arch/arm/mach-tegra/include/mach/irqs.h
index 73265af4dda3..9c2da0ec7759 100644
--- a/arch/arm/mach-tegra/include/mach/irqs.h
+++ b/arch/arm/mach-tegra/include/mach/irqs.h
@@ -172,6 +172,8 @@
#define INT_GPIO_NR (28 * 8)
+#define FIQ_START INT_GIC_BASE
+
#define TEGRA_NR_IRQS (INT_GPIO_BASE + INT_GPIO_NR)
#define INT_BOARD_BASE TEGRA_NR_IRQS