diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2011-04-18 07:25:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-20 01:11:40 -0400 |
commit | 6baa9b20a68a88c2fd751cbe8d7652009379351b (patch) | |
tree | 999283be451c020ff35110c336292e9d698d2464 /arch/sparc/kernel/irq.h | |
parent | 06010fb588700e7fcb29e720c56884e3de5fd327 (diff) |
sparc32: genirq support
The conversion of sparc32 to genirq is based on original work done
by David S. Miller.
Daniel Hellstrom has helped in the conversion and implemented
the shutdowm functionality.
Marcel van Nies <morcles@gmail.com> has tested this on Sparc Station 20
Test status:
sun4c - not tested
sun4m,pci - not tested
sun4m,sbus - tested (Sparc Classic, Sparc Station 5, Sparc Station 20)
sun4d - not tested
leon - tested on various combinations of leon boards,
including SMP variants
generic
Introduce use of GENERIC_HARDIRQS and GENERIC_IRQ_SHOW
Allocate 64 IRQs - which is enough even for SS2000
Use a table of irq_bucket to maintain uses IRQs
irq_bucket is also used to chain several irq's that
must be called when the same intrrupt is asserted
Use irq_link to link a interrupt source to the irq
All plafforms must now supply their own build_device_irq method
handler_irq rewriten to use generic irq support
floppy
Read FLOPPY_IRQ from platform device
Use generic request_irq to register the floppy interrupt
Rewrote sparc_floppy_irq to use the generic irq support
pcic:
Introduce irq_chip
Store mask in chip_data for use in mask/unmask functions
Add build_device_irq for pcic
Use pcic_build_device_irq in pci_time_init
allocate virtual irqs in pcic_fill_irq
sun4c:
Introduce irq_chip
Store mask in chip_data for use in mask/unmask functions
Add build_device_irq for sun4c
Use sun4c_build_device_irq in sun4c_init_timers
sun4m:
Introduce irq_chip
Introduce dedicated mask/unmask methods
Introduce sun4m_handler_data that allow easy access to necessary
data in the mask/unmask functions
Add a helper method to enable profile_timer (used from smp)
Added sun4m_build_device_irq
Use sun4m_build_device_irq in sun4m_init_timers
TODO:
There is no replacement for smp_rotate that always scheduled
next CPU as interrupt target upon an interrupt
sun4d:
Introduce irq_chip
Introduce dedicated mask/unmask methods
Introduce sun4d_handler_data that allow easy access to
necessary data in mask/unmask fuctions
Rewrote sun4d_handler_irq to use generic irq support
TODO:
The original implmentation of enable/disable had:
if (irq < NR_IRQS)
return;
The new implmentation does not distingush between SBUS and cpu
interrupts.
I am no sure what is right here. I assume we need to do
something for the cpu interrupts.
I have not succeeded booting my sun4d box (with or without this patch)
and my understanding of this platfrom is limited.
So I would be a bit suprised if this works.
leon:
Introduce irq_chip
Store mask in chip_data for use in mask/unmask functions
Add build_device_irq for leon
Use leon_build_device_irq in leon_init_timers
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Daniel Hellstrom <daniel@gaisler.com>
Tested-by: Daniel Hellstrom <daniel@gaisler.com>
Tested-by: Marcel van Nies <morcles@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/irq.h')
-rw-r--r-- | arch/sparc/kernel/irq.h | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/arch/sparc/kernel/irq.h b/arch/sparc/kernel/irq.h index 008453b798ec..a189c273f638 100644 --- a/arch/sparc/kernel/irq.h +++ b/arch/sparc/kernel/irq.h | |||
@@ -2,6 +2,23 @@ | |||
2 | 2 | ||
3 | #include <asm/btfixup.h> | 3 | #include <asm/btfixup.h> |
4 | 4 | ||
5 | struct irq_bucket { | ||
6 | struct irq_bucket *next; | ||
7 | unsigned int real_irq; | ||
8 | unsigned int irq; | ||
9 | unsigned int pil; | ||
10 | }; | ||
11 | |||
12 | #define SUN4D_MAX_BOARD 10 | ||
13 | #define SUN4D_MAX_IRQ ((SUN4D_MAX_BOARD + 2) << 5) | ||
14 | |||
15 | /* Map between the irq identifier used in hw to the | ||
16 | * irq_bucket. The map is sufficient large to hold | ||
17 | * the sun4d hw identifiers. | ||
18 | */ | ||
19 | extern struct irq_bucket *irq_map[SUN4D_MAX_IRQ]; | ||
20 | |||
21 | |||
5 | /* sun4m specific type definitions */ | 22 | /* sun4m specific type definitions */ |
6 | 23 | ||
7 | /* This maps direct to CPU specific interrupt registers */ | 24 | /* This maps direct to CPU specific interrupt registers */ |
@@ -35,6 +52,10 @@ struct sparc_irq_config { | |||
35 | }; | 52 | }; |
36 | extern struct sparc_irq_config sparc_irq_config; | 53 | extern struct sparc_irq_config sparc_irq_config; |
37 | 54 | ||
55 | unsigned int irq_alloc(unsigned int real_irq, unsigned int pil); | ||
56 | void irq_link(unsigned int irq); | ||
57 | void irq_unlink(unsigned int irq); | ||
58 | void handler_irq(unsigned int pil, struct pt_regs *regs); | ||
38 | 59 | ||
39 | /* Dave Redman (djhr@tadpole.co.uk) | 60 | /* Dave Redman (djhr@tadpole.co.uk) |
40 | * changed these to function pointers.. it saves cycles and will allow | 61 | * changed these to function pointers.. it saves cycles and will allow |
@@ -44,33 +65,9 @@ extern struct sparc_irq_config sparc_irq_config; | |||
44 | * Changed these to btfixup entities... It saves cycles :) | 65 | * Changed these to btfixup entities... It saves cycles :) |
45 | */ | 66 | */ |
46 | 67 | ||
47 | BTFIXUPDEF_CALL(void, disable_irq, unsigned int) | ||
48 | BTFIXUPDEF_CALL(void, enable_irq, unsigned int) | ||
49 | BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) | ||
50 | BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) | ||
51 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) | 68 | BTFIXUPDEF_CALL(void, clear_clock_irq, void) |
52 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) | 69 | BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) |
53 | 70 | ||
54 | static inline void __disable_irq(unsigned int irq) | ||
55 | { | ||
56 | BTFIXUP_CALL(disable_irq)(irq); | ||
57 | } | ||
58 | |||
59 | static inline void __enable_irq(unsigned int irq) | ||
60 | { | ||
61 | BTFIXUP_CALL(enable_irq)(irq); | ||
62 | } | ||
63 | |||
64 | static inline void disable_pil_irq(unsigned int irq) | ||
65 | { | ||
66 | BTFIXUP_CALL(disable_pil_irq)(irq); | ||
67 | } | ||
68 | |||
69 | static inline void enable_pil_irq(unsigned int irq) | ||
70 | { | ||
71 | BTFIXUP_CALL(enable_pil_irq)(irq); | ||
72 | } | ||
73 | |||
74 | static inline void clear_clock_irq(void) | 71 | static inline void clear_clock_irq(void) |
75 | { | 72 | { |
76 | BTFIXUP_CALL(clear_clock_irq)(); | 73 | BTFIXUP_CALL(clear_clock_irq)(); |