diff options
Diffstat (limited to 'arch/mips/cavium-octeon/octeon-irq.c')
-rw-r--r-- | arch/mips/cavium-octeon/octeon-irq.c | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index c424cd158dc6..f4b901aaf509 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -10,8 +10,6 @@ | |||
10 | #include <linux/smp.h> | 10 | #include <linux/smp.h> |
11 | 11 | ||
12 | #include <asm/octeon/octeon.h> | 12 | #include <asm/octeon/octeon.h> |
13 | #include <asm/octeon/cvmx-pexp-defs.h> | ||
14 | #include <asm/octeon/cvmx-npi-defs.h> | ||
15 | 13 | ||
16 | static DEFINE_RAW_SPINLOCK(octeon_irq_ciu0_lock); | 14 | static DEFINE_RAW_SPINLOCK(octeon_irq_ciu0_lock); |
17 | static DEFINE_RAW_SPINLOCK(octeon_irq_ciu1_lock); | 15 | static DEFINE_RAW_SPINLOCK(octeon_irq_ciu1_lock); |
@@ -528,90 +526,6 @@ static struct irq_chip octeon_irq_chip_ciu1 = { | |||
528 | #endif | 526 | #endif |
529 | }; | 527 | }; |
530 | 528 | ||
531 | #ifdef CONFIG_PCI_MSI | ||
532 | |||
533 | static DEFINE_RAW_SPINLOCK(octeon_irq_msi_lock); | ||
534 | |||
535 | static void octeon_irq_msi_ack(unsigned int irq) | ||
536 | { | ||
537 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
538 | /* These chips have PCI */ | ||
539 | cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV, | ||
540 | 1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
541 | } else { | ||
542 | /* | ||
543 | * These chips have PCIe. Thankfully the ACK doesn't | ||
544 | * need any locking. | ||
545 | */ | ||
546 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0, | ||
547 | 1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
548 | } | ||
549 | } | ||
550 | |||
551 | static void octeon_irq_msi_eoi(unsigned int irq) | ||
552 | { | ||
553 | /* Nothing needed */ | ||
554 | } | ||
555 | |||
556 | static void octeon_irq_msi_enable(unsigned int irq) | ||
557 | { | ||
558 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
559 | /* | ||
560 | * Octeon PCI doesn't have the ability to mask/unmask | ||
561 | * MSI interrupts individually. Instead of | ||
562 | * masking/unmasking them in groups of 16, we simple | ||
563 | * assume MSI devices are well behaved. MSI | ||
564 | * interrupts are always enable and the ACK is assumed | ||
565 | * to be enough. | ||
566 | */ | ||
567 | } else { | ||
568 | /* These chips have PCIe. Note that we only support | ||
569 | * the first 64 MSI interrupts. Unfortunately all the | ||
570 | * MSI enables are in the same register. We use | ||
571 | * MSI0's lock to control access to them all. | ||
572 | */ | ||
573 | uint64_t en; | ||
574 | unsigned long flags; | ||
575 | raw_spin_lock_irqsave(&octeon_irq_msi_lock, flags); | ||
576 | en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
577 | en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0); | ||
578 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); | ||
579 | cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
580 | raw_spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); | ||
581 | } | ||
582 | } | ||
583 | |||
584 | static void octeon_irq_msi_disable(unsigned int irq) | ||
585 | { | ||
586 | if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) { | ||
587 | /* See comment in enable */ | ||
588 | } else { | ||
589 | /* | ||
590 | * These chips have PCIe. Note that we only support | ||
591 | * the first 64 MSI interrupts. Unfortunately all the | ||
592 | * MSI enables are in the same register. We use | ||
593 | * MSI0's lock to control access to them all. | ||
594 | */ | ||
595 | uint64_t en; | ||
596 | unsigned long flags; | ||
597 | raw_spin_lock_irqsave(&octeon_irq_msi_lock, flags); | ||
598 | en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
599 | en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0)); | ||
600 | cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en); | ||
601 | cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0); | ||
602 | raw_spin_unlock_irqrestore(&octeon_irq_msi_lock, flags); | ||
603 | } | ||
604 | } | ||
605 | |||
606 | static struct irq_chip octeon_irq_chip_msi = { | ||
607 | .name = "MSI", | ||
608 | .enable = octeon_irq_msi_enable, | ||
609 | .disable = octeon_irq_msi_disable, | ||
610 | .ack = octeon_irq_msi_ack, | ||
611 | .eoi = octeon_irq_msi_eoi, | ||
612 | }; | ||
613 | #endif | ||
614 | |||
615 | void __init arch_init_irq(void) | 529 | void __init arch_init_irq(void) |
616 | { | 530 | { |
617 | int irq; | 531 | int irq; |
@@ -672,13 +586,6 @@ void __init arch_init_irq(void) | |||
672 | set_irq_chip_and_handler(irq, chip1, handle_percpu_irq); | 586 | set_irq_chip_and_handler(irq, chip1, handle_percpu_irq); |
673 | } | 587 | } |
674 | 588 | ||
675 | #ifdef CONFIG_PCI_MSI | ||
676 | /* 152 - 215 PCI/PCIe MSI interrupts */ | ||
677 | for (irq = OCTEON_IRQ_MSI_BIT0; irq <= OCTEON_IRQ_MSI_BIT63; irq++) { | ||
678 | set_irq_chip_and_handler(irq, &octeon_irq_chip_msi, | ||
679 | handle_percpu_irq); | ||
680 | } | ||
681 | #endif | ||
682 | set_c0_status(0x300 << 2); | 589 | set_c0_status(0x300 << 2); |
683 | } | 590 | } |
684 | 591 | ||