Path: blob/master/arch/sh/boards/mach-sdk7786/irq.c
15126 views
/*1* SDK7786 FPGA IRQ Controller Support.2*3* Copyright (C) 2010 Matt Fleming4* Copyright (C) 2010 Paul Mundt5*6* This file is subject to the terms and conditions of the GNU General Public7* License. See the file "COPYING" in the main directory of this archive8* for more details.9*/10#include <linux/irq.h>11#include <mach/fpga.h>12#include <mach/irq.h>1314enum {15ATA_IRQ_BIT = 1,16SPI_BUSY_BIT = 2,17LIRQ5_BIT = 3,18LIRQ6_BIT = 4,19LIRQ7_BIT = 5,20LIRQ8_BIT = 6,21KEY_IRQ_BIT = 7,22PEN_IRQ_BIT = 8,23ETH_IRQ_BIT = 9,24RTC_ALARM_BIT = 10,25CRYSTAL_FAIL_BIT = 12,26ETH_PME_BIT = 14,27};2829void __init sdk7786_init_irq(void)30{31unsigned int tmp;3233/* Enable priority encoding for all IRLs */34fpga_write_reg(fpga_read_reg(INTMSR) | 0x0303, INTMSR);3536/* Clear FPGA interrupt status registers */37fpga_write_reg(0x0000, INTASR);38fpga_write_reg(0x0000, INTBSR);3940/* Unmask FPGA interrupts */41tmp = fpga_read_reg(INTAMR);42tmp &= ~(1 << ETH_IRQ_BIT);43fpga_write_reg(tmp, INTAMR);4445plat_irq_setup_pins(IRQ_MODE_IRL7654_MASK);46plat_irq_setup_pins(IRQ_MODE_IRL3210_MASK);47}484950