diff options
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/kernel/prom.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 99daeee4209d..86cdbd4dbad5 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c | |||
@@ -539,6 +539,25 @@ static unsigned long __sabre_onboard_imap_off[] = { | |||
539 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ | 539 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ |
540 | (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) | 540 | (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) |
541 | 541 | ||
542 | static int parent_is_sabre_or_simba(struct device_node *dp) | ||
543 | { | ||
544 | char *parent_model, *parent_compat; | ||
545 | |||
546 | parent_model = of_get_property(dp->parent, "model", NULL); | ||
547 | if (parent_model && | ||
548 | (!strcmp(parent_model, "SUNW,sabre") || | ||
549 | !strcmp(parent_model, "SUNW,simba"))) | ||
550 | return 1; | ||
551 | |||
552 | parent_compat = of_get_property(dp->parent, "compatible", NULL); | ||
553 | if (parent_compat && | ||
554 | (!strcmp(parent_compat, "pci108e,a000") || | ||
555 | !strcmp(parent_compat, "pci108e,a001"))) | ||
556 | return 1; | ||
557 | |||
558 | return 0; | ||
559 | } | ||
560 | |||
542 | static unsigned int sabre_irq_build(struct device_node *dp, | 561 | static unsigned int sabre_irq_build(struct device_node *dp, |
543 | unsigned int ino, | 562 | unsigned int ino, |
544 | void *_data) | 563 | void *_data) |
@@ -577,15 +596,18 @@ static unsigned int sabre_irq_build(struct device_node *dp, | |||
577 | 596 | ||
578 | virt_irq = build_irq(inofixup, iclr, imap); | 597 | virt_irq = build_irq(inofixup, iclr, imap); |
579 | 598 | ||
599 | /* If the parent device is a PCI<->PCI bridge other than | ||
600 | * APB, we have to install a pre-handler to ensure that | ||
601 | * all pending DMA is drained before the interrupt handler | ||
602 | * is run. | ||
603 | */ | ||
580 | regs = of_get_property(dp, "reg", NULL); | 604 | regs = of_get_property(dp, "reg", NULL); |
581 | if (regs && | 605 | if (regs && |
582 | ((regs->phys_hi >> 16) & 0xff) != irq_data->pci_first_busno) { | 606 | !parent_is_sabre_or_simba(dp)) { |
583 | irq_install_pre_handler(virt_irq, | 607 | irq_install_pre_handler(virt_irq, |
584 | sabre_wsync_handler, | 608 | sabre_wsync_handler, |
585 | (void *) (long) regs->phys_hi, | 609 | (void *) (long) regs->phys_hi, |
586 | (void *) | 610 | (void *) irq_data); |
587 | controller_regs + | ||
588 | SABRE_WRSYNC); | ||
589 | } | 611 | } |
590 | 612 | ||
591 | return virt_irq; | 613 | return virt_irq; |