1
2
3
4
5
6
7
8#include <linux/types.h>
9#include <linux/kernel.h>
10#include <linux/pci.h>
11#include <linux/init.h>
12#include <linux/slab.h>
13#include <linux/interrupt.h>
14#include <linux/irq.h>
15
16#include <asm/io.h>
17#include <asm/smp.h>
18
19#include "pci-frv.h"
20
21
22
23
24
25
26
27
28
29
30
31
32static const uint8_t __initdata pci_bus0_irq_routing[32][4] = {
33 [0 ] = { IRQ_FPGA_MB86943_PCI_INTA },
34 [16] = { IRQ_FPGA_RTL8029_INTA },
35 [17] = { IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB },
36 [18] = { IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD, IRQ_FPGA_PCI_INTA },
37 [19] = { IRQ_FPGA_PCI_INTA, IRQ_FPGA_PCI_INTB, IRQ_FPGA_PCI_INTC, IRQ_FPGA_PCI_INTD },
38};
39
40void __init pcibios_irq_init(void)
41{
42}
43
44void __init pcibios_fixup_irqs(void)
45{
46 struct pci_dev *dev = NULL;
47 uint8_t line, pin;
48
49 for_each_pci_dev(dev) {
50 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
51 if (pin) {
52 dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1];
53 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
54 }
55 pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &line);
56 }
57}
58
59void __init pcibios_penalize_isa_irq(int irq)
60{
61}
62
63void pcibios_enable_irq(struct pci_dev *dev)
64{
65 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
66}
67