X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/10a828fab04670f679d9fd88508f355a7927197c..541ff27cfb26939cf1b98b73fa5aeea0d8432082:/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c diff --git a/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c b/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c index 69cb362a0..581b1a4a1 100644 --- a/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c +++ b/target/linux/atheros/files/arch/mips/atheros/ar5315/irq.c @@ -60,6 +60,10 @@ asmlinkage void ar5315_irq_dispatch(void) do_IRQ(AR5315_IRQ_WLAN0_INTRS); else if (pending & CAUSEF_IP4) do_IRQ(AR5315_IRQ_ENET0_INTRS); +#ifdef CONFIG_PCI + else if (pending & CAUSEF_IP5) + ar5315_pci_irq(AR5315_IRQ_LCBUS_PCI); +#endif else if (pending & CAUSEF_IP2) { unsigned int ar531x_misc_intrs = sysRegRead(AR5315_ISR) & sysRegRead(AR5315_IMR); @@ -81,6 +85,30 @@ asmlinkage void ar5315_irq_dispatch(void) do_IRQ(AR531X_IRQ_CPU_CLOCK); } +#ifdef CONFIG_PCI +static inline void pci_abort_irq(void) +{ + sysRegWrite(AR5315_PCI_INT_STATUS, AR5315_PCI_ABORT_INT); + (void)sysRegRead(AR5315_PCI_INT_STATUS); /* flush write to hardware */ +} + +static inline void pci_ack_irq(void) +{ + sysRegWrite(AR5315_PCI_INT_STATUS, AR5315_PCI_EXT_INT); + (void)sysRegRead(AR5315_PCI_INT_STATUS); /* flush write to hardware */ +} + +void ar5315_pci_irq(int irq) +{ + if (sysRegRead(AR5315_PCI_INT_STATUS) == AR5315_PCI_ABORT_INT) + pci_abort_irq(); + else { + do_IRQ(irq); + pci_ack_irq(); + } +} +#endif + static void ar5315_gpio_intr_enable(unsigned int irq) { u32 gpio, mask;