diff options
Diffstat (limited to 'arch/mips/pci/ops-tx3927.c')
-rw-r--r-- | arch/mips/pci/ops-tx3927.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/mips/pci/ops-tx3927.c b/arch/mips/pci/ops-tx3927.c index c6bd79e71e26..31c150196595 100644 --- a/arch/mips/pci/ops-tx3927.c +++ b/arch/mips/pci/ops-tx3927.c | |||
@@ -37,8 +37,11 @@ | |||
37 | #include <linux/pci.h> | 37 | #include <linux/pci.h> |
38 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/interrupt.h> | ||
40 | 41 | ||
41 | #include <asm/addrspace.h> | 42 | #include <asm/addrspace.h> |
43 | #include <asm/txx9irq.h> | ||
44 | #include <asm/txx9/pci.h> | ||
42 | #include <asm/txx9/tx3927.h> | 45 | #include <asm/txx9/tx3927.h> |
43 | 46 | ||
44 | static int mkaddr(struct pci_bus *bus, unsigned char devfn, unsigned char where) | 47 | static int mkaddr(struct pci_bus *bus, unsigned char devfn, unsigned char where) |
@@ -194,3 +197,34 @@ void __init tx3927_pcic_setup(struct pci_controller *channel, | |||
194 | PCI_COMMAND_PARITY | PCI_COMMAND_SERR; | 197 | PCI_COMMAND_PARITY | PCI_COMMAND_SERR; |
195 | local_irq_restore(flags); | 198 | local_irq_restore(flags); |
196 | } | 199 | } |
200 | |||
201 | static irqreturn_t tx3927_pcierr_interrupt(int irq, void *dev_id) | ||
202 | { | ||
203 | struct pt_regs *regs = get_irq_regs(); | ||
204 | |||
205 | if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) { | ||
206 | printk(KERN_WARNING "PCI error interrupt at 0x%08lx.\n", | ||
207 | regs->cp0_epc); | ||
208 | printk(KERN_WARNING "pcistat:%02x, lbstat:%04lx\n", | ||
209 | tx3927_pcicptr->pcistat, tx3927_pcicptr->lbstat); | ||
210 | } | ||
211 | if (txx9_pci_err_action != TXX9_PCI_ERR_PANIC) { | ||
212 | /* clear all pci errors */ | ||
213 | tx3927_pcicptr->pcistat |= TX3927_PCIC_PCISTATIM_ALL; | ||
214 | tx3927_pcicptr->istat = TX3927_PCIC_IIM_ALL; | ||
215 | tx3927_pcicptr->tstat = TX3927_PCIC_TIM_ALL; | ||
216 | tx3927_pcicptr->lbstat = TX3927_PCIC_LBIM_ALL; | ||
217 | return IRQ_HANDLED; | ||
218 | } | ||
219 | console_verbose(); | ||
220 | panic("PCI error."); | ||
221 | } | ||
222 | |||
223 | void __init tx3927_setup_pcierr_irq(void) | ||
224 | { | ||
225 | if (request_irq(TXX9_IRQ_BASE + TX3927_IR_PCI, | ||
226 | tx3927_pcierr_interrupt, | ||
227 | IRQF_DISABLED, "PCI error", | ||
228 | (void *)TX3927_PCIC_REG)) | ||
229 | printk(KERN_WARNING "Failed to request irq for PCIERR\n"); | ||
230 | } | ||