pci_64.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef __SPARC64_PCI_H
  2. #define __SPARC64_PCI_H
  3. #ifdef __KERNEL__
  4. #include <linux/dma-mapping.h>
  5. /* Can be used to override the logic in pci_scan_bus for skipping
  6. * already-configured bus numbers - to be used for buggy BIOSes
  7. * or architectures with incomplete PCI setup by the loader.
  8. */
  9. #define pcibios_assign_all_busses() 0
  10. #define pcibios_scan_all_fns(a, b) 0
  11. #define PCIBIOS_MIN_IO 0UL
  12. #define PCIBIOS_MIN_MEM 0UL
  13. #define PCI_IRQ_NONE 0xffffffff
  14. #define PCI_CACHE_LINE_BYTES 64
  15. static inline void pcibios_set_master(struct pci_dev *dev)
  16. {
  17. /* No special bus mastering setup handling */
  18. }
  19. static inline void pcibios_penalize_isa_irq(int irq, int active)
  20. {
  21. /* We don't do dynamic PCI IRQ allocation */
  22. }
  23. /* The PCI address space does not equal the physical memory
  24. * address space. The networking and block device layers use
  25. * this boolean for bounce buffer decisions.
  26. */
  27. #define PCI_DMA_BUS_IS_PHYS (0)
  28. /* pci_unmap_{single,page} is not a nop, thus... */
  29. #define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) \
  30. dma_addr_t ADDR_NAME;
  31. #define DECLARE_PCI_UNMAP_LEN(LEN_NAME) \
  32. __u32 LEN_NAME;
  33. #define pci_unmap_addr(PTR, ADDR_NAME) \
  34. ((PTR)->ADDR_NAME)
  35. #define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) \
  36. (((PTR)->ADDR_NAME) = (VAL))
  37. #define pci_unmap_len(PTR, LEN_NAME) \
  38. ((PTR)->LEN_NAME)
  39. #define pci_unmap_len_set(PTR, LEN_NAME, VAL) \
  40. (((PTR)->LEN_NAME) = (VAL))
  41. /* PCI IOMMU mapping bypass support. */
  42. /* PCI 64-bit addressing works for all slots on all controller
  43. * types on sparc64. However, it requires that the device
  44. * can drive enough of the 64 bits.
  45. */
  46. #define PCI64_REQUIRED_MASK (~(dma64_addr_t)0)
  47. #define PCI64_ADDR_BASE 0xfffc000000000000UL
  48. #ifdef CONFIG_PCI
  49. static inline void pci_dma_burst_advice(struct pci_dev *pdev,
  50. enum pci_dma_burst_strategy *strat,
  51. unsigned long *strategy_parameter)
  52. {
  53. unsigned long cacheline_size;
  54. u8 byte;
  55. pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
  56. if (byte == 0)
  57. cacheline_size = 1024;
  58. else
  59. cacheline_size = (int) byte * 4;
  60. *strat = PCI_DMA_BURST_BOUNDARY;
  61. *strategy_parameter = cacheline_size;
  62. }
  63. #endif
  64. /* Return the index of the PCI controller for device PDEV. */
  65. extern int pci_domain_nr(struct pci_bus *bus);
  66. static inline int pci_proc_domain(struct pci_bus *bus)
  67. {
  68. return 1;
  69. }
  70. /* Platform support for /proc/bus/pci/X/Y mmap()s. */
  71. #define HAVE_PCI_MMAP
  72. #define HAVE_ARCH_PCI_GET_UNMAPPED_AREA
  73. #define get_pci_unmapped_area get_fb_unmapped_area
  74. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  75. enum pci_mmap_state mmap_state,
  76. int write_combine);
  77. extern void
  78. pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
  79. struct resource *res);
  80. extern void
  81. pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
  82. struct pci_bus_region *region);
  83. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  84. {
  85. return PCI_IRQ_NONE;
  86. }
  87. struct device_node;
  88. extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
  89. #define HAVE_ARCH_PCI_RESOURCE_TO_USER
  90. extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
  91. const struct resource *rsrc,
  92. resource_size_t *start, resource_size_t *end);
  93. #endif /* __KERNEL__ */
  94. #endif /* __SPARC64_PCI_H */