pci.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef __ASM_SH_PCI_H
  2. #define __ASM_SH_PCI_H
  3. #ifdef __KERNEL__
  4. /* Can be used to override the logic in pci_scan_bus for skipping
  5. already-configured bus numbers - to be used for buggy BIOSes
  6. or architectures with incomplete PCI setup by the loader */
  7. #define pcibios_assign_all_busses() 1
  8. /*
  9. * A board can define one or more PCI channels that represent built-in (or
  10. * external) PCI controllers.
  11. */
  12. struct pci_channel {
  13. struct pci_channel *next;
  14. struct pci_bus *bus;
  15. struct pci_ops *pci_ops;
  16. struct resource *resources;
  17. unsigned int nr_resources;
  18. unsigned long io_offset;
  19. unsigned long mem_offset;
  20. unsigned long reg_base;
  21. unsigned long io_map_base;
  22. unsigned int index;
  23. unsigned int need_domain_info;
  24. /* Optional error handling */
  25. struct timer_list err_timer, serr_timer;
  26. unsigned int err_irq, serr_irq;
  27. };
  28. /* arch/sh/drivers/pci/pci.c */
  29. extern raw_spinlock_t pci_config_lock;
  30. extern int register_pci_controller(struct pci_channel *hose);
  31. extern void pcibios_report_status(unsigned int status_mask, int warn);
  32. /* arch/sh/drivers/pci/common.c */
  33. extern int early_read_config_byte(struct pci_channel *hose, int top_bus,
  34. int bus, int devfn, int offset, u8 *value);
  35. extern int early_read_config_word(struct pci_channel *hose, int top_bus,
  36. int bus, int devfn, int offset, u16 *value);
  37. extern int early_read_config_dword(struct pci_channel *hose, int top_bus,
  38. int bus, int devfn, int offset, u32 *value);
  39. extern int early_write_config_byte(struct pci_channel *hose, int top_bus,
  40. int bus, int devfn, int offset, u8 value);
  41. extern int early_write_config_word(struct pci_channel *hose, int top_bus,
  42. int bus, int devfn, int offset, u16 value);
  43. extern int early_write_config_dword(struct pci_channel *hose, int top_bus,
  44. int bus, int devfn, int offset, u32 value);
  45. extern void pcibios_enable_timers(struct pci_channel *hose);
  46. extern unsigned int pcibios_handle_status_errors(unsigned long addr,
  47. unsigned int status, struct pci_channel *hose);
  48. extern int pci_is_66mhz_capable(struct pci_channel *hose,
  49. int top_bus, int current_bus);
  50. extern unsigned long PCIBIOS_MIN_IO, PCIBIOS_MIN_MEM;
  51. struct pci_dev;
  52. #define HAVE_PCI_MMAP
  53. extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
  54. enum pci_mmap_state mmap_state, int write_combine);
  55. extern void pcibios_set_master(struct pci_dev *dev);
  56. /* Dynamic DMA mapping stuff.
  57. * SuperH has everything mapped statically like x86.
  58. */
  59. /* The PCI address space does equal the physical memory
  60. * address space. The networking and block device layers use
  61. * this boolean for bounce buffer decisions.
  62. */
  63. #define PCI_DMA_BUS_IS_PHYS (dma_ops->is_phys)
  64. #ifdef CONFIG_PCI
  65. /*
  66. * None of the SH PCI controllers support MWI, it is always treated as a
  67. * direct memory write.
  68. */
  69. #define PCI_DISABLE_MWI
  70. #endif
  71. /* Board-specific fixup routines. */
  72. int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
  73. #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
  74. static inline int pci_proc_domain(struct pci_bus *bus)
  75. {
  76. struct pci_channel *hose = bus->sysdata;
  77. return hose->need_domain_info;
  78. }
  79. /* Chances are this interrupt is wired PC-style ... */
  80. static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  81. {
  82. return channel ? 15 : 14;
  83. }
  84. #endif /* __KERNEL__ */
  85. #endif /* __ASM_SH_PCI_H */