diff options
-rw-r--r-- | arch/sparc64/kernel/irq.c | 32 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_sun4v.c | 30 | ||||
-rw-r--r-- | include/asm-sparc64/irq.h | 1 |
3 files changed, 35 insertions, 28 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index 51f65054bf18..bcc889a53324 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -303,6 +303,38 @@ out: | |||
303 | return __irq(bucket); | 303 | return __irq(bucket); |
304 | } | 304 | } |
305 | 305 | ||
306 | unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags) | ||
307 | { | ||
308 | struct ino_bucket *bucket; | ||
309 | unsigned long sysino; | ||
310 | |||
311 | sysino = sun4v_devino_to_sysino(devhandle, devino); | ||
312 | |||
313 | printk(KERN_INFO "sun4v_irq: Mapping ( devh[%08x] devino[%08x] ) " | ||
314 | "--> sysino[%016lx]\n", devhandle, devino, sysino); | ||
315 | |||
316 | bucket = &ivector_table[sysino]; | ||
317 | |||
318 | /* Catch accidental accesses to these things. IMAP/ICLR handling | ||
319 | * is done by hypervisor calls on sun4v platforms, not by direct | ||
320 | * register accesses. | ||
321 | */ | ||
322 | bucket->imap = ~0UL; | ||
323 | bucket->iclr = ~0UL; | ||
324 | |||
325 | bucket->pil = pil; | ||
326 | bucket->flags = flags; | ||
327 | |||
328 | bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC); | ||
329 | if (!bucket->irq_info) { | ||
330 | prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n"); | ||
331 | prom_halt(); | ||
332 | } | ||
333 | memset(bucket->irq_info, 0, sizeof(struct irq_desc)); | ||
334 | |||
335 | return __irq(bucket); | ||
336 | } | ||
337 | |||
306 | static void atomic_bucket_insert(struct ino_bucket *bucket) | 338 | static void atomic_bucket_insert(struct ino_bucket *bucket) |
307 | { | 339 | { |
308 | unsigned long pstate; | 340 | unsigned long pstate; |
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 5174346ce35d..b8846b271f96 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -644,18 +644,11 @@ static void pci_sun4v_scan_bus(struct pci_controller_info *p) | |||
644 | 644 | ||
645 | static unsigned int pci_sun4v_irq_build(struct pci_pbm_info *pbm, | 645 | static unsigned int pci_sun4v_irq_build(struct pci_pbm_info *pbm, |
646 | struct pci_dev *pdev, | 646 | struct pci_dev *pdev, |
647 | unsigned int ino) | 647 | unsigned int devino) |
648 | { | 648 | { |
649 | struct ino_bucket *bucket; | ||
650 | unsigned long sysino; | ||
651 | u32 devhandle = pbm->devhandle; | 649 | u32 devhandle = pbm->devhandle; |
652 | int pil; | 650 | int pil; |
653 | 651 | ||
654 | sysino = sun4v_devino_to_sysino(devhandle, ino); | ||
655 | |||
656 | printk(KERN_INFO "pci_irq_buld: Mapping ( devh[%08x] ino[%08x] ) " | ||
657 | "--> sysino[%016lx]\n", devhandle, ino, sysino); | ||
658 | |||
659 | pil = 4; | 652 | pil = 4; |
660 | if (pdev) { | 653 | if (pdev) { |
661 | switch ((pdev->class >> 16) & 0xff) { | 654 | switch ((pdev->class >> 16) & 0xff) { |
@@ -685,26 +678,7 @@ static unsigned int pci_sun4v_irq_build(struct pci_pbm_info *pbm, | |||
685 | } | 678 | } |
686 | BUG_ON(PIL_RESERVED(pil)); | 679 | BUG_ON(PIL_RESERVED(pil)); |
687 | 680 | ||
688 | bucket = &ivector_table[sysino]; | 681 | return sun4v_build_irq(devhandle, devino, pil, IBF_PCI); |
689 | |||
690 | /* Catch accidental accesses to these things. IMAP/ICLR handling | ||
691 | * is done by hypervisor calls on sun4v platforms, not by direct | ||
692 | * register accesses. | ||
693 | */ | ||
694 | bucket->imap = ~0UL; | ||
695 | bucket->iclr = ~0UL; | ||
696 | |||
697 | bucket->pil = pil; | ||
698 | bucket->flags = IBF_PCI; | ||
699 | |||
700 | bucket->irq_info = kmalloc(sizeof(struct irq_desc), GFP_ATOMIC); | ||
701 | if (!bucket->irq_info) { | ||
702 | prom_printf("IRQ: Error, kmalloc(irq_desc) failed.\n"); | ||
703 | prom_halt(); | ||
704 | } | ||
705 | memset(bucket->irq_info, 0, sizeof(struct irq_desc)); | ||
706 | |||
707 | return __irq(bucket); | ||
708 | } | 682 | } |
709 | 683 | ||
710 | static void pci_sun4v_base_address_update(struct pci_dev *pdev, int resource) | 684 | static void pci_sun4v_base_address_update(struct pci_dev *pdev, int resource) |
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index 8b70edcb80dc..529a9df1ad43 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h | |||
@@ -111,6 +111,7 @@ extern void disable_irq(unsigned int); | |||
111 | #define disable_irq_nosync disable_irq | 111 | #define disable_irq_nosync disable_irq |
112 | extern void enable_irq(unsigned int); | 112 | extern void enable_irq(unsigned int); |
113 | extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); | 113 | extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); |
114 | extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino, int pil, unsigned char flags); | ||
114 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); | 115 | extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); |
115 | 116 | ||
116 | static __inline__ void set_softint(unsigned long bits) | 117 | static __inline__ void set_softint(unsigned long bits) |