pci.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_SH_PCI_H
  3. #define __ASM_SH_PCI_H
  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. #define HAVE_PCI_MMAP
  52. #define ARCH_GENERIC_PCI_MMAP_RESOURCE
  53. /* Dynamic DMA mapping stuff.
  54. * SuperH has everything mapped statically like x86.
  55. */
  56. #ifdef CONFIG_PCI
  57. /*
  58. * None of the SH PCI controllers support MWI, it is always treated as a
  59. * direct memory write.
  60. */
  61. #define PCI_DISABLE_MWI
  62. #endif
  63. /* Board-specific fixup routines. */
  64. int pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin);
  65. #define pci_domain_nr(bus) ((struct pci_channel *)(bus)->sysdata)->index
  66. static inline int pci_proc_domain(struct pci_bus *bus)
  67. {
  68. struct pci_channel *hose = bus->sysdata;
  69. return hose->need_domain_info;
  70. }
  71. #endif /* __ASM_SH_PCI_H */