aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-01-28 17:08:19 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 21:19:09 -0400
commite787098cfe69dad4e7cccf50352e830f539cd50a (patch)
tree30aa243f59e554d28b2f47a715738dae7571cff9 /arch/sparc
parentb7afdb7e85d97294efa24fbfef7b1fa196ca808c (diff)
sparc32,sun4c: irq file cleanup
- drop filename in header - drop unused includes - add description of sun4c interrupts (from davem) - add spaces after reserved words This is partly based on a patch from: David Miller <davem@davemloft.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/sun4c_irq.c81
1 files changed, 44 insertions, 37 deletions
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c
index 892fb884910a..f543b452ebc1 100644
--- a/arch/sparc/kernel/sun4c_irq.c
+++ b/arch/sparc/kernel/sun4c_irq.c
@@ -1,5 +1,5 @@
1/* sun4c_irq.c 1/*
2 * arch/sparc/kernel/sun4c_irq.c: 2 * sun4c irq support
3 * 3 *
4 * djhr: Hacked out of irq.c into a CPU dependent version. 4 * djhr: Hacked out of irq.c into a CPU dependent version.
5 * 5 *
@@ -9,31 +9,41 @@
9 * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk) 9 * Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
10 */ 10 */
11 11
12#include <linux/errno.h>
13#include <linux/linkage.h>
14#include <linux/kernel_stat.h>
15#include <linux/signal.h>
16#include <linux/sched.h>
17#include <linux/ptrace.h>
18#include <linux/interrupt.h>
19#include <linux/init.h> 12#include <linux/init.h>
20#include <linux/of.h>
21#include <linux/of_device.h>
22#include "irq.h"
23 13
24#include <asm/ptrace.h>
25#include <asm/processor.h>
26#include <asm/system.h>
27#include <asm/psr.h>
28#include <asm/vaddrs.h>
29#include <asm/timer.h>
30#include <asm/openprom.h>
31#include <asm/oplib.h> 14#include <asm/oplib.h>
32#include <asm/traps.h> 15#include <asm/timer.h>
33#include <asm/irq.h> 16#include <asm/irq.h>
34#include <asm/io.h> 17#include <asm/io.h>
35#include <asm/idprom.h> 18
36#include <asm/machines.h> 19#include "irq.h"
20
21/* Sun4c interrupts are typically laid out as follows:
22 *
23 * 1 - Software interrupt, SBUS level 1
24 * 2 - SBUS level 2
25 * 3 - ESP SCSI, SBUS level 3
26 * 4 - Software interrupt
27 * 5 - Lance ethernet, SBUS level 4
28 * 6 - Software interrupt
29 * 7 - Graphics card, SBUS level 5
30 * 8 - SBUS level 6
31 * 9 - SBUS level 7
32 * 10 - Counter timer
33 * 11 - Floppy
34 * 12 - Zilog uart
35 * 13 - CS4231 audio
36 * 14 - Profiling timer
37 * 15 - NMI
38 *
39 * The interrupt enable bits in the interrupt mask register are
40 * really only used to enable/disable the timer interrupts, and
41 * for signalling software interrupts. There is also a master
42 * interrupt enable bit in this register.
43 *
44 * Interrupts are enabled by setting the SUN4C_INT_* bits, they
45 * are disabled by clearing those bits.
46 */
37 47
38/* 48/*
39 * Bit field defines for the interrupt registers on various 49 * Bit field defines for the interrupt registers on various
@@ -49,26 +59,21 @@
49#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ 59#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */
50#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ 60#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */
51 61
52/* Pointer to the interrupt enable byte 62/*
53 * 63 * Pointer to the interrupt enable byte
54 * Dave Redman (djhr@tadpole.co.uk) 64 * Used by entry.S
55 * What you may not be aware of is that entry.S requires this variable.
56 *
57 * --- linux_trap_nmi_sun4c --
58 *
59 * so don't go making it static, like I tried. sigh.
60 */ 65 */
61unsigned char __iomem *interrupt_enable = NULL; 66unsigned char __iomem *interrupt_enable;
62 67
63static void sun4c_disable_irq(unsigned int irq_nr) 68static void sun4c_disable_irq(unsigned int irq_nr)
64{ 69{
65 unsigned long flags; 70 unsigned long flags;
66 unsigned char current_mask, new_mask; 71 unsigned char current_mask, new_mask;
67 72
68 local_irq_save(flags); 73 local_irq_save(flags);
69 irq_nr &= (NR_IRQS - 1); 74 irq_nr &= (NR_IRQS - 1);
70 current_mask = sbus_readb(interrupt_enable); 75 current_mask = sbus_readb(interrupt_enable);
71 switch(irq_nr) { 76 switch (irq_nr) {
72 case 1: 77 case 1:
73 new_mask = ((current_mask) & (~(SUN4C_INT_E1))); 78 new_mask = ((current_mask) & (~(SUN4C_INT_E1)));
74 break; 79 break;
@@ -93,11 +98,11 @@ static void sun4c_enable_irq(unsigned int irq_nr)
93{ 98{
94 unsigned long flags; 99 unsigned long flags;
95 unsigned char current_mask, new_mask; 100 unsigned char current_mask, new_mask;
96 101
97 local_irq_save(flags); 102 local_irq_save(flags);
98 irq_nr &= (NR_IRQS - 1); 103 irq_nr &= (NR_IRQS - 1);
99 current_mask = sbus_readb(interrupt_enable); 104 current_mask = sbus_readb(interrupt_enable);
100 switch(irq_nr) { 105 switch (irq_nr) {
101 case 1: 106 case 1:
102 new_mask = ((current_mask) | SUN4C_INT_E1); 107 new_mask = ((current_mask) | SUN4C_INT_E1);
103 break; 108 break;
@@ -180,12 +185,14 @@ static void __init sun4c_init_timers(irq_handler_t counter_fn)
180 prom_printf("sun4c_init_timers: request_irq() fails with %d\n", err); 185 prom_printf("sun4c_init_timers: request_irq() fails with %d\n", err);
181 prom_halt(); 186 prom_halt();
182 } 187 }
183 188
184 sun4c_disable_irq(irq[1].pri); 189 sun4c_disable_irq(irq[1].pri);
185} 190}
186 191
187#ifdef CONFIG_SMP 192#ifdef CONFIG_SMP
188static void sun4c_nop(void) {} 193static void sun4c_nop(void)
194{
195}
189#endif 196#endif
190 197
191void __init sun4c_init_IRQ(void) 198void __init sun4c_init_IRQ(void)