Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

-148
-17
arch/sparc/include/asm/sbus_32.h
··· 76 76 77 77 struct linux_prom_ranges sbus_ranges[PROMREG_MAX]; 78 78 int num_sbus_ranges; 79 - 80 - int devid; 81 - int board; 82 79 }; 83 80 #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) 84 81 ··· 99 102 for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ 100 103 for ((device) = (bus)->devices; (device); (device) = (device)->next) 101 104 102 - extern void sbus_fill_device_irq(struct sbus_dev *); 103 - 104 105 /* These yield IOMMU mappings in consistent mode. */ 105 106 void prom_adjust_ranges(struct linux_prom_ranges *, int, 106 107 struct linux_prom_ranges *, int); 107 108 108 - /* Eric Brower (ebrower@usa.net) 109 - * Translate SBus interrupt levels to ino values-- 110 - * this is used when converting sbus "interrupts" OBP 111 - * node values to "intr" node values, and is platform 112 - * dependent. If only we could call OBP with 113 - * "sbus-intr>cpu (sbint -- ino)" from kernel... 114 - * See .../drivers/sbus/sbus.c for details. 115 - */ 116 - BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) 117 - #define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) 118 - 119 109 extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); 120 110 extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); 121 - extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); 122 111 extern int sbus_arch_preinit(void); 123 112 extern void sbus_arch_postinit(void); 124 113
-3
arch/sparc/include/asm/sbus_64.h
··· 94 94 for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \ 95 95 for ((device) = (bus)->devices; (device); (device) = (device)->next) 96 96 97 - extern void sbus_fill_device_irq(struct sbus_dev *); 98 - 99 97 extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); 100 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 99 extern int sbus_arch_preinit(void); 103 100 extern void sbus_arch_postinit(void); 104 101
-53
arch/sparc/kernel/ioport.c
··· 255 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 259 * Allocate a chunk of memory suitable for DMA. 303 260 * Typically devices use them for control blocks. ··· 434 477 if (sparc_cpu_model == sun4d) 435 478 iounit_init(sbus); 436 479 #endif 437 - } 438 - 439 - void __init sbus_setup_arch_props(struct sbus_bus *sbus, struct device_node *dp) 440 - { 441 - if (sparc_cpu_model == sun4d) { 442 - struct device_node *parent = dp->parent; 443 - 444 - sbus->devid = of_getintprop_default(parent, "device-id", 0); 445 - sbus->board = of_getintprop_default(parent, "board#", 0); 446 - } 447 480 } 448 481 449 482 int __init sbus_arch_preinit(void)
-13
arch/sparc/kernel/sun4c_irq.c
··· 66 66 */ 67 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 69 static void sun4c_disable_irq(unsigned int irq_nr) 82 70 { 83 71 unsigned long flags; ··· 231 243 if (!interrupt_enable) 232 244 panic("Cannot map interrupt_enable"); 233 245 234 - BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM); 235 246 BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM); 236 247 BTFIXUPSET_CALL(disable_irq, sun4c_disable_irq, BTFIXUPCALL_NORM); 237 248 BTFIXUPSET_CALL(enable_pil_irq, sun4c_enable_irq, BTFIXUPCALL_NORM);
-21
arch/sparc/kernel/sun4d_irq.c
··· 257 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 260 int sun4d_request_irq(unsigned int irq, 281 261 irq_handler_t handler, 282 262 unsigned long irqflags, const char * devname, void *dev_id) ··· 565 585 { 566 586 local_irq_disable(); 567 587 568 - BTFIXUPSET_CALL(sbint_to_irq, sun4d_sbint_to_irq, BTFIXUPCALL_NORM); 569 588 BTFIXUPSET_CALL(enable_irq, sun4d_enable_irq, BTFIXUPCALL_NORM); 570 589 BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM); 571 590 BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
-13
arch/sparc/kernel/sun4m_irq.c
··· 152 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 155 static unsigned long sun4m_get_irqmask(unsigned int irq) 168 156 { 169 157 unsigned long mask; ··· 435 447 &sun4m_interrupts->undirected_target; 436 448 sun4m_interrupts->undirected_target = 0; 437 449 } 438 - BTFIXUPSET_CALL(sbint_to_irq, sun4m_sbint_to_irq, BTFIXUPCALL_NORM); 439 450 BTFIXUPSET_CALL(enable_irq, sun4m_enable_irq, BTFIXUPCALL_NORM); 440 451 BTFIXUPSET_CALL(disable_irq, sun4m_disable_irq, BTFIXUPCALL_NORM); 441 452 BTFIXUPSET_CALL(enable_pil_irq, sun4m_enable_pil_irq, BTFIXUPCALL_NORM);
-24
arch/sparc64/kernel/sbus.c
··· 650 650 prom_printf("sbus_iommu_init: Fatal memory allocation error.\n"); 651 651 } 652 652 653 - void sbus_fill_device_irq(struct sbus_dev *sdev) 654 - { 655 - struct device_node *dp = of_find_node_by_phandle(sdev->prom_node); 656 - const struct linux_prom_irqs *irqs; 657 - 658 - irqs = of_get_property(dp, "interrupts", NULL); 659 - if (!irqs) { 660 - sdev->irqs[0] = 0; 661 - sdev->num_irqs = 0; 662 - } else { 663 - unsigned int pri = irqs[0].pri; 664 - 665 - sdev->num_irqs = 1; 666 - if (pri < 0x20) 667 - pri += sdev->slot * 8; 668 - 669 - sdev->irqs[0] = sbus_build_irq(sdev->bus, pri); 670 - } 671 - } 672 - 673 653 void __init sbus_arch_bus_ranges_init(struct device_node *pn, struct sbus_bus *sbus) 674 654 { 675 655 } ··· 657 677 void __init sbus_setup_iommu(struct sbus_bus *sbus, struct device_node *dp) 658 678 { 659 679 sbus_iommu_init(dp->node, sbus); 660 - } 661 - 662 - void __init sbus_setup_arch_props(struct sbus_bus *sbus, struct device_node *dp) 663 - { 664 680 } 665 681 666 682 int __init sbus_arch_preinit(void)
-4
drivers/sbus/sbus.c
··· 83 83 len / sizeof(struct linux_prom_ranges); 84 84 } 85 85 86 - sbus_fill_device_irq(sdev); 87 - 88 86 sd = &sdev->ofdev.dev.archdata; 89 87 sd->prom_node = dp; 90 88 sd->op = &sdev->ofdev; ··· 262 264 (((sbus_clock/1000)%1000) + 1000) : 0)); 263 265 264 266 strcpy(sbus->prom_name, dp->name); 265 - 266 - sbus_setup_arch_props(sbus, dp); 267 267 268 268 sbus_bus_ranges_init(dp, sbus); 269 269