12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include <linux/types.h>
- #include <asm/txx9/pci.h>
- #include <asm/txx9/jmr3927.h>
- int __init jmr3927_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
- {
- unsigned char irq = pin;
-
- irq--;
- if (slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(23)) {
-
-
-
- irq = (irq + 2) % 4;
- } else if (slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(22)) {
-
-
-
- irq = (irq + 0) % 4;
- } else {
-
- if (txx9_pci_option & TXX9_PCI_OPT_PICMG)
- irq = (irq + 33 - slot) % 4;
- else
- irq = (irq + 3 + slot) % 4;
- }
- irq++;
- switch (irq) {
- case 1:
- irq = JMR3927_IRQ_IOC_PCIA;
- break;
- case 2:
- irq = JMR3927_IRQ_IOC_PCIB;
- break;
- case 3:
- irq = JMR3927_IRQ_IOC_PCIC;
- break;
- case 4:
- irq = JMR3927_IRQ_IOC_PCID;
- break;
- }
-
- if (dev->bus->parent == NULL &&
- slot == TX3927_PCIC_IDSEL_AD_TO_SLOT(24))
- irq = JMR3927_IRQ_ETHER0;
- return irq;
- }
|