pci.h 2.9 KB

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