pci.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 <linux/io.h>
  12. #include <video/vga.h>
  13. #include <asm/irq.h>
  14. #include <asm/mach/pci.h>
  15. #include <asm/mach-types.h>
  16. #define IO_START 0x40000000
  17. static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  18. {
  19. if (dev->bus->number == 0)
  20. if (dev->devfn == 0)
  21. return 255;
  22. else
  23. return 11;
  24. else
  25. return 255;
  26. }
  27. extern void __init via82c505_preinit(void);
  28. static struct hw_pci shark_pci __initdata = {
  29. .setup = via82c505_setup,
  30. .map_irq = shark_map_irq,
  31. .nr_controllers = 1,
  32. .ops = &via82c505_ops,
  33. .preinit = via82c505_preinit,
  34. };
  35. static int __init shark_pci_init(void)
  36. {
  37. if (!machine_is_shark())
  38. return -ENODEV;
  39. pcibios_min_io = 0x6000;
  40. pcibios_min_mem = 0x50000000;
  41. vga_base = 0xe8000000;
  42. pci_ioremap_io(0, IO_START);
  43. pci_common_init(&shark_pci);
  44. return 0;
  45. }
  46. subsys_initcall(shark_pci_init);