2 * U-boot - irq.h Interrupt related header file
4 * Copyright (c) 2005 blackfin.uclinux.org
6 * This file was based on
7 * linux/arch/$(ARCH)/platform/$(PLATFORM)/irq.c
9 * Changed by HuTao Apr18, 2003
11 * Copyright was missing when I got the code so took from MIPS arch ...MaTed---
12 * Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
13 * Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001 by Ralf Baechle
15 * Adapted for BlackFin (ADI) by Ted Ma <mated@sympatico.ca>
16 * Copyright (c) 2002 Arcturus Networks Inc. (www.arcturusnetworks.com)
17 * Copyright (c) 2002 Lineo, Inc. <mattw@lineo.com>
19 * See file CREDITS for list of people who contributed to this
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License as
24 * published by the Free Software Foundation; either version 2 of
25 * the License, or (at your option) any later version.
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 * GNU General Public License for more details.
32 * You should have received a copy of the GNU General Public License
33 * along with this program; if not, write to the Free Software
34 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
38 #ifndef _BLACKFIN_IRQ_H_
39 #define _BLACKFIN_IRQ_H_
41 #include <linux/config.h>
42 #include <asm/cpu/bf533_irq.h>
45 * On the Blackfin, the interrupt structure allows remmapping of the hardware
47 * - I'm going to assume that the H/W level is going to stay at the default
48 * settings. If someone wants to go through and abstart this out, feel free
49 * to mod the interrupt numbering scheme.
50 * - I'm abstracting the interrupts so that uClinux does not know anything
51 * about the H/W levels. If you want to change the H/W AND keep the abstracted
52 * levels that uClinux sees, you should be able to do most of it here.
53 * - I've left the "abstract" numbering sparce in case someone wants to pull the
54 * interrupts apart (just the TX/RX for the various devices)
57 #define NR_IRQS SYS_IRQS
59 * "Generic" interrupt sources
61 #define IRQ_SCHED_TIMER (8) /* interrupt source for scheduling timer */
63 static __inline__ int irq_cannonicalize(int irq)
69 * Machine specific interrupt sources.
71 * Adding an interrupt service routine for a source with this bit
72 * set indicates a special machine specific interrupt source.
73 * The machine specific files define these sources.
75 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to
76 * introduce unnecessary overhead.
78 * All interrupt handling is actually machine specific so it is better
79 * to use function pointers, as used by the Sparc port, and select the
80 * interrupt handling functions when initializing the kernel. This way
81 * we save some unnecessary overhead at run-time.
85 extern void (*mach_enable_irq) (unsigned int);
86 extern void (*mach_disable_irq) (unsigned int);
87 extern int sys_request_irq(unsigned int,
88 void (*)(int, void *, struct pt_regs *),
89 unsigned long, const char *, void *);
90 extern void sys_free_irq(unsigned int, void *);
93 * various flags for request_irq() - the Amiga now uses the standard
94 * mechanism like all other architectures - SA_INTERRUPT and SA_SHIRQ
97 #define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */
98 #define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */
99 #define IRQ_FLG_FAST (0x0004)
100 #define IRQ_FLG_SLOW (0x0008)
101 #define IRQ_FLG_STD (0x8000) /* internally used */
104 * This structure is used to chain together the ISRs for a particular
105 * interrupt source (if it supports chaining).
107 typedef struct irq_node {
108 void (*handler) (int, void *, struct pt_regs *);
112 struct irq_node *next;
116 * This structure has only 4 elements for speed reasons
118 typedef struct irq_handler {
119 void (*handler) (int, void *, struct pt_regs *);
125 /* count of spurious interrupts */
126 extern volatile unsigned int num_spurious;
129 * This function returns a new irq_node_t
131 extern irq_node_t *new_irq_node(void);
134 * Some drivers want these entry points
136 #define enable_irq(x) (mach_enable_irq ? (*mach_enable_irq)(x) : 0)
137 #define disable_irq(x) (mach_disable_irq ? (*mach_disable_irq)(x) : 0)
139 #define enable_irq_nosync(x) enable_irq(x)
140 #define disable_irq_nosync(x) disable_irq(x)