diff options
author | jchandra <jchandra@FreeBSD.org> | 2015-02-27 00:57:09 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2015-02-27 00:57:09 +0000 |
commit | 1f4069c7a5164399ea48b6f7df2a96c411a9b920 (patch) | |
tree | ac508f56c48d9a690ce329ca9a5cfb7408208a80 /sys/mips/nlm/xlp_pci.c | |
parent | 2c469d5dc197be18d184b76127cc02ae2ba5e8fd (diff) | |
download | FreeBSD-src-1f4069c7a5164399ea48b6f7df2a96c411a9b920.zip FreeBSD-src-1f4069c7a5164399ea48b6f7df2a96c411a9b920.tar.gz |
Improve additional interrupt ACK for Broadcom XLP
Handling some interrupts in XLP (like PCIe and SATA) involves writing to
vendor specific registers as part of interrupt acknowledgement.
This was earlier done with xlp_establish_intr(), but a better solution
is to provide a function xlp_set_bus_ack() that can be used with
cpu_establish_hardintr(). This will allow platform initialization code to
setup these ACKs without changing the standrard drivers.
Diffstat (limited to 'sys/mips/nlm/xlp_pci.c')
-rw-r--r-- | sys/mips/nlm/xlp_pci.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/mips/nlm/xlp_pci.c b/sys/mips/nlm/xlp_pci.c index 3c5f968..4e5957f 100644 --- a/sys/mips/nlm/xlp_pci.c +++ b/sys/mips/nlm/xlp_pci.c @@ -561,7 +561,7 @@ xlp_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, } static void -bridge_pcie_ack(int irq) +bridge_pcie_ack(int irq, void *arg) { uint32_t node,reg; uint64_t base; @@ -597,7 +597,6 @@ mips_platform_pcib_setup_intr(device_t dev, device_t child, { int error = 0; int xlpirq; - void *extra_ack; error = rman_activate_resource(irq); if (error) @@ -656,12 +655,11 @@ mips_platform_pcib_setup_intr(device_t dev, device_t child, xlpirq = PIC_PCIE_IRQ(link); } - if (xlpirq >= PIC_PCIE_0_IRQ && xlpirq <= PIC_PCIE_3_IRQ) - extra_ack = bridge_pcie_ack; - else - extra_ack = NULL; - xlp_establish_intr(device_get_name(child), filt, - intr, arg, xlpirq, flags, cookiep, extra_ack); + /* if it is for real PCIe, we need to ack at bridge too */ + if (xlpirq >= PIC_PCIE_IRQ(0) && xlpirq <= PIC_PCIE_IRQ(3)) + xlp_set_bus_ack(xlpirq, bridge_pcie_ack, NULL); + cpu_establish_hardintr(device_get_name(child), filt, intr, arg, + xlpirq, flags, cookiep); return (0); } |