pci.c 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * linux/arch/arm/mach-shark/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. static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  15. {
  16. if (dev->bus->number == 0)
  17. if (dev->devfn == 0)
  18. return 255;
  19. else
  20. return 11;
  21. else
  22. return 255;
  23. }
  24. extern void __init via82c505_preinit(void);
  25. static struct hw_pci shark_pci __initdata = {
  26. .setup = via82c505_setup,
  27. .swizzle = pci_std_swizzle,
  28. .map_irq = shark_map_irq,
  29. .nr_controllers = 1,
  30. .scan = via82c505_scan_bus,
  31. .preinit = via82c505_preinit,
  32. };
  33. static int __init shark_pci_init(void)
  34. {
  35. if (machine_is_shark())
  36. pci_common_init(&shark_pci);
  37. return 0;
  38. }
  39. subsys_initcall(shark_pci_init);