Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
irq.c
Go to the documentation of this file.
1 /*
2  * SDK7786 FPGA IRQ Controller Support.
3  *
4  * Copyright (C) 2010 Matt Fleming
5  * Copyright (C) 2010 Paul Mundt
6  *
7  * This file is subject to the terms and conditions of the GNU General Public
8  * License. See the file "COPYING" in the main directory of this archive
9  * for more details.
10  */
11 #include <linux/irq.h>
12 #include <mach/fpga.h>
13 #include <mach/irq.h>
14 
15 enum {
18  LIRQ5_BIT = 3,
19  LIRQ6_BIT = 4,
20  LIRQ7_BIT = 5,
21  LIRQ8_BIT = 6,
28 };
29 
31 {
32  unsigned int tmp;
33 
34  /* Enable priority encoding for all IRLs */
35  fpga_write_reg(fpga_read_reg(INTMSR) | 0x0303, INTMSR);
36 
37  /* Clear FPGA interrupt status registers */
38  fpga_write_reg(0x0000, INTASR);
39  fpga_write_reg(0x0000, INTBSR);
40 
41  /* Unmask FPGA interrupts */
42  tmp = fpga_read_reg(INTAMR);
43  tmp &= ~(1 << ETH_IRQ_BIT);
44  fpga_write_reg(tmp, INTAMR);
45 
48 }