netwinder-pci.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * linux/arch/arm/mach-footbridge/netwinder-pci.c
  3. *
  4. * PCI bios-type initialisation for PCI machines
  5. *
  6. * Bits taken from various places.
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/pci.h>
  10. #include <linux/init.h>
  11. #include <asm/irq.h>
  12. #include <asm/mach/pci.h>
  13. #include <asm/mach-types.h>
  14. /*
  15. * We now use the slot ID instead of the device identifiers to select
  16. * which interrupt is routed where.
  17. */
  18. static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  19. {
  20. switch (slot) {
  21. case 0: /* host bridge */
  22. return 0;
  23. case 9: /* CyberPro */
  24. return IRQ_NETWINDER_VGA;
  25. case 10: /* DC21143 */
  26. return IRQ_NETWINDER_ETHER100;
  27. case 12: /* Winbond 553 */
  28. return IRQ_ISA_HARDDISK1;
  29. case 13: /* Winbond 89C940F */
  30. return IRQ_NETWINDER_ETHER10;
  31. default:
  32. printk(KERN_ERR "PCI: unknown device in slot %s\n",
  33. pci_name(dev));
  34. return 0;
  35. }
  36. }
  37. static struct hw_pci netwinder_pci __initdata = {
  38. .map_irq = netwinder_map_irq,
  39. .nr_controllers = 1,
  40. .ops = &dc21285_ops,
  41. .setup = dc21285_setup,
  42. .preinit = dc21285_preinit,
  43. .postinit = dc21285_postinit,
  44. };
  45. static int __init netwinder_pci_init(void)
  46. {
  47. if (machine_is_netwinder())
  48. pci_common_init(&netwinder_pci);
  49. return 0;
  50. }
  51. subsys_initcall(netwinder_pci_init);