diff options
author | David S. Miller <davem@davemloft.net> | 2006-06-20 04:21:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-06-20 04:21:57 -0400 |
commit | 37cdcd9e82108f9b899f1631f66ade2e45738a6e (patch) | |
tree | 452b4a106d767947664b99797640194c7483047e /arch/sparc64/kernel/pci_sabre.c | |
parent | c6387a48cf5958e43c201fc27a158c328927531a (diff) |
[SPARC64]: Kill ino_bucket->pil
And reuse that struct member for virt_irq, which will
be used in future changesets for the implementation of
mapping between real and virtual IRQ numbers.
This nicely kills off a ton of SBUS and PCI controller
PIL assignment code which is no longer necessary.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/pci_sabre.c')
-rw-r--r-- | arch/sparc64/kernel/pci_sabre.c | 81 |
1 files changed, 2 insertions, 79 deletions
diff --git a/arch/sparc64/kernel/pci_sabre.c b/arch/sparc64/kernel/pci_sabre.c index f67bb7f078cf..caa7aeed5d14 100644 --- a/arch/sparc64/kernel/pci_sabre.c +++ b/arch/sparc64/kernel/pci_sabre.c | |||
@@ -523,78 +523,6 @@ static unsigned long __onboard_imap_off[] = { | |||
523 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ | 523 | ((ino & 0x20) ? (SABRE_ICLR_SCSI + (((ino) & 0x1f) << 3)) : \ |
524 | (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) | 524 | (SABRE_ICLR_A_SLOT0 + (((ino) & 0x1f)<<3))) |
525 | 525 | ||
526 | /* PCI SABRE INO number to Sparc PIL level. */ | ||
527 | static unsigned char sabre_pil_table[] = { | ||
528 | /*0x00*/0, 0, 0, 0, /* PCI A slot 0 Int A, B, C, D */ | ||
529 | /*0x04*/0, 0, 0, 0, /* PCI A slot 1 Int A, B, C, D */ | ||
530 | /*0x08*/0, 0, 0, 0, /* PCI A slot 2 Int A, B, C, D */ | ||
531 | /*0x0c*/0, 0, 0, 0, /* PCI A slot 3 Int A, B, C, D */ | ||
532 | /*0x10*/0, 0, 0, 0, /* PCI B slot 0 Int A, B, C, D */ | ||
533 | /*0x14*/0, 0, 0, 0, /* PCI B slot 1 Int A, B, C, D */ | ||
534 | /*0x18*/0, 0, 0, 0, /* PCI B slot 2 Int A, B, C, D */ | ||
535 | /*0x1c*/0, 0, 0, 0, /* PCI B slot 3 Int A, B, C, D */ | ||
536 | /*0x20*/5, /* SCSI */ | ||
537 | /*0x21*/5, /* Ethernet */ | ||
538 | /*0x22*/8, /* Parallel Port */ | ||
539 | /*0x23*/13, /* Audio Record */ | ||
540 | /*0x24*/14, /* Audio Playback */ | ||
541 | /*0x25*/15, /* PowerFail */ | ||
542 | /*0x26*/5, /* second SCSI */ | ||
543 | /*0x27*/11, /* Floppy */ | ||
544 | /*0x28*/5, /* Spare Hardware */ | ||
545 | /*0x29*/9, /* Keyboard */ | ||
546 | /*0x2a*/5, /* Mouse */ | ||
547 | /*0x2b*/12, /* Serial */ | ||
548 | /*0x2c*/10, /* Timer 0 */ | ||
549 | /*0x2d*/11, /* Timer 1 */ | ||
550 | /*0x2e*/15, /* Uncorrectable ECC */ | ||
551 | /*0x2f*/15, /* Correctable ECC */ | ||
552 | /*0x30*/15, /* PCI Bus A Error */ | ||
553 | /*0x31*/15, /* PCI Bus B Error */ | ||
554 | /*0x32*/15, /* Power Management */ | ||
555 | }; | ||
556 | |||
557 | static int sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino) | ||
558 | { | ||
559 | int ret; | ||
560 | |||
561 | if (pdev && | ||
562 | pdev->vendor == PCI_VENDOR_ID_SUN && | ||
563 | pdev->device == PCI_DEVICE_ID_SUN_RIO_USB) | ||
564 | return 9; | ||
565 | |||
566 | ret = sabre_pil_table[ino]; | ||
567 | if (ret == 0 && pdev == NULL) { | ||
568 | ret = 5; | ||
569 | } else if (ret == 0) { | ||
570 | switch ((pdev->class >> 16) & 0xff) { | ||
571 | case PCI_BASE_CLASS_STORAGE: | ||
572 | ret = 5; | ||
573 | break; | ||
574 | |||
575 | case PCI_BASE_CLASS_NETWORK: | ||
576 | ret = 6; | ||
577 | break; | ||
578 | |||
579 | case PCI_BASE_CLASS_DISPLAY: | ||
580 | ret = 9; | ||
581 | break; | ||
582 | |||
583 | case PCI_BASE_CLASS_MULTIMEDIA: | ||
584 | case PCI_BASE_CLASS_MEMORY: | ||
585 | case PCI_BASE_CLASS_BRIDGE: | ||
586 | case PCI_BASE_CLASS_SERIAL: | ||
587 | ret = 10; | ||
588 | break; | ||
589 | |||
590 | default: | ||
591 | ret = 5; | ||
592 | break; | ||
593 | }; | ||
594 | } | ||
595 | return ret; | ||
596 | } | ||
597 | |||
598 | /* When a device lives behind a bridge deeper in the PCI bus topology | 526 | /* When a device lives behind a bridge deeper in the PCI bus topology |
599 | * than APB, a special sequence must run to make sure all pending DMA | 527 | * than APB, a special sequence must run to make sure all pending DMA |
600 | * transfers at the time of IRQ delivery are visible in the coherency | 528 | * transfers at the time of IRQ delivery are visible in the coherency |
@@ -619,7 +547,7 @@ static unsigned int sabre_irq_build(struct pci_pbm_info *pbm, | |||
619 | struct ino_bucket *bucket; | 547 | struct ino_bucket *bucket; |
620 | unsigned long imap, iclr; | 548 | unsigned long imap, iclr; |
621 | unsigned long imap_off, iclr_off; | 549 | unsigned long imap_off, iclr_off; |
622 | int pil, inofixup = 0; | 550 | int inofixup = 0; |
623 | 551 | ||
624 | ino &= PCI_IRQ_INO; | 552 | ino &= PCI_IRQ_INO; |
625 | if (ino < SABRE_ONBOARD_IRQ_BASE) { | 553 | if (ino < SABRE_ONBOARD_IRQ_BASE) { |
@@ -635,11 +563,6 @@ static unsigned int sabre_irq_build(struct pci_pbm_info *pbm, | |||
635 | } | 563 | } |
636 | 564 | ||
637 | /* Now build the IRQ bucket. */ | 565 | /* Now build the IRQ bucket. */ |
638 | pil = sabre_ino_to_pil(pdev, ino); | ||
639 | |||
640 | if (PIL_RESERVED(pil)) | ||
641 | BUG(); | ||
642 | |||
643 | imap = pbm->controller_regs + imap_off; | 566 | imap = pbm->controller_regs + imap_off; |
644 | imap += 4; | 567 | imap += 4; |
645 | 568 | ||
@@ -650,7 +573,7 @@ static unsigned int sabre_irq_build(struct pci_pbm_info *pbm, | |||
650 | if ((ino & 0x20) == 0) | 573 | if ((ino & 0x20) == 0) |
651 | inofixup = ino & 0x03; | 574 | inofixup = ino & 0x03; |
652 | 575 | ||
653 | bucket = __bucket(build_irq(pil, inofixup, iclr, imap)); | 576 | bucket = __bucket(build_irq(inofixup, iclr, imap)); |
654 | bucket->flags |= IBF_PCI; | 577 | bucket->flags |= IBF_PCI; |
655 | 578 | ||
656 | if (pdev) { | 579 | if (pdev) { |