diff options
author | David S. Miller <davem@davemloft.net> | 2008-08-27 05:56:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-08-29 05:15:10 -0400 |
commit | 33c4655c00e6af3ec4023f2cafd63dd4a42de49b (patch) | |
tree | 4d693872eb9641035dc15efc709424c9983b1348 /arch/sparc | |
parent | 71d3721189c0f4fad105a81e052bddfb826b693b (diff) |
sparc: Kill SBUS layer IRQ hooks.
IRQs are obtained by drivers from the of_device struct.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/sbus_32.h | 17 | ||||
-rw-r--r-- | arch/sparc/include/asm/sbus_64.h | 3 | ||||
-rw-r--r-- | arch/sparc/kernel/ioport.c | 53 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4c_irq.c | 13 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4d_irq.c | 21 | ||||
-rw-r--r-- | arch/sparc/kernel/sun4m_irq.c | 13 |
6 files changed, 0 insertions, 120 deletions
diff --git a/arch/sparc/include/asm/sbus_32.h b/arch/sparc/include/asm/sbus_32.h index 435ae394d2bd..81ea0f687b18 100644 --- a/arch/sparc/include/asm/sbus_32.h +++ b/arch/sparc/include/asm/sbus_32.h | |||
@@ -76,9 +76,6 @@ struct sbus_bus { | |||
76 | 76 | ||
77 | struct linux_prom_ranges sbus_ranges[PROMREG_MAX]; | 77 | struct linux_prom_ranges sbus_ranges[PROMREG_MAX]; |
78 | int num_sbus_ranges; | 78 | int num_sbus_ranges; |
79 | |||
80 | int devid; | ||
81 | int board; | ||
82 | }; | 79 | }; |
83 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) | 80 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) |
84 | 81 | ||
@@ -102,26 +99,12 @@ sbus_is_slave(struct sbus_dev *dev) | |||
102 | for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ | 99 | for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ |
103 | for ((device) = (bus)->devices; (device); (device) = (device)->next) | 100 | for ((device) = (bus)->devices; (device); (device) = (device)->next) |
104 | 101 | ||
105 | extern void sbus_fill_device_irq(struct sbus_dev *); | ||
106 | |||
107 | /* These yield IOMMU mappings in consistent mode. */ | 102 | /* These yield IOMMU mappings in consistent mode. */ |
108 | void prom_adjust_ranges(struct linux_prom_ranges *, int, | 103 | void prom_adjust_ranges(struct linux_prom_ranges *, int, |
109 | struct linux_prom_ranges *, int); | 104 | struct linux_prom_ranges *, int); |
110 | 105 | ||
111 | /* Eric Brower (ebrower@usa.net) | ||
112 | * Translate SBus interrupt levels to ino values-- | ||
113 | * this is used when converting sbus "interrupts" OBP | ||
114 | * node values to "intr" node values, and is platform | ||
115 | * dependent. If only we could call OBP with | ||
116 | * "sbus-intr>cpu (sbint -- ino)" from kernel... | ||
117 | * See .../drivers/sbus/sbus.c for details. | ||
118 | */ | ||
119 | BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) | ||
120 | #define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) | ||
121 | |||
122 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); | 106 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); |
123 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); | 107 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); |
124 | extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); | ||
125 | extern int sbus_arch_preinit(void); | 108 | extern int sbus_arch_preinit(void); |
126 | extern void sbus_arch_postinit(void); | 109 | extern void sbus_arch_postinit(void); |
127 | 110 | ||
diff --git a/arch/sparc/include/asm/sbus_64.h b/arch/sparc/include/asm/sbus_64.h index 79719c2e5fa6..2b2562e0e5c1 100644 --- a/arch/sparc/include/asm/sbus_64.h +++ b/arch/sparc/include/asm/sbus_64.h | |||
@@ -94,11 +94,8 @@ extern struct sbus_bus *sbus_root; | |||
94 | for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ | 94 | for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ |
95 | for ((device) = (bus)->devices; (device); (device) = (device)->next) | 95 | for ((device) = (bus)->devices; (device); (device) = (device)->next) |
96 | 96 | ||
97 | extern void sbus_fill_device_irq(struct sbus_dev *); | ||
98 | |||
99 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); | 97 | extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); |
100 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); | 98 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); |
101 | extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); | ||
102 | extern int sbus_arch_preinit(void); | 99 | extern int sbus_arch_preinit(void); |
103 | extern void sbus_arch_postinit(void); | 100 | extern void sbus_arch_postinit(void); |
104 | 101 | ||
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index d65fb9b06688..0e478301e8e5 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -255,49 +255,6 @@ void sbus_set_sbus64(struct device *dev, int x) | |||
255 | printk("sbus_set_sbus64: unsupported\n"); | 255 | printk("sbus_set_sbus64: unsupported\n"); |
256 | } | 256 | } |
257 | 257 | ||
258 | extern unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq); | ||
259 | void __init sbus_fill_device_irq(struct sbus_dev *sdev) | ||
260 | { | ||
261 | struct linux_prom_irqs irqs[PROMINTR_MAX]; | ||
262 | int len; | ||
263 | |||
264 | len = prom_getproperty(sdev->prom_node, "intr", | ||
265 | (char *)irqs, sizeof(irqs)); | ||
266 | if (len != -1) { | ||
267 | sdev->num_irqs = len / 8; | ||
268 | if (sdev->num_irqs == 0) { | ||
269 | sdev->irqs[0] = 0; | ||
270 | } else if (sparc_cpu_model == sun4d) { | ||
271 | for (len = 0; len < sdev->num_irqs; len++) | ||
272 | sdev->irqs[len] = | ||
273 | sun4d_build_irq(sdev, irqs[len].pri); | ||
274 | } else { | ||
275 | for (len = 0; len < sdev->num_irqs; len++) | ||
276 | sdev->irqs[len] = irqs[len].pri; | ||
277 | } | ||
278 | } else { | ||
279 | int interrupts[PROMINTR_MAX]; | ||
280 | |||
281 | /* No "intr" node found-- check for "interrupts" node. | ||
282 | * This node contains SBus interrupt levels, not IPLs | ||
283 | * as in "intr", and no vector values. We convert | ||
284 | * SBus interrupt levels to PILs (platform specific). | ||
285 | */ | ||
286 | len = prom_getproperty(sdev->prom_node, "interrupts", | ||
287 | (char *)interrupts, sizeof(interrupts)); | ||
288 | if (len == -1) { | ||
289 | sdev->irqs[0] = 0; | ||
290 | sdev->num_irqs = 0; | ||
291 | } else { | ||
292 | sdev->num_irqs = len / sizeof(int); | ||
293 | for (len = 0; len < sdev->num_irqs; len++) { | ||
294 | sdev->irqs[len] = | ||
295 | sbint_to_irq(sdev, interrupts[len]); | ||
296 | } | ||
297 | } | ||
298 | } | ||
299 | } | ||
300 | |||
301 | /* | 258 | /* |
302 | * Allocate a chunk of memory suitable for DMA. | 259 | * Allocate a chunk of memory suitable for DMA. |
303 | * Typically devices use them for control blocks. | 260 | * Typically devices use them for control blocks. |
@@ -479,16 +436,6 @@ void __init sbus_setup_iommu(struct sbus_bus *sbus, struct device_node *dp) | |||
479 | #endif | 436 | #endif |
480 | } | 437 | } |
481 | 438 | ||
482 | void __init sbus_setup_arch_props(struct sbus_bus *sbus, struct device_node *dp) | ||
483 | { | ||
484 | if (sparc_cpu_model == sun4d) { | ||
485 | struct device_node *parent = dp->parent; | ||
486 | |||
487 | sbus->devid = of_getintprop_default(parent, "device-id", 0); | ||
488 | sbus->board = of_getintprop_default(parent, "board#", 0); | ||
489 | } | ||
490 | } | ||
491 | |||
492 | int __init sbus_arch_preinit(void) | 439 | int __init sbus_arch_preinit(void) |
493 | { | 440 | { |
494 | register_proc_sparc_ioport(); | 441 | register_proc_sparc_ioport(); |
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index 340fc395fe2d..a5a32a0b10d1 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c | |||
@@ -66,18 +66,6 @@ static struct resource sun4c_intr_eb = { "sun4c_intr" }; | |||
66 | */ | 66 | */ |
67 | unsigned char *interrupt_enable = NULL; | 67 | unsigned char *interrupt_enable = NULL; |
68 | 68 | ||
69 | static int sun4c_pil_map[] = { 0, 1, 2, 3, 5, 7, 8, 9 }; | ||
70 | |||
71 | static unsigned int sun4c_sbint_to_irq(struct sbus_dev *sdev, | ||
72 | unsigned int sbint) | ||
73 | { | ||
74 | if (sbint >= sizeof(sun4c_pil_map)) { | ||
75 | printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint); | ||
76 | BUG(); | ||
77 | } | ||
78 | return sun4c_pil_map[sbint]; | ||
79 | } | ||
80 | |||
81 | static void sun4c_disable_irq(unsigned int irq_nr) | 69 | static void sun4c_disable_irq(unsigned int irq_nr) |
82 | { | 70 | { |
83 | unsigned long flags; | 71 | unsigned long flags; |
@@ -243,7 +231,6 @@ void __init sun4c_init_IRQ(void) | |||
243 | if (!interrupt_enable) | 231 | if (!interrupt_enable) |
244 | panic("Cannot map interrupt_enable"); | 232 | panic("Cannot map interrupt_enable"); |
245 | 233 | ||
246 | BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM); | ||
247 | BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); | 234 | BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); |
248 | BTFIXUPSET_CALL(disable_irq, sun4c_disable_irq, BTFIXUPCALL_NORM); | 235 | BTFIXUPSET_CALL(disable_irq, sun4c_disable_irq, BTFIXUPCALL_NORM); |
249 | BTFIXUPSET_CALL(enable_pil_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); | 236 | BTFIXUPSET_CALL(enable_pil_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); |
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index 7424967142f0..acfb447c00d0 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -257,26 +257,6 @@ void sun4d_handler_irq(int irq, struct pt_regs * regs) | |||
257 | set_irq_regs(old_regs); | 257 | set_irq_regs(old_regs); |
258 | } | 258 | } |
259 | 259 | ||
260 | unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq) | ||
261 | { | ||
262 | int sbusl = pil_to_sbus[irq]; | ||
263 | |||
264 | if (sbusl) | ||
265 | return ((sdev->bus->board + 1) << 5) + (sbusl << 2) + sdev->slot; | ||
266 | else | ||
267 | return irq; | ||
268 | } | ||
269 | |||
270 | static unsigned int sun4d_sbint_to_irq(struct sbus_dev *sdev, | ||
271 | unsigned int sbint) | ||
272 | { | ||
273 | if (sbint >= sizeof(sbus_to_pil)) { | ||
274 | printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint); | ||
275 | BUG(); | ||
276 | } | ||
277 | return sun4d_build_irq(sdev, sbus_to_pil[sbint]); | ||
278 | } | ||
279 | |||
280 | int sun4d_request_irq(unsigned int irq, | 260 | int sun4d_request_irq(unsigned int irq, |
281 | irq_handler_t handler, | 261 | irq_handler_t handler, |
282 | unsigned long irqflags, const char * devname, void *dev_id) | 262 | unsigned long irqflags, const char * devname, void *dev_id) |
@@ -585,7 +565,6 @@ void __init sun4d_init_IRQ(void) | |||
585 | { | 565 | { |
586 | local_irq_disable(); | 566 | local_irq_disable(); |
587 | 567 | ||
588 | BTFIXUPSET_CALL(sbint_to_irq, sun4d_sbint_to_irq, BTFIXUPCALL_NORM); | ||
589 | BTFIXUPSET_CALL(enable_irq, sun4d_enable_irq, BTFIXUPCALL_NORM); | 568 | BTFIXUPSET_CALL(enable_irq, sun4d_enable_irq, BTFIXUPCALL_NORM); |
590 | BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM); | 569 | BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM); |
591 | BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM); | 570 | BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM); |
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 94e02de960ea..d66334b853ef 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c | |||
@@ -152,18 +152,6 @@ static unsigned long irq_mask[] = { | |||
152 | SUN4M_INT_SBUS(6) /* 14 irq 13 */ | 152 | SUN4M_INT_SBUS(6) /* 14 irq 13 */ |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static int sun4m_pil_map[] = { 0, 2, 3, 5, 7, 9, 11, 13 }; | ||
156 | |||
157 | static unsigned int sun4m_sbint_to_irq(struct sbus_dev *sdev, | ||
158 | unsigned int sbint) | ||
159 | { | ||
160 | if (sbint >= sizeof(sun4m_pil_map)) { | ||
161 | printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint); | ||
162 | BUG(); | ||
163 | } | ||
164 | return sun4m_pil_map[sbint] | 0x30; | ||
165 | } | ||
166 | |||
167 | static unsigned long sun4m_get_irqmask(unsigned int irq) | 155 | static unsigned long sun4m_get_irqmask(unsigned int irq) |
168 | { | 156 | { |
169 | unsigned long mask; | 157 | unsigned long mask; |
@@ -447,7 +435,6 @@ void __init sun4m_init_IRQ(void) | |||
447 | &sun4m_interrupts->undirected_target; | 435 | &sun4m_interrupts->undirected_target; |
448 | sun4m_interrupts->undirected_target = 0; | 436 | sun4m_interrupts->undirected_target = 0; |
449 | } | 437 | } |
450 | BTFIXUPSET_CALL(sbint_to_irq, sun4m_sbint_to_irq, BTFIXUPCALL_NORM); | ||
451 | BTFIXUPSET_CALL(enable_irq, sun4m_enable_irq, BTFIXUPCALL_NORM); | 438 | BTFIXUPSET_CALL(enable_irq, sun4m_enable_irq, BTFIXUPCALL_NORM); |
452 | BTFIXUPSET_CALL(disable_irq, sun4m_disable_irq, BTFIXUPCALL_NORM); | 439 | BTFIXUPSET_CALL(disable_irq, sun4m_disable_irq, BTFIXUPCALL_NORM); |
453 | BTFIXUPSET_CALL(enable_pil_irq, sun4m_enable_pil_irq, BTFIXUPCALL_NORM); | 440 | BTFIXUPSET_CALL(enable_pil_irq, sun4m_enable_pil_irq, BTFIXUPCALL_NORM); |