2010-03-15 23:04:46 -07:00
|
|
|
/*
|
2011-05-01 14:10:10 -07:00
|
|
|
* Copyright (C) 2011 Google, Inc.
|
2010-03-15 23:04:46 -07:00
|
|
|
*
|
|
|
|
* Author:
|
2011-05-01 14:10:10 -07:00
|
|
|
* Colin Cross <ccross@android.com>
|
2010-03-15 23:04:46 -07:00
|
|
|
*
|
2010-04-05 20:30:59 -07:00
|
|
|
* Copyright (C) 2010, NVIDIA Corporation
|
|
|
|
*
|
2010-03-15 23:04:46 -07:00
|
|
|
* 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>
|
2010-11-28 22:23:55 -08:00
|
|
|
#include <linux/delay.h>
|
2010-03-15 23:04:46 -07:00
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
|
|
#include <asm/hardware/gic.h>
|
|
|
|
|
|
|
|
#include <mach/iomap.h>
|
2010-11-28 22:23:55 -08:00
|
|
|
#include <mach/legacy_irq.h>
|
2010-03-15 23:04:46 -07:00
|
|
|
|
|
|
|
#include "board.h"
|
|
|
|
|
2010-11-28 22:23:55 -08:00
|
|
|
static void tegra_mask(struct irq_data *d)
|
|
|
|
{
|
2011-05-01 14:10:10 -07:00
|
|
|
if (d->irq >= 32)
|
|
|
|
tegra_legacy_mask_irq(d->irq);
|
2010-11-28 22:23:55 -08:00
|
|
|
}
|
2010-04-05 20:30:59 -07:00
|
|
|
|
2010-11-28 22:23:55 -08:00
|
|
|
static void tegra_unmask(struct irq_data *d)
|
2010-04-05 20:30:59 -07:00
|
|
|
{
|
2011-05-01 14:10:10 -07:00
|
|
|
if (d->irq >= 32)
|
|
|
|
tegra_legacy_unmask_irq(d->irq);
|
2010-04-05 20:30:59 -07:00
|
|
|
}
|
|
|
|
|
2011-02-09 22:17:17 -08:00
|
|
|
static void tegra_ack(struct irq_data *d)
|
|
|
|
{
|
2011-05-01 14:10:10 -07:00
|
|
|
if (d->irq >= 32)
|
|
|
|
tegra_legacy_force_irq_clr(d->irq);
|
2011-02-09 22:17:17 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static int tegra_retrigger(struct irq_data *d)
|
|
|
|
{
|
2011-05-01 14:10:10 -07:00
|
|
|
if (d->irq < 32)
|
|
|
|
return 0;
|
|
|
|
|
2011-02-09 22:17:17 -08:00
|
|
|
tegra_legacy_force_irq_set(d->irq);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2010-03-15 23:04:46 -07:00
|
|
|
void __init tegra_init_irq(void)
|
|
|
|
{
|
2010-11-28 22:23:55 -08:00
|
|
|
tegra_init_legacy_irq();
|
2010-04-05 20:30:59 -07:00
|
|
|
|
2011-05-01 14:10:10 -07:00
|
|
|
gic_arch_extn.irq_ack = tegra_ack;
|
|
|
|
gic_arch_extn.irq_mask = tegra_mask;
|
|
|
|
gic_arch_extn.irq_unmask = tegra_unmask;
|
|
|
|
gic_arch_extn.irq_retrigger = tegra_retrigger;
|
|
|
|
|
2010-12-04 15:55:14 +00:00
|
|
|
gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
|
|
|
|
IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
|
2010-04-05 20:30:59 -07:00
|
|
|
}
|