1/*
2 * linux/arch/unicore32/include/asm/irq.h
3 *
4 * Code specific to PKUnity SoC and UniCore ISA
5 *
6 * Copyright (C) 2001-2010 GUAN Xue-tao
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __UNICORE_IRQ_H__
13#define __UNICORE_IRQ_H__
14
15#include <asm-generic/irq.h>
16
17#define	IRQ_GPIOLOW0		0x00
18#define	IRQ_GPIOLOW1		0x01
19#define	IRQ_GPIOLOW2		0x02
20#define	IRQ_GPIOLOW3		0x03
21#define	IRQ_GPIOLOW4		0x04
22#define	IRQ_GPIOLOW5		0x05
23#define	IRQ_GPIOLOW6		0x06
24#define	IRQ_GPIOLOW7		0x07
25#define IRQ_GPIOHIGH		0x08
26#define IRQ_USB			0x09
27#define IRQ_SDC			0x0a
28#define IRQ_AC97		0x0b
29#define IRQ_SATA		0x0c
30#define IRQ_MME			0x0d
31#define IRQ_PCI_BRIDGE		0x0e
32#define	IRQ_DDR			0x0f
33#define	IRQ_SPI			0x10
34#define	IRQ_UNIGFX		0x11
35#define	IRQ_I2C			0x11
36#define	IRQ_UART1		0x12
37#define	IRQ_UART0		0x13
38#define IRQ_UMAL		0x14
39#define IRQ_NAND		0x15
40#define IRQ_PS2_KBD		0x16
41#define IRQ_PS2_AUX		0x17
42#define IRQ_DMA			0x18
43#define IRQ_DMAERR		0x19
44#define	IRQ_TIMER0		0x1a
45#define	IRQ_TIMER1		0x1b
46#define	IRQ_TIMER2		0x1c
47#define	IRQ_TIMER3		0x1d
48#define	IRQ_RTC			0x1e
49#define	IRQ_RTCAlarm		0x1f
50
51#define	IRQ_GPIO0		0x20
52#define	IRQ_GPIO1		0x21
53#define	IRQ_GPIO2		0x22
54#define	IRQ_GPIO3		0x23
55#define	IRQ_GPIO4		0x24
56#define	IRQ_GPIO5		0x25
57#define	IRQ_GPIO6		0x26
58#define	IRQ_GPIO7		0x27
59#define IRQ_GPIO8		0x28
60#define IRQ_GPIO9		0x29
61#define IRQ_GPIO10		0x2a
62#define IRQ_GPIO11		0x2b
63#define IRQ_GPIO12		0x2c
64#define IRQ_GPIO13		0x2d
65#define IRQ_GPIO14		0x2e
66#define IRQ_GPIO15		0x2f
67#define IRQ_GPIO16		0x30
68#define IRQ_GPIO17		0x31
69#define IRQ_GPIO18		0x32
70#define IRQ_GPIO19		0x33
71#define IRQ_GPIO20		0x34
72#define IRQ_GPIO21		0x35
73#define IRQ_GPIO22		0x36
74#define IRQ_GPIO23		0x37
75#define IRQ_GPIO24		0x38
76#define IRQ_GPIO25		0x39
77#define IRQ_GPIO26		0x3a
78#define IRQ_GPIO27		0x3b
79
80#ifdef CONFIG_ARCH_FPGA
81#define IRQ_PCIINTA             IRQ_GPIOLOW2
82#define IRQ_PCIINTB             IRQ_GPIOLOW1
83#define IRQ_PCIINTC             IRQ_GPIOLOW0
84#define IRQ_PCIINTD             IRQ_GPIOLOW6
85#endif
86
87#if defined(CONFIG_PUV3_DB0913) || defined(CONFIG_PUV3_NB0916)	\
88	|| defined(CONFIG_PUV3_SMW0919)
89#define IRQ_PCIINTA             IRQ_GPIOLOW1
90#define IRQ_PCIINTB             IRQ_GPIOLOW2
91#define IRQ_PCIINTC             IRQ_GPIOLOW3
92#define IRQ_PCIINTD             IRQ_GPIOLOW4
93#endif
94
95#define IRQ_SD_CD               IRQ_GPIO6 /* falling or rising trigger */
96
97#ifndef __ASSEMBLY__
98struct pt_regs;
99
100extern void asm_do_IRQ(unsigned int, struct pt_regs *);
101
102#endif
103
104#endif
105
106