pci.h 2.0 KB

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