pci.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef ASMARM_PCI_H
  2. #define ASMARM_PCI_H
  3. #ifdef __KERNEL__
  4. #include <asm-generic/pci-dma-compat.h>
  5. #include <asm/mach/pci.h> /* for pci_sys_data */
  6. #include <mach/hardware.h> /* for PCIBIOS_MIN_* */
  7. #ifdef CONFIG_PCI_DOMAINS
  8. static inline int pci_domain_nr(struct pci_bus *bus)
  9. {
  10. struct pci_sys_data *root = bus->sysdata;
  11. return root->domain;
  12. }
  13. static inline int pci_proc_domain(struct pci_bus *bus)
  14. {
  15. return pci_domain_nr(bus);
  16. }
  17. #endif /* CONFIG_PCI_DOMAINS */
  18. #ifdef CONFIG_PCI_HOST_ITE8152
  19. /* ITE bridge requires setting latency timer to avoid early bus access
  20. termination by PIC bus mater devices
  21. */
  22. extern void pcibios_set_master(struct pci_dev *dev);
  23. #else
  24. static inline void pcibios_set_master(struct pci_dev *dev)
  25. {
  26. /* No special bus mastering setup handling */
  27. }
  28. #endif
  29. static inline void pcibios_penalize_isa_irq(int irq, int active)
  30. {
  31. /* We don't do dynamic PCI IRQ allocation */
  32. }
  33. /*
  34. * The PCI address space does equal the physical memory address space.
  35. * The networking and block device layers use this boolean for bounce
  36. * buffer decisions.
  37. */
  38. #define PCI_DMA_BUS_IS_PHYS (1)
  39. #ifdef CONFIG_PCI
  40. static inline void pci_dma_burst_advice(struct pci_dev *pdev,
  41. enum pci_dma_burst_strategy *strat,
  42. unsigned long *strategy_parameter)
  43. {
  44. *strat = PCI_DMA_BURST_INFINITY;
  45. *strategy_parameter = ~0UL;
  46. }
  47. #endif
  48. #define HAVE_PCI_MMAP
  49. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  50. enum pci_mmap_state mmap_state, int write_combine);
  51. extern void
  52. pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
  53. struct resource *res);
  54. extern void
  55. pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
  56. struct pci_bus_region *region);
  57. /*
  58. * Dummy implementation; always return 0.
  59. */
  60. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  61. {
  62. return 0;
  63. }
  64. #endif /* __KERNEL__ */
  65. #endif