pci.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef __ALPHA_PCI_H
  2. #define __ALPHA_PCI_H
  3. #ifdef __KERNEL__
  4. #include <linux/spinlock.h>
  5. #include <linux/dma-mapping.h>
  6. #include <linux/scatterlist.h>
  7. #include <asm/machvec.h>
  8. #include <asm-generic/pci-bridge.h>
  9. /*
  10. * The following structure is used to manage multiple PCI busses.
  11. */
  12. struct pci_dev;
  13. struct pci_bus;
  14. struct resource;
  15. struct pci_iommu_arena;
  16. struct page;
  17. /* A controller. Used to manage multiple PCI busses. */
  18. struct pci_controller {
  19. struct pci_controller *next;
  20. struct pci_bus *bus;
  21. struct resource *io_space;
  22. struct resource *mem_space;
  23. /* The following are for reporting to userland. The invariant is
  24. that if we report a BWX-capable dense memory, we do not report
  25. a sparse memory at all, even if it exists. */
  26. unsigned long sparse_mem_base;
  27. unsigned long dense_mem_base;
  28. unsigned long sparse_io_base;
  29. unsigned long dense_io_base;
  30. /* This one's for the kernel only. It's in KSEG somewhere. */
  31. unsigned long config_space_base;
  32. unsigned int index;
  33. /* For compatibility with current (as of July 2003) pciutils
  34. and XFree86. Eventually will be removed. */
  35. unsigned int need_domain_info;
  36. struct pci_iommu_arena *sg_pci;
  37. struct pci_iommu_arena *sg_isa;
  38. void *sysdata;
  39. };
  40. /* Override the logic in pci_scan_bus for skipping already-configured
  41. bus numbers. */
  42. #define pcibios_assign_all_busses() 1
  43. #define PCIBIOS_MIN_IO alpha_mv.min_io_address
  44. #define PCIBIOS_MIN_MEM alpha_mv.min_mem_address
  45. extern void pcibios_set_master(struct pci_dev *dev);
  46. /* IOMMU controls. */
  47. /* The PCI address space does not equal the physical memory address space.
  48. The networking and block device layers use this boolean for bounce buffer
  49. decisions. */
  50. #define PCI_DMA_BUS_IS_PHYS 0
  51. #ifdef CONFIG_PCI
  52. /* implement the pci_ DMA API in terms of the generic device dma_ one */
  53. #include <asm-generic/pci-dma-compat.h>
  54. #endif
  55. /* TODO: integrate with include/asm-generic/pci.h ? */
  56. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  57. {
  58. return channel ? 15 : 14;
  59. }
  60. #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
  61. static inline int pci_proc_domain(struct pci_bus *bus)
  62. {
  63. struct pci_controller *hose = bus->sysdata;
  64. return hose->need_domain_info;
  65. }
  66. #endif /* __KERNEL__ */
  67. /* Values for the `which' argument to sys_pciconfig_iobase. */
  68. #define IOBASE_HOSE 0
  69. #define IOBASE_SPARSE_MEM 1
  70. #define IOBASE_DENSE_MEM 2
  71. #define IOBASE_SPARSE_IO 3
  72. #define IOBASE_DENSE_IO 4
  73. #define IOBASE_ROOT_BUS 5
  74. #define IOBASE_FROM_HOSE 0x10000
  75. extern struct pci_dev *isa_bridge;
  76. extern int pci_legacy_read(struct pci_bus *bus, loff_t port, u32 *val,
  77. size_t count);
  78. extern int pci_legacy_write(struct pci_bus *bus, loff_t port, u32 val,
  79. size_t count);
  80. extern int pci_mmap_legacy_page_range(struct pci_bus *bus,
  81. struct vm_area_struct *vma,
  82. enum pci_mmap_state mmap_state);
  83. extern void pci_adjust_legacy_attr(struct pci_bus *bus,
  84. enum pci_mmap_state mmap_type);
  85. #define HAVE_PCI_LEGACY 1
  86. extern int pci_create_resource_files(struct pci_dev *dev);
  87. extern void pci_remove_resource_files(struct pci_dev *dev);
  88. #endif /* __ALPHA_PCI_H */